diff options
Diffstat (limited to 'engines/access/amazon/amazon_game.cpp')
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 102 |
1 files changed, 59 insertions, 43 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index 4c9df7b8ff..8467d8b623 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -146,27 +146,24 @@ void AmazonEngine::playGame() { } void AmazonEngine::setupGame() { + Amazon::AmazonResources &res = *((Amazon::AmazonResources *)_res); + // Load death list - if (isDemo()) { - _deaths.resize(34); - for (int i = 0; i < 34; ++i) { - _deaths[i]._screenId = DEATH_SCREENS_DEMO[i]; - _deaths[i]._msg = DEATH_TEXT_DEMO[i]; - } - } else { - _deaths.resize(58); - for (int i = 0; i < 58; ++i) { - _deaths[i]._screenId = DEATH_SCREENS[i]; - _deaths[i]._msg = DEATH_TEXT[i]; - } + _deaths.resize(_res->DEATHS.size()); + + for (uint idx = 0; idx < _deaths.size(); ++idx) { + _deaths[idx]._screenId = res.DEATHS[idx]._screenId; + _deaths[idx]._msg = res.DEATHS[idx]._msg; } + + // Load the deaths cells _deaths._cells.resize(13); for (int i = 0; i < 13; ++i) _deaths._cells[i] = CellIdent(DEATH_CELLS[i][0], DEATH_CELLS[i][1], DEATH_CELLS[i][2]); // Miscellaneous - _fonts._font1.load(FONT6x6_INDEX, FONT6x6_DATA); - _fonts._font2.load(FONT2_INDEX, FONT2_DATA); + _fonts._font1.load(&res.FONT6x6_INDEX[0], &res.FONT6x6_DATA[0]); + _fonts._font2.load(&res.FONT2_INDEX[0], &res.FONT2_DATA[0]); initVariables(); } @@ -195,8 +192,8 @@ void AmazonEngine::initVariables() { _timers.push_back(te); } - _player->_playerX = _player->_rawPlayer.x = TRAVEL_POS[_player->_roomNumber][0]; - _player->_playerY = _player->_rawPlayer.y = TRAVEL_POS[_player->_roomNumber][1]; + _player->_playerX = _player->_rawPlayer.x = _res->ROOMTBL[_player->_roomNumber]._travelPos.x; + _player->_playerY = _player->_rawPlayer.y = _res->ROOMTBL[_player->_roomNumber]._travelPos.y; _room->_selectCommand = -1; _events->setNormalCursor(CURSOR_CROSSHAIRS); _mouseMode = 0; @@ -260,13 +257,24 @@ void AmazonEngine::doEstablish(int screenId, int estabIndex) { _screen->setIconPalette(); _screen->forceFadeIn(); - _fonts._charSet._lo = 1; - _fonts._charSet._hi = 10; - _fonts._charFor._lo = 29; - _fonts._charFor._hi = 32; + if (getGameID() == GType_MartianMemorandum) { + _fonts._charSet._lo = 1; + _fonts._charSet._hi = 10; + _fonts._charFor._lo = 0xF7; + _fonts._charFor._hi = 0xFF; + + _screen->_maxChars = 50; + _screen->_printOrg = _screen->_printStart = Common::Point(24, 18); + } else { + _fonts._charSet._lo = 1; + _fonts._charSet._hi = 10; + _fonts._charFor._lo = 29; + _fonts._charFor._hi = 32; + + _screen->_maxChars = 37; + _screen->_printOrg = _screen->_printStart = Common::Point(48, 35); + } - _screen->_maxChars = 37; - _screen->_printOrg = _screen->_printStart = Common::Point(48, 35); loadEstablish(estabIndex); uint16 msgOffset; if (!isCD()) @@ -400,6 +408,7 @@ void AmazonEngine::calcIQ() { } void AmazonEngine::helpTitle() { + AmazonResources &res = *(AmazonResources *)_res; int width = _fonts._font2.stringWidth(_bubbleBox->_bubbleTitle); int posX = 160 - (width / 2); _fonts._font2._fontColors[0] = 0; @@ -408,13 +417,13 @@ void AmazonEngine::helpTitle() { _fonts._font2._fontColors[3] = 35; _fonts._font2.drawString(_screen, _bubbleBox->_bubbleTitle, Common::Point(posX, 24)); - width = _fonts._font2.stringWidth(HELPLVLTXT[_helpLevel]); + width = _fonts._font2.stringWidth(res.HELPLVLTXT[_helpLevel]); posX = 160 - (width / 2); _fonts._font2._fontColors[0] = 0; _fonts._font2._fontColors[1] = 10; _fonts._font2._fontColors[2] = 11; _fonts._font2._fontColors[3] = 12; - _fonts._font2.drawString(_screen, HELPLVLTXT[_helpLevel], Common::Point(posX, 36)); + _fonts._font2.drawString(_screen, res.HELPLVLTXT[_helpLevel], Common::Point(posX, 36)); Common::String iqText = "IQ: "; calcIQ(); @@ -430,7 +439,7 @@ void AmazonEngine::helpTitle() { index /= 20; iqText += " "; - iqText += IQLABELS[index]; + iqText += res.IQLABELS[index]; width = _fonts._font2.stringWidth(iqText); posX = 160 - (width / 2); @@ -487,7 +496,7 @@ void AmazonEngine::drawHelp(const Common::String str) { _files->loadScreen(95, 2); if (_moreHelp == 1) { - ASurface *oldDest = _destIn; + BaseSurface *oldDest = _destIn; _destIn = _screen; int oldClip = _screen->_clipHeight; _screen->_clipHeight = 200; @@ -608,7 +617,12 @@ void AmazonEngine::startChapter(int chapter) { _establishGroup = 1; loadEstablish(0x40 + _chapter); - uint16 msgOffset = READ_LE_UINT16(_establish->data() + ((0x40 + _chapter) * 2) + 2); + + byte *entryOffset = _establish->data() + ((0x40 + _chapter) * 2); + if (isCD()) + entryOffset += 2; + + uint16 msgOffset = READ_LE_UINT16(entryOffset); _printEnd = 170; Common::String msg((const char *)_establish->data() + msgOffset); @@ -631,25 +645,27 @@ void AmazonEngine::startChapter(int chapter) { _room->init4Quads(); } - if (chapter == 14) { - _conversation = 31; - _char->loadChar(_conversation); - _events->setCursor(CURSOR_ARROW); + if (isCD()) { + if (chapter == 14) { + _conversation = 31; + _char->loadChar(_conversation); + _events->setCursor(CURSOR_ARROW); - _images.clear(); - _oldRects.clear(); - _scripts->_sequence = 0; - _scripts->searchForSequence(); + _images.clear(); + _oldRects.clear(); + _scripts->_sequence = 0; + _scripts->searchForSequence(); - if (_screen->_vesaMode) { - _converseMode = 1; - } - } else if (chapter != 1) { - _player->_roomNumber = CHAPTER_JUMP[_chapter - 1]; - _room->_function = FN_CLEAR1; - _converseMode = 0; + if (_screen->_vesaMode) { + _converseMode = 1; + } + } else if (chapter != 1) { + _player->_roomNumber = CHAPTER_JUMP[_chapter - 1]; + _room->_function = FN_CLEAR1; + _converseMode = 0; - _scripts->cmdRetPos(); + _scripts->cmdRetPos(); + } } } |