diff options
author | Eugene Sandulenko | 2005-01-02 20:29:27 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-01-02 20:29:27 +0000 |
commit | 63be4b64350f72463965c2716e1e0cc43ade2f98 (patch) | |
tree | c3050c46246a59cb3786d471a917a1475fa52e80 | |
parent | 6738870568a08788acd26a5a02ee64d07600095b (diff) | |
download | scummvm-rg350-63be4b64350f72463965c2716e1e0cc43ade2f98.tar.gz scummvm-rg350-63be4b64350f72463965c2716e1e0cc43ade2f98.tar.bz2 scummvm-rg350-63be4b64350f72463965c2716e1e0cc43ade2f98.zip |
o Started putting all panels stuff in order. Still incomplete
o Proper detection for Mac Wyrmkeep CD
o Support for wyrmkeep logos
svn-id: r16415
-rw-r--r-- | saga/actor.cpp | 41 | ||||
-rw-r--r-- | saga/game.cpp | 185 | ||||
-rw-r--r-- | saga/input.cpp | 2 | ||||
-rw-r--r-- | saga/interface.cpp | 10 | ||||
-rw-r--r-- | saga/interface.h | 18 | ||||
-rw-r--r-- | saga/ite_introproc.cpp | 34 | ||||
-rw-r--r-- | saga/rscfile.cpp | 60 | ||||
-rw-r--r-- | saga/saga.cpp | 3 | ||||
-rw-r--r-- | saga/saga.h | 3 | ||||
-rw-r--r-- | saga/script.h | 2 | ||||
-rw-r--r-- | saga/sfuncs.cpp | 18 |
11 files changed, 232 insertions, 144 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index 6caa325189..42eaf5ca2a 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -446,8 +446,11 @@ void Actor::handleActions(int msec, bool setup) { //todo: dragon stuff + if (actor->index == 2) + debug(9, "Action: %d Flags: %x", actor->currentAction, actor->flags); + switch(actor->currentAction) { - case kActionWait: { + case kActionWait: if (!setup && (actor->flags & kFollower)) { followProtagonist(actor); if (actor->currentAction != kActionWait) @@ -484,9 +487,10 @@ void Actor::handleActions(int msec, bool setup) { } } actor->actionCycle++; - } break; + break; + case kActionWalkToPoint: - case kActionWalkToLink: { + case kActionWalkToLink: // tiled stuff if (_vm->_scene->getMode() == SCENE_MODE_ISO) { //todo: it @@ -568,12 +572,14 @@ void Actor::handleActions(int msec, bool setup) { } actor->frameNumber = frameRange->frameIndex + actor->actionCycle; - } break; - case kActionWalkDir: { + break; + + case kActionWalkDir: debug(9,"kActionWalkDir not implemented"); //todo: do it - } break; - case kActionSpeak: { + break; + + case kActionSpeak: actor->actionCycle++; actor->cycleWrap(64); @@ -594,14 +600,14 @@ void Actor::handleActions(int msec, bool setup) { } actor->frameNumber = frameRange->frameIndex + state; - } break; + break; case kActionAccept: case kActionStoop: break; case kActionCycleFrames: - case kActionPongFrames: { + case kActionPongFrames: if (actor->cycleTimeCount > 0) { actor->cycleTimeCount--; break; @@ -647,17 +653,19 @@ void Actor::handleActions(int msec, bool setup) { } else { actor->frameNumber = frameRange->frameIndex + state; } - } break; - case kActionFall: { + break; + + case kActionFall: debug(9,"kActionFall not implemented"); //todo: do it - } break; - case kActionClimb: { + break; + + case kActionClimb: debug(9,"kActionClimb not implemented"); //todo: do it - } break; + break; } } @@ -705,6 +713,9 @@ void Actor::calcActorScreenPosition(ActorData *actor) { actor->screenPosition.x = (actor->location.x / ACTOR_LMULT); actor->screenPosition.y = (actor->location.y / ACTOR_LMULT) - actor->location.z; } + + if (actor->index == 2) + debug(9, "act: %d. x: %d y: %d", actor->index, actor->screenPosition.x, actor->screenPosition.y); } void Actor::createDrawOrderList() { @@ -946,7 +957,7 @@ bool Actor::actorWalkTo(uint16 actorId, const ActorLocation &toLocation) { bool extraEndNode; actor = getActor(actorId); - + if (actor == _protagonist) { _vm->_scene->setDoorState(2, 0xff); _vm->_scene->setDoorState(3, 0); diff --git a/saga/game.cpp b/saga/game.cpp index b0ad3b2536..dbd92796b9 100644 --- a/saga/game.cpp +++ b/saga/game.cpp @@ -199,93 +199,94 @@ struct GAME_MD5 { GAME_IDS id; const char *md5; const char *filename; + bool caseSensitive; }; #define FILE_MD5_BYTES 5000 static GAME_MD5 game_md5[] = { - { GID_ITE_DISK_G, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" }, - { GID_ITE_DISK_G, "516f7330f8410057b834424ea719d1ef", "scripts.rsc" }, - { GID_ITE_DISK_G, "c46e4392fcd2e89bc91e5567db33b62d", "voices.rsc" }, - - { GID_ITE_CD_G, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" }, - { GID_ITE_CD_G, "50a0d2d7003c926a3832d503c8534e90", "scripts.rsc" }, - { GID_ITE_CD_G, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" }, - { GID_ITE_CD_G, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" }, - - { GID_ITE_CD, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" }, - { GID_ITE_CD, "a891405405edefc69c9d6c420c868b84", "scripts.rsc" }, - { GID_ITE_CD, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" }, - { GID_ITE_CD, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" }, - - { GID_ITE_DEMO_G, "986c79c4d2939dbe555576529fd37932", "ite.rsc" }, - { GID_ITE_DEMO_G, "d5697dd3240a3ceaddaa986c47e1a2d7", "scripts.rsc" }, - { GID_ITE_DEMO_G, "c58e67c506af4ffa03fd0aac2079deb0", "voices.rsc" }, - { GID_ITE_DEMO_G, "0b9a70eb4e120b6f00579b46c8cae29e", "ite.dmo" }, - - { GID_ITE_MACCD, "4f7fa11c5175980ed593392838523060", "ite.rsc" }, - { GID_ITE_MACCD, "adf1f46c1d0589083996a7060c798ad0", "scripts.rsc" }, - { GID_ITE_MACCD, "1a91cd60169f367ecb6c6e058d899b2f", "music.rsc" }, - { GID_ITE_MACCD, "95863b89a0916941f6c5e1789843ba14", "sounds.rsc" }, - { GID_ITE_MACCD, "c14c4c995e7a0d3828e3812a494301b7", "Inherit the Earth Voices" }, - - { GID_ITE_LINCD, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" }, - { GID_ITE_LINCD, "a891405405edefc69c9d6c420c868b84", "scripts.rsc" }, - { GID_ITE_LINCD, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" }, - { GID_ITE_LINCD, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" }, - { GID_ITE_LINCD, "d6454756517f042f01210458abe8edd4", "music.rsc" }, - - { GID_ITE_DISK_DE, "869fc23c8f38f575979ec67152914fee", "ite.rsc" }, - { GID_ITE_DISK_DE, "516f7330f8410057b834424ea719d1ef", "scripts.rsc" }, - { GID_ITE_DISK_DE, "0c9113e630f97ef0996b8c3114badb08", "voices.rsc" }, - - { GID_ITE_WINDEMO2, "3a450852cbf3c80773984d565647e6ac", "ited.rsc" }, - { GID_ITE_WINDEMO2, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" }, - { GID_ITE_WINDEMO2, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc" }, - { GID_ITE_WINDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" }, - - { GID_ITE_LINDEMO, "3a450852cbf3c80773984d565647e6ac", "ited.rsc" }, - { GID_ITE_LINDEMO, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" }, - { GID_ITE_LINDEMO, "d6454756517f042f01210458abe8edd4", "musicd.rsc" }, - { GID_ITE_LINDEMO, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc" }, - { GID_ITE_LINDEMO, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" }, - - { GID_ITE_MACDEMO2, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc" }, - { GID_ITE_MACDEMO2, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc" }, - { GID_ITE_MACDEMO2, "495bdde51fd9f4bea2b9c911091b1ab2", "musicd.rsc" }, - { GID_ITE_MACDEMO2, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc" }, - { GID_ITE_MACDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" }, - - { GID_ITE_WINDEMO1, "3a450852cbf3c80773984d565647e6ac", "ited.rsc" }, - { GID_ITE_WINDEMO1, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" }, - { GID_ITE_WINDEMO1, "a741139dd7365a13f463cd896ff9969a", "soundsd.rsc" }, - { GID_ITE_WINDEMO1, "0759eaf5b64ae19fd429920a70151ad3", "voicesd.rsc" }, - - { GID_ITE_MACDEMO1, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc" }, - { GID_ITE_MACDEMO1, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc" }, - { GID_ITE_MACDEMO1, "1a91cd60169f367ecb6c6e058d899b2f", "musicd.rsc" }, - { GID_ITE_MACDEMO1, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc" }, - { GID_ITE_MACDEMO1, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" }, + { GID_ITE_DISK_G, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false }, + { GID_ITE_DISK_G, "516f7330f8410057b834424ea719d1ef", "scripts.rsc", false }, + { GID_ITE_DISK_G, "c46e4392fcd2e89bc91e5567db33b62d", "voices.rsc", false }, + + { GID_ITE_CD_G, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false }, + { GID_ITE_CD_G, "50a0d2d7003c926a3832d503c8534e90", "scripts.rsc", false }, + { GID_ITE_CD_G, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false }, + { GID_ITE_CD_G, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false }, + + { GID_ITE_CD, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false }, + { GID_ITE_CD, "a891405405edefc69c9d6c420c868b84", "scripts.rsc", false }, + { GID_ITE_CD, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false }, + { GID_ITE_CD, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false }, + + { GID_ITE_DEMO_G, "986c79c4d2939dbe555576529fd37932", "ite.rsc", false }, + { GID_ITE_DEMO_G, "d5697dd3240a3ceaddaa986c47e1a2d7", "scripts.rsc", false }, + { GID_ITE_DEMO_G, "c58e67c506af4ffa03fd0aac2079deb0", "voices.rsc", false }, + { GID_ITE_DEMO_G, "0b9a70eb4e120b6f00579b46c8cae29e", "ite.dmo", false }, + + { GID_ITE_MACCD, "4f7fa11c5175980ed593392838523060", "ite.rsc", false }, + { GID_ITE_MACCD, "adf1f46c1d0589083996a7060c798ad0", "scripts.rsc", false }, + { GID_ITE_MACCD, "1a91cd60169f367ecb6c6e058d899b2f", "music.rsc", false }, + { GID_ITE_MACCD, "95863b89a0916941f6c5e1789843ba14", "sounds.rsc", false }, + { GID_ITE_MACCD, "c14c4c995e7a0d3828e3812a494301b7", "Inherit the Earth Voices", true }, + + { GID_ITE_LINCD, "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false }, + { GID_ITE_LINCD, "a891405405edefc69c9d6c420c868b84", "scripts.rsc", false }, + { GID_ITE_LINCD, "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false }, + { GID_ITE_LINCD, "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false }, + { GID_ITE_LINCD, "d6454756517f042f01210458abe8edd4", "music.rsc", false }, + + { GID_ITE_DISK_DE, "869fc23c8f38f575979ec67152914fee", "ite.rsc", false }, + { GID_ITE_DISK_DE, "516f7330f8410057b834424ea719d1ef", "scripts.rsc", false }, + { GID_ITE_DISK_DE, "0c9113e630f97ef0996b8c3114badb08", "voices.rsc", false }, + + { GID_ITE_WINDEMO2, "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false }, + { GID_ITE_WINDEMO2, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false }, + { GID_ITE_WINDEMO2, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc", false }, + { GID_ITE_WINDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false }, + + { GID_ITE_LINDEMO, "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false }, + { GID_ITE_LINDEMO, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false }, + { GID_ITE_LINDEMO, "d6454756517f042f01210458abe8edd4", "musicd.rsc", false }, + { GID_ITE_LINDEMO, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc", false }, + { GID_ITE_LINDEMO, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false }, + + { GID_ITE_MACDEMO2, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc", false }, + { GID_ITE_MACDEMO2, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc", false }, + { GID_ITE_MACDEMO2, "495bdde51fd9f4bea2b9c911091b1ab2", "musicd.rsc", false }, + { GID_ITE_MACDEMO2, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc", false }, + { GID_ITE_MACDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false }, + + { GID_ITE_WINDEMO1, "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false }, + { GID_ITE_WINDEMO1, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false }, + { GID_ITE_WINDEMO1, "a741139dd7365a13f463cd896ff9969a", "soundsd.rsc", false }, + { GID_ITE_WINDEMO1, "0759eaf5b64ae19fd429920a70151ad3", "voicesd.rsc", false }, + + { GID_ITE_MACDEMO1, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc", false }, + { GID_ITE_MACDEMO1, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc", false }, + { GID_ITE_MACDEMO1, "1a91cd60169f367ecb6c6e058d899b2f", "musicd.rsc", false }, + { GID_ITE_MACDEMO1, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc", false }, + { GID_ITE_MACDEMO1, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false }, // My CD also has a file called 'patch.re_'. I assume it contains // bugfixes, but let's ignore it for now. - { GID_IHNM_CD, "0439083e3dfdc51b486071d45872ae52", "musicfm.res" }, - { GID_IHNM_CD, "80f875a1fb384160d1f4b27166eef583", "musicgm.res" }, - { GID_IHNM_CD, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res" }, - { GID_IHNM_CD, "be38bbc5a26be809dbf39f13befebd01", "scripts.res" }, - { GID_IHNM_CD, "1c610d543f32ec8b525e3f652536f269", "sfx.res" }, - { GID_IHNM_CD, "fc6440b38025f4b2cc3ff55c3da5c3eb", "voices1.res" }, - { GID_IHNM_CD, "b37f10fd1696ade7d58704ccaaebceeb", "voices2.res" }, - { GID_IHNM_CD, "3bbc16a8f741dbb511da506c660a0b54", "voices3.res" }, - { GID_IHNM_CD, "ebfa160122d2247a676ca39920e5d481", "voices4.res" }, - { GID_IHNM_CD, "1f501ce4b72392bdd1d9ec38f6eec6da", "voices5.res" }, - { GID_IHNM_CD, "f580ed7568c7d6ef34e934ba20adf834", "voices6.res" }, - { GID_IHNM_CD, "54b1f2013a075338ceb0e258d97808bd", "voicess.res" }, - - { GID_IHNM_DEMO, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res" }, - { GID_IHNM_DEMO, "9626bda8978094ff9b29198bc1ed5f9a", "scripts.res" }, - { GID_IHNM_DEMO, "1c610d543f32ec8b525e3f652536f269", "sfx.res" }, - { GID_IHNM_DEMO, "3bbc16a8f741dbb511da506c660a0b54", "voicesd.res" }, + { GID_IHNM_CD, "0439083e3dfdc51b486071d45872ae52", "musicfm.res", false }, + { GID_IHNM_CD, "80f875a1fb384160d1f4b27166eef583", "musicgm.res", false }, + { GID_IHNM_CD, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res", false }, + { GID_IHNM_CD, "be38bbc5a26be809dbf39f13befebd01", "scripts.res", false }, + { GID_IHNM_CD, "1c610d543f32ec8b525e3f652536f269", "sfx.res", false }, + { GID_IHNM_CD, "fc6440b38025f4b2cc3ff55c3da5c3eb", "voices1.res", false }, + { GID_IHNM_CD, "b37f10fd1696ade7d58704ccaaebceeb", "voices2.res", false }, + { GID_IHNM_CD, "3bbc16a8f741dbb511da506c660a0b54", "voices3.res", false }, + { GID_IHNM_CD, "ebfa160122d2247a676ca39920e5d481", "voices4.res", false }, + { GID_IHNM_CD, "1f501ce4b72392bdd1d9ec38f6eec6da", "voices5.res", false }, + { GID_IHNM_CD, "f580ed7568c7d6ef34e934ba20adf834", "voices6.res", false }, + { GID_IHNM_CD, "54b1f2013a075338ceb0e258d97808bd", "voicess.res", false }, + + { GID_IHNM_DEMO, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res", false }, + { GID_IHNM_DEMO, "9626bda8978094ff9b29198bc1ed5f9a", "scripts.res", false }, + { GID_IHNM_DEMO, "1c610d543f32ec8b525e3f652536f269", "sfx.res", false }, + { GID_IHNM_DEMO, "3bbc16a8f741dbb511da506c660a0b54", "voicesd.res", false }, }; static GAMEDESC GameDescs[] = { @@ -358,7 +359,7 @@ static GAMEDESC GameDescs[] = { ARRAYSIZE(ITEMACDEMO_GameFonts), ITEMACDEMO_GameFonts, &ITECD_GameSound, - GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES + GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_WYRMKEEP }, // Inherit the earth - Linux Demo version @@ -377,7 +378,7 @@ static GAMEDESC GameDescs[] = { ARRAYSIZE(ITECD_GameFonts), ITECD_GameFonts, &ITECD_GameSound, - GF_VOX_VOICES + GF_VOX_VOICES | GF_WYRMKEEP }, // Inherit the earth - Linux Demo version @@ -395,7 +396,7 @@ static GAMEDESC GameDescs[] = { ARRAYSIZE(ITECD_GameFonts), ITECD_GameFonts, &ITECD_GameSound, - GF_VOX_VOICES + GF_VOX_VOICES | GF_WYRMKEEP }, // Inherit the earth - Win32 Demo version @@ -413,7 +414,7 @@ static GAMEDESC GameDescs[] = { ARRAYSIZE(ITEWINDEMO_GameFonts), ITEWINDEMO_GameFonts, &ITECD_GameSound, - GF_VOX_VOICES + GF_VOX_VOICES | GF_WYRMKEEP }, // Inherit the earth - Wyrmkeep Linux CD version @@ -432,7 +433,7 @@ static GAMEDESC GameDescs[] = { ARRAYSIZE(ITECD_GameFonts), ITECD_GameFonts, &ITECD_GameSound, - 0 + GF_WYRMKEEP }, // Inherit the earth - DOS CD version @@ -639,7 +640,7 @@ int detectGame(const FSList &fslist, bool mode) { File test_file; bool file_missing; - Common::String tstr; + Common::String tstr, tstr1; char md5str[32+1]; uint8 md5sum[16]; @@ -647,7 +648,11 @@ int detectGame(const FSList &fslist, bool mode) { for (int i = 0; i < ARRAYSIZE(game_md5); i++) { tstr = Common::String(game_md5[i].filename); tstr.toLowercase(); - filesList[tstr] = true; + + if (game_md5[i].caseSensitive && !mode) + filesList[Common::String(game_md5[i].filename)] = true; + else + filesList[tstr] = true; } if (mode) { @@ -655,14 +660,18 @@ int detectGame(const FSList &fslist, bool mode) { for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (!file->isDirectory()) { tstr = file->displayName(); + // FIXME: there is a bug in String class. tstr1 = tstr; tstr.toLowercase() + // makes tstr1 lowercase as well + tstr1 = Common::String(file->displayName().c_str()); tstr.toLowercase(); - if (filesList.contains(tstr)) { + if (filesList.contains(tstr) || filesList.contains(tstr1)) { if (md5_file(file->path().c_str(), md5sum, NULL, FILE_MD5_BYTES)) { for (int j = 0; j < 16; j++) { sprintf(md5str + j*2, "%02x", (int)md5sum[j]); } filesMD5[tstr] = Common::String(md5str); + filesMD5[tstr1] = Common::String(md5str); } } } @@ -690,7 +699,6 @@ int detectGame(const FSList &fslist, bool mode) { // Try to open all files for this game for (file_n = 0; file_n < file_count; file_n++) { tstr = GameDescs[game_n].gd_filedescs[file_n].gf_fname; - tstr.toLowercase(); if (!filesMD5.contains(tstr)) { file_missing = true; @@ -710,7 +718,6 @@ int detectGame(const FSList &fslist, bool mode) { for (int i = 0; i < ARRAYSIZE(game_md5); i++) { if (game_md5[i].id == GameDescs[game_n].gd_game_id) { tstr = game_md5[i].filename; - tstr.toLowercase(); if (strcmp(game_md5[i].md5, filesMD5[tstr].c_str())) { match = false; diff --git a/saga/input.cpp b/saga/input.cpp index 0fed2b8435..1747aa7964 100644 --- a/saga/input.cpp +++ b/saga/input.cpp @@ -81,7 +81,7 @@ int SagaEngine::processInput() { break; case 27: // Esc // Skip to next scene skip target - if (!_interface->getMode() == kPanelNone) // FIXME: hack + if (!_interface->getMode() == kPanelNull) // FIXME: hack _actor->abortAllSpeeches(); else _scene->skipScene(); diff --git a/saga/interface.cpp b/saga/interface.cpp index 3e6efc11e6..77fa34b6fe 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -238,7 +238,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm), _initialized(false) { _activeVerb = I_VERB_WALKTO; _active = 0; - _panelMode = kPanelNone; + _panelMode = _savedMode = kPanelNull; *_statusText = 0; _inventoryCount = 0; @@ -331,7 +331,7 @@ int Interface::draw() { drawStatusBar(back_buf); // Draw command panel background - if (_panelMode == kPanelCommand) { + if (_panelMode == kPanelMain) { xbase = _cPanel.x; ybase = _cPanel.y; @@ -357,7 +357,7 @@ int Interface::draw() { _vm->_sprite->draw(back_buf, _defPortraits, _leftPortrait, lportrait, 256); - if (_panelMode == kPanelDialogue && _iDesc.rportrait_x >= 0) { + if (_panelMode == kPanelConverse && _iDesc.rportrait_x >= 0) { rportrait.x = xbase + _iDesc.rportrait_x; rportrait.y = ybase + _iDesc.rportrait_y; @@ -388,7 +388,7 @@ int Interface::update(const Point& imousePt, int update_flag) { // Get game display info _vm->getDisplayInfo(&g_di); - if (_panelMode == kPanelCommand) { + if (_panelMode == kPanelMain) { // Update playfield space ( only if cursor is inside ) if (imouse_y < g_di.scene_h) { // Mouse is in playfield space @@ -691,7 +691,7 @@ void Interface::removeFromInventory(int sprite) { } void Interface::drawInventory() { - if (_panelMode != kPanelCommand) + if (_panelMode != kPanelMain) return; SURFACE *back_buf = _vm->_gfx->getBackBuffer(); diff --git a/saga/interface.h b/saga/interface.h index 846bacce98..82f15068d9 100644 --- a/saga/interface.h +++ b/saga/interface.h @@ -102,9 +102,17 @@ enum INTERFACE_UPDATE_FLAGS { #define IHNM_INVENTORY_YSPACING 0 enum PANEL_MODES { - kPanelNone, - kPanelCommand, - kPanelDialogue + kPanelNull, + kPanelMain, + kPanelOption, + kPanelTextBox, + kPanelQuit, + kPanelError, + kPanelLoad, + kPanelConverse, + kPanelProtect, + kPanelPlacard, + kPanelMap }; enum BUTTON_FLAGS { @@ -201,6 +209,8 @@ public: int deactivate(); int setMode(int mode); int getMode(void) { return _panelMode; } + void rememberMode() { _savedMode = _panelMode; } + void restoreMode() { _panelMode = _savedMode; } int setStatusText(const char *new_txt); int loadScenePortraits(int res); int setLeftPortrait(int portrait); @@ -212,6 +222,7 @@ public: void removeFromInventory(int sprite); void drawInventory(); int inventoryTest(const Point& imousePt, int *ibutton); + private: int hitTest(const Point& imousePt, int *ibutton); int drawStatusBar(SURFACE *ds); @@ -228,6 +239,7 @@ private: RSCFILE_CONTEXT *_interfaceContext; INTERFACE_DESC _iDesc; int _panelMode; + int _savedMode; INTERFACE_PANEL _cPanel; INTERFACE_PANEL _dPanel; char _statusText[STATUS_TEXT_LEN]; diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp index 1580d4b9d1..028ed2a7dd 100644 --- a/saga/ite_introproc.cpp +++ b/saga/ite_introproc.cpp @@ -195,21 +195,29 @@ int Scene::ITEIntroAnimProc(int param, SCENE_INFO *scene_info) { // Link this scene's animation resources for continuous // playback - _vm->_anim->link(0, 1); - _vm->_anim->link(1, 2); - _vm->_anim->link(2, 3); - _vm->_anim->link(3, 4); - - if (_vm->_features & GF_MAC_RESOURCES) - _vm->_anim->setFlag(4, ANIM_ENDSCENE); - else { - _vm->_anim->link(4, 5); - _vm->_anim->link(5, 6); - - // Scene should end on display of last animation frame - _vm->_anim->setFlag(6, ANIM_ENDSCENE); + int lastAnim; + + if (_vm->_features & GF_WYRMKEEP) { + if (_vm->_features & GF_MAC_RESOURCES) { + lastAnim = 3; + } else { + lastAnim = 2; + } + } else { + if (_vm->_features & GF_MAC_RESOURCES) { + lastAnim = 4; + } else { + lastAnim = 5; + } } + for (int i = 0; i < lastAnim; i++) + _vm->_anim->link(i, i+1); + + _vm->_anim->setFlag(lastAnim, ANIM_ENDSCENE); + + debug(0, "Beginning animation playback."); + // Begin the animation event.type = ONESHOT_EVENT; event.code = ANIM_EVENT; diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp index 2b6c430569..e39ad522f5 100644 --- a/saga/rscfile.cpp +++ b/saga/rscfile.cpp @@ -30,6 +30,20 @@ namespace Saga { +static struct Substitutes { + uint32 id; + const char *fname; +} substitutes[] = { + { 1529, "wyrm.pak" }, + { 1530, "wyrm1.dlt" }, + { 1531, "wyrm2.dlt" }, + { 1532, "wyrm3.dlt" }, + { 1533, "wyrm4.dlt" }, + { 1796, "credit3n.dlt" }, + { 1797, "credit4n.dlt" } +}; + + RSCFILE_CONTEXT *RSC_CreateContext() { RSCFILE_CONTEXT empty_context; empty_context.rc_file_fspec = NULL; @@ -220,8 +234,9 @@ const char *RSC_FileName(RSCFILE_CONTEXT *rsc) { int RSC_LoadResource(RSCFILE_CONTEXT *rsc, uint32 res_num, byte **res_p, size_t *res_size_p) { uint32 res_offset; - size_t res_size; - byte *res_buf; + size_t res_size = 0; + byte *res_buf = NULL; + int substnum = -1; if ((rsc == NULL) || (res_p == NULL)) { return FAILURE; @@ -231,19 +246,42 @@ int RSC_LoadResource(RSCFILE_CONTEXT *rsc, uint32 res_num, byte **res_p, size_t return FAILURE; } - res_offset = rsc->rc_res_table[res_num].res_offset; - res_size = rsc->rc_res_table[res_num].res_size; + debug(8, "LoadResource %d", res_num); + for (int i = 0; i < ARRAYSIZE(substitutes); i++) + if (substitutes[i].id == res_num) { + substnum = i; + break; + } + + if (substnum != -1) { + File in; - rsc->rc_file->seek((long)res_offset, SEEK_SET); + if (in.open(substitutes[substnum].fname)) { + res_size = in.size(); + if ((res_buf = (byte *)malloc(res_size)) == NULL) + return MEM; - res_buf = (byte *)malloc(res_size); - if (res_buf == NULL) { - return MEM; + in.read(res_buf, res_size); + in.close(); + debug(8, "LoadResource: substituted resource by %s", substitutes[substnum].fname); + } else { + substnum = -1; + } } - if (rsc->rc_file->read(res_buf, res_size) != res_size) { - free(res_buf); - return FAILURE; + if (substnum == -1) { + res_offset = rsc->rc_res_table[res_num].res_offset; + res_size = rsc->rc_res_table[res_num].res_size; + + if ((res_buf = (byte *)malloc(res_size)) == NULL) + return MEM; + + rsc->rc_file->seek((long)res_offset, SEEK_SET); + + if (rsc->rc_file->read(res_buf, res_size) != res_size) { + free(res_buf); + return FAILURE; + } } *res_p = res_buf; diff --git a/saga/saga.cpp b/saga/saga.cpp index 47136697b4..7f6380a2a0 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -102,6 +102,9 @@ SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst) File::addDefaultDirectory(_gameDataPath + "music/"); File::addDefaultDirectory(_gameDataPath + "sound/"); + // Mac CD Wyrmkeep + File::addDefaultDirectory(_gameDataPath + "patch/"); + // Setup mixer if (!_mixer->isReady()) { warning("Sound initialization failed."); diff --git a/saga/saga.h b/saga/saga.h index a80372076c..942dd06c85 100644 --- a/saga/saga.h +++ b/saga/saga.h @@ -180,7 +180,8 @@ enum GAME_FEATURES { GF_VOX_VOICES = 1, GF_BIG_ENDIAN_DATA = 2, GF_MAC_RESOURCES = 4, - GF_LANG_DE = 8 + GF_LANG_DE = 8, + GF_WYRMKEEP = 16 }; struct GAME_DISPLAYINFO { diff --git a/saga/script.h b/saga/script.h index fb4e7c8aaa..c49b7d1219 100644 --- a/saga/script.h +++ b/saga/script.h @@ -309,7 +309,7 @@ private: int sfWait(SCRIPTFUNC_PARAMS); int SF_takeObject(SCRIPTFUNC_PARAMS); int SF_objectIsCarried(SCRIPTFUNC_PARAMS); - int SF_setStatusText(SCRIPTFUNC_PARAMS); + int sfStatusBar(SCRIPTFUNC_PARAMS); int SF_commandMode(SCRIPTFUNC_PARAMS); int sfScriptWalkTo(SCRIPTFUNC_PARAMS); int SF_doAction(SCRIPTFUNC_PARAMS); diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index e0612395c6..d3c57bc8b3 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -51,7 +51,7 @@ void Script::setupScriptFuncList(void) { OPCODE(sfWait), OPCODE(SF_takeObject), OPCODE(SF_objectIsCarried), - OPCODE(SF_setStatusText), + OPCODE(sfStatusBar), OPCODE(SF_commandMode), OPCODE(sfScriptWalkTo), OPCODE(SF_doAction), @@ -185,7 +185,7 @@ int Script::SF_objectIsCarried(SCRIPTFUNC_PARAMS) { // Script function #4 (0x04) nonblocking // Set the command display to the specified text string // Param1: dialogue index of string -int Script::SF_setStatusText(SCRIPTFUNC_PARAMS) { +int Script::sfStatusBar(SCRIPTFUNC_PARAMS) { ScriptDataWord param = thread->pop(); return _vm->_interface->setStatusText(getString(param)); @@ -193,7 +193,7 @@ int Script::SF_setStatusText(SCRIPTFUNC_PARAMS) { // Script function #5 (0x05) int Script::SF_commandMode(SCRIPTFUNC_PARAMS) { - return _vm->_interface->setMode(kPanelCommand); + return _vm->_interface->setMode(kPanelMain); } // Script function #6 (0x06) blocking @@ -295,7 +295,7 @@ int Script::SF_freezeInterface(SCRIPTFUNC_PARAMS) { // Script function #12 (0x0C) // Disables mouse input, etc. int Script::SF_dialogMode(SCRIPTFUNC_PARAMS) { - return _vm->_interface->setMode(kPanelDialogue); + return _vm->_interface->setMode(kPanelConverse); } // Script function #13 (0x0D) @@ -848,7 +848,10 @@ int Script::sfPlaceActor(SCRIPTFUNC_PARAMS) { actorDirection = getSWord(thread->pop()); frameType = getSWord(thread->pop()); frameOffset = getSWord(thread->pop()); - + + debug(1, "sfPlaceActor(%d, %d, %d, %d, %d, %d)", actorId, actorLocation.x, + actorLocation.y, actorDirection, frameType, frameOffset); + actor = _vm->_actor->getActor(actorId); actor->location.x = actorLocation.x; actor->location.y = actorLocation.y; @@ -950,6 +953,9 @@ int Script::sfPlacard(SCRIPTFUNC_PARAMS) { _vm->_scene->getBGPal(&pal); _vm->_gfx->blackToPalWait(back_buf, pal, kNormalFadeDuration); + _vm->_interface->rememberMode(); + _vm->_interface->setMode(kPanelPlacard); + return SUCCESS; } @@ -973,6 +979,8 @@ int Script::sfPlacardOff(SCRIPTFUNC_PARAMS) { _vm->_gfx->showCursor(true); _vm->_gfx->blackToPalWait(back_buf, pal, kNormalFadeDuration); + _vm->_interface->restoreMode(); + return SUCCESS; } |