diff options
author | Strangerke | 2014-08-27 01:25:18 +0200 |
---|---|---|
committer | Strangerke | 2014-08-27 01:25:18 +0200 |
commit | 610644c4a1fd386d6fde2c4c52b5aa9c1bdacc48 (patch) | |
tree | 17976389e50ed7c87cec6edb89dde2f248d3c914 | |
parent | 1568b4a433f8efc0b4e670d8e9714885aa8831c0 (diff) | |
download | scummvm-rg350-610644c4a1fd386d6fde2c4c52b5aa9c1bdacc48.tar.gz scummvm-rg350-610644c4a1fd386d6fde2c4c52b5aa9c1bdacc48.tar.bz2 scummvm-rg350-610644c4a1fd386d6fde2c4c52b5aa9c1bdacc48.zip |
ACCESS: Implement tileScreen
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 40 | ||||
-rw-r--r-- | engines/access/amazon/amazon_game.h | 5 | ||||
-rw-r--r-- | engines/access/amazon/amazon_room.cpp | 2 |
3 files changed, 45 insertions, 2 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index f7ed4146d8..608db5d573 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -44,15 +44,18 @@ AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc) _hitCount = 0; _saveRiver = 0; _hitSafe = 0; - _chapter = 0; + _oldTitleChap = _chapter = 0; _topList = 0; _botList = 0; _riverIndex = 0; _rawInactiveX = 0; _rawInactiveY = 0; _inactiveYOff = 0; + _tilePos = Common::Point(0, 0); Common::fill(&_esTabTable[0], &_esTabTable[100], 0); + memset(_tileData, 0, sizeof(_tileData)); + _hintLevel = 0; } @@ -270,6 +273,41 @@ void AmazonEngine::doEstablish(int esatabIndex, int sub) { _room->init4Quads(); } +const char *const _tileFiles[] = { + "GRAY.BLK", "RED.BLK", "LTBROWN.BLK", "DKBROWN.BLK", "VIOLET.BLK", "LITEBLUE.BLK", + "DARKBLUE.BLK", "CYAN.BLK", "GREEN.BLK", "OLIVE.BLK", "GRAY.BLK", "RED.BLK", + "LTBROWN.BLK", "DKBROWN.BLK", "VIOLET.BLK", "OLIVE.BLK" +}; + +void AmazonEngine::tileScreen(Common::String filename) { + if (!_screen->_vesaMode) + return; + + if (!_clearSummaryFlag && (_oldTitleChap == _chapter)) + return; + + _oldTitleChap = _chapter; + int idx = _chapter - 1; + + if (!_files->existFile(_tileFiles[idx])) + return; + + byte *data = _files->loadFile(_tileFiles[idx]); + int x = READ_LE_UINT16(data); + int y = READ_LE_UINT16(data + 2); + int size = ((x + 2) * y) + 10; + + for (int i = 0; i < size; ++i) + _tileData[i] = data[i + 4]; + + // CHECKME: Depending on the Vesa mode during initialization, 400 or 480 + for (_tilePos.y = 0; _tilePos.y < 480; _tilePos.y += y) { + for (_tilePos.x = 0; _tilePos.x < 640; _tilePos.x += x) + warning("TODO: DRAWOBJECT"); + } + +} + void AmazonEngine::drawHelp() { error("TODO: drawHelp"); } diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h index 5c4c472fb7..5192e208d7 100644 --- a/engines/access/amazon/amazon_game.h +++ b/engines/access/amazon/amazon_game.h @@ -39,6 +39,7 @@ private: int _hitCount; int _saveRiver; int _hitSafe; + int _oldTitleChap; int _chapter; int _topList; int _botList; @@ -47,6 +48,8 @@ private: int _rawInactiveY; int _inactiveYOff; int _esTabTable[100]; + Common::Point _tilePos; + byte _tileData[1455]; /** * Do the game introduction @@ -108,6 +111,8 @@ public: void drawHelp(); virtual void establish(int esatabIndex, int sub); + + void tileScreen(Common::String filename); }; } // End of namespace Amazon diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp index 3666de5e09..f8c8bc45a8 100644 --- a/engines/access/amazon/amazon_room.cpp +++ b/engines/access/amazon/amazon_room.cpp @@ -180,7 +180,7 @@ void AmazonRoom::init4Quads() { if (!_vm->_screen->_vesaMode) return; - warning("TILESCREEN(TILE.BLK);"); + _game->tileScreen(Common::String("TILE.BLK")); _vm->_inventory->refreshInventory(); warning("TODO: UPDATESUMMARY(chapter)"); |