diff options
author | Willem Jan Palenstijn | 2013-04-18 23:34:29 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:39:44 +0200 |
commit | 01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6 (patch) | |
tree | 544b07f3aa41abe7907bcd2040cdad11ebc324bb /engines/saga | |
parent | 9cf2c83e5e5a35816ab153bf8443dac691829ea8 (diff) | |
parent | a41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff) | |
download | scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.gz scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.bz2 scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.zip |
Merge branch 'master'
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/actor.cpp | 1 | ||||
-rw-r--r-- | engines/saga/actor.h | 2 | ||||
-rw-r--r-- | engines/saga/actor_walk.cpp | 10 | ||||
-rw-r--r-- | engines/saga/detection.cpp | 11 | ||||
-rw-r--r-- | engines/saga/detection_tables.h | 83 | ||||
-rw-r--r-- | engines/saga/input.cpp | 1 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 7 | ||||
-rw-r--r-- | engines/saga/introproc_ite.cpp | 33 | ||||
-rw-r--r-- | engines/saga/music.cpp | 12 | ||||
-rw-r--r-- | engines/saga/palanim.h | 1 | ||||
-rw-r--r-- | engines/saga/puzzle.cpp | 18 | ||||
-rw-r--r-- | engines/saga/render.cpp | 2 | ||||
-rw-r--r-- | engines/saga/resource.cpp | 6 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 5 | ||||
-rw-r--r-- | engines/saga/saga.h | 15 | ||||
-rw-r--r-- | engines/saga/saveload.cpp | 7 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 2 | ||||
-rw-r--r-- | engines/saga/script.cpp | 13 | ||||
-rw-r--r-- | engines/saga/shorten.cpp | 1 | ||||
-rw-r--r-- | engines/saga/shorten.h | 1 | ||||
-rw-r--r-- | engines/saga/sndres.cpp | 9 | ||||
-rw-r--r-- | engines/saga/sthread.cpp | 18 |
22 files changed, 123 insertions, 135 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 862a0b4d64..06ce335518 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -385,6 +385,7 @@ void Actor::loadActorList(int protagonistIdx, int actorCount, int actorsResource ByteArrayReadStreamEndian actorS(actorListData); + _actors.clear(); _actors.resize(actorCount); i = 0; for (ActorDataArray::iterator actor = _actors.begin(); actor != _actors.end(); ++actor, i++) { diff --git a/engines/saga/actor.h b/engines/saga/actor.h index a4f475660d..d9d4b70168 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -650,7 +650,7 @@ private: public: #ifdef ACTOR_DEBUG #ifndef SAGA_DEBUG - you must also define SAGA_DEBUG + #error You must also define SAGA_DEBUG #endif //path debug - use with care struct DebugPoint { diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp index 5607fcdd66..ea33a0950d 100644 --- a/engines/saga/actor_walk.cpp +++ b/engines/saga/actor_walk.cpp @@ -1165,7 +1165,15 @@ void Actor::moveDragon(ActorData *actor) { dir0 = actor->_actionDirection; dir1 = actor->_tileDirections[actor->_walkStepIndex++]; dir2 = actor->_tileDirections[actor->_walkStepIndex]; - dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; + // Fix for Bug #3324850 ("ITE (SAGA): crash in dog sewers") + // If there were more than two steps left, get the third (next) step. + // Otherwise, store the second step again so the anim looks right. + // (If you stop the move instead, Rif isn't automatically knocked into + // the Sewer.) + if (actor->_walkStepIndex + 1 < actor->_walkStepsCount) + dir3 = actor->_tileDirections[actor->_walkStepIndex + 1]; + else + dir3 = dir2; if (dir0 != dir1){ actor->_actionDirection = dir0 = dir1; diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 7a98fe4164..091ec8d427 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -67,9 +67,6 @@ int SagaEngine::getGameId() const { return _gameDescription->gameId; } uint32 SagaEngine::getFeatures() const { uint32 result = _gameDescription->features; - if (_gf_wyrmkeep) - result |= GF_WYRMKEEP; - return result; } @@ -259,13 +256,7 @@ SaveStateDescriptor SagaMetaEngine::querySaveMetaInfos(const char *target, int s desc.setWriteProtectedFlag(false); if (version >= 6) { - Graphics::Surface *thumbnail = new Graphics::Surface(); - assert(thumbnail); - if (!Graphics::loadThumbnail(*in, *thumbnail)) { - delete thumbnail; - thumbnail = 0; - } - + Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*in); desc.setThumbnail(thumbnail); uint32 saveDate = in->readUint32BE(); diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index ab73fcba6e..863c2cee64 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -164,9 +164,6 @@ static const GamePatchDescription ITEMacPatch_Files[] = { { NULL, 0, 0} }; -using Common::GUIO_NONE; -using Common::GUIO_NOSPEECH; - static const SAGAGameDescription gameDescriptions[] = { // ITE Section //////////////////////////////////////////////////////////////////////////////////////////// @@ -193,7 +190,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, // Game id GF_OLD_ITE_DOS, // features @@ -218,10 +215,10 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformMacintosh, ADGF_DEMO, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, - GF_WYRMKEEP | GF_SCENE_SUBSTITUTES | GF_MONO_MUSIC | GF_LE_VOICES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -244,10 +241,10 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformMacintosh, ADGF_DEMO, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, - GF_WYRMKEEP | GF_LE_VOICES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -270,10 +267,10 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_ITE, - GF_WYRMKEEP | GF_SCENE_SUBSTITUTES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -296,10 +293,10 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_ITE, - GF_WYRMKEEP | GF_8BIT_UNSIGNED_PCM, + GF_8BIT_UNSIGNED_PCM, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -328,8 +325,8 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, GF_8BIT_UNSIGNED_PCM, @@ -352,11 +349,11 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -384,11 +381,11 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformUnknown, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITE_GameFonts), @@ -414,11 +411,11 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::IT_ITA, Common::kPlatformUnknown, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITE_GameFonts), @@ -438,8 +435,8 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, GF_EXTRA_ITE_CREDITS, @@ -462,8 +459,8 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::IT_ITA, Common::kPlatformPC, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, 0, @@ -486,8 +483,8 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, 0, @@ -511,8 +508,8 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::DE_DEU, Common::kPlatformPC, - ADGF_NO_FLAGS, - GUIO_NONE + ADGF_CD, + GUIO1(GUIO_NONE) }, GID_ITE, 0, @@ -539,7 +536,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, GF_ITE_FLOPPY, @@ -563,7 +560,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, GF_ITE_FLOPPY, @@ -587,7 +584,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NOSPEECH + GUIO1(GUIO_NOSPEECH) }, GID_ITE, GF_ITE_FLOPPY, @@ -620,7 +617,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -652,7 +649,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -682,7 +679,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -710,7 +707,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -739,7 +736,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -767,7 +764,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -792,7 +789,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformMacintosh, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_IHNM, 0, @@ -822,7 +819,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_DINO, 0, @@ -852,7 +849,7 @@ static const SAGAGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, - GUIO_NONE + GUIO1(GUIO_NONE) }, GID_FTA2, 0, diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp index 69a353da9f..8576a3e536 100644 --- a/engines/saga/input.cpp +++ b/engines/saga/input.cpp @@ -158,4 +158,3 @@ Point SagaEngine::mousePos() const { } } // End of namespace Saga - diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 08c5ddc6f9..994b35cbf8 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -320,10 +320,11 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) { _disableAbortSpeeches = false; // set save game reminder alarm - _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this, "sagaSaveReminder"); } Interface::~Interface() { + _vm->getTimerManager()->removeTimerProc(&saveReminderCallback); } void Interface::saveReminderCallback(void *refCon) { @@ -335,7 +336,7 @@ void Interface::updateSaveReminder() { _saveReminderState = _saveReminderState % _vm->getDisplayInfo().saveReminderNumSprites + 1; drawStatusBar(); _vm->getTimerManager()->removeTimerProc(&saveReminderCallback); - _vm->getTimerManager()->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this, "sagaSaveReminder"); } } @@ -1390,7 +1391,7 @@ void Interface::setSave(PanelButton *panelButton) { void Interface::resetSaveReminder() { _vm->getTimerManager()->removeTimerProc(&saveReminderCallback); - _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this, "sagaSaveReminder"); setSaveReminderState(1); } diff --git a/engines/saga/introproc_ite.cpp b/engines/saga/introproc_ite.cpp index 87fd48e2d2..9248f2b530 100644 --- a/engines/saga/introproc_ite.cpp +++ b/engines/saga/introproc_ite.cpp @@ -179,21 +179,22 @@ enum { EventColumns *Scene::ITEQueueCredits(int delta_time, int duration, int n_credits, const IntroCredit credits[]) { int game; Common::Language lang; + bool hasWyrmkeepCredits = (Common::File::exists("credit3n.dlt") || // PC + Common::File::exists("credit3m.dlt")); // Mac // The assumption here is that all WyrmKeep versions have the same // credits, regardless of which operating system they're for. lang = _vm->getLanguage(); - if (_vm->getFeatures() & GF_WYRMKEEP) { + if (hasWyrmkeepCredits) game = kITEWyrmKeep; - } else if (_vm->getPlatform() == Common::kPlatformMacintosh) { + else if (_vm->getPlatform() == Common::kPlatformMacintosh) game = kITEMac; - } else if (_vm->getFeatures() & GF_EXTRA_ITE_CREDITS) { + else if (_vm->getFeatures() & GF_EXTRA_ITE_CREDITS) game = kITEPCCD; - } else { + else game = kITEPC; - } int line_spacing = 0; int paragraph_spacing; @@ -303,6 +304,11 @@ int Scene::SC_ITEIntroAnimProc(int param, void *refCon) { int Scene::ITEIntroAnimProc(int param) { Event event; EventColumns *eventColumns; + bool isMac = _vm->getPlatform() == Common::kPlatformMacintosh; + bool isMultiCD = _vm->getPlatform() == Common::kPlatformUnknown; + bool hasWyrmkeepCredits = (Common::File::exists("credit3n.dlt") || // PC + Common::File::exists("credit3m.dlt")); // Mac + bool isDemo = Common::File::exists("scriptsd.rsc"); switch (param) { case SCENE_BEGIN:{ @@ -324,19 +330,10 @@ int Scene::ITEIntroAnimProc(int param) { // playback int lastAnim; - if (_vm->getFeatures() & GF_WYRMKEEP) { - if (_vm->getPlatform() == Common::kPlatformMacintosh) { - lastAnim = 3; - } else { - lastAnim = 2; - } - } else { - if (_vm->getPlatform() == Common::kPlatformMacintosh) { - lastAnim = 4; - } else { - lastAnim = 5; - } - } + if (hasWyrmkeepCredits || isMultiCD || isDemo) + lastAnim = isMac ? 3 : 2; + else + lastAnim = isMac ? 4 : 5; for (int i = 0; i < lastAnim; i++) _vm->_anim->link(i, i+1); diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 21f3cc489e..13850a0b6d 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -213,7 +213,7 @@ void Music::setVolume(int volume, int time) { return; } - _vm->getTimerManager()->installTimerProc(&musicVolumeGaugeCallback, time * 3000L, this); + _vm->getTimerManager()->installTimerProc(&musicVolumeGaugeCallback, time * 3000L, this, "sagaMusicVolume"); } bool Music::isPlaying() { @@ -287,7 +287,12 @@ void Music::play(uint32 resourceId, MusicFlags flags) { if (_vm->isBigEndian()) musicFlags &= ~Audio::FLAG_LITTLE_ENDIAN; - if (_vm->getFeatures() & GF_MONO_MUSIC) + // The newer ITE Mac demo version contains a music file, but it has mono music. + // This is the only music file that is about 7MB, whereas all the other ones + // are much larger. Thus, we use this simple heuristic to determine if we got + // mono music in the ITE demos or not. + if (!strcmp(_digitalMusicContext->fileName(), "musicd.rsc") && + _digitalMusicContext->fileSize() < 8000000) musicFlags &= ~Audio::FLAG_STEREO; audioStream = Audio::makeRawStream(musicStream, 11025, musicFlags, DisposeAfterUse::YES); @@ -368,10 +373,12 @@ void Music::play(uint32 resourceId, MusicFlags flags) { void Music::pause() { _player->pause(); + _player->setVolume(0); } void Music::resume() { _player->resume(); + _player->setVolume(_vm->_musicVolume); } void Music::stop() { @@ -379,4 +386,3 @@ void Music::stop() { } } // End of namespace Saga - diff --git a/engines/saga/palanim.h b/engines/saga/palanim.h index 9959d08e2f..920cbec65a 100644 --- a/engines/saga/palanim.h +++ b/engines/saga/palanim.h @@ -53,4 +53,3 @@ class PalAnim { } // End of namespace Saga #endif - diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index d5d83c706f..63d9a88fee 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -140,7 +140,7 @@ void Puzzle::initPieceInfo(int i, int16 curX, int16 curY, byte offX, byte offY, void Puzzle::execute() { _active = true; - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint"); initPieces(); @@ -408,12 +408,12 @@ void Puzzle::solicitHint() { switch (_hintRqState) { case kRQSpeaking: if (_vm->_actor->isSpeaking()) { - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50 * 1000000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50 * 1000000, this, "sagaPuzzleHint"); break; } _hintRqState = _hintNextRqState; - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 100*1000000/3, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 100*1000000/3, this, "sagaPuzzleHint"); break; case kRQNoHint: @@ -436,11 +436,11 @@ void Puzzle::solicitHint() { // Roll to see if Sakka scolds if (_vm->_rnd.getRandomNumber(1)) { _hintRqState = kRQSakkaDenies; - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 200*1000000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 200*1000000, this, "sagaPuzzleHint"); } else { _hintRqState = kRQSpeaking; _hintNextRqState = kRQHintRequested; - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this, "sagaPuzzleHint"); } break; @@ -453,7 +453,7 @@ void Puzzle::solicitHint() { _hintRqState = kRQSpeaking; _hintNextRqState = kRQHintRequestedStage2; - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this, "sagaPuzzleHint"); _vm->_interface->converseClear(); _vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0); @@ -480,7 +480,7 @@ void Puzzle::solicitHint() { _vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0); _vm->_interface->converseDisplayText(); - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint"); _hintRqState = kRQSkipEverything; break; @@ -504,7 +504,7 @@ void Puzzle::handleReply(int reply) { _vm->_actor->abortSpeech(); _hintRqState = kRQNoHint; _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this, "sagaPuzzleHint"); clearHint(); break; } @@ -566,7 +566,7 @@ void Puzzle::giveHint() { _vm->_interface->converseDisplayText(); _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); - _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this, "sagaPuzzleHint"); } void Puzzle::clearHint() { diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 757374a3a3..a9ef23381e 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -50,7 +50,7 @@ Render::Render(SagaEngine *vm, OSystem *system) { #ifdef SAGA_DEBUG // Initialize FPS timer callback - _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this); + _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this, "sagaFPS"); #endif _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, Graphics::PixelFormat::createFormatCLUT8()); diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp index 72b021309c..1b0dfa2f22 100644 --- a/engines/saga/resource.cpp +++ b/engines/saga/resource.cpp @@ -162,12 +162,6 @@ bool Resource::createContexts() { uint16 voiceFileAddType; }; - - // If the Wyrmkeep credits file is found, set the Wyrmkeep version flag to true - if (Common::File::exists("credit3n.dlt")) { - _vm->_gf_wyrmkeep = true; - } - for (const ADGameFileDescription *gameFileDescription = _vm->getFilesDescriptions(); gameFileDescription->fileName; gameFileDescription++) { addContext(gameFileDescription->fileName, gameFileDescription->fileType); diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index d168605e99..6e272d37c0 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -72,9 +72,8 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) _readingSpeed = 0; _copyProtection = false; - _gf_wyrmkeep = false; _musicWasPlaying = false; - + _hasITESceneSubstitutes = false; _sndRes = NULL; _sound = NULL; @@ -211,9 +210,9 @@ Common::Error SagaEngine::run() { _subtitlesEnabled = ConfMan.getBool("subtitles"); _readingSpeed = getTalkspeed(); _copyProtection = ConfMan.getBool("copy_protection"); - _gf_wyrmkeep = false; _musicWasPlaying = false; _isIHNMDemo = Common::File::exists("music.res"); + _hasITESceneSubstitutes = Common::File::exists("boarhall.bbm"); if (_readingSpeed > 3) _readingSpeed = 0; diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 23258e1277..fb01b1ac5d 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -29,7 +29,6 @@ #include "common/random.h" #include "common/memstream.h" #include "common/textconsole.h" -#include "audio/mididrv.h" #include "saga/gfx.h" @@ -137,16 +136,12 @@ enum GameFileTypes { }; enum GameFeatures { - GF_WYRMKEEP = 1 << 0, - GF_ITE_FLOPPY = 1 << 1, - GF_SCENE_SUBSTITUTES = 1 << 2, + GF_ITE_FLOPPY = 1 << 0, #if 0 - GF_OLD_ITE_DOS = 1 << 3, // Currently unused + GF_OLD_ITE_DOS = 1 << 1, // Currently unused #endif - GF_MONO_MUSIC = 1 << 4, - GF_EXTRA_ITE_CREDITS = 1 << 5, - GF_LE_VOICES = 1 << 6, - GF_8BIT_UNSIGNED_PCM = 1 << 7 + GF_EXTRA_ITE_CREDITS = 1 << 2, + GF_8BIT_UNSIGNED_PCM = 1 << 3 }; enum VerbTypeIds { @@ -532,9 +527,9 @@ public: int _readingSpeed; bool _copyProtection; - bool _gf_wyrmkeep; bool _musicWasPlaying; bool _isIHNMDemo; + bool _hasITESceneSubstitutes; SndRes *_sndRes; Sound *_sound; diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 8d7b718c09..9e0789fdaf 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -295,12 +295,7 @@ void SagaEngine::load(const char *fileName) { if (_saveHeader.version >= 6) { // We don't need the thumbnail here, so just read it and discard it - Graphics::Surface *thumbnail = new Graphics::Surface(); - assert(thumbnail); - Graphics::loadThumbnail(*in, *thumbnail); - thumbnail->free(); - delete thumbnail; - thumbnail = 0; + Graphics::skipThumbnail(*in); in->readUint32BE(); // save date in->readUint16BE(); // save time diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 66ee8f4504..61e62d5626 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -451,7 +451,7 @@ void Scene::changeScene(int16 sceneNumber, int actorsEntrance, SceneTransitionTy // This is used for latter ITE demos where all places on world map except // Tent Faire are substituted with LBM picture and short description - if (_vm->getFeatures() & GF_SCENE_SUBSTITUTES) { + if (_vm->_hasITESceneSubstitutes) { for (int i = 0; i < ARRAYSIZE(sceneSubstitutes); i++) { if (sceneSubstitutes[i].sceneId == sceneNumber) { Surface bbmBuffer; diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index f4902b6c11..96746b538c 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -26,6 +26,7 @@ #include "saga/gfx.h" #include "saga/console.h" +#include "saga/animation.h" #include "saga/script.h" #include "saga/interface.h" #include "saga/itedata.h" @@ -941,6 +942,18 @@ void Script::opSpeak(SCRIPTOP_PARAMS) { return; } +#ifdef ENABLE_IHNM + // WORKAROUND for script bug #3358007 in IHNM. When the zeppelin is landing + // and the player attempts to exit from the right door in room 13, the game + // scripts change to scene 5, but do not clear the cutaway that appears + // before Gorrister's speech starts, resulting in a deadlock. We do this + // manually here. + if (_vm->getGameId() == GID_IHNM && _vm->_scene->currentChapterNumber() == 1 && + _vm->_scene->currentSceneNumber() == 5 && _vm->_anim->hasCutaway()) { + _vm->_anim->returnFromCutaway(); + } +#endif + int stringsCount = scriptS->readByte(); uint16 actorId = scriptS->readUint16LE(); uint16 speechFlags = scriptS->readByte(); diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp index 39af7aa3db..5efc8d1f67 100644 --- a/engines/saga/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -541,4 +541,3 @@ Audio::AudioStream *makeShortenStream(Common::SeekableReadStream &stream) { } // End of namespace Audio #endif // defined(SOUND_SHORTEN_H) - diff --git a/engines/saga/shorten.h b/engines/saga/shorten.h index f2114bedeb..77feafa54d 100644 --- a/engines/saga/shorten.h +++ b/engines/saga/shorten.h @@ -57,4 +57,3 @@ Audio::AudioStream *makeShortenStream(Common::ReadStream &stream); #endif #endif // engine and dynamic plugins guard - diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 2433c93e93..add34e22a2 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -262,9 +262,12 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff buffer.flags |= Audio::FLAG_UNSIGNED; buffer.flags &= ~Audio::FLAG_16BITS; } else { - // Voice files in newer ITE demo versions are OKI ADPCM (VOX) encoded - if (!uncompressedSound && !scumm_stricmp(context->fileName(), "voicesd.rsc")) + // Voice files in newer ITE demo versions are OKI ADPCM (VOX) encoded. + // These are LE in all the Windows and Mac demos + if (!uncompressedSound && !scumm_stricmp(context->fileName(), "voicesd.rsc")) { resourceType = kSoundVOX; + buffer.flags |= Audio::FLAG_LITTLE_ENDIAN; + } } } buffer.buffer = NULL; @@ -272,8 +275,6 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff // Check for LE sounds if (!context->isBigEndian()) buffer.flags |= Audio::FLAG_LITTLE_ENDIAN; - if ((context->fileType() & GAME_VOICEFILE) && (_vm->getFeatures() & GF_LE_VOICES)) - buffer.flags |= Audio::FLAG_LITTLE_ENDIAN; // Older Mac versions of ITE were Macbinary packed int soundOffset = (context->fileType() & GAME_MACBINARY) ? 36 : 0; diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp index ec81d8d733..6e5cc68ae6 100644 --- a/engines/saga/sthread.cpp +++ b/engines/saga/sthread.cpp @@ -102,9 +102,8 @@ void Script::wakeUpThreadsDelayed(int waitType, int sleepTime) { void Script::executeThreads(uint msec) { ScriptThreadList::iterator threadIterator; - if (_vm->_interface->_statusTextInput) { + if (_vm->_interface->_statusTextInput) return; - } threadIterator = _threadList.begin(); @@ -129,11 +128,10 @@ void Script::executeThreads(uint msec) { switch (thread._waitType) { case kWaitTypeDelay: - if (thread._sleepTime < msec) { + if (thread._sleepTime < msec) thread._sleepTime = 0; - } else { + else thread._sleepTime -= msec; - } if (thread._sleepTime == 0) thread._flags &= ~kTFlagWaiting; @@ -141,11 +139,9 @@ void Script::executeThreads(uint msec) { case kWaitTypeWalk: { - ActorData *actor; - actor = (ActorData *)thread._threadObj; - if (actor->_currentAction == kActionWait) { + ActorData *actor = (ActorData *)thread._threadObj; + if (actor->_currentAction == kActionWait) thread._flags &= ~kTFlagWaiting; - } } break; @@ -157,9 +153,8 @@ void Script::executeThreads(uint msec) { } if (!(thread._flags & kTFlagWaiting)) { - if (runThread(thread)) { + if (runThread(thread)) break; - } } ++threadIterator; @@ -236,4 +231,3 @@ bool Script::runThread(ScriptThread &thread) { } } // End of namespace Saga - |