[Scummvm-git-logs] scummvm master -> 8744e2300b6c358115702244c240858892126dc9
lephilousophe
lephilousophe at users.noreply.github.com
Mon Oct 4 16:37:28 UTC 2021
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f5ea77bed3 CRYOMNI3D: Support the Versailles 1685 demo
c75e3088fe CRYOMNI3D: Add detection for the Atlantis: The Lost Tales demo
8744e2300b VIDEO: Initial support for UBB2 videos
Commit: f5ea77bed3f34497bf0dfcae52cc7d527309b2ea
https://github.com/scummvm/scummvm/commit/f5ea77bed3f34497bf0dfcae52cc7d527309b2ea
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-10-04T18:37:25+02:00
Commit Message:
CRYOMNI3D: Support the Versailles 1685 demo
Changed paths:
engines/cryomni3d/cryomni3d.cpp
engines/cryomni3d/cryomni3d.h
engines/cryomni3d/detection.h
engines/cryomni3d/detection_tables.h
engines/cryomni3d/metaengine.cpp
diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 867139f1cb..22303dabd9 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -29,6 +29,8 @@
#include "common/events.h"
#include "common/file.h"
+#include "engines/util.h"
+
#include "audio/mixer.h"
#include "graphics/palette.h"
@@ -488,4 +490,19 @@ void CryOmni3DEngine::fillSurface(byte color) {
g_system->fillScreen(color);
g_system->updateScreen();
}
+
+Common::Error CryOmni3DEngine_HNMPlayer::run() {
+ CryOmni3DEngine::run();
+
+ initGraphics(640, 480);
+
+ syncSoundSettings();
+
+ for (int i = 0; _gameDescription->desc.filesDescriptions[i].fileName; i++) {
+ playHNM(_gameDescription->desc.filesDescriptions[i].fileName, Audio::Mixer::kMusicSoundType);
+ }
+
+ return Common::kNoError;
+}
+
} // End of namespace CryOmni3D
diff --git a/engines/cryomni3d/cryomni3d.h b/engines/cryomni3d/cryomni3d.h
index f9b88babe3..7187974d86 100644
--- a/engines/cryomni3d/cryomni3d.h
+++ b/engines/cryomni3d/cryomni3d.h
@@ -183,6 +183,22 @@ private:
bool _hnmHasClip;
};
+class CryOmni3DEngine_HNMPlayer : public CryOmni3DEngine {
+protected:
+ Common::Error run() override;
+
+public:
+ CryOmni3DEngine_HNMPlayer(OSystem *syst, const CryOmni3DGameDescription *gamedesc) : CryOmni3DEngine(syst, gamedesc) {}
+ ~CryOmni3DEngine_HNMPlayer() override {}
+
+ virtual bool displayToolbar(const Graphics::Surface *original) override { return false; }
+ virtual bool hasPlaceDocumentation() override { return false; }
+ virtual bool displayPlaceDocumentation() override { return false; }
+ virtual uint displayOptions() override { return 0; }
+ virtual void makeTranslucent(Graphics::Surface &dst, const Graphics::Surface &src) const override {}
+ virtual void setupPalette(const byte *colors, uint start, uint num) override {}
+};
+
} // End of namespace CryOmni3D
#endif
diff --git a/engines/cryomni3d/detection.h b/engines/cryomni3d/detection.h
index d90b079cfc..fcef4da334 100644
--- a/engines/cryomni3d/detection.h
+++ b/engines/cryomni3d/detection.h
@@ -28,7 +28,8 @@
namespace CryOmni3D {
enum CryOmni3DGameType {
- GType_VERSAILLES
+ GType_VERSAILLES,
+ GType_HNM_PLAYER
};
enum CryOmni3DGameFeatures {
diff --git a/engines/cryomni3d/detection_tables.h b/engines/cryomni3d/detection_tables.h
index fae3f1c5e1..049678114e 100644
--- a/engines/cryomni3d/detection_tables.h
+++ b/engines/cryomni3d/detection_tables.h
@@ -23,6 +23,7 @@
namespace CryOmni3D {
#define GUI_OPTIONS_VERSAILLES GUIO3(GUIO_NOMIDI, GUIO_NOSFX, GUIO_NOASPECT)
+#define GUI_OPTIONS_HNM_PLAYER GUIO4(GUIO_NOMIDI, GUIO_NOSFX, GUIO_NOSPEECH, GUIO_NOASPECT)
// To correctly detect root we need files from various places: CD1, CD2, HDD, on-CD install files
// We use files common to all installations except the documentation links and the binary
@@ -541,17 +542,14 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
{
"versailles",
"Demo",
- {
- { "DEMO_US.HNS", 0, "3a65a984353fec354dd26a62ca2cd3fb", 68462303 },
- { "PLAYHNS.EXE", 0, "1c992f034f43418a5da2e8ebd0b92620", 472371 }
- },
+ AD_ENTRY1s("DEMO_US.HNS", "3a65a984353fec354dd26a62ca2cd3fb", 68462303),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_DEMO | ADGF_UNSUPPORTED,
- GUI_OPTIONS_VERSAILLES
+ ADGF_DEMO,
+ GUI_OPTIONS_HNM_PLAYER
},
- GType_VERSAILLES,
- /* GF_VERSAILLES_FONTS_ | */ GF_VERSAILLES_AUDIOPADDING_NO,
+ GType_HNM_PLAYER,
+ 0,
},
{ AD_TABLE_END_MARKER, 0, 0 }
diff --git a/engines/cryomni3d/metaengine.cpp b/engines/cryomni3d/metaengine.cpp
index 5a31f79667..8917e3eba2 100644
--- a/engines/cryomni3d/metaengine.cpp
+++ b/engines/cryomni3d/metaengine.cpp
@@ -141,6 +141,9 @@ Common::Error CryOmni3DMetaEngine::createInstance(OSystem *syst, Engine **engine
#else
return Common::Error(Common::kUnsupportedGameidError, _s("Versailles 1685 support is not compiled in"));
#endif
+ case GType_HNM_PLAYER:
+ *engine = new CryOmni3DEngine_HNMPlayer(syst, gd);
+ return Common::kNoError;
default:
return Common::kUnsupportedGameidError;
}
Commit: c75e3088fe2151f1065d0522fa3c5d54c7d61acb
https://github.com/scummvm/scummvm/commit/c75e3088fe2151f1065d0522fa3c5d54c7d61acb
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-10-04T18:37:25+02:00
Commit Message:
CRYOMNI3D: Add detection for the Atlantis: The Lost Tales demo
Changed paths:
engines/cryomni3d/cryomni3d.cpp
engines/cryomni3d/detection.cpp
engines/cryomni3d/detection_tables.h
diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 22303dabd9..1bb7b7c4ee 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -132,7 +132,7 @@ Common::String CryOmni3DEngine::prepareFileName(const Common::String &baseName,
void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::SoundType soundType,
HNMCallback beforeDraw, HNMCallback afterDraw) {
- const char *const extensions[] = { "hns", "hnm", nullptr };
+ const char *const extensions[] = { "hns", "hnm", "ubb", nullptr };
Common::String fname(prepareFileName(filename, extensions));
byte *currentPalette = new byte[256 * 3];
diff --git a/engines/cryomni3d/detection.cpp b/engines/cryomni3d/detection.cpp
index bfd27ee0d6..17cad02ad5 100644
--- a/engines/cryomni3d/detection.cpp
+++ b/engines/cryomni3d/detection.cpp
@@ -33,6 +33,7 @@
namespace CryOmni3D {
static const PlainGameDescriptor cryomni3DGames[] = {
+ {"atlantis", "Atlantis: The Lost Tales"},
{"versailles", "Versailles 1685"},
{0, 0}
};
diff --git a/engines/cryomni3d/detection_tables.h b/engines/cryomni3d/detection_tables.h
index 049678114e..cf52d6d63f 100644
--- a/engines/cryomni3d/detection_tables.h
+++ b/engines/cryomni3d/detection_tables.h
@@ -552,6 +552,22 @@ static const CryOmni3DGameDescription gameDescriptions[] = {
0,
},
+ // Atlantis: The Lost Tales
+ // English DOS Non-interactive Demo
+ {
+ {
+ "atlantis",
+ "Demo",
+ AD_ENTRY1s("ATLANTIS.UBB", "f5b41b857678a61d7f9bd6eb41916ce5", 106611456),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_DEMO,
+ GUI_OPTIONS_HNM_PLAYER
+ },
+ GType_HNM_PLAYER,
+ 0,
+ },
+
{ AD_TABLE_END_MARKER, 0, 0 }
};
Commit: 8744e2300b6c358115702244c240858892126dc9
https://github.com/scummvm/scummvm/commit/8744e2300b6c358115702244c240858892126dc9
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-10-04T18:37:25+02:00
Commit Message:
VIDEO: Initial support for UBB2 videos
Currently only handles the audio track.
Changed paths:
video/hnm_decoder.cpp
video/hnm_decoder.h
diff --git a/video/hnm_decoder.cpp b/video/hnm_decoder.cpp
index 0c9394c049..6747674c22 100644
--- a/video/hnm_decoder.cpp
+++ b/video/hnm_decoder.cpp
@@ -53,8 +53,8 @@ bool HNMDecoder::loadStream(Common::SeekableReadStream *stream) {
uint32 tag = stream->readUint32BE();
- /* For now, only HNM4, HNM6 in the future */
- if (tag != MKTAG('H', 'N', 'M', '4')) {
+ /* For now, only HNM4 and UBB2, HNM6 in the future */
+ if (tag != MKTAG('H', 'N', 'M', '4') && tag != MKTAG('U', 'B', 'B', '2')) {
close();
return false;
}
@@ -85,9 +85,13 @@ bool HNMDecoder::loadStream(Common::SeekableReadStream *stream) {
_videoTrack = new HNM4VideoTrack(width, height, frameSize, frameCount, _regularFrameDelay,
_initialPalette);
addTrack(_videoTrack);
- if (soundFormat == 2 && soundBits != 0) {
- // HNM4 is 22050Hz
- _audioTrack = new DPCMAudioTrack(soundFormat, soundBits, 22050, getSoundType());
+ if (tag == MKTAG('H', 'N', 'M', '4') && soundFormat == 2 && soundBits != 0) {
+ // HNM4 is Mono 22050Hz
+ _audioTrack = new DPCMAudioTrack(soundFormat, soundBits, 22050, false, getSoundType());
+ addTrack(_audioTrack);
+ } else if (tag == MKTAG('U', 'B', 'B', '2') && soundFormat == 2 && soundBits == 0) {
+ // UBB2 is Stereo 22050Hz
+ _audioTrack = new DPCMAudioTrack(soundFormat, 16, 22050, true, getSoundType());
addTrack(_audioTrack);
} else {
_audioTrack = nullptr;
@@ -142,12 +146,16 @@ void HNMDecoder::readNextPacket() {
_videoTrack->decodeInterframe(_stream, chunkSize - 8);
}
_videoTrack->presentFrame(flags);
+ } else if (chunkType == MKTAG16('I', 'V')) {
+ _videoTrack->decodeInterframeIV(_stream, chunkSize - 8);
+ _videoTrack->presentFrame(flags);
} else if (chunkType == MKTAG16('S', 'D')) {
if (_audioTrack) {
Audio::Timestamp duration = _audioTrack->decodeSound(_stream, chunkSize - 8);
_videoTrack->setFrameDelay(duration.msecs());
} else {
warning("Got audio data without an audio track");
+ _stream->skip(chunkSize - 8);
}
} else {
error("Got %d chunk: size %d", chunkType, chunkSize);
@@ -461,6 +469,16 @@ void HNMDecoder::HNM4VideoTrack::decodeInterframeA(Common::SeekableReadStream *s
}
}
+void HNMDecoder::HNM4VideoTrack::decodeInterframeIV(Common::SeekableReadStream *stream, uint32 size) {
+ SWAP(_frameBufferC, _frameBufferP);
+
+ // TODO: Implement this
+
+ if (size > 0) {
+ stream->skip(size);
+ }
+}
+
void HNMDecoder::HNM4VideoTrack::decodeIntraframe(Common::SeekableReadStream *stream, uint32 size) {
Image::HLZDecoder::decodeFrameInPlace(*stream, size, _frameBufferC);
memcpy(_frameBufferP, _frameBufferC, (uint)_surface.w * (uint)_surface.h);
@@ -508,17 +526,17 @@ void HNMDecoder::HNM4VideoTrack::presentFrame(uint16 flags) {
_nextNextFrameDelay = uint32(-1);
}
-HNMDecoder::DPCMAudioTrack::DPCMAudioTrack(uint16 format, uint16 bits, uint sampleRate,
+HNMDecoder::DPCMAudioTrack::DPCMAudioTrack(uint16 format, uint16 bits, uint sampleRate, bool stereo,
Audio::Mixer::SoundType soundType) : AudioTrack(soundType), _audioStream(nullptr),
- _gotLUT(false), _lastSample(0) {
+ _gotLUT(false), _lastSample(0), _sampleRate(sampleRate), _stereo(stereo) {
if (bits != 16) {
error("Unsupported audio bits");
}
if (format != 2) {
warning("Unsupported %d audio format", format);
}
- // Format 2 is Mono 16-bits DPCM
- _audioStream = Audio::makeQueuingAudioStream(sampleRate, false);
+ // Format 2 is 16-bits DPCM
+ _audioStream = Audio::makeQueuingAudioStream(_sampleRate, _stereo);
}
HNMDecoder::DPCMAudioTrack::~DPCMAudioTrack() {
@@ -553,12 +571,17 @@ Audio::Timestamp HNMDecoder::DPCMAudioTrack::decodeSound(Common::SeekableReadStr
_lastSample = sample;
byte flags = Audio::FLAG_16BITS;
+
+ if (_audioStream->isStereo())
+ flags |= Audio::FLAG_STEREO;
+
#ifdef SCUMM_LITTLE_ENDIAN
flags |= Audio::FLAG_LITTLE_ENDIAN;
#endif
+
_audioStream->queueBuffer((byte *)out, size * sizeof(*out), DisposeAfterUse::YES, flags);
}
- return Audio::Timestamp(0, size, 22050);
+ return Audio::Timestamp(0, _audioStream->isStereo() ? size / 2 : size, _sampleRate);
}
} // End of namespace Video
diff --git a/video/hnm_decoder.h b/video/hnm_decoder.h
index 3e03ca0643..1bb97a85b3 100644
--- a/video/hnm_decoder.h
+++ b/video/hnm_decoder.h
@@ -75,6 +75,7 @@ private:
void decodePalette(Common::SeekableReadStream *stream, uint32 size);
void decodeInterframe(Common::SeekableReadStream *stream, uint32 size);
void decodeInterframeA(Common::SeekableReadStream *stream, uint32 size);
+ void decodeInterframeIV(Common::SeekableReadStream *stream, uint32 size);
void decodeIntraframe(Common::SeekableReadStream *stream, uint32 size);
void presentFrame(uint16 flags);
@@ -102,7 +103,7 @@ private:
class DPCMAudioTrack : public AudioTrack {
public:
- DPCMAudioTrack(uint16 format, uint16 bits, uint sampleRate,
+ DPCMAudioTrack(uint16 format, uint16 bits, uint sampleRate, bool stereo,
Audio::Mixer::SoundType soundType);
~DPCMAudioTrack() override;
@@ -114,6 +115,8 @@ private:
bool _gotLUT;
uint16 _lut[256];
uint16 _lastSample;
+ uint _sampleRate;
+ bool _stereo;
};
bool _loop;
More information about the Scummvm-git-logs
mailing list