diff options
author | Strangerke | 2014-08-17 22:42:28 +0200 |
---|---|---|
committer | Strangerke | 2014-08-17 22:42:28 +0200 |
commit | 4ea9339d183cb53f465d7752e739cf8a153a7978 (patch) | |
tree | a76c6a08d408a3fedcd4b758cd17d7da2dad83d4 /engines | |
parent | 1b69da3d17c7dce0c64eb23e7c5499a20c60cd47 (diff) | |
download | scummvm-rg350-4ea9339d183cb53f465d7752e739cf8a153a7978.tar.gz scummvm-rg350-4ea9339d183cb53f465d7752e739cf8a153a7978.tar.bz2 scummvm-rg350-4ea9339d183cb53f465d7752e739cf8a153a7978.zip |
ACCESS: Implement cmdSetTex()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/player.h | 4 | ||||
-rw-r--r-- | engines/access/room.h | 3 | ||||
-rw-r--r-- | engines/access/scripts.cpp | 36 | ||||
-rw-r--r-- | engines/access/scripts.h | 4 |
4 files changed, 38 insertions, 9 deletions
diff --git a/engines/access/player.h b/engines/access/player.h index a9efff2433..b904e46170 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -49,11 +49,9 @@ private: int _diagDownWalkMin, _diagDownWalkMax; Common::Point _guard; bool _collideFlag; - Direction _playerDirection; Direction _move; int _xFlag, _yFlag; Common::Point _moveTo; - SpriteResource *_playerSprites; SpriteResource *_playerSprites1; byte *_manPal1; int _scrollEnd; @@ -79,6 +77,8 @@ private: bool scrollLeft(); bool scrollRight(); public: + Direction _playerDirection; + SpriteResource *_playerSprites; // Fields in original Player structure byte *_monData; int _walkOffRight[PLAYER_DATA_COUNT]; diff --git a/engines/access/room.h b/engines/access/room.h index f76db6f681..a90c6e400e 100644 --- a/engines/access/room.h +++ b/engines/access/room.h @@ -68,7 +68,6 @@ private: protected: void loadRoomData(const byte *roomData); void setupRoom(); - void setWallCodes(); void buildScreen(); /** @@ -110,6 +109,8 @@ protected: virtual void mainAreaClick() = 0; public: + void setWallCodes(); + virtual void setIconPalette() {} public: Plotter _plotter; diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index a209efcd04..0d232cc779 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -96,7 +96,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, @@ -105,7 +105,7 @@ void Scripts::executeCommand(int commandIndex) { &Scripts::cmdPlotImage, &Scripts::cmdSetDisplay, &Scripts::cmdSetBuffer, &Scripts::cmdSetScroll, &Scripts::CMDSAVERECT, &Scripts::CMDSAVERECT, &Scripts::CMDSETBUFVID, &Scripts::CMDPLAYBUFVID, &Scripts::cmdRemoveLast, - &Scripts::CMDSPECIAL, &Scripts::CMDSPECIAL, &Scripts::CMDSPECIAL, + &Scripts::cmdSpecial, &Scripts::cmdSpecial, &Scripts::cmdSpecial, &Scripts::CMDSETCYCLE, &Scripts::CMDCYCLE, &Scripts::cmdCharSpeak, &Scripts::cmdTexSpeak, &Scripts::CMDTEXCHOICE, &Scripts::CMDWAIT, &Scripts::cmdSetConPos, &Scripts::CMDCHECKVFRAME, &Scripts::cmdJumpChoice, @@ -255,7 +255,35 @@ void Scripts::cmdCheckInventory() { _data->skip(2); } -void Scripts::CMDSETTEX() { error("TODO CMDSETTEX"); } +void Scripts::cmdSetTex() { + _vm->_player->_playerDirection = RIGHT; + int posX = _data->readSint16LE() - (_vm->_player->_playerOffset.x / 2); + if (posX <= _vm->_player->_rawPlayer.x) + _vm->_player->_playerDirection = LEFT; + + _vm->_player->_rawPlayer.x = posX; + _vm->_player->checkScroll(); + bool scrlTemp = _vm->_player->_scrollFlag; + + _vm->_player->_playerDirection = UP; + int posY = _data->readSint16LE(); + if (posY <= _vm->_player->_rawPlayer.y) + _vm->_player->_playerDirection = DOWN; + + _vm->_player->_rawPlayer.y = posY; + _vm->_player->_frame = 5; + _vm->_player->checkScroll(); + + _vm->_player->_scrollFlag |= scrlTemp; + + _vm->_player->_position = Common::Point(_vm->_player->_rawPlayer.x, _vm->_player->_rawPlayer.y - _vm->_player->_playerOffset.y); + _vm->_player->_priority = _vm->_player->_playerOffset.y; + _vm->_player->_spritesPtr = _vm->_player->_playerSprites; + _vm->_player->_frameNumber = _vm->_player->_frame; + + _vm->_room->setWallCodes(); +} + void Scripts::CMDNEWROOM() { error("TODO CMDNEWROOM"); } void Scripts::CMDCONVERSE() { error("TODO CMDCONVERSE"); } @@ -363,7 +391,7 @@ void Scripts::cmdRemoveLast() { --_vm->_numAnimTimers; } -void Scripts::CMDSPECIAL() { +void Scripts::cmdSpecial() { _specialFunction = _data->readUint16LE(); int p1 = _data->readUint16LE(); int p2 = _data->readUint16LE(); diff --git a/engines/access/scripts.h b/engines/access/scripts.h index aae31464bf..70d79c4b65 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -65,7 +65,7 @@ protected: void cmdSetInventory(); void cmdCheckInventory(); - void CMDSETTEX(); + void cmdSetTex(); void CMDNEWROOM(); void CMDCONVERSE(); void cmdCheckFrame(); @@ -88,7 +88,7 @@ protected: void CMDSETBUFVID(); void CMDPLAYBUFVID(); void cmdRemoveLast(); - void CMDSPECIAL(); + void cmdSpecial(); void CMDSETCYCLE(); void CMDCYCLE(); void cmdCharSpeak(); |