Skip to content

Commit

Permalink
ACCESS: Implement tileScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Aug 26, 2014
1 parent 1568b4a commit 610644c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
40 changes: 39 additions & 1 deletion engines/access/amazon/amazon_game.cpp
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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");
}
Expand Down
5 changes: 5 additions & 0 deletions engines/access/amazon/amazon_game.h
Expand Up @@ -39,6 +39,7 @@ class AmazonEngine : public AccessEngine {
int _hitCount;
int _saveRiver;
int _hitSafe;
int _oldTitleChap;
int _chapter;
int _topList;
int _botList;
Expand All @@ -47,6 +48,8 @@ class AmazonEngine : public AccessEngine {
int _rawInactiveY;
int _inactiveYOff;
int _esTabTable[100];
Common::Point _tilePos;
byte _tileData[1455];

/**
* Do the game introduction
Expand Down Expand Up @@ -108,6 +111,8 @@ class AmazonEngine : public AccessEngine {
void drawHelp();

virtual void establish(int esatabIndex, int sub);

void tileScreen(Common::String filename);
};

} // End of namespace Amazon
Expand Down
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_room.cpp
Expand Up @@ -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)");

Expand Down

0 comments on commit 610644c

Please sign in to comment.