diff options
author | Paul Gilbert | 2014-08-07 21:54:22 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-07 21:54:22 -0400 |
commit | 0c38730f3fd4965fbf1b854f76ff936dddf9f931 (patch) | |
tree | a9777d76edcb2ae6448dab5003d07ca60a271f4f /engines/access/room.cpp | |
parent | 0183007d0b4f3b951ef2c704894655e894ce4a71 (diff) | |
download | scummvm-rg350-0c38730f3fd4965fbf1b854f76ff936dddf9f931.tar.gz scummvm-rg350-0c38730f3fd4965fbf1b854f76ff936dddf9f931.tar.bz2 scummvm-rg350-0c38730f3fd4965fbf1b854f76ff936dddf9f931.zip |
ACCESS: Implement buildScreen
Diffstat (limited to 'engines/access/room.cpp')
-rw-r--r-- | engines/access/room.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/engines/access/room.cpp b/engines/access/room.cpp index afa42c82f0..7a07f58bcb 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -26,9 +26,12 @@ #include "access/resources.h" #include "access/room.h" +#define TILE_WIDTH 16 +#define TILE_HEIGHT 16 + namespace Access { -Room::Room(AccessEngine *vm) : _vm(vm) { +Room::Room(AccessEngine *vm) : Manager(vm) { _function = 0; _roomFlag = 0; } @@ -261,11 +264,40 @@ void Room::setupRoom() { } void Room::setWallCodes() { - // TODO + _jetFrame.clear(); + _jetFrame.resize(_plotter._walls.size()); + + _vm->_player->_rawXTemp = _vm->_player->_rawPlayer.x; + _vm->_player->_rawYTemp = _vm->_player->_rawPlayer.y; } void Room::buildScreen() { - // TODO + int scrollCol = _vm->_screen->_scrollCol; + int cnt = _vm->_screen->_vWindowSize.x + 1; + int offset = 0; + + for (int idx = 0; idx < cnt, offset += TILE_WIDTH; ++idx) { + buildColumn(_vm->_screen->_scrollCol, offset); + ++_vm->_screen->_scrollCol; + } + + _vm->_screen->_scrollCol = scrollCol; + _vm->_screen->copyBF1BF2(); +} + +void Room::buildColumn(int playX, int screenX) { + const byte *pSrc = _vm->_playField + _vm->_screen->_scrollRow * + _vm->_playFieldSize.x + playX; + byte *pDest = (byte *)_vm->_buffer1.getPixels(); + + for (int y = 0; y <= _vm->_screen->_vWindowSize.y; ++y) { + byte *pTile = _vm->_tile + (*pSrc << 8); + + for (int tileY = 0; tileY < TILE_HEIGHT; ++tileY) { + Common::copy(pTile, pTile + TILE_WIDTH, pDest); + pDest += _vm->_screen->_vWindowSize.x; + } + } } /*------------------------------------------------------------------------*/ |