diff options
author | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-07-20 09:27:39 -0400 |
commit | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch) | |
tree | e568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/saga | |
parent | d7411acc2b1c7702280dbff1c3e1bafee528184b (diff) | |
parent | e25e85fbb047fef895ede97c3c2c73451631052c (diff) | |
download | scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2 scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/actor.cpp | 3 | ||||
-rw-r--r-- | engines/saga/actor.h | 6 | ||||
-rw-r--r-- | engines/saga/actor_walk.cpp | 10 | ||||
-rw-r--r-- | engines/saga/animation.cpp | 4 | ||||
-rw-r--r-- | engines/saga/detection.cpp | 3 | ||||
-rw-r--r-- | engines/saga/detection_tables.h | 18 | ||||
-rw-r--r-- | engines/saga/events.cpp | 2 | ||||
-rw-r--r-- | engines/saga/introproc_ite.cpp | 33 | ||||
-rw-r--r-- | engines/saga/introproc_saga2.cpp | 2 | ||||
-rw-r--r-- | engines/saga/isomap.cpp | 2 | ||||
-rw-r--r-- | engines/saga/music.cpp | 9 | ||||
-rw-r--r-- | engines/saga/palanim.cpp | 4 | ||||
-rw-r--r-- | engines/saga/resource.cpp | 6 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 7 | ||||
-rw-r--r-- | engines/saga/saga.h | 14 | ||||
-rw-r--r-- | engines/saga/scene.cpp | 2 | ||||
-rw-r--r-- | engines/saga/scene.h | 2 | ||||
-rw-r--r-- | engines/saga/sndres.cpp | 9 | ||||
-rw-r--r-- | engines/saga/sprite.cpp | 8 |
19 files changed, 72 insertions, 72 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp index 86606855e3..06ce335518 100644 --- a/engines/saga/actor.cpp +++ b/engines/saga/actor.cpp @@ -340,7 +340,7 @@ void Actor::loadActorSpriteList(ActorData *actor) { uint lastFrame = 0; uint curFrameIndex; int resourceId = actor->_spriteListResourceId; - + if (actor->_frames != NULL) { for (ActorFrameSequences::const_iterator i = actor->_frames->begin(); i != actor->_frames->end(); ++i) { for (int orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) { @@ -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 451497986d..d9d4b70168 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -321,7 +321,7 @@ public: _screenDepth = in->readSint32LE(); _screenScale = in->readSint32LE(); } - + CommonObjectData() { _index = 0; _id = 0; @@ -463,7 +463,7 @@ public: void cmdActorWalkTo(int argc, const char **argv); bool validActorId(uint16 id) { - return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size()))); + return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size()))); } int actorIdToIndex(uint16 id) { return (id == ID_PROTAG) ? 0 : objectIdToIndex(id); } uint16 actorIndexToId(int index) { return (index == 0) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); } @@ -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/animation.cpp b/engines/saga/animation.cpp index 7ec4a59398..8b2d1e9dad 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -169,7 +169,7 @@ int Anim::playCutaway(int cut, bool fade) { ByteArray resourceData; _vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData); load(MAX_ANIMATIONS + cutawaySlot, resourceData); - + setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles); setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate); @@ -414,7 +414,7 @@ void Anim::load(uint16 animId, const ByteArray &resourceData) { } anim->resourceData.resize(resourceData.size() - dataOffset); - + memcpy(anim->resourceData.getBuffer(), resourceData.getBuffer() + dataOffset, anim->resourceData.size()); // Cache frame offsets diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 7a98fe4164..2f1b61eed8 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; } diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index f63efd206b..a29d835a54 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -221,7 +221,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NOSPEECH }, GID_ITE, - GF_WYRMKEEP | GF_SCENE_SUBSTITUTES | GF_MONO_MUSIC | GF_LE_VOICES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -247,7 +247,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NOSPEECH }, GID_ITE, - GF_WYRMKEEP | GF_LE_VOICES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -273,7 +273,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NONE }, GID_ITE, - GF_WYRMKEEP | GF_SCENE_SUBSTITUTES, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -299,7 +299,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NONE }, GID_ITE, - GF_WYRMKEEP | GF_8BIT_UNSIGNED_PCM, + GF_8BIT_UNSIGNED_PCM, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -356,7 +356,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NONE }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -388,7 +388,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NONE }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITE_GameFonts), @@ -418,7 +418,7 @@ static const SAGAGameDescription gameDescriptions[] = { GUIO_NONE }, GID_ITE, - GF_WYRMKEEP, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITE_GameFonts), @@ -821,7 +821,7 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GID_DINO, @@ -851,7 +851,7 @@ static const SAGAGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_UNSTABLE, GUIO_NONE }, GID_FTA2, diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp index 35f41e30ab..ec3ef2f6f9 100644 --- a/engines/saga/events.cpp +++ b/engines/saga/events.cpp @@ -557,7 +557,7 @@ int Events::handleInterval(Event *event) { } EventColumns *Events::chain(EventColumns *eventColumns, const Event &event) { - + if (eventColumns == NULL) { EventColumns tmp; 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/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 80d53a2794..bdf8936a55 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -113,7 +113,7 @@ void Scene::playMovie(const char *filename) { _vm->_system->updateScreen(); } } - + Common::Event event; while (_vm->_system->getEventManager()->pollEvent(event)) { if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP) diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index adea59ca9a..e886f0df82 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -836,7 +836,7 @@ void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *loca count = colDiff; col += colDiff; } - + colDiff = _tileClip.right - col; if (colDiff > 0) { int countDiff = fgRunCount - count; diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 21f3cc489e..49d3f91d77 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -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() { diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp index 1fefad93ab..021a4c9bac 100644 --- a/engines/saga/palanim.cpp +++ b/engines/saga/palanim.cpp @@ -53,7 +53,7 @@ void PalAnim::loadPalAnim(const ByteArray &resourceData) { debug(3, "PalAnim::loadPalAnim(): Loading %d PALANIM entries.", _entries.size()); for (Common::Array<PalanimEntry>::iterator i = _entries.begin(); i != _entries.end(); ++i) { - + i->cycle = 0; i->colors.resize(readS.readUint16()); @@ -139,7 +139,7 @@ void PalAnim::cycleStep(int vectortime) { void PalAnim::clear() { debug(3, "PalAnim::clear()"); - + _entries.clear(); } 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 15bd2aff72..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; @@ -451,7 +450,7 @@ void SagaEngine::loadStrings(StringsTable &stringsTable, const ByteArray &string error("SagaEngine::loadStrings() Wrong offset"); } stringsTable.strings[ui] = &stringsTable.buffer[offset]; - + debug(9, "string[%i]=%s", ui, stringsTable.strings[ui]); } } diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 23258e1277..336883680a 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -137,16 +137,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 +528,9 @@ public: int _readingSpeed; bool _copyProtection; - bool _gf_wyrmkeep; bool _musicWasPlaying; bool _isIHNMDemo; + bool _hasITESceneSubstitutes; SndRes *_sndRes; Sound *_sound; 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/scene.h b/engines/saga/scene.h index adac3b622a..6e2cb12380 100644 --- a/engines/saga/scene.h +++ b/engines/saga/scene.h @@ -126,7 +126,7 @@ struct SceneDescription { uint16 sceneScriptEntrypointNumber; uint16 startScriptEntrypointNumber; int16 musicResourceId; - + void reset() { flags = resourceListResourceId = endSlope = beginSlope = scriptModuleNumber = sceneScriptEntrypointNumber = startScriptEntrypointNumber = musicResourceId = 0; } 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/sprite.cpp b/engines/saga/sprite.cpp index 81893c7480..2895c6800c 100644 --- a/engines/saga/sprite.cpp +++ b/engines/saga/sprite.cpp @@ -207,7 +207,7 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b const byte *srcPointer; int backBufferPitch = _vm->_gfx->getBackBufferPitch(); - + //find Rects intersection yDiff = clipRect.top - spritePointer.y; if (yDiff > 0) { @@ -247,10 +247,10 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b } bufRowPointer = _vm->_gfx->getBackBufferPixels() + backBufferPitch * yDstOffset + xDstOffset; srcRowPointer = spriteBuffer + width * ySrcOffset + xSrcOffset; - + // validate src, dst buffers assert(_vm->_gfx->getBackBufferPixels() <= bufRowPointer); - assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >= + assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >= (byte *)(bufRowPointer + backBufferPitch * (cHeight - 1) + cWidth)); assert((const byte *)spriteBuffer <= srcRowPointer); assert(((const byte *)spriteBuffer + (width * height)) >= (const byte *)(srcRowPointer + width * (cHeight - 1) + cWidth)); @@ -469,7 +469,7 @@ void Sprite::scaleBuffer(const byte *src, int width, int height, int scale, size _decodeBuf.resize(outLength); byte *dst = &_decodeBuf.front(); - + memset(dst, 0, _decodeBuf.size()); for (int i = 0; i < height; i++) { |