diff options
author | Paul Gilbert | 2014-08-19 20:43:32 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-19 20:43:32 -0400 |
commit | 23a442443f22f63a32e602b4e796981dbb9ee561 (patch) | |
tree | 04d43b8ddf76b0b35a284f73c3c12c8f5c53e0cd | |
parent | 6066afb020b6213bc6f9ef5ba5c3d7171c695340 (diff) | |
download | scummvm-rg350-23a442443f22f63a32e602b4e796981dbb9ee561.tar.gz scummvm-rg350-23a442443f22f63a32e602b4e796981dbb9ee561.tar.bz2 scummvm-rg350-23a442443f22f63a32e602b4e796981dbb9ee561.zip |
ACCESS: Implemented cmdNewRoom opcode
-rw-r--r-- | engines/access/access.cpp | 6 | ||||
-rw-r--r-- | engines/access/access.h | 2 | ||||
-rw-r--r-- | engines/access/scripts.cpp | 16 | ||||
-rw-r--r-- | engines/access/scripts.h | 2 |
4 files changed, 23 insertions, 3 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp index 71271230dd..6fcd64ecca 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -338,4 +338,10 @@ void AccessEngine::doLoadSave() { error("TODO: doLoadSave"); } +void AccessEngine::freeChar() { + _scripts->freeScriptData(); + _animation->clearTimers(); + _animation->freeAnimationData(); +} + } // End of namespace Access diff --git a/engines/access/access.h b/engines/access/access.h index f775310805..8cb1e72cfc 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -227,6 +227,8 @@ public: void copyBF2Vid(); void doLoadSave(); + + void freeChar(); }; } // End of namespace Access diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index 57f5788022..3a3fb06b1a 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -99,7 +99,7 @@ void Scripts::executeCommand(int commandIndex) { &Scripts::cmdPrint, &Scripts::cmdRetPos, &Scripts::cmdAnim, &Scripts::cmdSetFlag, &Scripts::cmdCheckFlag, &Scripts::cmdGoto, &Scripts::cmdSetInventory, &Scripts::cmdSetInventory, &Scripts::cmdCheckInventory, - &Scripts::cmdSetTex, &Scripts::CMDNEWROOM, &Scripts::CMDCONVERSE, + &Scripts::cmdSetTex, &Scripts::cmdNewRoom, &Scripts::CMDCONVERSE, &Scripts::cmdCheckFrame, &Scripts::cmdCheckAnim, &Scripts::cmdSnd, &Scripts::cmdRetNeg, &Scripts::cmdRetPos, &Scripts::cmdCheckLoc, &Scripts::cmdSetAnim, &Scripts::cmdDispInv, &Scripts::cmdSetTimer, @@ -296,7 +296,19 @@ void Scripts::cmdSetTex() { _vm->_room->setWallCodes(); } -void Scripts::CMDNEWROOM() { error("TODO CMDNEWROOM"); } +#define CURRENT_ROOM 0xFF + +void Scripts::cmdNewRoom() { + int roomNumber = _data->readByte(); + if (roomNumber != CURRENT_ROOM) + _vm->_player->_roomNumber = roomNumber; + + _vm->_room->_function = 1; + _vm->freeChar(); + _vm->_converseMode = 0; + cmdRetPos(); +} + void Scripts::CMDCONVERSE() { error("TODO CMDCONVERSE"); } void Scripts::cmdCheckFrame() { diff --git a/engines/access/scripts.h b/engines/access/scripts.h index 40f667a2f1..4b224c32bd 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -78,7 +78,7 @@ protected: void cmdSetInventory(); void cmdCheckInventory(); void cmdSetTex(); - void CMDNEWROOM(); + void cmdNewRoom(); void CMDCONVERSE(); void cmdCheckFrame(); void cmdCheckAnim(); |