diff options
author | Travis Howell | 2006-10-19 05:21:07 +0000 |
---|---|---|
committer | Travis Howell | 2006-10-19 05:21:07 +0000 |
commit | 6e872547c30d8de61c6e1353ec9f74c693b75b29 (patch) | |
tree | 3e35ce954622d9a86f5d7b3e26e756e781fd394a /engines | |
parent | a0b9f78bd374c1844472c4b8de1b721c2745bc44 (diff) | |
download | scummvm-rg350-6e872547c30d8de61c6e1353ec9f74c693b75b29.tar.gz scummvm-rg350-6e872547c30d8de61c6e1353ec9f74c693b75b29.tar.bz2 scummvm-rg350-6e872547c30d8de61c6e1353ec9f74c693b75b29.zip |
Add support for arrows keys in WW
svn-id: r24385
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agos/agos.cpp | 49 | ||||
-rw-r--r-- | engines/agos/agos.h | 2 | ||||
-rw-r--r-- | engines/agos/script.cpp | 8 |
3 files changed, 44 insertions, 15 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 532e2cb699..9ba0de5caf 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -34,6 +34,7 @@ #include "agos/vga.h" #include "sound/mididrv.h" +#include "sound/mod.h" #ifdef PALMOS_68K #include "globals.h" @@ -1352,13 +1353,9 @@ startOver: for (;;) { if (getGameType() != GType_FF && getGameType() != GType_PP && _keyPressed == 35) displayBoxStars(); - if (getGameType() == GType_PP) { - if (processSpecialKeys() != 0) { - _needHitAreaRecalc++; - return; - } - } else { - processSpecialKeys(); + if (processSpecialKeys() != 0) { + _needHitAreaRecalc++; + return; } if (_lastHitArea3 == (HitArea *) -1) goto startOver; @@ -2075,18 +2072,26 @@ bool AGOSEngine::processSpecialKeys() { case 17: // Up if (getGameType() == GType_PP) _verbHitArea = 302; + else if (getGameType() == GType_WW) + _verbHitArea = 239; break; case 18: // Down if (getGameType() == GType_PP) _verbHitArea = 304; + else if (getGameType() == GType_WW) + _verbHitArea = 241; break; case 19: // Right if (getGameType() == GType_PP) _verbHitArea = 303; + else if (getGameType() == GType_WW) + _verbHitArea = 240; break; case 20: // Left if (getGameType() == GType_PP) _verbHitArea = 301; + else if (getGameType() == GType_WW) + _verbHitArea = 242; break; case 27: // escape _exitCutscene = true; @@ -2430,18 +2435,40 @@ void AGOSEngine::loadMusic(uint music) { if (getPlatform() == Common::kPlatformAtariST) { // TODO: Add support for music format used by Elvira 2 } else if (getPlatform() == Common::kPlatformAmiga) { - // TODO: Add Protracker mod support for Amiga versions + Audio::AudioStream *modStream; char filename[15]; + File f; if (getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) sprintf(filename, "elvira2"); else sprintf(filename, "%dtune", music); - if (getFeatures() & GF_CRUNCHED) { - debug(5,"loadMusic - Decrunch %s attempt", filename); + f.open(filename); + if (f.isOpen() == false) { + error("loadMusic: Can't load music from '%s'", filename); } - debug(5,"playMusic - Play %s attempt", filename); + + if (!(getGameType() == GType_ELVIRA1 && getFeatures() & GF_DEMO) && + getFeatures() & GF_CRUNCHED) { + uint srcSize = f.size(); + byte *srcBuf = (byte *)malloc(srcSize); + if (f.read(srcBuf, srcSize) != srcSize) + error("loadMusic: Read failed"); + + uint dstSize = READ_BE_UINT32(srcBuf + srcSize - 4); + byte *dstBuf = (byte *)malloc(dstSize); + decrunchFile(srcBuf, dstBuf, srcSize); + free(srcBuf); + + Common::MemoryReadStream stream(dstBuf, dstSize); + modStream = Audio::makeMODStream(&stream); + } else { + modStream = Audio::makeMODStream(&f); + } + + _mixer->stopAll(); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, modStream); } else if (getGameType() == GType_SIMON2) { midi.stop(); _gameFile->seek(_gameOffsetsPtr[_musicIndexBase + music - 1], SEEK_SET); diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 831d860b91..7ac04fd569 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -1098,7 +1098,7 @@ public: void oe1_moveDirn(); void oe1_score(); void oe1_doClass(); - void oe1_pobj(); + void oe1_pObj(); void oe1_pName(); void oe1_pcName(); void oe1_cFlag(); diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index a553658e7c..eb2b970c88 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -250,6 +250,8 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { op[105] = &AGOSEngine::o_process; op[106] = &AGOSEngine::oe1_doClass; + op[112] = &AGOSEngine::oe1_pObj; + op[114] = &AGOSEngine::oe1_pName; op[115] = &AGOSEngine::oe1_pcName; @@ -355,7 +357,7 @@ void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) { op[35] = &AGOSEngine::oe1_copyfo; op[37] = &AGOSEngine::oe1_whatO; op[54] = &AGOSEngine::oe2_moveDirn; - op[73] = &AGOSEngine::oe1_pobj; + op[73] = &AGOSEngine::oe1_pObj; op[74] = &AGOSEngine::oe1_pName; op[75] = &AGOSEngine::oe1_pcName; op[83] = &AGOSEngine::o1_rescan; @@ -419,7 +421,7 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) { op[54] = &AGOSEngine::oww_moveDirn; op[55] = &AGOSEngine::oww_goto; op[70] = &AGOSEngine::o1_printLongText; - op[73] = &AGOSEngine::oe1_pobj; + op[73] = &AGOSEngine::oe1_pObj; op[74] = &AGOSEngine::oe1_pName; op[75] = &AGOSEngine::oe1_pcName; op[83] = &AGOSEngine::o1_rescan; @@ -1938,7 +1940,7 @@ void AGOSEngine::oe1_doClass() { } } -void AGOSEngine::oe1_pobj() { +void AGOSEngine::oe1_pObj() { // 112: print object SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2); getVarOrWord(); |