[Scummvm-git-logs] scummvm master -> b527d3d67433364dfe9d4002dbc098224c70b1c7
mgerhardy
noreply at scummvm.org
Wed Jun 8 09:43:16 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2d3661052b COMMON: Add Android to Platform Header
5e8aa1a7ba TWINE: Add detection for DotEmu Android version of LBA1
145f0bc72e TWINE: added android dotemu sample support
b527d3d674 TWINE: Move Android sample playing to right place, mark as stable
Commit: 2d3661052be562cfa8492acefd2a935fc66af2da
https://github.com/scummvm/scummvm/commit/2d3661052be562cfa8492acefd2a935fc66af2da
Author: eientei (einstein95 at users.noreply.github.com)
Date: 2022-06-08T11:43:09+02:00
Commit Message:
COMMON: Add Android to Platform Header
Changed paths:
common/platform.cpp
common/platform.h
diff --git a/common/platform.cpp b/common/platform.cpp
index ef5f3841365..4cefa61a405 100644
--- a/common/platform.cpp
+++ b/common/platform.cpp
@@ -55,6 +55,7 @@ const PlatformDescription g_platforms[] = {
{ "xbox", "xbox", "xbox", "Microsoft Xbox", kPlatformXbox },
{ "cdi", "cdi", "cdi", "Philips CD-i", kPlatformCDi },
{ "ios", "ios", "ios", "Apple iOS", kPlatformIOS },
+ { "android", "android", "android", "Android", kPlatformAndroid },
{ "os2", "os2", "os2", "OS/2", kPlatformOS2 },
{ "beos", "beos", "beos", "BeOS", kPlatformBeOS },
{ "ppc", "ppc", "ppc", "PocketPC", kPlatformPocketPC },
diff --git a/common/platform.h b/common/platform.h
index 3a313e8390c..0ae41ca9e0c 100644
--- a/common/platform.h
+++ b/common/platform.h
@@ -68,6 +68,7 @@ enum Platform {
kPlatformXbox,
kPlatformCDi,
kPlatformIOS,
+ kPlatformAndroid,
kPlatformOS2,
kPlatformBeOS,
kPlatformPocketPC,
Commit: 5e8aa1a7ba9559a30a41f16014885e7fe50a7ff7
https://github.com/scummvm/scummvm/commit/5e8aa1a7ba9559a30a41f16014885e7fe50a7ff7
Author: eientei (einstein95 at users.noreply.github.com)
Date: 2022-06-08T11:43:09+02:00
Commit Message:
TWINE: Add detection for DotEmu Android version of LBA1
Changed paths:
engines/twine/detection.cpp
diff --git a/engines/twine/detection.cpp b/engines/twine/detection.cpp
index ee07b0e2534..2bef2a3a626 100644
--- a/engines/twine/detection.cpp
+++ b/engines/twine/detection.cpp
@@ -434,6 +434,37 @@ static const ADGameDescription twineGameDescriptions[] = {
GUIO1(GUIO_NONE)
},
+ // Little Big Adventure - DotEmu Enhanced Version (Android)
+ // liblba.so
+ // 8 Sep 2014 at 15:56
+ {
+ "lba",
+ "DotEmu",
+ AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
+ Common::EN_ANY,
+ Common::kPlatformAndroid,
+ ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ GUIO1(GUIO_NONE)
+ },
+ {
+ "lba",
+ "DotEmu",
+ AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
+ Common::FR_FRA,
+ Common::kPlatformAndroid,
+ ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ GUIO1(GUIO_NONE)
+ },
+ {
+ "lba",
+ "DotEmu",
+ AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
+ Common::DE_DEU,
+ Common::kPlatformAndroid,
+ ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ GUIO1(GUIO_NONE)
+ },
+
// Little Big Adventure - GOG Version
// LBA.GOG
// 11 October 2011 at 17:30
Commit: 145f0bc72e99e9d7c76f8cb2d98e75ab079538a6
https://github.com/scummvm/scummvm/commit/145f0bc72e99e9d7c76f8cb2d98e75ab079538a6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-08T11:43:09+02:00
Commit Message:
TWINE: added android dotemu sample support
the have it in ogg files - see https://bugs.scummvm.org/ticket/13492
Changed paths:
engines/twine/audio/sound.cpp
engines/twine/audio/sound.h
engines/twine/metaengine.cpp
engines/twine/text.cpp
engines/twine/text.h
engines/twine/twine.cpp
engines/twine/twine.h
diff --git a/engines/twine/audio/sound.cpp b/engines/twine/audio/sound.cpp
index 5d4e326e569..a1c53ff4285 100644
--- a/engines/twine/audio/sound.cpp
+++ b/engines/twine/audio/sound.cpp
@@ -84,7 +84,9 @@ void Sound::playFlaSample(int32 index, int32 repeat, uint8 balance, int32 volume
*sampPtr = 'C';
}
- playSample(channelIdx, index, sampPtr, sampSize, repeat, Resources::HQR_FLASAMP_FILE);
+ Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, DisposeAfterUse::YES);
+ Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES);
+ playSample(channelIdx, index, audioStream, repeat, Resources::HQR_FLASAMP_FILE);
}
void Sound::playSample(int32 index, int32 repeat, int32 x, int32 y, int32 z, int32 actorIdx) {
@@ -104,9 +106,19 @@ void Sound::playSample(int32 index, int32 repeat, int32 x, int32 y, int32 z, int
samplesPlayingActors[channelIdx] = actorIdx;
}
+ if (_engine->isAndroid()) {
+ const Common::String &basename = Common::String::format("%s%i", _engine->_text->_currentOggBaseFile.c_str(), index);
+ Audio::SeekableAudioStream *audioStream = Audio::SeekableAudioStream::openStreamFile(basename);
+ if (audioStream != nullptr) {
+ playSample(index, repeat, audioStream, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kSFXSoundType);
+ return;
+ }
+ }
uint8 *sampPtr = _engine->_resources->_samplesTable[index];
- int32 sampSize = _engine->_resources->_samplesSizeTable[index];
- playSample(channelIdx, index, sampPtr, sampSize, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kSFXSoundType, DisposeAfterUse::NO);
+ uint32 sampSize = _engine->_resources->_samplesSizeTable[index];
+ Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, DisposeAfterUse::NO);
+ Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES);
+ playSample(channelIdx, index, audioStream, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kSFXSoundType);
}
bool Sound::playVoxSample(const TextEntry *text) {
@@ -142,16 +154,14 @@ bool Sound::playVoxSample(const TextEntry *text) {
_engine->_text->_voxHiddenIndex++;
*sampPtr = 'C';
}
-
- return playSample(channelIdx, text->index, sampPtr, sampSize, 1, _engine->_text->_currentVoxBankFile.c_str(), Audio::Mixer::kSpeechSoundType);
+ Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, DisposeAfterUse::YES);
+ Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES);
+ return playSample(channelIdx, text->index, audioStream, 1, _engine->_text->_currentVoxBankFile.c_str(), Audio::Mixer::kSpeechSoundType);
}
-bool Sound::playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, Audio::Mixer::SoundType soundType, DisposeAfterUse::Flag disposeFlag) {
- Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, disposeFlag);
- Audio::SeekableAudioStream *audioStream = Audio::makeVOCStream(stream, DisposeAfterUse::YES);
+bool Sound::playSample(int channelIdx, int index, Audio::SeekableAudioStream *audioStream, int32 loop, const char *name, Audio::Mixer::SoundType soundType) {
if (audioStream == nullptr) {
- warning("Failed to create audio stream for %s", name);
- delete stream;
+ warning("Failed to create audio stream for %s: %i", name, index);
return false;
}
if (loop == -1) {
diff --git a/engines/twine/audio/sound.h b/engines/twine/audio/sound.h
index 88499966a60..7fc9bf77a81 100644
--- a/engines/twine/audio/sound.h
+++ b/engines/twine/audio/sound.h
@@ -22,6 +22,7 @@
#ifndef TWINE_SOUND_H
#define TWINE_SOUND_H
+#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "common/scummsys.h"
#include "common/types.h"
@@ -62,7 +63,7 @@ private:
/** Samples playing at a actors position */
int32 samplesPlayingActors[NUM_CHANNELS]{0};
- bool playSample(int channelIdx, int index, uint8 *sampPtr, int32 sampSize, int32 loop, const char *name, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType, DisposeAfterUse::Flag disposeFlag = DisposeAfterUse::YES);
+ bool playSample(int channelIdx, int index, Audio::SeekableAudioStream *audioStream, int32 loop, const char *name, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
bool isChannelPlaying(int32 channel);
diff --git a/engines/twine/metaengine.cpp b/engines/twine/metaengine.cpp
index c0b358477f3..407303789e6 100644
--- a/engines/twine/metaengine.cpp
+++ b/engines/twine/metaengine.cpp
@@ -57,7 +57,7 @@ public:
} else if (gameId == "lbashow") {
gameType = TwineGameType::GType_LBASHOW;
}
- *engine = new TwinE::TwinEEngine(syst, desc->language, desc->flags, gameType);
+ *engine = new TwinE::TwinEEngine(syst, desc->language, desc->flags, desc->platform, gameType);
return Common::kNoError;
}
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index b6a46e92c8e..7f774126d09 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -79,6 +79,7 @@ void Text::initVoxBank(TextBankId bankIdx) {
}
// get the correct vox hqr file
_currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, LanguageTypes[_engine->_cfgfile.LanguageId].id, LanguageSuffixTypes[(int)bankIdx]);
+ _currentOggBaseFile = Common::String::format("%s_%s_", LanguageTypes[_engine->_cfgfile.LanguageId].id, LanguageSuffixTypes[(int)bankIdx]);
// TODO: loop through other languages and take the scummvm settings regarding voices into account...
// TODO check the rest to reverse
diff --git a/engines/twine/text.h b/engines/twine/text.h
index 6b114dd2864..9e249c4f8e1 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -153,6 +153,8 @@ public:
const TextEntry *_currDialTextEntry = nullptr; // ordered entry
Common::String _currentVoxBankFile;
+ // used for the android version (dotemu)
+ Common::String _currentOggBaseFile;
bool _showDialogueBubble = true;
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 3fcc5b13514..0f1a7c2f434 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -123,8 +123,8 @@ void TwineScreen::update() {
Super::update();
}
-TwinEEngine::TwinEEngine(OSystem *system, Common::Language language, uint32 flags, TwineGameType gameType)
- : Engine(system), _gameType(gameType), _gameLang(language), _frontVideoBuffer(this), _gameFlags(flags), _rnd("twine") {
+TwinEEngine::TwinEEngine(OSystem *system, Common::Language language, uint32 flags, Common::Platform platform, TwineGameType gameType)
+ : Engine(system), _gameType(gameType), _gameLang(language), _frontVideoBuffer(this), _gameFlags(flags), _platform(platform), _rnd("twine") {
// Add default file directories
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "fla");
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 0a222629c74..019a5723eb3 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -23,6 +23,7 @@
#define TWINE_TWINE_H
#include "backends/keymapper/keymap.h"
+#include "common/platform.h"
#include "common/random.h"
#include "common/rect.h"
#include "engines/advancedDetector.h"
@@ -229,7 +230,7 @@ private:
*/
bool runGameEngine();
public:
- TwinEEngine(OSystem *system, Common::Language language, uint32 flagsTwineGameType, TwineGameType gameType);
+ TwinEEngine(OSystem *system, Common::Language language, uint32 flagsTwineGameType, Common::Platform platform, TwineGameType gameType);
~TwinEEngine() override;
Common::Error run() override;
@@ -255,6 +256,7 @@ public:
bool isDotEmuEnhanced() const { return (_gameFlags & TwinE::TF_DOTEMU_ENHANCED) != 0; }
bool isLba1Classic() const { return (_gameFlags & TwinE::TF_LBA1_CLASSIC) != 0; }
bool isDemo() const { return (_gameFlags & ADGF_DEMO) != 0; };
+ bool isAndroid() const { return _platform == Common::Platform::kPlatformAndroid; };
const char *getGameId() const;
Common::Language getGameLang() const;
@@ -296,6 +298,7 @@ public:
int32 _loopInventoryItem = 0;
int32 _loopActorStep = 0;
uint32 _gameFlags;
+ Common::Platform _platform;
/** Disable screen recenter */
bool _disableScreenRecenter = false;
Commit: b527d3d67433364dfe9d4002dbc098224c70b1c7
https://github.com/scummvm/scummvm/commit/b527d3d67433364dfe9d4002dbc098224c70b1c7
Author: eientei (einstein95 at users.noreply.github.com)
Date: 2022-06-08T11:43:09+02:00
Commit Message:
TWINE: Move Android sample playing to right place, mark as stable
Changed paths:
engines/twine/audio/music.cpp
engines/twine/audio/sound.cpp
engines/twine/detection.cpp
engines/twine/text.cpp
diff --git a/engines/twine/audio/music.cpp b/engines/twine/audio/music.cpp
index 389fde2c507..44bef93cbb6 100644
--- a/engines/twine/audio/music.cpp
+++ b/engines/twine/audio/music.cpp
@@ -266,7 +266,7 @@ bool Music::playMidiMusic(int32 midiIdx, int32 loop) {
}
void Music::stopMidiMusic() {
- if (_engine->_gameFlags & TF_DOTEMU_ENHANCED) {
+ if (_engine->isDotEmuEnhanced()) {
_engine->_system->getMixer()->stopHandle(_midiHandle);
}
diff --git a/engines/twine/audio/sound.cpp b/engines/twine/audio/sound.cpp
index a1c53ff4285..84ae7170497 100644
--- a/engines/twine/audio/sound.cpp
+++ b/engines/twine/audio/sound.cpp
@@ -106,14 +106,6 @@ void Sound::playSample(int32 index, int32 repeat, int32 x, int32 y, int32 z, int
samplesPlayingActors[channelIdx] = actorIdx;
}
- if (_engine->isAndroid()) {
- const Common::String &basename = Common::String::format("%s%i", _engine->_text->_currentOggBaseFile.c_str(), index);
- Audio::SeekableAudioStream *audioStream = Audio::SeekableAudioStream::openStreamFile(basename);
- if (audioStream != nullptr) {
- playSample(index, repeat, audioStream, repeat, Resources::HQR_SAMPLES_FILE, Audio::Mixer::kSFXSoundType);
- return;
- }
- }
uint8 *sampPtr = _engine->_resources->_samplesTable[index];
uint32 sampSize = _engine->_resources->_samplesSizeTable[index];
Common::MemoryReadStream *stream = new Common::MemoryReadStream(sampPtr, sampSize, DisposeAfterUse::NO);
@@ -126,6 +118,20 @@ bool Sound::playVoxSample(const TextEntry *text) {
return false;
}
+ int channelIdx = getFreeSampleChannelIndex();
+ if (channelIdx == -1) {
+ warning("Failed to play vox sample for index: %i - no free channel", text->index);
+ return false;
+ }
+
+ if (_engine->isAndroid()) {
+ const Common::String &basename = Common::String::format("%s%03i", _engine->_text->_currentOggBaseFile.c_str(), text->index);
+ Audio::SeekableAudioStream *audioStream = Audio::SeekableAudioStream::openStreamFile(basename);
+ if (audioStream != nullptr) {
+ return playSample(channelIdx, text->index, audioStream, 1, _engine->_text->_currentOggBaseFile.c_str(), Audio::Mixer::kSpeechSoundType);
+ }
+ }
+
uint8 *sampPtr = nullptr;
int32 sampSize = HQR::getAllocVoxEntry(&sampPtr, _engine->_text->_currentVoxBankFile.c_str(), text->index, _engine->_text->_voxHiddenIndex);
if (sampSize == 0) {
@@ -142,12 +148,6 @@ bool Sound::playVoxSample(const TextEntry *text) {
return false;
}
- int channelIdx = getFreeSampleChannelIndex();
- if (channelIdx == -1) {
- warning("Failed to play vox sample for index: %i - no free channel", text->index);
- return false;
- }
-
// Fix incorrect sample files first byte
if (*sampPtr != 'C') {
_engine->_text->_hasHiddenVox = *sampPtr != '\0';
diff --git a/engines/twine/detection.cpp b/engines/twine/detection.cpp
index 2bef2a3a626..17c8d7c97b9 100644
--- a/engines/twine/detection.cpp
+++ b/engines/twine/detection.cpp
@@ -443,7 +443,7 @@ static const ADGameDescription twineGameDescriptions[] = {
AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
Common::EN_ANY,
Common::kPlatformAndroid,
- ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ TwinE::TF_DOTEMU_ENHANCED,
GUIO1(GUIO_NONE)
},
{
@@ -452,7 +452,7 @@ static const ADGameDescription twineGameDescriptions[] = {
AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
Common::FR_FRA,
Common::kPlatformAndroid,
- ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ TwinE::TF_DOTEMU_ENHANCED,
GUIO1(GUIO_NONE)
},
{
@@ -461,7 +461,7 @@ static const ADGameDescription twineGameDescriptions[] = {
AD_ENTRY1s("text.hqr", "a374c93450dd2bb874b7167a63974e8d", 377224),
Common::DE_DEU,
Common::kPlatformAndroid,
- ADGF_UNSTABLE | TwinE::TF_DOTEMU_ENHANCED,
+ TwinE::TF_DOTEMU_ENHANCED,
GUIO1(GUIO_NONE)
},
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 7f774126d09..2bd96ad4339 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -79,7 +79,7 @@ void Text::initVoxBank(TextBankId bankIdx) {
}
// get the correct vox hqr file
_currentVoxBankFile = Common::String::format("%s%s" VOX_EXT, LanguageTypes[_engine->_cfgfile.LanguageId].id, LanguageSuffixTypes[(int)bankIdx]);
- _currentOggBaseFile = Common::String::format("%s_%s_", LanguageTypes[_engine->_cfgfile.LanguageId].id, LanguageSuffixTypes[(int)bankIdx]);
+ _currentOggBaseFile = Common::String::format("%s%s_", LanguageTypes[_engine->_cfgfile.LanguageId].id, LanguageSuffixTypes[(int)bankIdx]);
// TODO: loop through other languages and take the scummvm settings regarding voices into account...
// TODO check the rest to reverse
More information about the Scummvm-git-logs
mailing list