diff options
35 files changed, 1441 insertions, 1302 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 3f83f82191..1bc4c5348d 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -57,8 +57,6 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription * _nim = nullptr; _ghostroom = nullptr; _help = nullptr; - _shootemup = nullptr; - _mainmenu = nullptr; _platform = gd->desc.platform; initVariables(); @@ -83,8 +81,6 @@ AvalancheEngine::~AvalancheEngine() { delete _nim; delete _ghostroom; delete _help; - delete _shootemup; - delete _mainmenu; for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) { @@ -169,8 +165,6 @@ Common::ErrorCode AvalancheEngine::initialize() { _nim = new Nim(this); _ghostroom = new GhostRoom(this); _help = new Help(this); - _shootemup = new ShootEmUp(this); - _mainmenu = new MainMenu(this); _graphics->init(); _dialogs->init(); diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 41ec00e6a5..146065ad63 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -91,8 +91,6 @@ public: Nim *_nim; GhostRoom *_ghostroom; Help *_help; - ShootEmUp *_shootemup; - MainMenu *_mainmenu; OSystem *_system; @@ -238,6 +236,7 @@ public: bool _isLoaded; // Is it a loaded gamestate? void callVerb(VerbCode id); + void loadBackground(byte num); void loadRoom(byte num); void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!! void incScore(byte num); // Add on no. of points diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index fefbbedd34..e855c71fcf 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -190,7 +190,6 @@ void AvalancheEngine::setup() { _animation->resetAnims(); - drawToolbar(); _dialogs->setReadyLight(2); fadeIn(); @@ -210,10 +209,17 @@ void AvalancheEngine::setup() { loadGame(loadSlot); } else { - _mainmenu->run(); - + // We don't need the MainMenu during the whole game, only at the beginning of it. + MainMenu *mainmenu = new MainMenu(this); + mainmenu->run(); + delete mainmenu; + if (_letMeOut) + return; + newGame(); + drawToolbar(); + thinkAbout(kObjectMoney, kThing); _dialogs->displayScrollChain('Q', 83); // Info on the game, etc. @@ -223,7 +229,7 @@ void AvalancheEngine::setup() { void AvalancheEngine::runAvalot() { setup(); - do { + while (!_letMeOut && !shouldQuit()) { uint32 beginLoop = _system->getMillis(); updateEvents(); // The event handler. @@ -241,7 +247,7 @@ void AvalancheEngine::runAvalot() { uint32 delay = _system->getMillis() - beginLoop; if (delay <= 55) _system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight). - } while (!_letMeOut && !shouldQuit()); + }; warning("STUB: run()"); @@ -410,9 +416,7 @@ void AvalancheEngine::loadAlso(byte num) { } } -void AvalancheEngine::loadRoom(byte num) { - CursorMan.showMouse(false); - +void AvalancheEngine::loadBackground(byte num) { Common::String filename = Common::String::format("place%d.avd", num); Common::File file; if (!file.open(filename)) @@ -434,9 +438,15 @@ void AvalancheEngine::loadRoom(byte num) { _graphics->refreshBackground(); file.close(); +} + +void AvalancheEngine::loadRoom(byte num) { + CursorMan.showMouse(false); + loadBackground(num); loadAlso(num); - _background->load(num); + _background->loadSprites(num); + CursorMan.showMouse(true); } diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp index c3d6ac3481..f1ba659a55 100644 --- a/engines/avalanche/background.cpp +++ b/engines/avalanche/background.cpp @@ -261,7 +261,7 @@ void Background::update() { } } -void Background::load(byte number) { +void Background::loadSprites(byte number) { Common::File f; _filename = _filename.format("chunk%d.avd", number); if (!f.open(_filename)) diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h index 98d6d36fed..e994d9eae9 100644 --- a/engines/avalanche/background.h +++ b/engines/avalanche/background.h @@ -51,7 +51,7 @@ public: ~Background(); void update(); - void load(byte number); + void loadSprites(byte number); void release(); // Setting the destination to negative coordinates means the picture should be drawn to it's original position. diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp index 0bc1f7eb8b..7c0529811e 100644 --- a/engines/avalanche/dropdown.cpp +++ b/engines/avalanche/dropdown.cpp @@ -405,8 +405,8 @@ Common::String DropDownMenu::selectGender(byte x) { void DropDownMenu::setupMenuGame() { _activeMenuItem.reset(); _activeMenuItem.setupOption("Help...", 'H', "f1", true); - _activeMenuItem.setupOption("Boss Key", 'B', "alt-B", false); - _activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true); + _activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true); + _activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", false); _activeMenuItem.setupOption("Score and rank", 'S', "f9", true); _activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true); _activeMenuItem.display(); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 553556f8e0..ae53f3e034 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -801,8 +801,11 @@ void GraphicManager::menuInitialize() { _menu.create(kScreenWidth, kMenuScreenHeight, Graphics::PixelFormat::createFormatCLUT8()); } -void GraphicManager::menuClear() { +void GraphicManager::menuFree() { _menu.free(); +} + +void GraphicManager::menuRestoreScreen() { initGraphics(kScreenWidth, 2 * kScreenHeight, true); } @@ -867,6 +870,13 @@ void GraphicManager::menuDrawBigText(FontType font, uint16 x, uint16 y, Common:: drawBigText(_menu, text, font, 14, x, y, color); } +void GraphicManager::menuDrawIndicator(int x) { // TODO: Implement striped pattern for the indicator. + if (x > 0) + _menu.fillRect(Common::Rect(x - 1, 330, x, 337), kColorBlack); + _menu.fillRect(Common::Rect(x, 330, x + 1, 337), kColorWhite); + menuRefreshScreen(); +} + /** * This function is for skipping the difference between a stored 'size' value associated with a picture * and the actual size of the pictures when reading them from files for Ghostroom and Shoot em' up. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 270e04da85..7e0ed64b5f 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -122,9 +122,11 @@ public: // so it needs it's own graphic functions on that matter. void menuRefreshScreen(); void menuInitialize(); - void menuClear(); + void menuFree(); + void menuRestoreScreen(); void menuLoadPictures(); void menuDrawBigText(FontType font, uint16 x, uint16 y, Common::String text, Color color); + void menuDrawIndicator(int x); void clearAlso(); void clearTextBar(); diff --git a/engines/avalanche/mainmenu.cpp b/engines/avalanche/mainmenu.cpp index 0f64527305..543684556c 100644 --- a/engines/avalanche/mainmenu.cpp +++ b/engines/avalanche/mainmenu.cpp @@ -37,6 +37,7 @@ MainMenu::MainMenu(AvalancheEngine *vm) { } void MainMenu::run() { + CursorMan.showMouse(false); _vm->_graphics->menuInitialize(); _vm->_graphics->menuLoadPictures(); loadRegiInfo(); @@ -54,7 +55,6 @@ void MainMenu::run() { _vm->_graphics->menuRefreshScreen(); wait(); - _vm->_graphics->menuClear(); } void MainMenu::loadFont() { @@ -81,7 +81,36 @@ void MainMenu::centre(int16 y, Common::String text) { } void MainMenu::wait() { - warning("STUB: MainMenu::wait()"); + int x = 0; + while (!_vm->shouldQuit()) { + _vm->_graphics->menuDrawIndicator(x); + _vm->_system->delayMillis(40); + x++; + if (x == 641) + x = 0; + Common::Event event; + _vm->getEvent(event); + if (event.type == Common::EVENT_KEYDOWN) { + switch (event.kbd.keycode) { + case Common::KEYCODE_SPACE: + case Common::KEYCODE_RETURN: + case Common::KEYCODE_1: // Falltroughs are inteded. + // Play the game + _vm->_graphics->menuFree(); + _vm->_graphics->menuRestoreScreen(); + CursorMan.showMouse(true); + return; + case Common::KEYCODE_ESCAPE: + case Common::KEYCODE_6: // Falltroughs are inteded. + // Exit back to DOS + _vm->_letMeOut = true; + _vm->_graphics->menuFree(); + return; + default: + break; + } + } + } } } // End of namespace Avalanche diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 44e8dde9ae..7db0d14890 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -2052,8 +2052,7 @@ void Parser::doThat() { _vm->_dialogs->displayText("Hello, Phaon!"); break; case kVerbCodeBoss: - // bosskey(); - warning("STUB: Parser::doThat() - case kVerbCodeboss"); + bossKey(); break; case kVerbCodePee: if (_vm->getFlag('P')) { @@ -2426,6 +2425,25 @@ void Parser::doThat() { } } +void Parser::bossKey() { + _vm->_graphics->saveScreen(); + _vm->_graphics->blackOutScreen(); + _vm->_graphics->loadMouse(kCurUpArrow); + _vm->loadBackground(98); + _vm->_graphics->drawNormalText("Graph/Histo/Draw/Sample: \"JANJUN93.GRA\": (W3-AB3)", _vm->_font, 8, 120, 169, kColorDarkgray); + _vm->_graphics->drawNormalText("Press any key or click the mouse to return.", _vm->_font, 8, 144, 182, kColorDarkgray); + _vm->_graphics->refreshScreen(); + Common::Event event; + _vm->getEvent(event); + while ((!_vm->shouldQuit()) && (event.type != Common::EVENT_KEYDOWN) && (event.type != Common::EVENT_LBUTTONDOWN)){ + _vm->getEvent(event); + _vm->_graphics->refreshScreen(); + } + _vm->_graphics->restoreScreen(); + _vm->_graphics->removeBackup(); + _vm->loadBackground(_vm->_room); +} + void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) { // kVerbCodegive isn't dealt with by this procedure, but by ddm__with. switch (verb) { diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index 46408f518a..6a15fb2387 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -146,6 +146,7 @@ private: void playHarp(); void winSequence(); void wipeText(); + void bossKey(); }; } // End of namespace Avalanche diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index c361203886..7b6e1ee1ce 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -331,7 +331,10 @@ void Timer::hangAround2() { _vm->_tiedUp = false; - _vm->_shootemup->run(); + // We don't need the ShootEmUp during the whole game, it's only playable once. + ShootEmUp *shootemup = new ShootEmUp(_vm); + shootemup->run(); + delete shootemup; } void Timer::afterTheShootemup() { diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index f07a1db787..b919ccdcb9 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -887,6 +887,10 @@ namespace Fullpipe { #define MSG_SC18_SHOWGIRLJUMPTO 1499 #define MSG_SC18_SHOWMANJUMP 1510 #define MSG_SC18_SHOWMANJUMPTO 1508 +#define MV_BOY18_JUMPTO 1481 +#define MV_KSL_INBOY 1491 +#define MV_KSL_INGIRL 1493 +#define MV_KSL_INMAN 1504 #define MV_KSL_SWING 1460 #define MV_KSL_SWINGBOY 1462 #define MV_KSL_SWINGGIRL 1464 @@ -898,6 +902,9 @@ namespace Fullpipe { #define PIC_SC18_RTRUBA 1520 #define SND_18_006 3906 #define SND_18_010 4994 +#define ST_KSL_JUMPBOY 1492 +#define ST_KSL_JUMPGIRL 1494 +#define ST_KSL_JUMPMAN 1505 // Scene 19 #define ANI_CORDIE 1529 diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 1c6369341a..09015937a5 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -290,6 +290,7 @@ Vars::Vars() { scene18_var25 = 0; scene18_var26 = 1; scene18_var27 = -1; + scene18_var33 = 0; scene18_var13 = -1; scene18_var14 = -1; scene18_var28 = 0; diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 30306fa9ab..7d67aab61d 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -494,6 +494,7 @@ public: int scene18_var25; int scene18_var26; int scene18_var27; + int scene18_var33; int scene18_var13; int scene18_var14; int scene18_var28; diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp index e9507851e3..8c03a8e078 100644 --- a/engines/fullpipe/scenes/scene18and19.cpp +++ b/engines/fullpipe/scenes/scene18and19.cpp @@ -389,7 +389,19 @@ void sceneHandler18_clickBoard() { } void sceneHandler18and19_showManJump() { - warning("STUB: sceneHandler18and19_showManJump()"); + g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT); + g_fp->_aniMan->_flags &= 0xFFFB; + g_fp->_aniMan->_flags &= 0xFEFF; + g_vars->scene18_var07[g_vars->scene18_var27]->sflags = 0x20; + + g_vars->scene18_var07[g_vars->scene18_var27]->ani->changeStatics2(ST_KSL_JUMPMAN); + g_vars->scene18_var07[g_vars->scene18_var27]->ani->startAnim(MV_KSL_INMAN, 0, -1); + g_vars->scene18_var07[g_vars->scene18_var27]->ani->_priority = 20; + + g_vars->scene18_var28 = 0; + g_vars->scene18_var15 = 1; + + g_fp->_aniMan2 = g_vars->scene18_var07[g_vars->scene18_var27]->ani; } void sceneHandler18_showManJumpTo() { @@ -397,7 +409,16 @@ void sceneHandler18_showManJumpTo() { } void sceneHandler18and19_showGirlJumpTo() { - warning("STUB: sceneHandler18and19_showGirlJumpTo()"); + g_vars->scene18_girl->stopAnim_maybe(); + g_vars->scene18_girl->hide(); + + g_vars->scene18_var07[g_vars->scene18_var33]->sflags = 4; + + g_vars->scene18_var07[g_vars->scene18_var33]->ani->changeStatics2(ST_KSL_JUMPGIRL); + g_vars->scene18_var07[g_vars->scene18_var33]->ani->startAnim(MV_KSL_INGIRL, 0, -1); + + g_vars->scene18_var23--; + g_vars->scene18_var25--; } void sceneHandler18and19_showGirlJump() { @@ -405,13 +426,28 @@ void sceneHandler18and19_showGirlJump() { } void sceneHandler18and19_showBoyJumpTo() { - warning("STUB: sceneHandler18and19_showBoyJumpTo()"); + g_vars->scene18_boy->stopAnim_maybe(); + g_vars->scene18_boy->hide(); + + g_vars->scene18_var07[g_vars->scene18_var33]->sflags = 2; + g_vars->scene18_var07[g_vars->scene18_var33]->ani->changeStatics2(ST_KSL_JUMPBOY); + g_vars->scene18_var07[g_vars->scene18_var33]->ani->startAnim(MV_KSL_INBOY, 0, -1); + + g_vars->scene18_var23--; + g_vars->scene18_var24--; } void sceneHandler18and19_showBoyJump() { warning("STUB: sceneHandler18and19_showBoyJump()"); } +void sceneHandler18and19_boyJumpTo() { + g_vars->scene18_boy->stopAnim_maybe(); + g_vars->scene18_boy->show1(g_vars->scene18_var29, g_vars->scene18_var30, MV_BOY18_JUMPTO, 0); + g_vars->scene18_boy->_priority = 50; + g_vars->scene18_boy->startAnim(MV_BOY18_JUMPTO, 0, -1); +} + void sceneHandler18and19_drawRiders() { warning("STUB: sceneHandler18and19_drawRiders()"); } @@ -536,7 +572,18 @@ int sceneHandler18(ExCommand *cmd) { } void sceneHandler19_updateNumRides() { - warning("STUB: sceneHandler19_updateNumRides()"); + int numRides = g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarAsInt(sO_DudeSwinged) + 1; + + if (numRides > 1) { + g_fp->setObjectState(sO_Girl, g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); + + g_vars->scene18_var23 = 1; + g_vars->scene18_var25++; + + numRides = 0; + } + + g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->setSubVarAsInt(sO_DudeSwinged, numRides); } int sceneHandler19(ExCommand *cmd) { diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 02a21e36f8..9d61b4d182 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -129,10 +129,10 @@ public: if (in) { if (TsAGE::Saver::readSavegameHeader(in, header)) { - saveList.push_back(SaveStateDescriptor(slot, header.saveName)); + saveList.push_back(SaveStateDescriptor(slot, header._saveName)); - header.thumbnail->free(); - delete header.thumbnail; + header._thumbnail->free(); + delete header._thumbnail; } delete in; @@ -162,11 +162,11 @@ public: delete f; // Create the return descriptor - SaveStateDescriptor desc(slot, header.saveName); - desc.setThumbnail(header.thumbnail); - desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay); - desc.setSaveTime(header.saveHour, header.saveMinutes); - desc.setPlayTime(header.totalFrames * GAME_FRAME_TIME); + SaveStateDescriptor desc(slot, header._saveName); + desc.setThumbnail(header._thumbnail); + desc.setSaveDate(header._saveYear, header._saveMonth, header._saveDay); + desc.setSaveTime(header._saveHour, header._saveMinutes); + desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME); return desc; } diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index fe71c03973..9954b929b2 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -141,8 +141,8 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { // Write out the savegame header tSageSavegameHeader header; - header.saveName = saveName; - header.version = TSAGE_SAVEGAME_VERSION; + header._saveName = saveName; + header._version = TSAGE_SAVEGAME_VERSION; writeSavegameHeader(saveFile, header); // Save out objects that need to come at the start of the savegame @@ -190,11 +190,11 @@ Common::Error Saver::restore(int slot) { // Read in the savegame header tSageSavegameHeader header; readSavegameHeader(saveFile, header); - if (header.thumbnail) - header.thumbnail->free(); - delete header.thumbnail; + if (header._thumbnail) + header._thumbnail->free(); + delete header._thumbnail; - serializer.setSaveVersion(header.version); + serializer.setSaveVersion(header._version); // Load in data for objects that need to come at the start of the savegame for (Common::List<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { @@ -242,34 +242,34 @@ const char *SAVEGAME_STR = "SCUMMVM_TSAGE"; bool Saver::readSavegameHeader(Common::InSaveFile *in, tSageSavegameHeader &header) { char saveIdentBuffer[SAVEGAME_STR_SIZE + 1]; - header.thumbnail = NULL; + header._thumbnail = NULL; // Validate the header Id in->read(saveIdentBuffer, SAVEGAME_STR_SIZE + 1); if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE)) return false; - header.version = in->readByte(); - if (header.version > TSAGE_SAVEGAME_VERSION) + header._version = in->readByte(); + if (header._version > TSAGE_SAVEGAME_VERSION) return false; // Read in the string - header.saveName.clear(); + header._saveName.clear(); char ch; - while ((ch = (char)in->readByte()) != '\0') header.saveName += ch; + while ((ch = (char)in->readByte()) != '\0') header._saveName += ch; // Get the thumbnail - header.thumbnail = Graphics::loadThumbnail(*in); - if (!header.thumbnail) + header._thumbnail = Graphics::loadThumbnail(*in); + if (!header._thumbnail) return false; // Read in save date/time - header.saveYear = in->readSint16LE(); - header.saveMonth = in->readSint16LE(); - header.saveDay = in->readSint16LE(); - header.saveHour = in->readSint16LE(); - header.saveMinutes = in->readSint16LE(); - header.totalFrames = in->readUint32LE(); + header._saveYear = in->readSint16LE(); + header._saveMonth = in->readSint16LE(); + header._saveDay = in->readSint16LE(); + header._saveHour = in->readSint16LE(); + header._saveMinutes = in->readSint16LE(); + header._totalFrames = in->readUint32LE(); return true; } @@ -281,7 +281,7 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h out->writeByte(TSAGE_SAVEGAME_VERSION); // Write savegame name - out->write(header.saveName.c_str(), header.saveName.size() + 1); + out->write(header._saveName.c_str(), header._saveName.size() + 1); // Get the active palette uint8 thumbPalette[256 * 3]; diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index a6ad71699e..be5ff51ffb 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -38,12 +38,12 @@ typedef void (*SaveNotifierFn)(bool postFlag); class SavedObject; struct tSageSavegameHeader { - uint8 version; - Common::String saveName; - Graphics::Surface *thumbnail; - int saveYear, saveMonth, saveDay; - int saveHour, saveMinutes; - int totalFrames; + uint8 _version; + Common::String _saveName; + Graphics::Surface *_thumbnail; + int _saveYear, _saveMonth, _saveDay; + int _saveHour, _saveMinutes; + int _totalFrames; }; /*--------------------------------------------------------------------------*/ diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 5e3d989110..b9c184e2bb 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -163,13 +163,13 @@ void Graphics::copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int } void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 chr, uint8 chrColor, const uint8 *src) { - if (chr < 32 || chr - 32 >= _charset.xCount * _charset.yCount) { + if (chr < 32 || chr - 32 >= _charset._xCount * _charset._yCount) { return; } - const int h = MIN(_charset.charH, 200 - yDst); - const int w = MIN(_charset.charW, pitch - xDst); + const int h = MIN(_charset._charH, 200 - yDst); + const int w = MIN(_charset._charW, pitch - xDst); dst += yDst * pitch + xDst; - int offset = (chr - 32) * _charset.charH * _charset.charW; + int offset = (chr - 32) * _charset._charH * _charset._charW; for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { const int color = src[offset++]; @@ -189,22 +189,22 @@ void Graphics::setCharset(CharsetType type) { _charsetType = type; switch (type) { case kCharsetTypeDefault: - _charset.charW = 10; - _charset.charH = 10; - _charset.xCount = 32; - _charset.yCount = 7; + _charset._charW = 10; + _charset._charH = 10; + _charset._xCount = 32; + _charset._yCount = 7; break; case kCharsetTypeEng: - _charset.charW = 10; - _charset.charH = 8; - _charset.xCount = 32; - _charset.yCount = 3; + _charset._charW = 10; + _charset._charH = 8; + _charset._xCount = 32; + _charset._yCount = 3; break; case kCharsetTypeCredits: - _charset.charW = 19; - _charset.charH = 10; - _charset.xCount = 16; - _charset.yCount = 7; + _charset._charW = 19; + _charset._charH = 10; + _charset._xCount = 16; + _charset._yCount = 7; break; } } diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index 3e2745186c..3e48179a30 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -34,16 +34,14 @@ enum CharsetType { }; struct Charset { - int charW; - int charH; - int xCount; - int yCount; + int _charW; + int _charH; + int _xCount; + int _yCount; }; class Graphics { public: - - static int encodeRLE(const uint8 *src, uint8 *dst, int w, int h); static int encodeRAW(const uint8 *src, uint8 *dst, int w, int h); diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index 13d5f06894..4601d11b10 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -33,8 +33,8 @@ static const int _data3UpdateLocation1_yTable[] = { 152, 8, 95 }; void TuckerEngine::execData3PreUpdate_locationNum1() { if (_flagsTable[1] == 1) { _flagsTable[1] = 2; - _locationSoundsTable[3].type = 2; - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + _locationSoundsTable[3]._type = 2; + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } _mapSequenceFlagsLocationTable[0] = (_flagsTable[1] > 0) ? 1 : 0; if (_updateLocationCounter == 0) { @@ -66,7 +66,7 @@ void TuckerEngine::execData3PreUpdate_locationNum1Helper1() { } } if (_updateLocationFlagsTable[0] == 1 && _updateLocationCounter == 0) { - setVolumeSound(12, _locationSoundsTable[12].volume); + setVolumeSound(12, _locationSoundsTable[12]._volume); } else { setVolumeSound(12, 0); } @@ -122,7 +122,7 @@ void TuckerEngine::execData3PostUpdate_locationNum1() { if (_flagsTable[63] == 0) { if (getRandomNumber() < 400) { _flagsTable[63] = 1; - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } _locationHeightTable[1] = (_yPosCurrent > 104) ? 60 : 0; @@ -130,48 +130,48 @@ void TuckerEngine::execData3PostUpdate_locationNum1() { void TuckerEngine::updateSprite_locationNum2() { if (_flagsTable[9] == 2) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; return; } if (_flagsTable[9] == 1) { if (_flagsTable[10] == 1) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].state = 4; - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._state = 4; + _spritesTable[0]._needUpdate = true; } else { - _spritesTable[0].needUpdate = 0; - _spritesTable[0].state = 5; + _spritesTable[0]._needUpdate = false; + _spritesTable[0]._state = 5; _flagsTable[10] = 1; - _spritesTable[0].gfxBackgroundOffset = 0; + _spritesTable[0]._gfxBackgroundOffset = 0; } return; } if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].state = 3; - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._state = 3; + _spritesTable[0]._needUpdate = true; return; } if (_csDataHandled) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(0, 0); } else if (getRandomNumber() > 20000) { - _spritesTable[0].state = 6; + _spritesTable[0]._state = 6; } else { - _spritesTable[0].state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._state = 3; + _spritesTable[0]._updateDelay = 5; } } else { if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(1, 0); } else if (getRandomNumber() < 20000) { - _spritesTable[0].state = 1; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._state = 1; + _spritesTable[0]._updateDelay = 5; } else { - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; } } } @@ -199,7 +199,7 @@ void TuckerEngine::execData3PreUpdate_locationNum2() { if (_updateLocationYPosTable2[i] > _updateLocationYMaxTable[i]) { _updateLocationYPosTable2[i] = 0; const int num = (getRandomNumber() < 16000) ? 2 : 3; - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } else if (getRandomNumber() > 32000) { const int num = getRandomNumber() / 8192; @@ -243,9 +243,9 @@ void TuckerEngine::updateSprite_locationNum3_0(int i) { int num; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { num = 5; - _spritesTable[i].needUpdate = 1; - } else if (_spritesTable[i].prevState == 5 && _spritesTable[i].animationFrame == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = true; + } else if (_spritesTable[i]._prevState == 5 && _spritesTable[i]._animationFrame == 1) { + _spritesTable[i]._needUpdate = false; int r = getRandomNumber(); if (r < 12000) { num = 3; @@ -256,11 +256,11 @@ void TuckerEngine::updateSprite_locationNum3_0(int i) { } } else { num = 5; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } - _spritesTable[i].state = num; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._state = num; + _spritesTable[i]._prevAnimationFrame = true; } void TuckerEngine::updateSprite_locationNum3_1(int i) { @@ -268,44 +268,44 @@ void TuckerEngine::updateSprite_locationNum3_1(int i) { if (_flagsTable[207] == 1) { num = -1; } else if (_flagsTable[203] == 1) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; num = 20; _flagsTable[203] = 2; } else if (_flagsTable[203] == 2) { num = 12; } else if (_flagsTable[203] == 3) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; num = 19; _flagsTable[203] = 0; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[21] == 0) { num = 7; } else { num = 8; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_csDataHandled) { num = 6; if (getRandomNumber() < 32000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - } else if (_spritesTable[i].state == 6 && _spritesTable[i].animationFrame == 1) { + } else if (_spritesTable[i]._state == 6 && _spritesTable[i]._animationFrame == 1) { if (getRandomNumber() < 20000) { num = 11; - _spritesTable[i].defaultUpdateDelay = 5; + _spritesTable[i]._defaultUpdateDelay = 5; } else { num = 10; } } else { num = 6; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } } - _spritesTable[i].state = num; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = num; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum3_2(int i) { @@ -314,32 +314,32 @@ void TuckerEngine::updateSprite_locationNum3_2(int i) { _flagsTable[205] = 0; num = 18; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; num = 17; } else if (_flagsTable[45] == 1) { _flagsTable[45] = 2; num = 16; } else if (_flagsTable[45] == 2) { num = 17; - _spritesTable[i].updateDelay = 5; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._updateDelay = 5; + _spritesTable[i]._needUpdate = false; } else if (_flagsTable[45] == 3) { _flagsTable[45] = 0; num = 16; - _updateSpriteFlag2 = 1; + _updateSpriteFlag2 = true; } else { - _spritesTable[i].needUpdate = 0; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter <= 5) { + _spritesTable[i]._needUpdate = false; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter <= 5) { num = 14; } else { - if (_spritesTable[i].counter > 8) { - _spritesTable[i].counter = 0; + if (_spritesTable[i]._counter > 8) { + _spritesTable[i]._counter = 0; } num = 15; } } - _spritesTable[i].state = num; + _spritesTable[i]._state = num; } void TuckerEngine::execData3PreUpdate_locationNum3() { @@ -362,36 +362,36 @@ void TuckerEngine::updateSprite_locationNum4(int i) { if (_flagsTable[9] == 2) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 1; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum4() { if (_flagsTable[6] == 0) { setVolumeSound(0, 0); } else { - setVolumeSound(0, _locationSoundsTable[0].volume); + setVolumeSound(0, _locationSoundsTable[0]._volume); } } void TuckerEngine::updateSprite_locationNum5_0() { - ++_spritesTable[0].counter; - if (_spritesTable[0].counter > 100) { - _spritesTable[0].counter = 0; - _spritesTable[0].state = 1; - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); - } else if (_spritesTable[0].counter == 50) { - _locationSoundsTable[1].type = 2; - _spritesTable[0].state = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); - } else { - _spritesTable[0].state = -1; + ++_spritesTable[0]._counter; + if (_spritesTable[0]._counter > 100) { + _spritesTable[0]._counter = 0; + _spritesTable[0]._state = 1; + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); + } else if (_spritesTable[0]._counter == 50) { + _locationSoundsTable[1]._type = 2; + _spritesTable[0]._state = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); + } else { + _spritesTable[0]._state = -1; if (isSoundPlaying(1)) { stopSound(1); } @@ -399,7 +399,7 @@ void TuckerEngine::updateSprite_locationNum5_0() { } void TuckerEngine::updateSprite_locationNum5_1(int i) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } void TuckerEngine::updateSprite_locationNum6_0(int i) { @@ -410,29 +410,29 @@ void TuckerEngine::updateSprite_locationNum6_0(int i) { state = 14; } else if (_flagsTable[26] == 4 || _flagsTable[26] == 5) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 3; - _spritesTable[0].counter = 0; + _spritesTable[0]._counter = 0; } else if (_xPosCurrent < 370 && _flagsTable[26] == 4) { state = 2; - } else if (_spritesTable[0].counter == 0) { + } else if (_spritesTable[0]._counter == 0) { setCharacterAnimation(0, 0); - _updateSpriteFlag1 = 1; - ++_spritesTable[0].counter; + _updateSpriteFlag1 = true; + ++_spritesTable[0]._counter; return; } else { state = 1; - _spritesTable[0].updateDelay = 2; - ++_spritesTable[0].counter; - if (_spritesTable[0].counter > 100) { - _spritesTable[0].counter = 0; + _spritesTable[0]._updateDelay = 2; + ++_spritesTable[0]._counter; + if (_spritesTable[0]._counter > 100) { + _spritesTable[0]._counter = 0; } } } else { state = -1; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum6_1(int i) { @@ -440,18 +440,18 @@ void TuckerEngine::updateSprite_locationNum6_1(int i) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { if (_flagsTable[209] == 1) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 10; } } else { if (getRandomNumber() < 30000 || (_csDataHandled && _xPosCurrent == 248)) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; _miscSoundFxNum[0] = 3; _miscSoundFxDelayCounter[0] = 70; @@ -459,7 +459,7 @@ void TuckerEngine::updateSprite_locationNum6_1(int i) { _miscSoundFxDelayCounter[1] = 25; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum6_2(int i) { @@ -467,13 +467,13 @@ void TuckerEngine::updateSprite_locationNum6_2(int i) { if (_flagsTable[26] < 5 || _flagsTable[207] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 12; } else { state = 12; - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum6() { @@ -483,11 +483,11 @@ void TuckerEngine::execData3PreUpdate_locationNum6() { if (_flagsTable[26] == 2) { _currentSpriteAnimationLength = 2; _currentSpriteAnimationFrame = 112; - if (_spritesTable[0].xSource < 45) { + if (_spritesTable[0]._xSource < 45) { _currentSpriteAnimationFrame2 = 144; - } else if (_spritesTable[0].xSource > 80) { + } else if (_spritesTable[0]._xSource > 80) { _currentSpriteAnimationFrame2 = 147; - } else if (_spritesTable[0].xSource < 60) { + } else if (_spritesTable[0]._xSource < 60) { _currentSpriteAnimationFrame2 = 145; } else { _currentSpriteAnimationFrame2 = 146; @@ -500,24 +500,24 @@ void TuckerEngine::execData3PreUpdate_locationNum6Helper1() { if (_flagsTable[26] == 1) { if (_flagsTable[27] < 15) { if (_flagsTable[27] == 0) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } ++_flagsTable[27]; - setVolumeSound(0, _locationSoundsTable[0].volume - _flagsTable[27] * 5); - setVolumeMusic(0, _locationMusicsTable[0].volume - _flagsTable[27] * 5); + setVolumeSound(0, _locationSoundsTable[0]._volume - _flagsTable[27] * 5); + setVolumeMusic(0, _locationMusicsTable[0]._volume - _flagsTable[27] * 5); } } else if (_flagsTable[26] == 3) { if (_flagsTable[27] > 0) { if (_flagsTable[27] == 15) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } --_flagsTable[27]; - setVolumeSound(0, _locationSoundsTable[0].volume - _flagsTable[27] * 5); - setVolumeMusic(0, _locationMusicsTable[0].volume - _flagsTable[27] * 5); + setVolumeSound(0, _locationSoundsTable[0]._volume - _flagsTable[27] * 5); + setVolumeMusic(0, _locationMusicsTable[0]._volume - _flagsTable[27] * 5); int volume = _flagsTable[27]; - if (volume < _locationSoundsTable[1].volume) { - volume = _locationSoundsTable[1].volume; + if (volume < _locationSoundsTable[1]._volume) { + volume = _locationSoundsTable[1]._volume; } setVolumeSound(1, volume); } @@ -538,12 +538,12 @@ void TuckerEngine::execData3PreUpdate_locationNum6Helper1() { x2 = 15 - _flagsTable[27]; } for (int i = 0; i < x1; ++i) { - execData3PreUpdate_locationNum6Helper2(20 * 640 + 325 + i * 8, _data3GfxBuf + _dataTable[238].sourceOffset); - execData3PreUpdate_locationNum6Helper2(20 * 640 + 445 - i * 8, _data3GfxBuf + _dataTable[238].sourceOffset); + execData3PreUpdate_locationNum6Helper2(20 * 640 + 325 + i * 8, _data3GfxBuf + _dataTable[238]._sourceOffset); + execData3PreUpdate_locationNum6Helper2(20 * 640 + 445 - i * 8, _data3GfxBuf + _dataTable[238]._sourceOffset); } for (int i = 0; i < x2; ++i) { - execData3PreUpdate_locationNum6Helper3(20 * 640 + 325 + x1 * 8 + i * 4, _data3GfxBuf + _dataTable[238].sourceOffset); - execData3PreUpdate_locationNum6Helper3(20 * 640 + 449 - x1 * 8 - i * 4, _data3GfxBuf + _dataTable[238].sourceOffset); + execData3PreUpdate_locationNum6Helper3(20 * 640 + 325 + x1 * 8 + i * 4, _data3GfxBuf + _dataTable[238]._sourceOffset); + execData3PreUpdate_locationNum6Helper3(20 * 640 + 449 - x1 * 8 - i * 4, _data3GfxBuf + _dataTable[238]._sourceOffset); } addDirtyRect(0, 20, 640, 51); } @@ -583,37 +583,37 @@ void TuckerEngine::execData3PostUpdate_locationNum6() { void TuckerEngine::updateSprite_locationNum7_0(int i) { int state; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 0) { + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 0) { state = 2; - _spritesTable[i].counter = 0; + _spritesTable[i]._counter = 0; } else { state = 1; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum7_1(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum8_0(int i) { - _spritesTable[i].state = (_flagsTable[28] < 20) ? -1 : 7; + _spritesTable[i]._state = (_flagsTable[28] < 20) ? -1 : 7; } void TuckerEngine::updateSprite_locationNum8_1(int i) { @@ -622,20 +622,20 @@ void TuckerEngine::updateSprite_locationNum8_1(int i) { state = -1; } else if (_flagsTable[28] == 18) { state = 6; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else if (_flagsTable[29] == 0) { state = 1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 1) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; } if (_flagsTable[28] == 19) { _flagsTable[28] = 20; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PostUpdate_locationNum8() { @@ -662,7 +662,7 @@ void TuckerEngine::execData3PostUpdate_locationNum8() { _updateLocationYPosTable2[0] += 2; if (_updateLocationYPosTable2[0] > 120) { _updateLocationYPosTable2[0] = 0; - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } if (_flagsTable[28] > 1 && _flagsTable[28] < 5) { @@ -674,82 +674,82 @@ void TuckerEngine::execData3PostUpdate_locationNum8() { void TuckerEngine::updateSprite_locationNum9_0(int i) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[i].needUpdate = 1; - _spritesTable[i].state = 3; + _spritesTable[i]._needUpdate = true; + _spritesTable[i]._state = 3; } else if (_updateLocationCounter2 > 0 || getRandomNumber() > 30000) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; if (_updateLocationCounter2 == 0) { _updateLocationCounter2 = 6; } } else if (getRandomNumber() > 30000) { - _spritesTable[i].state = 2; - _spritesTable[i].defaultUpdateDelay = 5; + _spritesTable[i]._state = 2; + _spritesTable[i]._defaultUpdateDelay = 5; } else { - _spritesTable[i].state = 1; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._state = 1; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } } void TuckerEngine::updateSprite_locationNum9_1(int i) { - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; - _spritesTable[i].state = 5; - _spritesTable[i].defaultUpdateDelay = 5; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; + _spritesTable[i]._state = 5; + _spritesTable[i]._defaultUpdateDelay = 5; } else { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } } void TuckerEngine::updateSprite_locationNum9_2(int i) { - _spritesTable[i].state = 6; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 6; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum9() { if (_flagsTable[7] < 2) { _flagsTable[7] = 2; } - if (_flagsTable[8] == 0 && _locationMusicsTable[0].volume != 0) { - _locationMusicsTable[0].volume = 0; + if (_flagsTable[8] == 0 && _locationMusicsTable[0]._volume != 0) { + _locationMusicsTable[0]._volume = 0; } else { - _locationMusicsTable[0].volume = _xPosCurrent / 40; + _locationMusicsTable[0]._volume = _xPosCurrent / 40; } - setVolumeMusic(0, _locationMusicsTable[0].volume); + setVolumeMusic(0, _locationMusicsTable[0]._volume); if (!isSoundPlaying(1) && getRandomNumber() > 32000) { int i = getRandomNumber() / 5500 + 3; assert(i >= 0 && i < kLocationSoundsTableSize); - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); } if (_flagsTable[8] == 2 && _locationMaskType == 0) { _flagsTable[8] = 0; - startSound(_locationSoundsTable[7].offset, 7, _locationSoundsTable[7].volume); + startSound(_locationSoundsTable[7]._offset, 7, _locationSoundsTable[7]._volume); } } void TuckerEngine::execData3PostUpdate_locationNum9() { - if (_spritesTable[1].state == 4) { - if (_spritesTable[1].flipX == 1) { + if (_spritesTable[1]._state == 4) { + if (_spritesTable[1]._flipX) { --_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] < -50) { - _spritesTable[1].flipX = 0; + _spritesTable[1]._flipX = false; _updateLocationXPosTable2[0] = -50; } } else { ++_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] > 500) { - _spritesTable[1].flipX = 1; + _spritesTable[1]._flipX = true; _updateLocationXPosTable2[0] = 500; } } } - _spritesTable[1].gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; + _spritesTable[1]._gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; for (int i = 1; i < 3; ++i) { - _spritesTable[i].colorType = 1; - _spritesTable[i].yMaxBackground = 60; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._yMaxBackground = 60; drawSprite(i); - _spritesTable[i].colorType = 0; + _spritesTable[i]._colorType = 0; } } @@ -759,7 +759,7 @@ void TuckerEngine::updateSprite_locationNum10() { if (_flagsTable[99] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; if (r < 26000) { state = 1; } else if (r < 29000) { @@ -769,12 +769,12 @@ void TuckerEngine::updateSprite_locationNum10() { } } else if (_csDataHandled) { state = 2; - _spritesTable[0].updateDelay = 4; + _spritesTable[0]._updateDelay = 4; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; if (r > 26000) { state = 5; - _spritesTable[0].prevAnimationFrame = 1; + _spritesTable[0]._prevAnimationFrame = true; } else if (r > 24000) { state = 6; _miscSoundFxDelayCounter[0] = 120; @@ -783,7 +783,7 @@ void TuckerEngine::updateSprite_locationNum10() { setCharacterAnimation(0, 0); } } - _spritesTable[0].state = state; + _spritesTable[0]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum10() { @@ -797,8 +797,8 @@ void TuckerEngine::execData3PreUpdate_locationNum10() { if (_flagsTable[47] == 1 && _inventoryItemsState[26] == 1) { _flagsTable[47] = 2; } - if (_spritesTable[0].state == 6 && _spritesTable[0].animationFrame == 18 && !isSoundPlaying(0)) { - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + if (_spritesTable[0]._state == 6 && _spritesTable[0]._animationFrame == 18 && !isSoundPlaying(0)) { + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } if (_flagsTable[230] == 1 && getRandomNumber() > 32000) { _flagsTable[230] = 0; @@ -808,52 +808,52 @@ void TuckerEngine::execData3PreUpdate_locationNum10() { void TuckerEngine::updateSprite_locationNum11_0(int i) { const int r = getRandomNumber(); if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; - _spritesTable[i].state = 2; + _spritesTable[i]._needUpdate = true; + _spritesTable[i]._state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r > 28000) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } else if (r > 20000) { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } else { - _spritesTable[i].state = 3; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._state = 3; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 5; } } } void TuckerEngine::updateSprite_locationNum11_1(int i) { if (getRandomNumber() > 20000) { - _spritesTable[i].state = 5; + _spritesTable[i]._state = 5; } else { - _spritesTable[i].animationFrame = 14; - _updateSpriteFlag1 = 1; - _spritesTable[i].state = 5; + _spritesTable[i]._animationFrame = 14; + _updateSpriteFlag1 = true; + _spritesTable[i]._state = 5; } } void TuckerEngine::updateSprite_locationNum11_2(int i) { if (getRandomNumber() > 20000) { - _spritesTable[i].state = 6; + _spritesTable[i]._state = 6; } else { - _spritesTable[i].animationFrame = 17; - _spritesTable[i].state = 6; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = 17; + _spritesTable[i]._state = 6; + _updateSpriteFlag1 = true; } } void TuckerEngine::updateSprite_locationNum11_3(int i) { - _spritesTable[i].state = 7; + _spritesTable[i]._state = 7; } void TuckerEngine::updateSprite_locationNum11_4(int i) { if (getRandomNumber() > 30000 && _flagsTable[55] < 2) { - _spritesTable[i].state = 1; - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + _spritesTable[i]._state = 1; + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -866,10 +866,10 @@ void TuckerEngine::updateSprite_locationNum12_0(int i) { if (_flagsTable[207] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_updateLocationCounter2 < 4) { state = 1; } else if (_updateLocationCounter2 < 8) { @@ -878,7 +878,7 @@ void TuckerEngine::updateSprite_locationNum12_0(int i) { state = 4; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum12_1(int i) { @@ -891,7 +891,7 @@ void TuckerEngine::updateSprite_locationNum12_1(int i) { } else { state = 8; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum12() { @@ -899,13 +899,13 @@ void TuckerEngine::execData3PreUpdate_locationNum12() { _flagsTable[38] = 1; } if (_flagsTable[41] == 0) { - if (_locationMusicsTable[0].volume != 100) { - _locationMusicsTable[0].volume = 100; + if (_locationMusicsTable[0]._volume != 100) { + _locationMusicsTable[0]._volume = 100; setVolumeMusic(0, 100); } } else { - if (_locationMusicsTable[0].volume != 20) { - _locationMusicsTable[0].volume = 20; + if (_locationMusicsTable[0]._volume != 20) { + _locationMusicsTable[0]._volume = 20; setVolumeMusic(0, 20); } } @@ -917,44 +917,44 @@ void TuckerEngine::updateSprite_locationNum13(int i) { if (_flagsTable[202] == 0) { _flagsTable[202] = 1; state = 3; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._stateIndex = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 4; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } } else if (_flagsTable[202] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[202] = 0; state = 6; } else { setCharacterAnimation(0, 0); return; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum13() { if (_flagsTable[69] == 0) { if (getRandomNumber() > 31000) { _flagsTable[69] = 1; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } else if (isSoundPlaying(1)) { stopSound(1); } } _flagsTable[8] = 2; - if (_spritesTable[0].state == 1) { - if (_spritesTable[0].animationFrame > 10 && _spritesTable[0].animationFrame < 20) { + if (_spritesTable[0]._state == 1) { + if (_spritesTable[0]._animationFrame > 10 && _spritesTable[0]._animationFrame < 20) { if (!isSoundPlaying(0)) { - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } } if (isSoundPlaying(0)) { - if (_spritesTable[0].animationFrame > 10 && _spritesTable[0].animationFrame < 20) { + if (_spritesTable[0]._animationFrame > 10 && _spritesTable[0]._animationFrame < 20) { stopSound(0); } } @@ -963,12 +963,12 @@ void TuckerEngine::execData3PreUpdate_locationNum13() { void TuckerEngine::updateSprite_locationNum14(int i) { int state = 2; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = (getRandomNumber() < 12000) ? 1 : 3; } else if (getRandomNumber() < 26000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum14() { @@ -988,7 +988,7 @@ void TuckerEngine::execData3PreUpdate_locationNum14() { num = 7; } if (num != -1) { - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } _locationHeightTable[14] = (_xPosCurrent < 100) ? 0 : 60; @@ -1008,11 +1008,11 @@ void TuckerEngine::execData3PreUpdate_locationNum14() { } const int num = _updateLocation14ObjNum[i]; if (num > 0) { - const int w = _dataTable[num].xSize; - const int h = _dataTable[num].ySize; + const int w = _dataTable[num]._xSize; + const int h = _dataTable[num]._ySize; const int x = _updateLocationXPosTable2[i] - w / 2; const int y = _updateLocationYPosTable2[i] / 16 - h / 2; - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + y * 640 + x, _data3GfxBuf + _dataTable[num].sourceOffset, w, h, 0, 0, false); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + y * 640 + x, _data3GfxBuf + _dataTable[num]._sourceOffset, w, h, 0, 0, false); addDirtyRect(x, y, w, h); } } @@ -1063,41 +1063,41 @@ void TuckerEngine::execData3PostUpdate_locationNum14() { } void TuckerEngine::updateSprite_locationNum15_0(int i) { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } void TuckerEngine::updateSprite_locationNum15_1(int i) { int state; int r = getRandomNumber(); if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r < 26000) { state = 5; } else if (r < 29000) { state = 2; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._prevAnimationFrame = true; } else { state = 4; - _spritesTable[4].counter = 1; + _spritesTable[4]._counter = 1; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum15_2(int i) { - _spritesTable[i].state = 3; - if (_spritesTable[4].counter > 0) { - ++_spritesTable[4].counter; - if (_spritesTable[4].counter > 6) { - _spritesTable[4].counter = 0; + _spritesTable[i]._state = 3; + if (_spritesTable[4]._counter > 0) { + ++_spritesTable[4]._counter; + if (_spritesTable[4]._counter > 6) { + _spritesTable[4]._counter = 0; } else { - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } } else { - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } } @@ -1106,7 +1106,7 @@ void TuckerEngine::execData3PreUpdate_locationNum15() { if (_updateLocationFadePaletteCounter > 500) { if (!isSoundPlaying(1) && getRandomNumber() > 31000) { const int i = getRandomNumber() / 4714; - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); _updateLocationFadePaletteCounter = 0; } } @@ -1123,21 +1123,21 @@ void TuckerEngine::updateSprite_locationNum16_0(int i) { } else if (_flagsTable[82] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - if (_spritesTable[0].needUpdate == 0) { - _spritesTable[0].needUpdate = 1; + if (!_spritesTable[0]._needUpdate) { + _spritesTable[0]._needUpdate = true; state = 1; } else { state = 1; - _spritesTable[0].animationFrame = 2; - _updateSpriteFlag1 = 1; + _spritesTable[0]._animationFrame = 2; + _updateSpriteFlag1 = true; } } else if (_csDataHandled) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 4; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (r < 30000) { state = 4; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (r < 31000) { state = 4; if (_xPosCurrent < 300) { @@ -1149,7 +1149,7 @@ void TuckerEngine::updateSprite_locationNum16_0(int i) { } else { state = 6; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum16_1(int i) { @@ -1164,18 +1164,18 @@ void TuckerEngine::updateSprite_locationNum16_1(int i) { } else if (_flagsTable[60] == 0) { state = 10; if (isSoundPlaying(1)) { - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } else { state = 9; if (isSoundPlaying(0)) { - _locationSoundsTable[0].type = 2; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + _locationSoundsTable[0]._type = 2; + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum16_2(int i) { @@ -1183,27 +1183,27 @@ void TuckerEngine::updateSprite_locationNum16_2(int i) { if (_flagsTable[78] == 0) { if (_flagsTable[60] == 1 && _flagsTable[61] == 1) { _flagsTable[78] = 1; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); state = 7; } } else if (_flagsTable[78] == 1) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { if (getRandomNumber() > 32000) { state = 7; } else if (getRandomNumber() > 10000) { state = 13; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { state = 13; } - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum16() { @@ -1218,26 +1218,26 @@ void TuckerEngine::updateSprite_locationNum17() { } else if (_flagsTable[82] == 2) { _flagsTable[82] = 3; _disableCharactersPath = true; - _spritesTable[0].gfxBackgroundOffset = 100; + _spritesTable[0]._gfxBackgroundOffset = 100; state = 1; - _spritesTable[0].backgroundOffset = -1; - } else if (_spritesTable[0].gfxBackgroundOffset < -160) { + _spritesTable[0]._backgroundOffset = -1; + } else if (_spritesTable[0]._gfxBackgroundOffset < -160) { state = -1; } else { state = 1; - _spritesTable[0].yMaxBackground = 0; - _spritesTable[0].colorType = 1; + _spritesTable[0]._yMaxBackground = 0; + _spritesTable[0]._colorType = 1; } - _spritesTable[0].state = state; + _spritesTable[0]._state = state; } void TuckerEngine::updateSprite_locationNum18() { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 2; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 1; const int r = getRandomNumber(); if (r > 31000) { @@ -1246,54 +1246,54 @@ void TuckerEngine::updateSprite_locationNum18() { state = 4; } } - _spritesTable[0].gfxBackgroundOffset = 0; - _spritesTable[0].backgroundOffset = 0; - _spritesTable[0].state = state; + _spritesTable[0]._gfxBackgroundOffset = 0; + _spritesTable[0]._backgroundOffset = 0; + _spritesTable[0]._state = state; } void TuckerEngine::updateSprite_locationNum19_0(int i) { int state; if (_flagsTable[206] == 1) { state = 7; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[206] = 0; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - ++_spritesTable[i].counter; - _spritesTable[i].needUpdate = 1; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + _spritesTable[i]._needUpdate = true; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; state = 2; } else { state = 1; } } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; } - if (_spritesTable[i].counter == 2) { + if (_spritesTable[i]._counter == 2) { state = 4; - _spritesTable[i].prevAnimationFrame = 1; - } else if (_spritesTable[i].counter == 5) { + _spritesTable[i]._prevAnimationFrame = true; + } else if (_spritesTable[i]._counter == 5) { state = 5; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._prevAnimationFrame = true; } else { state = 5; - _spritesTable[i].updateDelay = 6; + _spritesTable[i]._updateDelay = 6; } } - _spritesTable[i].state = state; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._state = state; + _spritesTable[i]._prevAnimationFrame = true; } void TuckerEngine::updateSprite_locationNum19_1(int i) { - _spritesTable[i].state = 9; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 9; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum19_2(int i) { - _spritesTable[i].gfxBackgroundOffset = 320; - _spritesTable[i].state = -1; + _spritesTable[i]._gfxBackgroundOffset = 320; + _spritesTable[i]._state = -1; } void TuckerEngine::updateSprite_locationNum19_3(int i) { @@ -1313,36 +1313,36 @@ void TuckerEngine::updateSprite_locationNum21() { } else if (_flagsTable[58] == 3) { state = 6; _flagsTable[58] = 4; - _locationSoundsTable[0].volume = 60; - _locationSoundsTable[5].volume = 60; + _locationSoundsTable[0]._volume = 60; + _locationSoundsTable[5]._volume = 60; } else if (_flagsTable[58] == 4) { state = 7; - _locationSoundsTable[4].volume = 60; + _locationSoundsTable[4]._volume = 60; } else if (_flagsTable[59] == 4) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; _flagsTable[59] = 2; state = 2; setVolumeSound(2, 0); } else if (_flagsTable[59] == 3) { _flagsTable[59] = 0; state = 4; - setVolumeSound(2, _locationSoundsTable[2].volume); + setVolumeSound(2, _locationSoundsTable[2]._volume); } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 3; } else if (_flagsTable[59] == 2) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (_flagsTable[15] == 1) { state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 1; } - _spritesTable[0].state = state; - _spritesTable[0].gfxBackgroundOffset = 320; + _spritesTable[0]._state = state; + _spritesTable[0]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum21() { @@ -1351,7 +1351,7 @@ void TuckerEngine::execData3PreUpdate_locationNum21() { _pendingActionDelay = 0; _flagsTable[59] = 1; _nextAction = 2; - _csDataLoaded = 0; + _csDataLoaded = false; } if (_flagsTable[58] > 0 && !isSoundPlaying(0)) { const int r = getRandomNumber(); @@ -1364,17 +1364,17 @@ void TuckerEngine::execData3PreUpdate_locationNum21() { } else { num = 5; } - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } - if (_spritesTable[0].state == 6) { - if (_spritesTable[0].animationFrame < 18) { - _spritesTable[0].gfxBackgroundOffset = 320 + _spritesTable[0].animationFrame * 638; + if (_spritesTable[0]._state == 6) { + if (_spritesTable[0]._animationFrame < 18) { + _spritesTable[0]._gfxBackgroundOffset = 320 + _spritesTable[0]._animationFrame * 638; } else { - _spritesTable[0].gfxBackgroundOffset = 11840 - _spritesTable[0].animationFrame * 2; + _spritesTable[0]._gfxBackgroundOffset = 11840 - _spritesTable[0]._animationFrame * 2; } } else { - _spritesTable[0].gfxBackgroundOffset = 320; + _spritesTable[0]._gfxBackgroundOffset = 320; } if (_inventoryItemsState[19] > 0) { _flagsTable[43] = 1; @@ -1397,20 +1397,20 @@ void TuckerEngine::execData3PreUpdate_locationNum22() { } if (_flagsTable[210] < 2 && !_csDataHandled && _flagsTable[54] == 1) { _nextAction = 25; - _csDataLoaded = 0; + _csDataLoaded = false; _flagsTable[210] = 2; } } void TuckerEngine::updateSprite_locationNum22() { if (_flagsTable[207] == 1) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; - _spritesTable[0].state = 2; + _spritesTable[0]._needUpdate = true; + _spritesTable[0]._state = 2; } else { - _spritesTable[0].needUpdate = 0; - _spritesTable[0].state = 1; + _spritesTable[0]._needUpdate = false; + _spritesTable[0]._state = 1; } } @@ -1421,37 +1421,37 @@ void TuckerEngine::updateSprite_locationNum23_0(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_1(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 14; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 25; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 13; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_2(int i) { int state = 0; if (_flagsTable[210] == 0) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() < 25000) ? 4 : 5; } } else if (_flagsTable[210] == 1) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[211] == 10) { state = 34; } else if (_flagsTable[211] == 0) { @@ -1461,7 +1461,7 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { state = 31; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[211] == 1) { state = 32; _flagsTable[211] = 0; @@ -1471,10 +1471,10 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { } } else if (_flagsTable[210] == 2) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 33; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[212] == 0) { state = 3; _flagsTable[212] = 1; @@ -1488,7 +1488,7 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { } else { state = 24; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_3(int i) { @@ -1496,13 +1496,13 @@ void TuckerEngine::updateSprite_locationNum23_3(int i) { if (_flagsTable[210] == 0 || _flagsTable[210] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 9; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_0(int i) { @@ -1512,40 +1512,40 @@ void TuckerEngine::updateSprite_locationNum24_0(int i) { state = 5; } else if (_flagsTable[103] == 0) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; if (getRandomNumber() < 30000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } } else if (_flagsTable[103] == 1 || _flagsTable[103] == 3) { state = -1; } else { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else { if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 6; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 6; } } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_1(int i) { if (_flagsTable[103] > 1) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -1554,11 +1554,11 @@ void TuckerEngine::updateSprite_locationNum24_2(int i) { if (_flagsTable[214] > 1) { state = -1; } else if (_flagsTable[214] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[214] = 2; state = 9; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[213] == 1) { state = 10; } else if (_flagsTable[213] == 2) { @@ -1567,10 +1567,10 @@ void TuckerEngine::updateSprite_locationNum24_2(int i) { state = 8; } } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 7; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_3(int i) { @@ -1585,7 +1585,7 @@ void TuckerEngine::updateSprite_locationNum24_3(int i) { } else { state = 11; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum24() { @@ -1596,7 +1596,7 @@ void TuckerEngine::execData3PreUpdate_locationNum24() { } else if (_inventoryItemsState[2] == 1 && _inventoryItemsState[11] == 1 && _flagsTable[156] == 1 && _flagsTable[145] == 3) { _flagsTable[156] = 2; _nextAction = 61; - _csDataLoaded = 0; + _csDataLoaded = false; } if (_flagsTable[103] > 0 && (_inventoryItemsState[2] > 0 || _inventoryItemsState[11] > 0 || _flagsTable[156] > 0 || _flagsTable[145] == 3) && _flagsTable[217] == 0) { _flagsTable[217] = 1; @@ -1619,9 +1619,9 @@ void TuckerEngine::updateSprite_locationNum26_0(int i) { if (_flagsTable[125] > 0 && _flagsTable[125] < 300) { _flagsTable[126] = 1; } - _spritesTable[i].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[i].state = 1; - _spritesTable[i].colorType = 99; + _spritesTable[i]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[i]._state = 1; + _spritesTable[i]._colorType = 99; } void TuckerEngine::updateSprite_locationNum26_1(int i) { @@ -1630,23 +1630,23 @@ void TuckerEngine::updateSprite_locationNum26_1(int i) { state = -1; } else if (_flagsTable[125] > 299) { state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { state = 2; } - _spritesTable[i].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[i].colorType = 1; - _spritesTable[i].state = state; + _spritesTable[i]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum26() { _characterPrevBackFrontFacing = 1; - _spritesTable[1].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[0].gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[1]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[0]._gfxBackgroundOffset = _flagsTable[125]; if (_flagsTable[125] > 0 && _flagsTable[125] < 300) { if (!isSoundPlaying(5)) { - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); } ++_flagsTable[125]; _flagsTable[126] = 1; @@ -1656,7 +1656,7 @@ void TuckerEngine::execData3PreUpdate_locationNum26() { stopSound(6); } } - if (_panelLockedFlag == 0) { + if (!_panelLockedFlag) { if (_xPosCurrent > 207 && _xPosCurrent < 256) { _objectKeysLocationTable[26] = 0; _objectKeysPosXTable[26] = 260; @@ -1674,17 +1674,17 @@ void TuckerEngine::updateSprite_locationNum27(int i) { state = 1; _flagsTable[155] = 4; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum27() { @@ -1701,36 +1701,36 @@ void TuckerEngine::updateSprite_locationNum28_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 4; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 0; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 30) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 30) { + _spritesTable[i]._counter = 0; } if (_flagsTable[86] == 1) { - if (_spritesTable[i].counter == 16 || _spritesTable[i].counter == 27) { + if (_spritesTable[i]._counter == 16 || _spritesTable[i]._counter == 27) { state = 3; } else { state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } else { - if (_spritesTable[i].counter == 5 || _spritesTable[i].counter == 11) { + if (_spritesTable[i]._counter == 5 || _spritesTable[i]._counter == 11) { state = 5; - } else if (_spritesTable[i].counter == 16 || _spritesTable[i].counter == 27) { + } else if (_spritesTable[i]._counter == 16 || _spritesTable[i]._counter == 27) { state = 6; } else { state = 6; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum28_1(int i) { - _spritesTable[i].state = (_flagsTable[86] == 1) ? 1 : -1; + _spritesTable[i]._state = (_flagsTable[86] == 1) ? 1 : -1; } void TuckerEngine::updateSprite_locationNum28_2(int i) { @@ -1741,14 +1741,14 @@ void TuckerEngine::updateSprite_locationNum28_2(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum28() { if (_flagsTable[86] == 0 && _xPosCurrent > 265 && _nextAction == 0) { - _panelLockedFlag = 0; + _panelLockedFlag = false; _nextAction = 21; - _csDataLoaded = 0; + _csDataLoaded = false; _pendingActionDelay = 0; _pendingActionIndex = 0; _currentActionVerb = 0; @@ -1762,21 +1762,21 @@ void TuckerEngine::execData3PostUpdate_locationNum28() { } void TuckerEngine::updateSprite_locationNum29_0(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? -1 : 2; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? -1 : 2; } void TuckerEngine::updateSprite_locationNum29_1(int i) { int state = -1; if (getRandomNumber() >= 32000) { state = 1; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._gfxBackgroundOffset = 320; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum29_2(int i) { - _spritesTable[i].state = 3; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 3; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum29() { @@ -1797,22 +1797,22 @@ void TuckerEngine::execData3PreUpdate_locationNum29() { } _system->getPaletteManager()->setPalette(scrollPal, 118, 5); if (_flagsTable[143] == 1) { - _locationObjectsTable[2].xPos = 999; - _locationObjectsTable[3].xPos = 187; + _locationObjectsTable[2]._xPos = 999; + _locationObjectsTable[3]._xPos = 187; } else { - _locationObjectsTable[2].xPos = 187; - _locationObjectsTable[3].xPos = 999; + _locationObjectsTable[2]._xPos = 187; + _locationObjectsTable[3]._xPos = 999; } } } void TuckerEngine::updateSprite_locationNum30_34(int i) { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } void TuckerEngine::execData3PreUpdate_locationNum30() { if (!isSoundPlaying(1) && getRandomNumber() > 32500) { - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } @@ -1829,7 +1829,7 @@ void TuckerEngine::execData3PreUpdate_locationNum31() { } void TuckerEngine::execData3PreUpdate_locationNum32() { - if (_spritesTable[0].state == 12 && _spritesTable[0].animationFrame < 22) { + if (_spritesTable[0]._state == 12 && _spritesTable[0]._animationFrame < 22) { _flagsTable[113] = 1; } else { _flagsTable[113] = 0; @@ -1843,16 +1843,16 @@ void TuckerEngine::execData3PostUpdate_locationNum32() { } void TuckerEngine::updateSprite_locationNum31_0(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? 3 : 1; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? 3 : 1; } void TuckerEngine::updateSprite_locationNum31_1(int i) { - _spritesTable[i].state = (_flagsTable[86] == 1) ? 2 : -1; + _spritesTable[i]._state = (_flagsTable[86] == 1) ? 2 : -1; } void TuckerEngine::updateSprite_locationNum32_0(int i) { static const uint8 stateTable[] = { 12, 1, 11, 1, 11, 2, 1, 5, 5, 11, 1, 5, 5, 5 }; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_flagsTable[123] == 2) { _flagsTable[123] = 0; } @@ -1862,42 +1862,42 @@ void TuckerEngine::updateSprite_locationNum32_0(int i) { _flagsTable[222] = 2; } else if (_flagsTable[222] == 2) { state = 19; - _spritesTable[i].animationFrame = 23; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = 23; + _updateSpriteFlag1 = true; } else if (_flagsTable[123] == 1) { state = 17; _flagsTable[123] = 2; } else if (_flagsTable[222] == 3) { state = 18; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else if (_csDataHandled) { state = 5; } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 13) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 13) { + _spritesTable[i]._counter = 0; } - state = stateTable[_spritesTable[i].counter]; + state = stateTable[_spritesTable[i]._counter]; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_0(int i) { int state = 5; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 7; } else if (_flagsTable[87] == 1) { state = 8; } else if (_flagsTable[222] == 5) { state = 4; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() < 30000) ? 5 : 6; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_1(int i) { @@ -1909,7 +1909,7 @@ void TuckerEngine::updateSprite_locationNum33_1(int i) { } else { state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_2(int i) { @@ -1921,37 +1921,37 @@ void TuckerEngine::updateSprite_locationNum33_2(int i) { } else { state = 9; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum33() { if (_xPosCurrent < 90) { if (_flagsTable[105] == 0) { _flagsTable[105] = 3; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } else { if (_flagsTable[105] == 1) { _flagsTable[105] = 2; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } if (_xPosCurrent > 230) { if (_flagsTable[106] == 0) { _flagsTable[106] = 3; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } else { if (_flagsTable[106] == 1) { _flagsTable[106] = 2; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } } void TuckerEngine::execData3PreUpdate_locationNum34() { if (_flagsTable[143] == 1) { - _locationObjectsTable[0].xPos = 0; + _locationObjectsTable[0]._xPos = 0; } } @@ -1962,7 +1962,7 @@ void TuckerEngine::execData3PreUpdate_locationNum35() { } void TuckerEngine::updateSprite_locationNum36(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? 1 : 2; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? 1 : 2; } void TuckerEngine::execData3PreUpdate_locationNum36() { @@ -1978,12 +1978,12 @@ void TuckerEngine::execData3PreUpdate_locationNum36() { void TuckerEngine::updateSprite_locationNum37(int i) { int j = i + 1; int offset = 200 - i * 45; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > offset) { - _spritesTable[i].state = j; - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > offset) { + _spritesTable[i]._state = j; + _spritesTable[i]._counter = 0; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -2001,16 +2001,16 @@ void TuckerEngine::updateSprite_locationNum41(int i) { state = 1; _flagsTable[158] = 2; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 3; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 4; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum41() { @@ -2020,10 +2020,10 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } else if (_backgroundSpriteCurrentFrame == 7) { _flagsTable[77] = 0; } - if (_changeBackgroundSprite == 0) { + if (!_changeBackgroundSprite) { if (_backgroundSpriteCurrentFrame == 16 && !isSoundPlaying(4)) { - _locationSoundsTable[4].type = 2; - startSound(_locationSoundsTable[4].offset, 4, _locationSoundsTable[4].volume); + _locationSoundsTable[4]._type = 2; + startSound(_locationSoundsTable[4]._offset, 4, _locationSoundsTable[4]._volume); } else { if (_backgroundSpriteCurrentFrame == 28) { stopSound(4); @@ -2031,8 +2031,8 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } else { if (_backgroundSpriteCurrentFrame == 28 && !isSoundPlaying(4)) { - _locationSoundsTable[4].type = 2; - startSound(_locationSoundsTable[4].offset, 4, _locationSoundsTable[4].volume); + _locationSoundsTable[4]._type = 2; + startSound(_locationSoundsTable[4]._offset, 4, _locationSoundsTable[4]._volume); } else { if (_backgroundSpriteCurrentFrame == 18) { stopSound(4); @@ -2040,11 +2040,11 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } } - if (_panelLockedFlag == 1 && _yPosCurrent > 130 && _selectedObject.yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) { - _panelLockedFlag = 0; + if (_panelLockedFlag && _yPosCurrent > 130 && _selectedObject._yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) { + _panelLockedFlag = false; _csDataLoaded = false; _nextLocationNum = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; _locationMaskType = 0; _nextAction = _flagsTable[163] + 32; ++_flagsTable[163]; @@ -2057,9 +2057,9 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } if (_flagsTable[77] == 0) { - _locationObjectsTable[3].xPos = 230; + _locationObjectsTable[3]._xPos = 230; } else { - _locationObjectsTable[3].xPos = 930; + _locationObjectsTable[3]._xPos = 930; } } } @@ -2076,13 +2076,13 @@ void TuckerEngine::updateSprite_locationNum42(int i) { _flagsTable[223] = 3; } else if (_flagsTable[223] == 3) { state = 5; - _spritesTable[i].updateDelay = 5; - _spritesTable[i].state = _spritesTable[i].firstFrame - 1; // FIXME: bug, fxNum ? - _updateSpriteFlag1 = 1; + _spritesTable[i]._updateDelay = 5; + _spritesTable[i]._state = _spritesTable[i]._firstFrame - 1; // FIXME: bug, fxNum ? + _updateSpriteFlag1 = true; } else { state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum42() { @@ -2094,18 +2094,18 @@ void TuckerEngine::updateSprite_locationNum43_2(int i) { if (_flagsTable[237] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; - } else if (_csDataHandled || _spritesTable[i].counter == 2) { - _spritesTable[i].needUpdate = 0; + } else if (_csDataHandled || _spritesTable[i]._counter == 2) { + _spritesTable[i]._needUpdate = false; state = 6; - } else if (_spritesTable[i].counter == 0) { + } else if (_spritesTable[i]._counter == 0) { state = 3; } else { state = 4; - _spritesTable[i].counter = 2; + _spritesTable[i]._counter = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_3(int i) { @@ -2114,12 +2114,12 @@ void TuckerEngine::updateSprite_locationNum43_3(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 7; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 8; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_4(int i) { @@ -2128,38 +2128,38 @@ void TuckerEngine::updateSprite_locationNum43_4(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 10; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_5(int i) { - _spritesTable[i].state = (_flagsTable[236] < 4) ? -1 : 11; + _spritesTable[i]._state = (_flagsTable[236] < 4) ? -1 : 11; } void TuckerEngine::updateSprite_locationNum43_6(int i) { - _spritesTable[i].state = (_flagsTable[236] < 4) ? -1 : 12; + _spritesTable[i]._state = (_flagsTable[236] < 4) ? -1 : 12; } void TuckerEngine::execData3PreUpdate_locationNum43() { - if (_panelLockedFlag == 1 && _xPosCurrent > 67 && _selectedObject.xPos > 68 && _locationMaskType == 0) { - _panelLockedFlag = 0; - _csDataLoaded = 0; + if (_panelLockedFlag && _xPosCurrent > 67 && _selectedObject._xPos > 68 && _locationMaskType == 0) { + _panelLockedFlag = false; + _csDataLoaded = false; _nextAction = 5; } - if (_xPosCurrent > 55 && _spritesTable[2].counter == 0) { - _spritesTable[2].counter = 1; + if (_xPosCurrent > 55 && _spritesTable[2]._counter == 0) { + _spritesTable[2]._counter = 1; } } void TuckerEngine::execData3PreUpdate_locationNum44() { if (_backgroundSpriteCurrentAnimation == 1) { if (!isSoundPlaying(3) && _backgroundSpriteCurrentFrame == 1) { - _locationSoundsTable[3].type = 2; - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + _locationSoundsTable[3]._type = 2; + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } if (_backgroundSpriteCurrentFrame == 21) { _flagsTable[77] = 1; @@ -2169,7 +2169,7 @@ void TuckerEngine::execData3PreUpdate_locationNum44() { } } else if (_backgroundSpriteCurrentAnimation == 4) { if (_backgroundSpriteCurrentFrame == 20 && !isSoundPlaying(3)) { - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } } } @@ -2182,14 +2182,14 @@ void TuckerEngine::updateSprite_locationNum48(int i) { _flagsTable[160] = 3; state = 3; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum49(int i) { @@ -2211,20 +2211,20 @@ void TuckerEngine::updateSprite_locationNum49(int i) { _flagsTable[185] = 0; state = 4; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (getRandomNumber() < 30000 || _backgroundSpriteCurrentAnimation <= -1) { state = 3; - _spritesTable[i].updateDelay = 1; + _spritesTable[i]._updateDelay = 1; } else if (getRandomNumber() < 16000) { state = 5; } else { state = 6; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum49() { @@ -2272,38 +2272,38 @@ void TuckerEngine::updateSprite_locationNum50(int i) { _flagsTable[240] = 1; } } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = i + 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum51(int i) { if (i == 2) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; } else if (i == 0) { static const int stateTable[] = { 3, 3, 4, 5, 3, 3, 5, 4, 3, 3, 4, 5, 4, 4 }; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 13) { - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 13) { + _spritesTable[i]._counter = 0; } - _spritesTable[i].state = stateTable[_spritesTable[i].counter]; + _spritesTable[i]._state = stateTable[_spritesTable[i]._counter]; } else { i = 1; - _spritesTable[i].state = 6; + _spritesTable[i]._state = 6; } - _spritesTable[i].colorType = 1; - _spritesTable[i].yMaxBackground = 0; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._yMaxBackground = 0; } void TuckerEngine::execData3PreUpdate_locationNum52() { - if (_selectedObject.xPos > 108 && _panelLockedFlag > 0 && _nextAction == 0 && _locationMaskType == 0) { + if (_selectedObject._xPos > 108 && _panelLockedFlag && _nextAction == 0 && _locationMaskType == 0) { _nextAction = 1; - _csDataLoaded = 0; + _csDataLoaded = false; } } @@ -2313,21 +2313,21 @@ void TuckerEngine::updateSprite_locationNum53_0(int i) { } int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else if (_flagsTable[197] == 1) { state = 3; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[197] = 2; } else if (_flagsTable[192] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum53_1(int i) { @@ -2339,14 +2339,14 @@ void TuckerEngine::updateSprite_locationNum53_1(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum53() { if (_flagsTable[192] == 0 && _xPosCurrent < 200 && _nextAction == 0) { - _panelLockedFlag = 0; + _panelLockedFlag = false; _nextAction = 14; - _csDataLoaded = 0; + _csDataLoaded = false; _pendingActionDelay = 0; _pendingActionIndex = 0; _currentActionVerb = 0; @@ -2354,55 +2354,52 @@ void TuckerEngine::execData3PreUpdate_locationNum53() { } void TuckerEngine::updateSprite_locationNum54(int i) { - int state = 3; if (_flagsTable[141] == 2) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; setCharacterAnimation(0, i); _flagsTable[141] = 1; - _spritesTable[i].counter = 0; - } else if (_flagsTable[141] == 1 && _spritesTable[i].counter < 40) { + _spritesTable[i]._counter = 0; + } else if (_flagsTable[141] == 1 && _spritesTable[i]._counter < 40) { setCharacterAnimation(1, i); - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; } else if (_flagsTable[141] == 1) { setCharacterAnimation(2, i); _flagsTable[141] = 3; } else { + int state = 3; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 2; + _spritesTable[i]._needUpdate = true; state = (getRandomNumber() < 12000) ? 2 : 4; } else if (_flagsTable[141] == 3) { - state = 3; _flagsTable[141] = 0; _flagsTable[224] = 1; - _spritesTable[i].counter = 0; - if (_panelLockedFlag == 0 && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) { + _spritesTable[i]._counter = 0; + if (!_panelLockedFlag && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) { _nextAction = 18; _csDataLoaded = false; } } else if (getRandomNumber() < 26000) { - state = 3; - _spritesTable[i].needUpdate = 0; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._needUpdate = false; + _spritesTable[i]._updateDelay = 5; } else { - state = 3; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } if (_inventoryItemsState[17] == 1) { _flagsTable[224] = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } } void TuckerEngine::updateSprite_locationNum55(int i) { if (_flagsTable[193] > 0 && _flagsTable[193] < 14) { setCharacterAnimation(_flagsTable[193] - 1, i); - _updateSpriteFlag1 = 1; + _updateSpriteFlag1 = true; if (_flagsTable[193] == 1 || _flagsTable[193] == 3 || _flagsTable[193] == 5 || _flagsTable[193] == 7 || _flagsTable[193] == 11 || _flagsTable[193] == 13) { ++_flagsTable[193]; } } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; if (_flagsTable[193] == 14) { _flagsTable[193] = 15; } @@ -2411,26 +2408,26 @@ void TuckerEngine::updateSprite_locationNum55(int i) { void TuckerEngine::updateSprite_locationNum56(int i) { int state; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_flagsTable[153] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum57_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (getRandomNumber() < 30000) { state = 1; } else if (getRandomNumber() < 16000) { @@ -2439,15 +2436,15 @@ void TuckerEngine::updateSprite_locationNum57_0(int i) { state = 2; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum57_1(int i) { int state = 6; if (getRandomNumber() < 30000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum57() { @@ -2472,20 +2469,20 @@ void TuckerEngine::updateSprite_locationNum58(int i) { _flagsTable[190] = 3; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum58() { // workaround original game glitch #2872348: do not change position on location change if (_nextLocationNum == 0 && _flagsTable[190] < 3 && _xPosCurrent > 310) { _xPosCurrent = 310; - _panelLockedFlag = 0; + _panelLockedFlag = false; } - if (_flagsTable[190] > 0 && _locationSoundsTable[0].volume > 0) { - _locationSoundsTable[0].volume = 0; - _locationSoundsTable[4].volume = 0; - _locationSoundsTable[5].volume = 0; + if (_flagsTable[190] > 0 && _locationSoundsTable[0]._volume > 0) { + _locationSoundsTable[0]._volume = 0; + _locationSoundsTable[4]._volume = 0; + _locationSoundsTable[5]._volume = 0; if (isSoundPlaying(0)) { stopSound(0); } @@ -2498,27 +2495,27 @@ void TuckerEngine::updateSprite_locationNum59(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 3; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_csDataHandled) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(0, 0); return; } - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (_flagsTable[199] == 1) { _flagsTable[199] = 0; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; setCharacterAnimation(1, 0); return; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum60_0(int i) { @@ -2526,34 +2523,34 @@ void TuckerEngine::updateSprite_locationNum60_0(int i) { if (_flagsTable[186] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 9; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() > 32000) ? 8 : 7; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum60_1(int i) { int state; if (_flagsTable[186] == 1) { _flagsTable[186] = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; } else if (_flagsTable[186] == 2) { state = 6; _flagsTable[187] = 1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() > 32000) ? 5 : 4; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PostUpdate_locationNum60() { @@ -2569,19 +2566,19 @@ void TuckerEngine::updateSprite_locationNum61_0(int i) { } else if (_flagsTable[88] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - if (_spritesTable[i].needUpdate == 0) { - _spritesTable[i].needUpdate = 1; + if (!_spritesTable[i]._needUpdate) { + _spritesTable[i]._needUpdate = true; state = 2; } else { state = 2; - _spritesTable[0].animationFrame = 2; - _updateSpriteFlag1 = 1; + _spritesTable[0]._animationFrame = 2; + _updateSpriteFlag1 = true; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r < 30000) { state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (r < 31000) { state = 7; } else if (r < 32000) { @@ -2590,7 +2587,7 @@ void TuckerEngine::updateSprite_locationNum61_0(int i) { state = 6; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum61_1(int i) { @@ -2598,19 +2595,19 @@ void TuckerEngine::updateSprite_locationNum61_1(int i) { if (_flagsTable[151] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 14; } else if (_csDataHandled || getRandomNumber() < 29000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 12; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (getRandomNumber() < 20000) { state = 12; } else { state = 13; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum61_2(int i) { @@ -2651,8 +2648,8 @@ void TuckerEngine::updateSprite_locationNum61_2(int i) { if (_flagsTable[136] != 2) { _flagsTable[150] = 0; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum61() { @@ -2676,13 +2673,13 @@ void TuckerEngine::updateSprite_locationNum63_0(int i) { } else if (_flagsTable[132] != 2 || _flagsTable[133] != 1 || _flagsTable[136] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_1(int i) { @@ -2694,16 +2691,16 @@ void TuckerEngine::updateSprite_locationNum63_1(int i) { state = 8; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_2(int i) { - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; int state = -1; if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] <= 0) { if (_flagsTable[226] == 0) { state = 9; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (_flagsTable[226] == 1) { state = 9; _flagsTable[226] = 2; @@ -2714,16 +2711,16 @@ void TuckerEngine::updateSprite_locationNum63_2(int i) { state = 10; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_3(int i) { - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; int state = -1; if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] <= 0) { - if (_spritesTable[i].counter > 80) { + if (_spritesTable[i]._counter > 80) { state = 7; - _spritesTable[i].counter = 0; + _spritesTable[i]._counter = 0; } else if (getRandomNumber() > 32000) { state = 2; } else if (getRandomNumber() > 32000) { @@ -2732,7 +2729,7 @@ void TuckerEngine::updateSprite_locationNum63_3(int i) { state = 8; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_4(int i) { @@ -2740,7 +2737,7 @@ void TuckerEngine::updateSprite_locationNum63_4(int i) { if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] == 0) { state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum63() { @@ -2764,8 +2761,8 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } else { if (_flagsTable[132] == 0 || (_flagsTable[132] == 2 && _flagsTable[136] > 0)) { if (!isSoundPlaying(1)) { - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } else { if (isSoundPlaying(1)) { @@ -2774,8 +2771,8 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } if (_flagsTable[132] == 1) { if (!isSoundPlaying(0)) { - _locationSoundsTable[0].type = 2; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + _locationSoundsTable[0]._type = 2; + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } else { if (isSoundPlaying(0)) { @@ -2784,7 +2781,7 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } if (_flagsTable[132] == 2 && _flagsTable[136] == 0) { if (!isSoundPlaying(2)) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } else { if (isSoundPlaying(2)) { @@ -2807,7 +2804,7 @@ void TuckerEngine::updateSprite_locationNum65(int i) { if (_flagsTable[188] == 1) { _flagsTable[188] = 2; state = 1; - _spritesTable[i].gfxBackgroundOffset = 100; + _spritesTable[i]._gfxBackgroundOffset = 100; } else if (_flagsTable[188] > 0 && _flagsTable[189] > 0) { state = -1; if (_xPosCurrent < 150 || _yPosCurrent > 240) { @@ -2826,7 +2823,7 @@ void TuckerEngine::updateSprite_locationNum65(int i) { _flagsTable[189] = 0; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum65() { @@ -2836,66 +2833,66 @@ void TuckerEngine::execData3PreUpdate_locationNum65() { void TuckerEngine::updateSprite_locationNum66_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum66_1(int i) { int state; if (_flagsTable[191] == 0 && _xPosCurrent > 568) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { state = 10; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 9; } else if (getRandomNumber() > 30000) { state = 6; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum66_2(int i) { - _spritesTable[i].disabled = 1; - _spritesTable[i].state = 3; + _spritesTable[i]._disabled = true; + _spritesTable[i]._state = 3; } void TuckerEngine::updateSprite_locationNum66_3(int i) { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } void TuckerEngine::updateSprite_locationNum66_4(int i) { - _spritesTable[i].state = 5; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 5; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum66() { // FIXME: shouldn't be executed after using the map _flagsTable[137] = 0; if (_xPosCurrent > 583 && _flagsTable[191] == 0 && _nextAction == 0 && _locationMaskType == 0) { - _panelLockedFlag = 0; - _csDataLoaded = 0; + _panelLockedFlag = false; + _csDataLoaded = false; _nextLocationNum = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; if (_flagsTable[131] == 0) { _nextAction = 13; } else if (_flagsTable[130] == 0) { @@ -2907,25 +2904,25 @@ void TuckerEngine::execData3PreUpdate_locationNum66() { } void TuckerEngine::execData3PostUpdate_locationNum66() { - if (_spritesTable[2].flipX == 1) { + if (_spritesTable[2]._flipX) { --_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] < -50) { - _spritesTable[2].flipX = 0; + _spritesTable[2]._flipX = false; _updateLocationXPosTable2[0] = -50; } } else { ++_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] > 500) { - _spritesTable[2].flipX = 1; + _spritesTable[2]._flipX = true; _updateLocationXPosTable2[0] = 500; } } - _spritesTable[2].gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; + _spritesTable[2]._gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; const int spr = 2; - _spritesTable[spr].colorType = 1; - _spritesTable[spr].yMaxBackground = 0; + _spritesTable[spr]._colorType = 1; + _spritesTable[spr]._yMaxBackground = 0; drawSprite(spr); - _spritesTable[spr].colorType = 0; + _spritesTable[spr]._colorType = 0; } void TuckerEngine::updateSprite_locationNum69_1(int i) { @@ -2939,10 +2936,10 @@ void TuckerEngine::updateSprite_locationNum69_1(int i) { } else if (_flagsTable[236] == 4) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 14; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else if (_flagsTable[236] == 5) { state = 7; @@ -2950,7 +2947,7 @@ void TuckerEngine::updateSprite_locationNum69_1(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum69_2(int i) { @@ -2966,10 +2963,10 @@ void TuckerEngine::updateSprite_locationNum69_2(int i) { } else if (_flagsTable[237] == 4 || _flagsTable[237] == 2 || _flagsTable[237] == 3 || _flagsTable[237] == 7) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 10; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 12; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else if (_flagsTable[237] == 5) { state = 16; @@ -2983,7 +2980,7 @@ void TuckerEngine::updateSprite_locationNum69_2(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum69_3(int i) { @@ -2997,21 +2994,21 @@ void TuckerEngine::updateSprite_locationNum69_3(int i) { _flagsTable[238] = 1; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 11; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 13; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum70() { const uint8 color = 103; if (_execData3Counter == 0) { - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); _execData3Counter = 1; _flagsTable[143] = 0; _updateLocation70StringLen = 0; @@ -3041,7 +3038,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { if (_lastKeyPressed == Common::KEYCODE_BACKSPACE || _lastKeyPressed == Common::KEYCODE_DELETE) { if (_updateLocation70StringLen > 0) { --_updateLocation70StringLen; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } else if (_lastKeyPressed == Common::KEYCODE_RETURN) { _flagsTable[143] = 1; @@ -3052,7 +3049,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { _flagsTable[143] = 2; } const int num = (_flagsTable[143] == 1) ? 4 : 5; - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } else if (_updateLocation70StringLen < 19) { uint8 chr = 0; switch (_lastKeyPressed) { @@ -3089,7 +3086,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { } break; } - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); if (chr > 0) { _updateLocation70String[_updateLocation70StringLen] = chr; ++_updateLocation70StringLen; @@ -3104,17 +3101,17 @@ void TuckerEngine::updateSprite_locationNum71(int i) { if (_flagsTable[155] != 6 || _flagsTable[207] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum72(int i) { @@ -3122,13 +3119,13 @@ void TuckerEngine::updateSprite_locationNum72(int i) { if (_flagsTable[155] == 7 || _flagsTable[207] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum74(int i) { @@ -3138,12 +3135,12 @@ void TuckerEngine::updateSprite_locationNum74(int i) { if (_updateLocationFlag == 0) { _updateLocationFlag = 1; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; } } - _spritesTable[i].state = stateTable[num] + i; + _spritesTable[i]._state = stateTable[num] + i; } void TuckerEngine::updateSprite_locationNum79(int i) { @@ -3153,43 +3150,43 @@ void TuckerEngine::updateSprite_locationNum79(int i) { _flagsTable[227] = 1; } else if (_flagsTable[227] == 1 && _charSpeechSoundCounter > 0) { state = 2; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_flagsTable[227] == 2) { state = 3; _flagsTable[227] = 3; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 3; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum81_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 3; _flagsTable[288] = 1; } else if (_flagsTable[288] < 2) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; if (_flagsTable[288] == 1) { _flagsTable[288] = 2; } } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum81_1(int i) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; } void TuckerEngine::updateSprite_locationNum82(int i) { @@ -3197,20 +3194,20 @@ void TuckerEngine::updateSprite_locationNum82(int i) { if (_charSpeechSoundCounter > 0) { state = 1; _flagsTable[229] = 1; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_flagsTable[229] == 0) { state = 1; } else if (_flagsTable[229] == 1) { state = 2; _flagsTable[229] = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } } // namespace Tucker diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 48ddefe455..dfb5c9ba21 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -279,7 +279,7 @@ Audio::RewindableAudioStream *CompressedSound::load(CompressedSoundType type, in void TuckerEngine::loadImage(const char *fname, uint8 *dst, int type) { char filename[80]; - strcpy(filename, fname); + Common::strlcpy(filename, fname, sizeof(filename)); Common::File f; if (!f.open(filename)) { @@ -351,11 +351,11 @@ void TuckerEngine::loadCharset2() { } void TuckerEngine::loadCharsetHelper() { - const int charW = Graphics::_charset.charW; - const int charH = Graphics::_charset.charH; + const int charW = Graphics::_charset._charW; + const int charH = Graphics::_charset._charH; int offset = 0; - for (int y = 0; y < Graphics::_charset.yCount; ++y) { - for (int x = 0; x < Graphics::_charset.xCount; ++x) { + for (int y = 0; y < Graphics::_charset._yCount; ++y) { + for (int x = 0; x < Graphics::_charset._xCount; ++x) { offset += Graphics::encodeRAW(_loadTempBuf + (y * 320) * charH + x * charW, _charsetGfxBuf + offset, charW, charH); } } @@ -408,8 +408,8 @@ void TuckerEngine::loadBudSpr(int startOffset) { loadImage(filename.c_str(), _loadTempBuf, 0); ++frame; } - int sz = Graphics::encodeRLE(_loadTempBuf + _spriteFramesTable[i].sourceOffset, _spritesGfxBuf + spriteOffset, _spriteFramesTable[i].xSize, _spriteFramesTable[i].ySize); - _spriteFramesTable[i].sourceOffset = spriteOffset; + int sz = Graphics::encodeRLE(_loadTempBuf + _spriteFramesTable[i]._sourceOffset, _spritesGfxBuf + spriteOffset, _spriteFramesTable[i]._xSize, _spriteFramesTable[i]._ySize); + _spriteFramesTable[i]._sourceOffset = spriteOffset; spriteOffset += sz; } } @@ -431,16 +431,16 @@ int TuckerEngine::loadCTable01(int index, int firstSpriteNum, int *framesCount) } const int y = t.getNextInteger(); SpriteFrame *c = &_spriteFramesTable[lastSpriteNum++]; - c->sourceOffset = y * 320 + x; - c->xSize = t.getNextInteger(); - c->ySize = t.getNextInteger(); - c->xOffset = t.getNextInteger(); - if (c->xOffset > 300) { - c->xOffset -= 500; + c->_sourceOffset = y * 320 + x; + c->_xSize = t.getNextInteger(); + c->_ySize = t.getNextInteger(); + c->_xOffset = t.getNextInteger(); + if (c->_xOffset > 300) { + c->_xOffset -= 500; } - c->yOffset = t.getNextInteger(); - if (c->yOffset > 300) { - c->yOffset -= 500; + c->_yOffset = t.getNextInteger(); + if (c->_yOffset > 300) { + c->_yOffset -= 500; } } } @@ -455,17 +455,17 @@ void TuckerEngine::loadCTable02(int fl) { loadFile("ctable02.c", _loadTempBuf); DataTokenizer t(_loadTempBuf, _fileLoadSize); while (t.findNextToken(kDataTokenDw)) { - _spriteAnimationsTable[entry].numParts = t.getNextInteger(); - if (_spriteAnimationsTable[entry].numParts < 1) { + _spriteAnimationsTable[entry]._numParts = t.getNextInteger(); + if (_spriteAnimationsTable[entry]._numParts < 1) { return; } - _spriteAnimationsTable[entry].rotateFlag = t.getNextInteger(); + _spriteAnimationsTable[entry]._rotateFlag = t.getNextInteger(); int num = t.getNextInteger(); if (num != fl) { continue; } int start = 0; - _spriteAnimationsTable[entry].firstFrameIndex = i; + _spriteAnimationsTable[entry]._firstFrameIndex = i; while (start != 999) { start = t.getNextInteger(); if (start == 9999) { // end marker in the demo version @@ -571,12 +571,12 @@ void TuckerEngine::loadData() { const int x = t.getNextInteger(); const int y = t.getNextInteger(); Data *d = &_dataTable[_dataCount]; - d->sourceOffset = y * 320 + x; - d->xSize = t.getNextInteger(); - d->ySize = t.getNextInteger(); - d->xDest = t.getNextInteger(); - d->yDest = t.getNextInteger(); - d->index = count; + d->_sourceOffset = y * 320 + x; + d->_xSize = t.getNextInteger(); + d->_ySize = t.getNextInteger(); + d->_xDest = t.getNextInteger(); + d->_yDest = t.getNextInteger(); + d->_index = count; } ++objNum; ++count; @@ -592,9 +592,9 @@ void TuckerEngine::loadData() { int TuckerEngine::loadDataHelper(int offset, int index) { for (int i = 0; i < _dataCount + 1; ++i) { - if (_dataTable[i].index == index) { - int sz = Graphics::encodeRLE(_loadTempBuf + _dataTable[i].sourceOffset, _data3GfxBuf + offset, _dataTable[i].xSize, _dataTable[i].ySize); - _dataTable[i].sourceOffset = offset; + if (_dataTable[i]._index == index) { + int sz = Graphics::encodeRLE(_loadTempBuf + _dataTable[i]._sourceOffset, _data3GfxBuf + offset, _dataTable[i]._xSize, _dataTable[i]._ySize); + _dataTable[i]._sourceOffset = offset; offset += sz; } } @@ -626,7 +626,7 @@ void TuckerEngine::loadData3() { } assert(_locationAnimationsCount < kLocationAnimationsTableSize); LocationAnimation *d = &_locationAnimationsTable[_locationAnimationsCount++]; - d->graphicNum = num; + d->_graphicNum = num; const int seqNum = t.getNextInteger(); if (seqNum > 0) { int anim = 0; @@ -636,22 +636,22 @@ void TuckerEngine::loadData3() { } ++anim; } - d->animCurrentCounter = d->animInitCounter = anim; + d->_animCurrentCounter = d->_animInitCounter = anim; while (_staticData3Table[anim + 1] != 999) { ++anim; } - d->animLastCounter = anim; + d->_animLastCounter = anim; } else { - d->animLastCounter = 0; + d->_animLastCounter = 0; } - d->getFlag = t.getNextInteger(); - d->inventoryNum = t.getNextInteger(); - d->flagNum = t.getNextInteger(); - d->flagValue = t.getNextInteger(); - d->selectable = t.getNextInteger(); - d->standX = t.getNextInteger(); - d->standY = t.getNextInteger(); - d->drawFlag = 0; + d->_getFlag = t.getNextInteger(); + d->_inventoryNum = t.getNextInteger(); + d->_flagNum = t.getNextInteger(); + d->_flagValue = t.getNextInteger(); + d->_selectable = t.getNextInteger(); + d->_standX = t.getNextInteger(); + d->_standY = t.getNextInteger(); + d->_drawFlag = false; } } } @@ -673,22 +673,22 @@ void TuckerEngine::loadData4() { } assert(_locationObjectsCount < kLocationObjectsTableSize); LocationObject *d = &_locationObjectsTable[_locationObjectsCount++]; - d->xPos = i; - d->yPos = t.getNextInteger(); - d->xSize = t.getNextInteger(); - d->ySize = t.getNextInteger(); - d->standX = t.getNextInteger(); - d->standY = t.getNextInteger(); - d->textNum = t.getNextInteger(); - d->cursorNum = t.getNextInteger(); - d->locationNum = t.getNextInteger(); - if (d->locationNum > 0) { - d->toX = t.getNextInteger(); - d->toY = t.getNextInteger(); - d->toX2 = t.getNextInteger(); - d->toY2 = t.getNextInteger(); - d->toWalkX2 = t.getNextInteger(); - d->toWalkY2 = t.getNextInteger(); + d->_xPos = i; + d->_yPos = t.getNextInteger(); + d->_xSize = t.getNextInteger(); + d->_ySize = t.getNextInteger(); + d->_standX = t.getNextInteger(); + d->_standY = t.getNextInteger(); + d->_textNum = t.getNextInteger(); + d->_cursorNum = t.getNextInteger(); + d->_locationNum = t.getNextInteger(); + if (d->_locationNum > 0) { + d->_toX = t.getNextInteger(); + d->_toY = t.getNextInteger(); + d->_toX2 = t.getNextInteger(); + d->_toY2 = t.getNextInteger(); + d->_toWalkX2 = t.getNextInteger(); + d->_toWalkY2 = t.getNextInteger(); } } } @@ -726,20 +726,20 @@ void TuckerEngine::loadActionFile() { int keyD = t.getNextInteger(); int keyE = t.getNextInteger(); Action *action = &_actionsTable[_actionsCount++]; - action->key = keyE * 1000000 + keyD * 100000 + keyA * 10000 + keyB * 1000 + keyC; - action->testFlag1Num = t.getNextInteger(); - action->testFlag1Value = t.getNextInteger(); - action->testFlag2Num = t.getNextInteger(); - action->testFlag2Value = t.getNextInteger(); - action->speech = t.getNextInteger(); - action->flipX = t.getNextInteger(); - action->index = t.getNextInteger(); - action->delay = t.getNextInteger(); - action->setFlagNum = t.getNextInteger(); - assert(action->setFlagNum >= 0 && action->setFlagNum < kFlagsTableSize); - action->setFlagValue = t.getNextInteger(); - action->fxNum = t.getNextInteger(); - action->fxDelay = t.getNextInteger(); + action->_key = keyE * 1000000 + keyD * 100000 + keyA * 10000 + keyB * 1000 + keyC; + action->_testFlag1Num = t.getNextInteger(); + action->_testFlag1Value = t.getNextInteger(); + action->_testFlag2Num = t.getNextInteger(); + action->_testFlag2Value = t.getNextInteger(); + action->_speech = t.getNextInteger(); + action->_flipX = t.getNextInteger(); + action->_index = t.getNextInteger(); + action->_delay = t.getNextInteger(); + action->_setFlagNum = t.getNextInteger(); + assert(action->_setFlagNum >= 0 && action->_setFlagNum < kFlagsTableSize); + action->_setFlagValue = t.getNextInteger(); + action->_fxNum = t.getNextInteger(); + action->_fxDelay = t.getNextInteger(); } } } @@ -756,17 +756,17 @@ void TuckerEngine::loadCharPos() { } assert(_charPosCount < 4); CharPos *charPos = &_charPosTable[_charPosCount++]; - charPos->xPos = i; - charPos->yPos = t.getNextInteger(); - charPos->xSize = t.getNextInteger(); - charPos->ySize = t.getNextInteger(); - charPos->xWalkTo = t.getNextInteger(); - charPos->yWalkTo = t.getNextInteger(); - charPos->flagNum = t.getNextInteger(); - charPos->flagValue = t.getNextInteger(); - charPos->direction = t.getNextInteger(); - charPos->name = t.getNextInteger(); - charPos->description = t.getNextInteger(); + charPos->_xPos = i; + charPos->_yPos = t.getNextInteger(); + charPos->_xSize = t.getNextInteger(); + charPos->_ySize = t.getNextInteger(); + charPos->_xWalkTo = t.getNextInteger(); + charPos->_yWalkTo = t.getNextInteger(); + charPos->_flagNum = t.getNextInteger(); + charPos->_flagValue = t.getNextInteger(); + charPos->_direction = t.getNextInteger(); + charPos->_name = t.getNextInteger(); + charPos->_description = t.getNextInteger(); } int quitLoop = 0; size_t count = 0; @@ -835,8 +835,8 @@ void TuckerEngine::loadSprC02_01() { _spritesCount = _sprC02LookupTable2[_locationNum]; for (int i = 0; i < kMaxCharacters; ++i) { memset(&_spritesTable[i], 0, sizeof(Sprite)); - _spritesTable[i].state = -1; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._state = -1; + _spritesTable[i]._stateIndex = -1; } } @@ -857,35 +857,35 @@ void TuckerEngine::loadFx() { _currentFxSet = 0; for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - s->offset = 0; - s->num = t.getNextInteger(); - s->volume = t.getNextInteger(); - s->type = t.getNextInteger(); - switch (s->type) { + s->_offset = 0; + s->_num = t.getNextInteger(); + s->_volume = t.getNextInteger(); + s->_type = t.getNextInteger(); + switch (s->_type) { case 5: _currentFxSet = 1; _currentFxIndex = i; - _currentFxVolume = s->volume; + _currentFxVolume = s->_volume; _currentFxDist = t.getNextInteger(); _currentFxScale = t.getNextInteger(); break; case 6: case 7: case 8: - s->startFxSpriteState = t.getNextInteger(); - s->startFxSpriteNum = t.getNextInteger(); - s->updateType = t.getNextInteger(); - if (s->type == 7) { - s->flagNum = t.getNextInteger(); - s->flagValueStartFx = t.getNextInteger(); - s->stopFxSpriteState = t.getNextInteger(); - s->stopFxSpriteNum = t.getNextInteger(); - s->flagValueStopFx = t.getNextInteger(); + s->_startFxSpriteState = t.getNextInteger(); + s->_startFxSpriteNum = t.getNextInteger(); + s->_updateType = t.getNextInteger(); + if (s->_type == 7) { + s->_flagNum = t.getNextInteger(); + s->_flagValueStartFx = t.getNextInteger(); + s->_stopFxSpriteState = t.getNextInteger(); + s->_stopFxSpriteNum = t.getNextInteger(); + s->_flagValueStopFx = t.getNextInteger(); } break; } - if (s->type == 8) { - s->type = 6; + if (s->_type == 8) { + s->_type = 6; } } t.findNextToken(kDataTokenDw); @@ -896,10 +896,10 @@ void TuckerEngine::loadFx() { int flagValue = t.getNextInteger(); if (flagValue == _flagsTable[flagNum]) { LocationMusic *m = &_locationMusicsTable[_locationMusicsCount++]; - m->offset = 0; - m->num = t.getNextInteger(); - m->volume = t.getNextInteger(); - m->flag = t.getNextInteger(); + m->_offset = 0; + m->_num = t.getNextInteger(); + m->_volume = t.getNextInteger(); + m->_flag = t.getNextInteger(); } else { for (int j = 0; j < 3; ++j) { t.getNextInteger(); @@ -1005,7 +1005,7 @@ void TuckerEngine::loadActionsTable() { } } } else { - if (_spritesTable[_csDataTableCount - 1].firstFrame - 1 != _spritesTable[_csDataTableCount - 1].animationFrame) { + if (_spritesTable[_csDataTableCount - 1]._firstFrame - 1 != _spritesTable[_csDataTableCount - 1]._animationFrame) { break; } } diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 5f40cbf904..92da2d4d9b 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -64,8 +64,8 @@ void TuckerEngine::saveOrLoadGameStateData(S &s) { saveOrLoadInt(s, _panelObjectsOffsetTable[i]); } saveOrLoadInt(s, _mainSpritesBaseOffset); - saveOrLoadInt(s, _selectedObject.xPos); - saveOrLoadInt(s, _selectedObject.yPos); + saveOrLoadInt(s, _selectedObject._xPos); + saveOrLoadInt(s, _selectedObject._yPos); saveOrLoadInt(s, _locationNum); saveOrLoadInt(s, _xPosCurrent); saveOrLoadInt(s, _yPosCurrent); diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 4b36a13f76..74a2e9a461 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -306,7 +306,7 @@ void TuckerEngine::handleMeanwhileSequence() { void TuckerEngine::handleMapSequence() { loadImage("map2.pcx", _quadBackgroundGfxBuf + 89600, 0); loadImage("map1.pcx", _loadTempBuf, 1); - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; if (_flagsTable[7] > 0) { copyMapRect(0, 0, 140, 86); } @@ -460,10 +460,10 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { } if (_partNum == 3 && _selectedObjectNum == 45) { for (int i = 0; i < 13; ++i) { - const int offset = _dataTable[204 + i].yDest * 640 + _dataTable[204 + i].xDest; + const int offset = _dataTable[204 + i]._yDest * 640 + _dataTable[204 + i]._xDest; static const int itemsTable[] = { 15, 44, 25, 19, 21, 24, 12, 27, 20, 29, 35, 23, 3 }; if (_inventoryItemsState[itemsTable[i]] > 1) { - Graphics::decodeRLE(_locationBackgroundGfxBuf + _scrollOffset + offset, _data3GfxBuf + _dataTable[204 + i].sourceOffset, _dataTable[204 + i].xSize, _dataTable[204 + i].ySize); + Graphics::decodeRLE(_locationBackgroundGfxBuf + _scrollOffset + offset, _data3GfxBuf + _dataTable[204 + i]._sourceOffset, _dataTable[204 + i]._xSize, _dataTable[204 + i]._ySize); } } } @@ -492,6 +492,15 @@ AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer * _updateScreenWidth = 0; _updateScreenPicture = false; _picBufPtr = _pic2BufPtr = 0; + + _changeToNextSequence = false; + _updateFunc = nullptr; + _updateFuncIndex = 0; + _updateScreenCounter = 0; + _updateScreenIndex = -1; + _frameCounter = 0; + _frameTime = 0; + _lastFrameTime = 1; } AnimationSequencePlayer::~AnimationSequencePlayer() { diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 7eb4856050..1d38d0f806 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -43,6 +43,8 @@ namespace Tucker { TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags) : Engine(system), _gameLang(language), _gameFlags(flags), _rnd("tucker") { _console = new TuckerConsole(this); + + resetVariables(); } TuckerEngine::~TuckerEngine() { @@ -119,7 +121,7 @@ void TuckerEngine::freeBuffers() { free(_ptTextBuf); } -void TuckerEngine::restart() { +void TuckerEngine::resetVariables() { _quitGame = false; _fastMode = false; _syncCounter = 0; @@ -131,15 +133,16 @@ void TuckerEngine::restart() { _nextLocationNum = (_gameFlags & kGameFlagDemo) == 0 ? kStartupLocationGame : kStartupLocationDemo; _gamePaused = false; _gameDebug = false; - _displayGameHints = false; _displaySpeechText = (_gameFlags & kGameFlagNoSubtitles) == 0 ? ConfMan.getBool("subtitles") : false; memset(_flagsTable, 0, sizeof(_flagsTable)); _gameHintsIndex = 0; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; _gameHintsStringNum = 0; + _displayGameHints = false; + _displayHintsText = false; + if ((_gameFlags & kGameFlagDemo) == 0) { _locationWidthTable = _locationWidthTableGame; _locationHeightTable = _locationHeightTableGame; @@ -189,7 +192,7 @@ void TuckerEngine::restart() { _switchPanelCounter = 0; _conversationOptionsCount = 0; _fadedPanel = false; - _panelLockedFlag = 0; + _panelLockedFlag = false; _conversationOptionLinesCount = 0; memset(_inventoryItemsState, 0, sizeof(_inventoryItemsState)); memset(_inventoryObjectsList, 0, sizeof(_inventoryObjectsList)); @@ -227,7 +230,7 @@ void TuckerEngine::restart() { _actionVerbLocked = 0; _actionPosX = 0; _actionPosY = 0; - _selectedObjectLocationMask = 0; + _selectedObjectLocationMask = false; memset(&_selectedObject, 0, sizeof(_selectedObject)); _selectedCharacterDirection = 0; _selectedCharacter2Num = 0; @@ -282,15 +285,15 @@ void TuckerEngine::restart() { _characterBackFrontFacing = _characterPrevBackFrontFacing = 0; _characterAnimationNum = 0; _noCharacterAnimationChange = 0; - _changeBackgroundSprite = 0; _characterSpriteAnimationFrameCounter = 0; _locationMaskIgnore = 0; _locationMaskType = 0; _locationMaskCounter = 0; - _updateSpriteFlag1 = 0; - _updateSpriteFlag2 = 0; _handleMapCounter = 0; _noPositionChangeAfterMap = false; + _changeBackgroundSprite = false; + _updateSpriteFlag1 = false; + _updateSpriteFlag2 = false; _mirroredDrawing = 0; _loadLocBufPtr = 0; @@ -326,7 +329,7 @@ void TuckerEngine::restart() { void TuckerEngine::mainLoop() { allocateBuffers(); - restart(); + resetVariables(); loadCharSizeDta(); if ((_gameFlags & kGameFlagDemo) != 0) { @@ -352,7 +355,7 @@ void TuckerEngine::mainLoop() { _flagsTable[219] = 1; _flagsTable[105] = 1; - _spriteAnimationFrameIndex = _spriteAnimationsTable[14].firstFrameIndex; + _spriteAnimationFrameIndex = _spriteAnimationsTable[14]._firstFrameIndex; if (ConfMan.hasKey("save_slot")) { const int slot = ConfMan.getInt("save_slot"); @@ -412,7 +415,7 @@ void TuckerEngine::mainLoop() { } if (_flagsTable[158] == 1) { _flagsTable[158] = 0; - _skipCurrentCharacterDraw = 1; + _skipCurrentCharacterDraw = true; } _mainLoopCounter1 = 0; } @@ -440,7 +443,7 @@ void TuckerEngine::mainLoop() { updateGameHints(); } if (_panelState == 0) { - if (_panelLockedFlag == 1 || _pendingActionDelay > 0) { + if (_panelLockedFlag || _pendingActionDelay > 0) { if (!_fadedPanel) { updateItemsGfxColors(0x60, 0x80); _fadedPanel = true; @@ -450,7 +453,7 @@ void TuckerEngine::mainLoop() { clearItemsGfx(); if (_gamePaused) { drawPausedInfoBar(); - } else if (_gameHintsDisplayText == 1 && _mouseIdleCounter > 1000) { + } else if (_displayHintsText && _mouseIdleCounter > 1000) { drawGameHintString(); } else { drawInfoString(); @@ -466,10 +469,10 @@ void TuckerEngine::mainLoop() { } _currentGfxBackground = _quadBackgroundGfxBuf + (_currentGfxBackgroundCounter / 10) * 44800; if (_fadePaletteCounter < 34 && _locationNum == 22) { - _spritesTable[0].gfxBackgroundOffset = (_currentGfxBackgroundCounter / 10) * 640; + _spritesTable[0]._gfxBackgroundOffset = (_currentGfxBackgroundCounter / 10) * 640; _mainSpritesBaseOffset = _currentGfxBackgroundCounter / 10; if (_locationNum == 22 && _currentGfxBackgroundCounter <= 29) { - _spritesTable[0].gfxBackgroundOffset = 640; + _spritesTable[0]._gfxBackgroundOffset = 640; _mainSpritesBaseOffset = 1; } } @@ -489,11 +492,11 @@ void TuckerEngine::mainLoop() { drawData3(); execData3PreUpdate(); for (int i = 0; i < _spritesCount; ++i) { - if (!_spritesTable[i].disabled) { + if (!_spritesTable[i]._disabled) { drawSprite(i); } } - if (_skipCurrentCharacterDraw != 1) { + if (!_skipCurrentCharacterDraw) { if (_backgroundSpriteCurrentAnimation > -1 && _backgroundSpriteCurrentFrame > 0) { drawBackgroundSprites(); } else { @@ -522,7 +525,7 @@ void TuckerEngine::mainLoop() { --_miscSoundFxDelayCounter[num]; if (_miscSoundFxDelayCounter[num] == 0) { const int index = _miscSoundFxNum[num]; - startSound(_locationSoundsTable[index].offset, index, _locationSoundsTable[index].volume); + startSound(_locationSoundsTable[index]._offset, index, _locationSoundsTable[index]._volume); } } } @@ -565,7 +568,7 @@ void TuckerEngine::mainLoop() { } if (_inputKeys[kInputKeyHelp]) { _inputKeys[kInputKeyHelp] = false; - if (_displayGameHints && _gameHintsDisplayText == 1) { + if (_displayGameHints && _displayHintsText) { _gameHintsStringNum = _gameHintsIndex + 1; _mouseIdleCounter = 1100; } @@ -696,7 +699,7 @@ void TuckerEngine::setupNewLocation() { _backgroundSpriteCurrentAnimation = -1; _backgroundSpriteCurrentFrame = 0; } - if (_panelLockedFlag == 0 || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) { + if (!_panelLockedFlag || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) { _locationMaskType = 0; } else { _locationMaskType = 3; @@ -829,8 +832,8 @@ void TuckerEngine::updateCharPosition() { updateCharPositionHelper(); return; case 1: - if (_locationAnimationsTable[_selectedCharacter2Num].getFlag == 1) { - _speechSoundNum = _speechSoundBaseNum + _locationAnimationsTable[_selectedCharacter2Num].inventoryNum; + if (_locationAnimationsTable[_selectedCharacter2Num]._getFlag == 1) { + _speechSoundNum = _speechSoundBaseNum + _locationAnimationsTable[_selectedCharacter2Num]._inventoryNum; _characterSpeechDataPtr = _ptTextBuf; updateCharPositionHelper(); return; @@ -842,8 +845,8 @@ void TuckerEngine::updateCharPosition() { break; case 2: _characterSpeechDataPtr = _ptTextBuf; - _speechSoundNum = 2175 + _charPosTable[_selectedCharacterNum].description; - if (_charPosTable[_selectedCharacterNum].description != 0) { + _speechSoundNum = 2175 + _charPosTable[_selectedCharacterNum]._description; + if (_charPosTable[_selectedCharacterNum]._description != 0) { updateCharPositionHelper(); return; } @@ -856,27 +859,27 @@ void TuckerEngine::updateCharPosition() { Action *action = 0; for (int i = 0; i < _actionsCount && skip == 0; ++i) { action = &_actionsTable[i]; - if (action->key == actionKey) { + if (action->_key == actionKey) { skip = 1; - if (action->testFlag1Num != 0) { - if (action->testFlag1Num < 500) { - if (_flagsTable[action->testFlag1Num] != action->testFlag1Value) { + if (action->_testFlag1Num != 0) { + if (action->_testFlag1Num < 500) { + if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value) { skip = 0; } - } else if (_inventoryItemsState[action->testFlag1Num - 500] != action->testFlag1Value) { + } else if (_inventoryItemsState[action->_testFlag1Num - 500] != action->_testFlag1Value) { skip = 0; } - debug(3, "updateCharPosition() flag1 %d value %d", action->testFlag1Num, action->testFlag1Value); + debug(3, "updateCharPosition() flag1 %d value %d", action->_testFlag1Num, action->_testFlag1Value); } - if (action->testFlag2Num != 0) { - if (action->testFlag2Num < 500) { - if (_flagsTable[action->testFlag2Num] != action->testFlag2Value) { + if (action->_testFlag2Num != 0) { + if (action->_testFlag2Num < 500) { + if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value) { skip = 0; } - } else if (_inventoryItemsState[action->testFlag2Num - 500] != action->testFlag2Value) { + } else if (_inventoryItemsState[action->_testFlag2Num - 500] != action->_testFlag2Value) { skip = 0; } - debug(3, "updateCharPosition() flag2 %d value %d", action->testFlag2Num, action->testFlag2Value); + debug(3, "updateCharPosition() flag2 %d value %d", action->_testFlag2Num, action->_testFlag2Value); } } } @@ -886,25 +889,25 @@ void TuckerEngine::updateCharPosition() { return; } assert(action); - if (action->speech != 6) { - if (action->speech < 100) { - _spriteAnimationFrameIndex = _spriteAnimationsTable[action->speech].firstFrameIndex; - _currentSpriteAnimationLength = _spriteAnimationsTable[action->speech].numParts; - _mirroredDrawing = action->flipX; + if (action->_speech != 6) { + if (action->_speech < 100) { + _spriteAnimationFrameIndex = _spriteAnimationsTable[action->_speech]._firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[action->_speech]._numParts; + _mirroredDrawing = action->_flipX; _characterFacingDirection = 5; _mainLoopCounter2 = 0; } else { - _backgroundSpriteCurrentAnimation = action->speech - 100; + _backgroundSpriteCurrentAnimation = action->_speech - 100; _backgroundSpriteCurrentFrame = 0; _mirroredDrawing = 0; } } - _pendingActionDelay = action->delay; - _charPositionFlagNum = action->setFlagNum; - _charPositionFlagValue = action->setFlagValue; - _pendingActionIndex = action->index; - _characterSoundFxDelayCounter = action->fxDelay; - _characterSoundFxNum = action->fxNum; + _pendingActionDelay = action->_delay; + _charPositionFlagNum = action->_setFlagNum; + _charPositionFlagValue = action->_setFlagValue; + _pendingActionIndex = action->_index; + _characterSoundFxDelayCounter = action->_fxDelay; + _characterSoundFxNum = action->_fxNum; _previousActionVerb = _currentActionVerb; _currentActionVerb = 0; } @@ -980,10 +983,10 @@ void TuckerEngine::setBlackPalette() { void TuckerEngine::updateCursor() { setCursorNum(0); - if (_backgroundSpriteCurrentAnimation == -1 && _panelLockedFlag == 0 && _selectedObject.locationObject_locationNum > 0) { - _selectedObject.locationObject_locationNum = 0; + if (_backgroundSpriteCurrentAnimation == -1 && !_panelLockedFlag && _selectedObject._locationObjectLocationNum > 0) { + _selectedObject._locationObjectLocationNum = 0; } - if (_locationMaskType > 0 || _selectedObject.locationObject_locationNum > 0 || _pendingActionDelay > 0) { + if (_locationMaskType > 0 || _selectedObject._locationObjectLocationNum > 0 || _pendingActionDelay > 0) { return; } if (_rightMouseButtonPressed) { @@ -1016,7 +1019,7 @@ void TuckerEngine::updateCursor() { } else { num = getObjectUnderCursor(); if (num > -1) { - _selectedObjectNum = _locationObjectsTable[num].textNum; + _selectedObjectNum = _locationObjectsTable[num]._textNum; } } handleMouseClickOnInventoryObject(); @@ -1092,26 +1095,26 @@ void TuckerEngine::stopSounds() { void TuckerEngine::playSounds() { for (int i = 0; i < _locationSoundsCount; ++i) { - if (_locationSoundsTable[i].type == 1 || _locationSoundsTable[i].type == 2 || _locationSoundsTable[i].type == 5 || - (_locationSoundsTable[i].type == 7 && _flagsTable[_locationSoundsTable[i].flagNum] == _locationSoundsTable[i].flagValueStartFx)) { - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + if (_locationSoundsTable[i]._type == 1 || _locationSoundsTable[i]._type == 2 || _locationSoundsTable[i]._type == 5 || + (_locationSoundsTable[i]._type == 7 && _flagsTable[_locationSoundsTable[i]._flagNum] == _locationSoundsTable[i]._flagValueStartFx)) { + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); } } for (int i = 0; i < _locationMusicsCount; ++i) { - if (_locationMusicsTable[i].flag > 0) { - startMusic(_locationMusicsTable[i].offset, i, _locationMusicsTable[i].volume); + if (_locationMusicsTable[i]._flag > 0) { + startMusic(_locationMusicsTable[i]._offset, i, _locationMusicsTable[i]._volume); } } } void TuckerEngine::updateCharactersPath() { - if (_panelLockedFlag == 0) { + if (!_panelLockedFlag) { return; } if (_backgroundSpriteCurrentAnimation != -1 && _locationNum != 25) { - if (_xPosCurrent == _selectedObject.xPos && _yPosCurrent == _selectedObject.yPos) { + if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) { _locationMaskCounter = 1; - _panelLockedFlag = 0; + _panelLockedFlag = false; } return; } @@ -1120,44 +1123,44 @@ void TuckerEngine::updateCharactersPath() { if (_characterFacingDirection == 5) { _characterPrevFacingDirection = 5; } - int flag = 0; - if (_yPosCurrent > _selectedObject.yPos) { - if (testLocationMask(_xPosCurrent, _yPosCurrent - 1) == 1) { + bool flag = false; + if (_yPosCurrent > _selectedObject._yPos) { + if (testLocationMask(_xPosCurrent, _yPosCurrent - 1)) { --_yPosCurrent; _characterFacingDirection = 4; - flag = 1; + flag = true; } - } else if (_yPosCurrent < _selectedObject.yPos) { - if (testLocationMask(_xPosCurrent, _yPosCurrent + 1) == 1) { + } else if (_yPosCurrent < _selectedObject._yPos) { + if (testLocationMask(_xPosCurrent, _yPosCurrent + 1)) { ++_yPosCurrent; _characterFacingDirection = 2; - flag = 1; + flag = true; } } - if (_xPosCurrent > _selectedObject.xPos) { - if (testLocationMask(_xPosCurrent - 1, _yPosCurrent) == 1) { + if (_xPosCurrent > _selectedObject._xPos) { + if (testLocationMask(_xPosCurrent - 1, _yPosCurrent)) { --_xPosCurrent; _characterFacingDirection = 3; _characterBackFrontFacing = 0; - flag = 1; + flag = true; } - } else if (_xPosCurrent < _selectedObject.xPos) { - if (testLocationMask(_xPosCurrent + 1, _yPosCurrent) == 1) { + } else if (_xPosCurrent < _selectedObject._xPos) { + if (testLocationMask(_xPosCurrent + 1, _yPosCurrent)) { ++_xPosCurrent; _characterFacingDirection = 1; _characterBackFrontFacing = 1; - flag = 1; + flag = true; } } - if (flag == 0) { - if (_selectedObjectLocationMask == 1) { - _selectedObjectLocationMask = 0; - _selectedObject.xPos = _selectedObject.xDefaultPos; - _selectedObject.yPos = _selectedObject.yDefaultPos; + if (!flag) { + if (_selectedObjectLocationMask) { + _selectedObjectLocationMask = false; + _selectedObject._xPos = _selectedObject._xDefaultPos; + _selectedObject._yPos = _selectedObject._yDefaultPos; } else { - _panelLockedFlag = 0; + _panelLockedFlag = false; _characterFacingDirection = 0; - if (_xPosCurrent == _selectedObject.xPos && _yPosCurrent == _selectedObject.yPos) { + if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) { _locationMaskCounter = 1; } } @@ -1169,19 +1172,19 @@ void TuckerEngine::updateCharactersPath() { return; } } - if (_xPosCurrent != _selectedObject.xPos || _yPosCurrent != _selectedObject.yPos) { + if (_xPosCurrent != _selectedObject._xPos || _yPosCurrent != _selectedObject._yPos) { return; } - if (_selectedObjectLocationMask != 0) { + if (_selectedObjectLocationMask) { return; } _locationMaskCounter = 1; - _panelLockedFlag = 0; + _panelLockedFlag = false; _locationMaskIgnore = 0; if (_characterPrevFacingDirection <= 0 || _characterPrevFacingDirection >= 5) { return; } - if (_selectedObject.locationObject_locationNum == 0) { + if (_selectedObject._locationObjectLocationNum == 0) { _characterFacingDirection = 5; while (_spriteAnimationFramesTable[_spriteAnimationFrameIndex] != 999) { ++_spriteAnimationFrameIndex; @@ -1200,12 +1203,12 @@ void TuckerEngine::setSoundVolumeDistance() { void TuckerEngine::updateData3DrawFlag() { for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; - if (a->flagNum > 0 && a->flagValue != _flagsTable[a->flagNum]) { - a->drawFlag = 0; - } else if (a->getFlag == 0) { - a->drawFlag = 1; + if (a->_flagNum > 0 && a->_flagValue != _flagsTable[a->_flagNum]) { + a->_drawFlag = false; + } else if (a->_getFlag == 0) { + a->_drawFlag = true; } else { - a->drawFlag = (_inventoryItemsState[a->inventoryNum] == 0) ? 1 : 0; + a->_drawFlag = (_inventoryItemsState[a->_inventoryNum] == 0); } } } @@ -1214,26 +1217,26 @@ void TuckerEngine::updateData3() { updateData3DrawFlag(); for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; - if (a->animLastCounter != 0 && a->drawFlag != 0) { - if (a->animLastCounter == a->animCurrentCounter) { - a->animCurrentCounter = a->animInitCounter; + if (a->_animLastCounter != 0 && a->_drawFlag) { + if (a->_animLastCounter == a->_animCurrentCounter) { + a->_animCurrentCounter = a->_animInitCounter; } else { - ++a->animCurrentCounter; + ++a->_animCurrentCounter; } - const int index = a->animCurrentCounter; + const int index = a->_animCurrentCounter; if (_staticData3Table[index] == 998) { _flagsTable[_staticData3Table[index + 1]] = _staticData3Table[index + 2]; - a->animCurrentCounter = a->animInitCounter; - a->drawFlag = 0; + a->_animCurrentCounter = a->_animInitCounter; + a->_drawFlag = false; } if (_locationNum == 24 && i == 0) { // workaround bug #2872385: update fish animation sequence for correct // position in aquarium. - if (a->animInitCounter == 505 && a->animCurrentCounter == 513) { - a->animCurrentCounter = 525; + if (a->_animInitCounter == 505 && a->_animCurrentCounter == 513) { + a->_animCurrentCounter = 525; } } - a->graphicNum = _staticData3Table[a->animCurrentCounter]; + a->_graphicNum = _staticData3Table[a->_animCurrentCounter]; } } updateData3DrawFlag(); @@ -1242,16 +1245,16 @@ void TuckerEngine::updateData3() { void TuckerEngine::updateSfxData3_1() { for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - if ((s->type == 6 || s->type == 7) && s->updateType == 1) { + if ((s->_type == 6 || s->_type == 7) && s->_updateType == 1) { for (int j = 0; j < _spritesCount; ++j) { - if (_spritesTable[j].animationFrame == s->startFxSpriteNum && _spritesTable[j].state == s->startFxSpriteState) { - if (s->type == 7) { - _flagsTable[s->flagNum] = s->flagValueStartFx; + if (_spritesTable[j]._animationFrame == s->_startFxSpriteNum && _spritesTable[j]._state == s->_startFxSpriteState) { + if (s->_type == 7) { + _flagsTable[s->_flagNum] = s->_flagValueStartFx; } - startSound(s->offset, i, s->volume); - } else if (s->type == 7) { - if (_spritesTable[j].animationFrame == s->stopFxSpriteNum && _spritesTable[j].state == s->stopFxSpriteState) { - _flagsTable[s->flagNum] = s->flagValueStopFx; + startSound(s->_offset, i, s->_volume); + } else if (s->_type == 7) { + if (_spritesTable[j]._animationFrame == s->_stopFxSpriteNum && _spritesTable[j]._state == s->_stopFxSpriteState) { + _flagsTable[s->_flagNum] = s->_flagValueStopFx; stopSound(i); } } @@ -1263,15 +1266,15 @@ void TuckerEngine::updateSfxData3_1() { void TuckerEngine::updateSfxData3_2() { for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - if ((s->type == 6 || s->type == 7) && s->updateType == 0) { - if (s->startFxSpriteNum == _backgroundSpriteCurrentFrame && s->startFxSpriteState == _backgroundSpriteCurrentAnimation) { - if (s->type == 7) { - _flagsTable[s->flagNum] = s->flagValueStartFx; + if ((s->_type == 6 || s->_type == 7) && s->_updateType == 0) { + if (s->_startFxSpriteNum == _backgroundSpriteCurrentFrame && s->_startFxSpriteState == _backgroundSpriteCurrentAnimation) { + if (s->_type == 7) { + _flagsTable[s->_flagNum] = s->_flagValueStartFx; } - startSound(s->offset, i, s->volume); - } else if (s->type == 7) { - if (s->stopFxSpriteNum == _backgroundSpriteCurrentFrame && s->stopFxSpriteState == _backgroundSpriteCurrentAnimation) { - _flagsTable[s->flagNum] = s->flagValueStopFx; + startSound(s->_offset, i, s->_volume); + } else if (s->_type == 7) { + if (s->_stopFxSpriteNum == _backgroundSpriteCurrentFrame && s->_stopFxSpriteState == _backgroundSpriteCurrentAnimation) { + _flagsTable[s->_flagNum] = s->_flagValueStopFx; stopSound(i); } } @@ -1471,31 +1474,31 @@ void TuckerEngine::updateGameHints() { if (_gameHintsIndex == 0 && _flagsTable[3] > 0) { _gameHintsIndex = 1; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 1 && _flagsTable[12] > 0) { _gameHintsIndex = 2; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 2 && _flagsTable[20] > 0) { _gameHintsIndex = 3; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 3 && _flagsTable[9] > 0) { _gameHintsIndex = 4; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 4 && _flagsTable[23] > 0) { _gameHintsIndex = 5; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_flagsTable[19] > 0) { _gameHintsIndex = 6; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } ++_gameHintsCounter; if (_gameHintsCounter > 1500) { - _gameHintsDisplayText = 1; + _displayHintsText = true; } } @@ -1503,7 +1506,7 @@ void TuckerEngine::startCharacterSounds() { if (_characterSoundFxDelayCounter != 0) { --_characterSoundFxDelayCounter; if (_characterSoundFxDelayCounter <= 0) { - startSound(_locationSoundsTable[_characterSoundFxNum].offset, _characterSoundFxNum, _locationSoundsTable[_characterSoundFxNum].volume); + startSound(_locationSoundsTable[_characterSoundFxNum]._offset, _characterSoundFxNum, _locationSoundsTable[_characterSoundFxNum]._volume); } } } @@ -1513,16 +1516,16 @@ void TuckerEngine::updateSoundsTypes3_4() { return; } for (int i = 0; i < _locationSoundsCount; ++i) { - switch (_locationSoundsTable[i].type) { + switch (_locationSoundsTable[i]._type) { case 3: if (getRandomNumber() >= 32300) { - startSound(_locationSoundsTable[i].offset, 0, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, 0, _locationSoundsTable[i]._volume); return; } break; case 4: if (getRandomNumber() >= 32763) { - startSound(_locationSoundsTable[i].offset, 0, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, 0, _locationSoundsTable[i]._volume); return; } break; @@ -1532,11 +1535,11 @@ void TuckerEngine::updateSoundsTypes3_4() { void TuckerEngine::drawData3() { for (int i = 0; i < _locationAnimationsCount; ++i) { - if (_locationAnimationsTable[i].drawFlag != 0) { - int num = _locationAnimationsTable[i].graphicNum; + if (_locationAnimationsTable[i]._drawFlag) { + int num = _locationAnimationsTable[i]._graphicNum; const Data *d = &_dataTable[num]; - Graphics::decodeRLE(_locationBackgroundGfxBuf + d->yDest * 640 + d->xDest, _data3GfxBuf + d->sourceOffset, d->xSize, d->ySize); - addDirtyRect(d->xDest, d->yDest, d->xSize, d->ySize); + Graphics::decodeRLE(_locationBackgroundGfxBuf + d->_yDest * 640 + d->_xDest, _data3GfxBuf + d->_sourceOffset, d->_xSize, d->_ySize); + addDirtyRect(d->_xDest, d->_yDest, d->_xSize, d->_ySize); } } } @@ -1750,28 +1753,28 @@ void TuckerEngine::drawCurrentSprite() { // Workaround original game glitch: location 14 contains some colors from [0xE0-0xF8] in a walkable area (tracker item #3106542) const bool color248Only = (_locationNum == 14); SpriteFrame *chr = &_spriteFramesTable[_currentSpriteAnimationFrame]; - int yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr->yOffset; + int yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr->_yOffset; int xPos = _xPosCurrent; if (_mirroredDrawing == 0) { - xPos += chr->xOffset - 14; + xPos += chr->_xOffset - 14; } else { - xPos -= chr->xSize + chr->xOffset - 14; + xPos -= chr->_xSize + chr->_xOffset - 14; } - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr->sourceOffset, chr->xSize, chr->ySize, - chr->yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); - addDirtyRect(xPos, yPos, chr->xSize, chr->ySize); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr->_sourceOffset, chr->_xSize, chr->_ySize, + chr->_yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); + addDirtyRect(xPos, yPos, chr->_xSize, chr->_ySize); if (_currentSpriteAnimationLength > 1) { SpriteFrame *chr2 = &_spriteFramesTable[_currentSpriteAnimationFrame2]; - yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr2->yOffset; + yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr2->_yOffset; xPos = _xPosCurrent; if (_mirroredDrawing == 0) { - xPos += chr2->xOffset - 14; + xPos += chr2->_xOffset - 14; } else { - xPos -= chr2->xSize + chr2->xOffset - 14; + xPos -= chr2->_xSize + chr2->_xOffset - 14; } - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr2->sourceOffset, chr2->xSize, chr2->ySize, - chr2->yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); - addDirtyRect(xPos, yPos, chr2->xSize, chr2->ySize); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr2->_sourceOffset, chr2->_xSize, chr2->_ySize, + chr2->_yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); + addDirtyRect(xPos, yPos, chr2->_xSize, chr2->_ySize); } } @@ -1790,8 +1793,8 @@ void TuckerEngine::setVolumeMusic(int index, int volume) { } void TuckerEngine::startSound(int offset, int index, int volume) { - bool loop = (_locationSoundsTable[index].type == 2 || _locationSoundsTable[index].type == 5 || _locationSoundsTable[index].type == 7); - loadSound(Audio::Mixer::kSFXSoundType, _locationSoundsTable[index].num, volume, loop, &_sfxHandles[index]); + bool loop = (_locationSoundsTable[index]._type == 2 || _locationSoundsTable[index]._type == 5 || _locationSoundsTable[index]._type == 7); + loadSound(Audio::Mixer::kSFXSoundType, _locationSoundsTable[index]._num, volume, loop, &_sfxHandles[index]); } void TuckerEngine::stopSound(int index) { @@ -1803,8 +1806,8 @@ bool TuckerEngine::isSoundPlaying(int index) { } void TuckerEngine::startMusic(int offset, int index, int volume) { - bool loop = (_locationMusicsTable[index].flag == 2); - loadSound(Audio::Mixer::kMusicSoundType, _locationMusicsTable[index].num, volume, loop, &_musicHandles[index]); + bool loop = (_locationMusicsTable[index]._flag == 2); + loadSound(Audio::Mixer::kMusicSoundType, _locationMusicsTable[index]._num, volume, loop, &_musicHandles[index]); } void TuckerEngine::stopMusic(int index) { @@ -1831,14 +1834,16 @@ void TuckerEngine::rememberSpeechSound() { } void TuckerEngine::redrawPanelItems() { - const uint8 *src = 0; - uint8 *dst = 0; - int sz = 0; if (_forceRedrawPanelItems || (_redrawPanelItemsCounter != 0 && _panelState == 0)) { _forceRedrawPanelItems = false; if (_redrawPanelItemsCounter > 0) { --_redrawPanelItemsCounter; } + + const uint8 *src = 0; + uint8 *dst = 0; + int sz = 0; + switch (_panelState) { case 0: src = _panelGfxBuf; @@ -1892,25 +1897,25 @@ void TuckerEngine::redrawPanelItemsHelper() { void TuckerEngine::drawSprite(int num) { Sprite *s = &_spritesTable[num]; - if (s->animationFrame <= s->firstFrame && s->animationFrame > 0 && s->state != -1) { - const uint8 *p = s->animationData; + if (s->_animationFrame <= s->_firstFrame && s->_animationFrame > 0 && s->_state != -1) { + const uint8 *p = s->_animationData; if (!p) { return; } - int frameOffset = READ_LE_UINT24(p + s->animationFrame * 4); + int frameOffset = READ_LE_UINT24(p + s->_animationFrame * 4); int srcW = READ_LE_UINT16(p + frameOffset); int srcH = READ_LE_UINT16(p + frameOffset + 2); int srcX = READ_LE_UINT16(p + frameOffset + 8); int srcY = READ_LE_UINT16(p + frameOffset + 10); - int xPos = s->gfxBackgroundOffset + srcX; + int xPos = s->_gfxBackgroundOffset + srcX; if (xPos < 600 && (_scrollOffset + 320 < xPos || _scrollOffset - srcW > xPos)) { return; } - s->xSource = srcX; - s->gfxBackgroundOffset += s->backgroundOffset; + s->_xSource = srcX; + s->_gfxBackgroundOffset += s->_backgroundOffset; uint8 *dstPtr = _locationBackgroundGfxBuf + srcY * 640 + xPos; const uint8 *srcPtr = p + frameOffset + 12; - switch (s->colorType) { + switch (s->_colorType) { case 0: Graphics::decodeRLE(dstPtr, srcPtr, srcW, srcH); break; @@ -1918,11 +1923,11 @@ void TuckerEngine::drawSprite(int num) { Graphics::decodeRLE_224(dstPtr, srcPtr, srcW, srcH); break; default: - Graphics::decodeRLE_248(dstPtr, srcPtr, srcW, srcH, 0, s->yMaxBackground, s->flipX != 0); + Graphics::decodeRLE_248(dstPtr, srcPtr, srcW, srcH, 0, s->_yMaxBackground, s->_flipX); break; } - const int xR = srcX + (s->gfxBackgroundOffset % 640); - const int yR = srcY + (s->gfxBackgroundOffset / 640); + const int xR = srcX + (s->_gfxBackgroundOffset % 640); + const int yR = srcY + (s->_gfxBackgroundOffset / 640); addDirtyRect(xR, yR, srcW, srcH); } } @@ -2031,7 +2036,7 @@ void TuckerEngine::updateCharacterAnimation() { ++_spriteAnimationFrameIndex; } _characterFacingDirection = 0; - if (_changeBackgroundSprite == 1) { + if (_changeBackgroundSprite) { if (_backgroundSpriteCurrentFrame == 0) { _backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation]; _backgroundSpriteCurrentFrame = _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); @@ -2040,7 +2045,7 @@ void TuckerEngine::updateCharacterAnimation() { if (_backgroundSpriteCurrentFrame < 1) { _backgroundSpriteCurrentAnimation = -1; _backgroundSpriteCurrentFrame = 0; - _changeBackgroundSprite = 0; + _changeBackgroundSprite = false; if (_nextAction == 0) { setCursorType(0); } @@ -2052,7 +2057,7 @@ void TuckerEngine::updateCharacterAnimation() { assert(_backgroundSpriteCurrentAnimation >= 0 && _backgroundSpriteCurrentAnimation < kSprA02TableSize); _backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation]; _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); - } else if (_locationNum == 25 && _panelLockedFlag != 1 && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) { + } else if (_locationNum == 25 && !_panelLockedFlag && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) { _backgroundSpriteCurrentFrame = 0; _backgroundSpriteCurrentAnimation = -1; } else { @@ -2068,9 +2073,9 @@ void TuckerEngine::updateCharacterAnimation() { } } if (_locationNum == 24 && _flagsTable[103] == 0) { - if (_panelLockedFlag == 1) { - _panelLockedFlag = 0; - _selectedObject.locationObject_locationNum = 0; + if (_panelLockedFlag) { + _panelLockedFlag = false; + _selectedObject._locationObjectLocationNum = 0; if (_actionVerb != 2) { _speechSoundNum = 2236; startSpeechSound(_speechSoundNum, _speechVolume); @@ -2108,7 +2113,7 @@ void TuckerEngine::updateCharacterAnimation() { if (_characterBackFrontFacing == 0) { if (_characterBackFrontFacing != _characterPrevBackFrontFacing) { _backgroundSpriteCurrentAnimation = 10; - } else if (_panelLockedFlag == 1) { + } else if (_panelLockedFlag) { _backgroundSpriteCurrentAnimation = 3; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) { _backgroundSpriteCurrentAnimation = 8; @@ -2118,7 +2123,7 @@ void TuckerEngine::updateCharacterAnimation() { } else { if (_characterBackFrontFacing != _characterPrevBackFrontFacing) { _backgroundSpriteCurrentAnimation = 2; - } else if (_panelLockedFlag == 1) { + } else if (_panelLockedFlag) { _backgroundSpriteCurrentAnimation = 6; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) { _backgroundSpriteCurrentAnimation = 9; @@ -2143,7 +2148,7 @@ void TuckerEngine::updateCharacterAnimation() { _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); } int frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; - if (_panelLockedFlag == 0 && _characterFacingDirection < 5 && _selectedObject.locationObject_locationNum == 0) { + if (!_panelLockedFlag && _characterFacingDirection < 5 && _selectedObject._locationObjectLocationNum == 0) { _characterFacingDirection = 0; } if (_charSpeechSoundCounter > 0 && _characterFacingDirection != 6 && _actionCharacterNum == 99) { @@ -2225,14 +2230,14 @@ void TuckerEngine::updateCharacterAnimation() { break; } } - _currentSpriteAnimationLength = _spriteAnimationsTable[num].numParts; - _spriteAnimationFrameIndex = _spriteAnimationsTable[num].firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[num]._numParts; + _spriteAnimationFrameIndex = _spriteAnimationsTable[num]._firstFrameIndex; frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; } if (_characterAnimationNum > 0) { num = _characterAnimationNum; - _currentSpriteAnimationLength = _spriteAnimationsTable[num].numParts; - _spriteAnimationFrameIndex = _spriteAnimationsTable[num].firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[num]._numParts; + _spriteAnimationFrameIndex = _spriteAnimationsTable[num]._firstFrameIndex; frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; _characterAnimationNum = 0; } @@ -2287,10 +2292,10 @@ void TuckerEngine::handleMap() { if (_handleMapCounter > 19) { _handleMapCounter = 0; _locationMaskCounter = 1; - _panelLockedFlag = 0; + _panelLockedFlag = false; } } - if (_panelLockedFlag == 0 && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) { + if (!_panelLockedFlag && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) { setCursorType(0); if (_locationMaskCounter == 1) { _characterFacingDirection = 0; @@ -2298,19 +2303,19 @@ void TuckerEngine::handleMap() { } return; } - if (_selectedObject.locationObject_locationNum != 0 && _locationMaskCounter != 0 && (_backgroundSpriteCurrentAnimation <= -1 || _locationNum == 25)) { + if (_selectedObject._locationObjectLocationNum != 0 && _locationMaskCounter != 0 && (_backgroundSpriteCurrentAnimation <= -1 || _locationNum == 25)) { if (_locationNum == 25 || _backgroundSpriteCurrentAnimation != 4) { if (_locationMaskType == 0) { _locationMaskType = 1; setCursorType(2); - if (_selectedObject.locationObject_toWalkX2 > 800) { - _backgroundSpriteCurrentAnimation = _selectedObject.locationObject_toWalkX2 - 900; - if (_selectedObject.locationObject_toWalkY2 > 499) { - _changeBackgroundSprite = 1; - _backgroundSprOffset = _selectedObject.locationObject_toWalkY2 - 500; + if (_selectedObject._locationObjectToWalkX2 > 800) { + _backgroundSpriteCurrentAnimation = _selectedObject._locationObjectToWalkX2 - 900; + if (_selectedObject._locationObjectToWalkY2 > 499) { + _changeBackgroundSprite = true; + _backgroundSprOffset = _selectedObject._locationObjectToWalkY2 - 500; } else { - _backgroundSprOffset = _selectedObject.locationObject_toWalkY2; - _changeBackgroundSprite = 0; + _backgroundSprOffset = _selectedObject._locationObjectToWalkY2; + _changeBackgroundSprite = false; } _backgroundSpriteCurrentFrame = 0; _mirroredDrawing = 0; @@ -2321,17 +2326,17 @@ void TuckerEngine::handleMap() { } } else { _locationMaskCounter = 0; - _selectedObject.xPos = _selectedObject.locationObject_toWalkX2; - _selectedObject.yPos = _selectedObject.locationObject_toWalkY2; + _selectedObject._xPos = _selectedObject._locationObjectToWalkX2; + _selectedObject._yPos = _selectedObject._locationObjectToWalkY2; _handleMapCounter = 1; - _panelLockedFlag = 1; + _panelLockedFlag = true; } return; } _locationMaskType = 2; _panelState = 0; setCursorType(0); - if (_selectedObject.locationObject_locationNum == 99) { + if (_selectedObject._locationObjectLocationNum == 99) { _noPositionChangeAfterMap = true; handleMapSequence(); return; @@ -2341,28 +2346,28 @@ void TuckerEngine::handleMap() { redrawScreen(_scrollOffset); _fadePaletteCounter = 34; } - _nextLocationNum = _selectedObject.locationObject_locationNum; - _xPosCurrent = _selectedObject.locationObject_toX; - _yPosCurrent = _selectedObject.locationObject_toY; - if (_selectedObject.locationObject_toX2 > 800) { - _backgroundSpriteCurrentAnimation = _selectedObject.locationObject_toX2 - 900; - if (_selectedObject.locationObject_toY2 > 499) { - _changeBackgroundSprite = 1; - _backgroundSprOffset = _selectedObject.locationObject_toY2 - 500; + _nextLocationNum = _selectedObject._locationObjectLocationNum; + _xPosCurrent = _selectedObject._locationObjectToX; + _yPosCurrent = _selectedObject._locationObjectToY; + if (_selectedObject._locationObjectToX2 > 800) { + _backgroundSpriteCurrentAnimation = _selectedObject._locationObjectToX2 - 900; + if (_selectedObject._locationObjectToY2 > 499) { + _changeBackgroundSprite = true; + _backgroundSprOffset = _selectedObject._locationObjectToY2 - 500; } else { - _changeBackgroundSprite = 0; - _backgroundSprOffset = _selectedObject.locationObject_toY2; + _changeBackgroundSprite = false; + _backgroundSprOffset = _selectedObject._locationObjectToY2; } _backgroundSpriteCurrentFrame = 0; } else { - _selectedObject.xPos = _selectedObject.locationObject_toX2; - _selectedObject.yPos = _selectedObject.locationObject_toY2; - _panelLockedFlag = 1; + _selectedObject._xPos = _selectedObject._locationObjectToX2; + _selectedObject._yPos = _selectedObject._locationObjectToY2; + _panelLockedFlag = true; } _scrollOffset = 0; _handleMapCounter = 0; _locationMaskCounter = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; } } } @@ -2370,79 +2375,79 @@ void TuckerEngine::handleMap() { void TuckerEngine::clearSprites() { memset(_spritesTable, 0, sizeof(_spritesTable)); for (int i = 0; i < kMaxCharacters; ++i) { - _spritesTable[i].state = -1; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._state = -1; + _spritesTable[i]._stateIndex = -1; } } void TuckerEngine::updateSprites() { const int count = (_locationNum == 9) ? 3 : _spritesCount; for (int i = 0; i < count; ++i) { - if (_spritesTable[i].stateIndex > -1) { - ++_spritesTable[i].stateIndex; - if (_characterStateTable[_spritesTable[i].stateIndex] == 99) { - _spritesTable[i].stateIndex = -1; - _spritesTable[i].state = -1; + if (_spritesTable[i]._stateIndex > -1) { + ++_spritesTable[i]._stateIndex; + if (_characterStateTable[_spritesTable[i]._stateIndex] == 99) { + _spritesTable[i]._stateIndex = -1; + _spritesTable[i]._state = -1; updateSprite(i); } else { - _spritesTable[i].animationFrame = _characterStateTable[_spritesTable[i].stateIndex]; + _spritesTable[i]._animationFrame = _characterStateTable[_spritesTable[i]._stateIndex]; } continue; } - if (_spritesTable[i].state == -1) { + if (_spritesTable[i]._state == -1) { updateSprite(i); continue; } - if (_charSpeechSoundCounter > 0 && i == _actionCharacterNum && _spritesTable[i].needUpdate == 0) { + if (_charSpeechSoundCounter > 0 && i == _actionCharacterNum && !_spritesTable[i]._needUpdate) { updateSprite(i); continue; } - if (_charSpeechSoundCounter == 0 && _spritesTable[i].needUpdate > 0) { + if (_charSpeechSoundCounter == 0 && _spritesTable[i]._needUpdate) { updateSprite(i); continue; } - if (_spritesTable[i].updateDelay > 0) { - --_spritesTable[i].updateDelay; - if (_spritesTable[i].updateDelay == 0) { + if (_spritesTable[i]._updateDelay > 0) { + --_spritesTable[i]._updateDelay; + if (_spritesTable[i]._updateDelay == 0) { updateSprite(i); } continue; } - if (_spritesTable[i].defaultUpdateDelay > 0) { - _spritesTable[i].updateDelay = _spritesTable[i].defaultUpdateDelay - 1; - ++_spritesTable[i].animationFrame; - if (_spritesTable[i].animationFrame == _spritesTable[i].firstFrame) { + if (_spritesTable[i]._defaultUpdateDelay > 0) { + _spritesTable[i]._updateDelay = _spritesTable[i]._defaultUpdateDelay - 1; + ++_spritesTable[i]._animationFrame; + if (_spritesTable[i]._animationFrame == _spritesTable[i]._firstFrame) { updateSprite(i); } continue; } - if (_spritesTable[i].nextAnimationFrame == 0) { - ++_spritesTable[i].animationFrame; - if (_spritesTable[i].firstFrame - 1 < _spritesTable[i].animationFrame) { - if (_spritesTable[i].prevAnimationFrame == 1) { - --_spritesTable[i].animationFrame; - _spritesTable[i].nextAnimationFrame = 1; + if (!_spritesTable[i]._nextAnimationFrame) { + ++_spritesTable[i]._animationFrame; + if (_spritesTable[i]._firstFrame - 1 < _spritesTable[i]._animationFrame) { + if (_spritesTable[i]._prevAnimationFrame) { + --_spritesTable[i]._animationFrame; + _spritesTable[i]._nextAnimationFrame = true; } else { updateSprite(i); } } continue; } - --_spritesTable[i].animationFrame; - if (_spritesTable[i].animationFrame == 0) { + --_spritesTable[i]._animationFrame; + if (_spritesTable[i]._animationFrame == 0) { updateSprite(i); } } } void TuckerEngine::updateSprite(int i) { - _spritesTable[i].prevState = _spritesTable[i].state; - _spritesTable[i].prevAnimationFrame = 0; - _spritesTable[i].nextAnimationFrame = 0; - _updateSpriteFlag1 = 0; - _updateSpriteFlag2 = 0; - _spritesTable[i].defaultUpdateDelay = 0; - _spritesTable[i].updateDelay = 0; + _spritesTable[i]._prevState = _spritesTable[i]._state; + _spritesTable[i]._prevAnimationFrame = false; + _spritesTable[i]._nextAnimationFrame = false; + _updateSpriteFlag1 = false; + _updateSpriteFlag2 = false; + _spritesTable[i]._defaultUpdateDelay = 0; + _spritesTable[i]._updateDelay = 0; switch (_locationNum) { case 2: updateSprite_locationNum2(); @@ -2632,7 +2637,7 @@ void TuckerEngine::updateSprite(int i) { if (i == 0) { updateSprite_locationNum32_0(0); } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } break; case 33: @@ -2643,7 +2648,7 @@ void TuckerEngine::updateSprite(int i) { } else if (i == 2) { updateSprite_locationNum33_2(2); } else { - _spritesTable[i].state = 12; + _spritesTable[i]._state = 12; } break; case 34: @@ -2654,7 +2659,7 @@ void TuckerEngine::updateSprite(int i) { break; case 37: if (i == 0) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else { updateSprite_locationNum37(i); } @@ -2670,9 +2675,9 @@ void TuckerEngine::updateSprite(int i) { updateSprite_locationNum43_2(i); } else if (i < 2) { if (_flagsTable[236] < 4) { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } else if (i == 3) { updateSprite_locationNum43_3(3); @@ -2685,10 +2690,10 @@ void TuckerEngine::updateSprite(int i) { } break; case 45: - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; break; case 47: - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; break; case 48: updateSprite_locationNum48(0); @@ -2700,7 +2705,7 @@ void TuckerEngine::updateSprite(int i) { if (i < 6) { updateSprite_locationNum50(i); } else { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } break; case 51: @@ -2782,7 +2787,7 @@ void TuckerEngine::updateSprite(int i) { break; case 69: if (i == 0) { - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; } else if (i == 1) { updateSprite_locationNum69_1(1); } else if (i == 2) { @@ -2814,23 +2819,23 @@ void TuckerEngine::updateSprite(int i) { updateSprite_locationNum82(0); break; case 98: - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; break; } - if (_spritesTable[i].stateIndex <= -1) { - if (_updateSpriteFlag1 == 0) { - _spritesTable[i].animationFrame = 1; + if (_spritesTable[i]._stateIndex <= -1) { + if (!_updateSpriteFlag1) { + _spritesTable[i]._animationFrame = 1; } - if (_spritesTable[i].state < 0 || !_sprC02Table[_spritesTable[i].state]) { + if (_spritesTable[i]._state < 0 || !_sprC02Table[_spritesTable[i]._state]) { // warning("Invalid state %d for sprite %d location %d", _spritesTable[i].state, i, _locationNum); return; } - _spritesTable[i].animationData = _sprC02Table[_spritesTable[i].state]; - _spritesTable[i].firstFrame = READ_LE_UINT16(_spritesTable[i].animationData); - if (_updateSpriteFlag2 == 1) { - _spritesTable[i].state = _spritesTable[i].firstFrame; - _spritesTable[i].nextAnimationFrame = 1; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._animationData = _sprC02Table[_spritesTable[i]._state]; + _spritesTable[i]._firstFrame = READ_LE_UINT16(_spritesTable[i]._animationData); + if (_updateSpriteFlag2) { + _spritesTable[i]._state = _spritesTable[i]._firstFrame; + _spritesTable[i]._nextAnimationFrame = true; + _spritesTable[i]._prevAnimationFrame = true; } } } @@ -2844,7 +2849,7 @@ void TuckerEngine::drawStringInteger(int num, int x, int y, int digits) { Graphics::drawStringChar(_locationBackgroundGfxBuf, _scrollOffset + x, y, 640, numStr[i], 102, _charsetGfxBuf); x += 8; } - addDirtyRect(_scrollOffset + x, y, Graphics::_charset.charW * 3, Graphics::_charset.charH); + addDirtyRect(_scrollOffset + x, y, Graphics::_charset._charW * 3, Graphics::_charset._charH); } void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int strLen) { @@ -2856,7 +2861,7 @@ void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int x += _charWidthTable[chr]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::drawItemString(int x, int num, const uint8 *str) { @@ -2911,7 +2916,7 @@ void TuckerEngine::updateItemsGfxColors(int color1, int color128) { } } -int TuckerEngine::testLocationMask(int x, int y) { +bool TuckerEngine::testLocationMask(int x, int y) { if (_locationMaskType > 0 || _locationMaskIgnore > 0) { return 1; } @@ -2919,7 +2924,7 @@ int TuckerEngine::testLocationMask(int x, int y) { y -= 3; } const int offset = y * 640 + x; - return _locationBackgroundMaskBuf[offset] > 0 ? 1 : 0; + return (_locationBackgroundMaskBuf[offset] > 0); } int TuckerEngine::getStringWidth(int num, const uint8 *ptr) { @@ -3123,7 +3128,7 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_bub: i = readTableInstructionParam(3); - _spriteAnimationFrameIndex = _spriteAnimationsTable[i].firstFrameIndex; + _spriteAnimationFrameIndex = _spriteAnimationsTable[i]._firstFrameIndex; _characterFacingDirection = 5; _mainLoopCounter2 = 0; return 0; @@ -3137,13 +3142,13 @@ int TuckerEngine::executeTableInstruction() { _selectedCharacterDirection = readTableInstructionParam(2); return 0; case kCode_bof: - _skipCurrentCharacterDraw = 1; + _skipCurrentCharacterDraw = true; return 0; case kCode_buh: _noCharacterAnimationChange = readTableInstructionParam(2); return 0; case kCode_bon: - _skipCurrentCharacterDraw = 0; + _skipCurrentCharacterDraw = false; return 0; case kCode_bso: _backgroundSprOffset = readTableInstructionParam(3); @@ -3159,24 +3164,24 @@ int TuckerEngine::executeTableInstruction() { _charSpeechSoundCounter = kDefaultCharSpeechSoundCounter; return 0; case kCode_buw: - _selectedObject.xPos = readTableInstructionParam(3); - _selectedObject.yPos = readTableInstructionParam(3); + _selectedObject._xPos = readTableInstructionParam(3); + _selectedObject._yPos = readTableInstructionParam(3); _locationMaskIgnore = 1; - _panelLockedFlag = 1; + _panelLockedFlag = true; return 0; case kCode_bux: _xPosCurrent = readTableInstructionParam(3); _yPosCurrent = readTableInstructionParam(3); return 0; case kCode_c0a: - _spritesTable[index].state = readTableInstructionParam(3); - if (_spritesTable[index].state == 999) { - _spritesTable[index].state = -1; + _spritesTable[index]._state = readTableInstructionParam(3); + if (_spritesTable[index]._state == 999) { + _spritesTable[index]._state = -1; } _mainLoopCounter1 = 0; - _spritesTable[index].updateDelay = 0; - _spritesTable[index].nextAnimationFrame = 0; - _spritesTable[index].prevAnimationFrame = 0; + _spritesTable[index]._updateDelay = 0; + _spritesTable[index]._nextAnimationFrame = false; + _spritesTable[index]._prevAnimationFrame = false; return 0; case kCode_c0c: setCharacterAnimation(readTableInstructionParam(3), index); @@ -3210,8 +3215,8 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_flx: i = readTableInstructionParam(2); - _locationSoundsTable[i].type = 2; - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + _locationSoundsTable[i]._type = 2; + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); return 0; case kCode_fxx: i = readTableInstructionParam(2); @@ -3221,7 +3226,7 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_fx: i = readTableInstructionParam(2); - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); _soundInstructionIndex = i; return 0; case kCode_gfg: @@ -3380,21 +3385,21 @@ int TuckerEngine::getObjectUnderCursor() { return -1; } for (int i = 0; i < _locationObjectsCount; ++i) { - if (_mousePosX + _scrollOffset + 1 <= _locationObjectsTable[i].xPos) { + if (_mousePosX + _scrollOffset + 1 <= _locationObjectsTable[i]._xPos) { continue; } - if (_mousePosX + _scrollOffset >= _locationObjectsTable[i].xPos + _locationObjectsTable[i].xSize) { + if (_mousePosX + _scrollOffset >= _locationObjectsTable[i]._xPos + _locationObjectsTable[i]._xSize) { continue; } - if (_mousePosY <= _locationObjectsTable[i].yPos) { + if (_mousePosY <= _locationObjectsTable[i]._yPos) { continue; } - if (_mousePosY >= _locationObjectsTable[i].yPos + _locationObjectsTable[i].ySize) { + if (_mousePosY >= _locationObjectsTable[i]._yPos + _locationObjectsTable[i]._ySize) { continue; } _selectedObjectType = 0; _selectedCharacterNum = i; - setCursorNum(_locationObjectsTable[i].cursorNum); + setCursorNum(_locationObjectsTable[i]._cursorNum); return i; } return -1; @@ -3405,127 +3410,127 @@ void TuckerEngine::setSelectedObjectKey() { if (_mousePosY > 139 && _nextAction == 0) { return; } - _panelLockedFlag = 1; + _panelLockedFlag = true; _locationMaskCounter = 0; _actionRequiresTwoObjects = false; - _selectedObject.yPos = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._yPos = 0; + _selectedObject._locationObjectLocationNum = 0; _pendingActionIndex = 0; if (_selectedObjectType == 0) { if (_selectedObjectNum == 0) { - _selectedObject.xPos = x; - _selectedObject.yPos = _mousePosY; + _selectedObject._xPos = x; + _selectedObject._yPos = _mousePosY; } else { - _selectedObject.xPos = _locationObjectsTable[_selectedCharacterNum].standX; - _selectedObject.yPos = _locationObjectsTable[_selectedCharacterNum].standY; + _selectedObject._xPos = _locationObjectsTable[_selectedCharacterNum]._standX; + _selectedObject._yPos = _locationObjectsTable[_selectedCharacterNum]._standY; if (_actionVerb == 0 || _actionVerb == 8) { - _selectedObject.locationObject_locationNum = _locationObjectsTable[_selectedCharacterNum].locationNum; - _selectedObject.locationObject_toX = _locationObjectsTable[_selectedCharacterNum].toX; - _selectedObject.locationObject_toY = _locationObjectsTable[_selectedCharacterNum].toY; - _selectedObject.locationObject_toX2 = _locationObjectsTable[_selectedCharacterNum].toX2; - _selectedObject.locationObject_toY2 = _locationObjectsTable[_selectedCharacterNum].toY2; - _selectedObject.locationObject_toWalkX2 = _locationObjectsTable[_selectedCharacterNum].toWalkX2; - _selectedObject.locationObject_toWalkY2 = _locationObjectsTable[_selectedCharacterNum].toWalkY2; + _selectedObject._locationObjectLocationNum = _locationObjectsTable[_selectedCharacterNum]._locationNum; + _selectedObject._locationObjectToX = _locationObjectsTable[_selectedCharacterNum]._toX; + _selectedObject._locationObjectToY = _locationObjectsTable[_selectedCharacterNum]._toY; + _selectedObject._locationObjectToX2 = _locationObjectsTable[_selectedCharacterNum]._toX2; + _selectedObject._locationObjectToY2 = _locationObjectsTable[_selectedCharacterNum]._toY2; + _selectedObject._locationObjectToWalkX2 = _locationObjectsTable[_selectedCharacterNum]._toWalkX2; + _selectedObject._locationObjectToWalkY2 = _locationObjectsTable[_selectedCharacterNum]._toWalkY2; } } } else { switch (_selectedObjectType) { case 1: - _selectedObject.xPos = _locationAnimationsTable[_selectedCharacterNum].standX; - _selectedObject.yPos = _locationAnimationsTable[_selectedCharacterNum].standY; + _selectedObject._xPos = _locationAnimationsTable[_selectedCharacterNum]._standX; + _selectedObject._yPos = _locationAnimationsTable[_selectedCharacterNum]._standY; break; case 2: - _selectedObject.xPos = _charPosTable[_selectedCharacterNum].xWalkTo; - _selectedObject.yPos = _charPosTable[_selectedCharacterNum].yWalkTo; + _selectedObject._xPos = _charPosTable[_selectedCharacterNum]._xWalkTo; + _selectedObject._yPos = _charPosTable[_selectedCharacterNum]._yWalkTo; break; case 3: - _selectedObject.xPos = _xPosCurrent; - _selectedObject.yPos = _yPosCurrent; + _selectedObject._xPos = _xPosCurrent; + _selectedObject._yPos = _yPosCurrent; break; } } - if (_selectedObject.yPos == 0) { - _selectedObject.xPos = x; - _selectedObject.yPos = _mousePosY; + if (_selectedObject._yPos == 0) { + _selectedObject._xPos = x; + _selectedObject._yPos = _mousePosY; } - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); - if (_selectedObjectLocationMask == 0 && _objectKeysLocationTable[_locationNum] == 1) { - if (_selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - while (_selectedObjectLocationMask == 0 && _selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - ++_selectedObject.yPos; - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); + if (!_selectedObjectLocationMask && _objectKeysLocationTable[_locationNum] == 1) { + if (_selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + while (!_selectedObjectLocationMask && _selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + ++_selectedObject._yPos; + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); } } else { - while (_selectedObjectLocationMask == 0 && _selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - --_selectedObject.yPos; - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); + while (!_selectedObjectLocationMask && _selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + --_selectedObject._yPos; + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); } } } - if (_selectedObjectLocationMask == 1) { - _selectedObjectLocationMask = testLocationMaskArea(_xPosCurrent, _yPosCurrent, _selectedObject.xPos, _selectedObject.yPos); - if (_selectedObjectLocationMask == 1 && _objectKeysPosXTable[_locationNum] > 0) { - _selectedObject.xDefaultPos = _selectedObject.xPos; - _selectedObject.yDefaultPos = _selectedObject.yPos; - _selectedObject.xPos = _objectKeysPosXTable[_locationNum]; - _selectedObject.yPos = _objectKeysPosYTable[_locationNum]; + if (_selectedObjectLocationMask) { + _selectedObjectLocationMask = testLocationMaskArea(_xPosCurrent, _yPosCurrent, _selectedObject._xPos, _selectedObject._yPos); + if (_selectedObjectLocationMask && _objectKeysPosXTable[_locationNum] > 0) { + _selectedObject._xDefaultPos = _selectedObject._xPos; + _selectedObject._yDefaultPos = _selectedObject._yPos; + _selectedObject._xPos = _objectKeysPosXTable[_locationNum]; + _selectedObject._yPos = _objectKeysPosYTable[_locationNum]; if (_objectKeysLocationTable[_locationNum] == 1) { - _selectedObject.xPos = _selectedObject.xDefaultPos; + _selectedObject._xPos = _selectedObject._xDefaultPos; } } } } void TuckerEngine::setCharacterAnimation(int count, int spr) { - _spritesTable[spr].animationFrame = 0; - _spritesTable[spr].stateIndex = 0; + _spritesTable[spr]._animationFrame = 0; + _spritesTable[spr]._stateIndex = 0; for (int i = 0; i < count; ++i) { - while (_characterStateTable[_spritesTable[spr].stateIndex] != 99) { - ++_spritesTable[spr].stateIndex; + while (_characterStateTable[_spritesTable[spr]._stateIndex] != 99) { + ++_spritesTable[spr]._stateIndex; } - ++_spritesTable[spr].stateIndex; + ++_spritesTable[spr]._stateIndex; } - _spritesTable[spr].state = _characterStateTable[_spritesTable[spr].stateIndex]; - ++_spritesTable[spr].stateIndex; - _spritesTable[spr].animationFrame = _characterStateTable[_spritesTable[spr].stateIndex]; - ++_spritesTable[spr].stateIndex; - _spritesTable[spr].animationData = _sprC02Table[_spritesTable[spr].state]; - _spritesTable[spr].firstFrame = READ_LE_UINT16(_spritesTable[spr].animationData); + _spritesTable[spr]._state = _characterStateTable[_spritesTable[spr]._stateIndex]; + ++_spritesTable[spr]._stateIndex; + _spritesTable[spr]._animationFrame = _characterStateTable[_spritesTable[spr]._stateIndex]; + ++_spritesTable[spr]._stateIndex; + _spritesTable[spr]._animationData = _sprC02Table[_spritesTable[spr]._state]; + _spritesTable[spr]._firstFrame = READ_LE_UINT16(_spritesTable[spr]._animationData); } -int TuckerEngine::testLocationMaskArea(int xBase, int yBase, int xPos, int yPos) { +bool TuckerEngine::testLocationMaskArea(int xBase, int yBase, int xPos, int yPos) { while (true) { bool loop = false; if (yBase > yPos) { - if (testLocationMask(xBase, yBase - 1) == 1) { + if (testLocationMask(xBase, yBase - 1)) { --yBase; loop = true; } } else if (yBase < yPos) { - if (testLocationMask(xBase, yBase + 1) == 1) { + if (testLocationMask(xBase, yBase + 1)) { ++yBase; loop = true; } } if (xBase > xPos) { - if (testLocationMask(xBase - 1, yBase) == 1) { + if (testLocationMask(xBase - 1, yBase)) { --xBase; loop = true; } } else if (xBase < xPos) { - if (testLocationMask(xBase + 1, yBase) == 1) { + if (testLocationMask(xBase + 1, yBase)) { ++xBase; loop = true; } } if (xBase == xPos && yBase == yPos) { - return 0; + return false; } if (!loop) { break; } } - return 1; + return true; } void TuckerEngine::handleMouseClickOnInventoryObject() { @@ -3585,23 +3590,23 @@ int TuckerEngine::setCharacterUnderCursor() { return -1; } for (int i = 0; i < _charPosCount; ++i) { - if (_mousePosX + _scrollOffset <= _charPosTable[i].xPos) { + if (_mousePosX + _scrollOffset <= _charPosTable[i]._xPos) { continue; } - if (_mousePosX + _scrollOffset >= _charPosTable[i].xPos + _charPosTable[i].xSize) { + if (_mousePosX + _scrollOffset >= _charPosTable[i]._xPos + _charPosTable[i]._xSize) { continue; } - if (_mousePosY <= _charPosTable[i].yPos) { + if (_mousePosY <= _charPosTable[i]._yPos) { continue; } - if (_mousePosY >= _charPosTable[i].yPos + _charPosTable[i].ySize) { + if (_mousePosY >= _charPosTable[i]._yPos + _charPosTable[i]._ySize) { continue; } - if (_charPosTable[i].flagNum == 0 || _flagsTable[_charPosTable[i].flagNum] == _charPosTable[i].flagValue) { + if (_charPosTable[i]._flagNum == 0 || _flagsTable[_charPosTable[i]._flagNum] == _charPosTable[i]._flagValue) { _selectedObjectType = 2; - _selectedCharacterDirection = _charPosTable[i].direction; + _selectedCharacterDirection = _charPosTable[i]._direction; _selectedCharacterNum = i; - return _charPosTable[i].name; + return _charPosTable[i]._name; } } return -1; @@ -3612,29 +3617,29 @@ int TuckerEngine::setLocationAnimationUnderCursor() { return -1; } for (int i = _locationAnimationsCount - 1; i >= 0; --i) { - if (_locationAnimationsTable[i].drawFlag == 0) { + if (!_locationAnimationsTable[i]._drawFlag) continue; - } - int num = _locationAnimationsTable[i].graphicNum; - if (_mousePosX + _scrollOffset + 1 <= _dataTable[num].xDest) { + + int num = _locationAnimationsTable[i]._graphicNum; + if (_mousePosX + _scrollOffset + 1 <= _dataTable[num]._xDest) { continue; } - if (_mousePosX + _scrollOffset >= _dataTable[num].xDest + _dataTable[num].xSize) { + if (_mousePosX + _scrollOffset >= _dataTable[num]._xDest + _dataTable[num]._xSize) { continue; } - if (_mousePosY <= _dataTable[num].yDest) { + if (_mousePosY <= _dataTable[num]._yDest) { continue; } - if (_mousePosY >= _dataTable[num].yDest + _dataTable[num].ySize) { + if (_mousePosY >= _dataTable[num]._yDest + _dataTable[num]._ySize) { continue; } - if (_locationAnimationsTable[i].selectable == 0) { + if (_locationAnimationsTable[i]._selectable == 0) { return -1; } _selectedObjectType = 1; _selectedCharacterNum = i; _selectedCharacter2Num = i; - return _locationAnimationsTable[i].selectable; + return _locationAnimationsTable[i]._selectable; } return -1; } @@ -3659,11 +3664,11 @@ void TuckerEngine::setActionForInventoryObject() { _currentActionObj2Num = _actionObj2Num; _currentInfoString2SourceType = _actionObj2Type; if (_actionVerb == 1 && _selectedObjectType == 3) { - if (_panelLockedFlag == 1) { + if (_panelLockedFlag) { if (_locationMaskType != 0) { return; } - _panelLockedFlag = 0; + _panelLockedFlag = false; } if (handleSpecialObjectSelectionSequence() == 1) { return; @@ -3819,7 +3824,7 @@ void TuckerEngine::drawSpeechTextLine(const uint8 *dataPtr, int pos, int count, x += _charWidthTable[dataPtr[pos]]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::redrawScreen(int offset) { diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 1a970e3a0c..013f023987 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -53,133 +53,133 @@ class RewindableAudioStream; namespace Tucker { struct Action { - int key; - int testFlag1Num; - int testFlag1Value; - int testFlag2Num; - int testFlag2Value; - int speech; - int flipX; - int index; - int delay; - int setFlagNum; - int setFlagValue; - int fxNum; - int fxDelay; + int _key; + int _testFlag1Num; + int _testFlag1Value; + int _testFlag2Num; + int _testFlag2Value; + int _speech; + int _flipX; + int _index; + int _delay; + int _setFlagNum; + int _setFlagValue; + int _fxNum; + int _fxDelay; }; struct Sprite { - int state; - int gfxBackgroundOffset; - int updateDelay; - int backgroundOffset; - int needUpdate; - int stateIndex; - int counter; - int disabled; - int colorType; - int animationFrame; - int firstFrame; - uint8 *animationData; - int prevState; - int nextAnimationFrame; - int prevAnimationFrame; - int defaultUpdateDelay; - int xSource; - int yMaxBackground; - int flipX; + int _state; + int _gfxBackgroundOffset; + int _updateDelay; + int _backgroundOffset; + int _stateIndex; + int _counter; + int _colorType; + int _animationFrame; + int _firstFrame; + uint8 *_animationData; + int _prevState; + int _defaultUpdateDelay; + int _xSource; + int _yMaxBackground; + bool _disabled; + bool _flipX; + bool _needUpdate; + bool _nextAnimationFrame; + bool _prevAnimationFrame; }; struct CharPos { - int xPos; - int yPos; - int xSize; - int ySize; - int xWalkTo; - int yWalkTo; - int flagNum; - int flagValue; - int direction; - int name; - int description; + int _xPos; + int _yPos; + int _xSize; + int _ySize; + int _xWalkTo; + int _yWalkTo; + int _flagNum; + int _flagValue; + int _direction; + int _name; + int _description; }; struct SpriteFrame { - int sourceOffset; - int xOffset; - int yOffset; - int xSize; - int ySize; + int _sourceOffset; + int _xOffset; + int _yOffset; + int _xSize; + int _ySize; }; struct SpriteAnimation { - int numParts; - int rotateFlag; - int firstFrameIndex; + int _numParts; + int _rotateFlag; // Useless variable + int _firstFrameIndex; }; struct Data { - int sourceOffset; - int xSize; - int ySize; - int xDest; - int yDest; - int index; + int _sourceOffset; + int _xSize; + int _ySize; + int _xDest; + int _yDest; + int _index; }; struct LocationAnimation { - int graphicNum; - int animInitCounter; - int animCurrentCounter; - int animLastCounter; - int getFlag; - int inventoryNum; - int flagNum; - int flagValue; - int selectable; - int standX; - int standY; - int drawFlag; + int _graphicNum; + int _animInitCounter; + int _animCurrentCounter; + int _animLastCounter; + int _getFlag; + int _inventoryNum; + int _flagNum; + int _flagValue; + int _selectable; + int _standX; + int _standY; + bool _drawFlag; }; struct LocationObject { - int xPos; - int yPos; - int xSize; - int ySize; - int textNum; - int locationNum; - int toX; - int toY; - int toX2; - int toY2; - int toWalkX2; - int toWalkY2; - int standX; - int standY; - int cursorNum; + int _xPos; + int _yPos; + int _xSize; + int _ySize; + int _textNum; + int _locationNum; + int _toX; + int _toY; + int _toX2; + int _toY2; + int _toWalkX2; + int _toWalkY2; + int _standX; + int _standY; + int _cursorNum; }; struct LocationSound { - int startFxSpriteState; - int startFxSpriteNum; - int updateType; - int stopFxSpriteState; - int stopFxSpriteNum; - int offset; - int type; - int volume; - int flagValueStartFx; - int flagValueStopFx; - int flagNum; - int num; + int _startFxSpriteState; + int _startFxSpriteNum; + int _updateType; + int _stopFxSpriteState; + int _stopFxSpriteNum; + int _offset; + int _type; + int _volume; + int _flagValueStartFx; + int _flagValueStopFx; + int _flagNum; + int _num; }; struct LocationMusic { - int flag; - int offset; - int volume; - int num; + int _flag; + int _offset; + int _volume; + int _num; }; enum { @@ -232,7 +232,7 @@ enum CompressedSoundType { class CompressedSound { public: - CompressedSound() : _compressedSoundType(-1) {} + CompressedSound() : _compressedSoundType(-1), _compressedSoundFlags(0) {} void openFile(); void closeFile(); @@ -284,7 +284,7 @@ protected: int getRandomNumber(); void allocateBuffers(); void freeBuffers(); - void restart(); + void resetVariables(); void mainLoop(); void waitForTimer(int ticksCount); void parseEvents(); @@ -356,7 +356,7 @@ protected: void drawCreditsString(int x, int y, int num); void updateCharSpeechSound(bool displayText); void updateItemsGfxColors(int bit0, int bit7); - int testLocationMask(int x, int y); + bool testLocationMask(int x, int y); int getStringWidth(int num, const uint8 *ptr); int getPositionForLine(int num, const uint8 *ptr); void resetCharacterAnimationIndex(int count); @@ -369,7 +369,7 @@ protected: int getObjectUnderCursor(); void setSelectedObjectKey(); void setCharacterAnimation(int count, int spr); - int testLocationMaskArea(int xBase, int yBase, int xPos, int yPos); + bool testLocationMaskArea(int xBase, int yBase, int xPos, int yPos); void handleMouseClickOnInventoryObject(); int setCharacterUnderCursor(); int setLocationAnimationUnderCursor(); @@ -630,14 +630,14 @@ protected: bool _gameDebug; bool _displayGameHints; int _execData3Counter; - bool _displaySpeechText; int _currentSaveLoadGameState; - int _gameHintsIndex; int _gameHintsCounter; - int _gameHintsDisplayText; int _gameHintsStringNum; + bool _displaySpeechText; + bool _displayHintsText; + int _fileLoadSize; uint8 *_loadTempBuf; uint8 *_cursorGfxBuf; @@ -685,7 +685,7 @@ protected: int _switchPanelCounter; int _conversationOptionsCount; bool _fadedPanel; - int _panelLockedFlag; + bool _panelLockedFlag; int _conversationOptionLinesCount; int _inventoryItemsState[50]; int _inventoryObjectsList[40]; @@ -745,19 +745,19 @@ protected: int _actionVerbLocked; int _actionPosX; int _actionPosY; - int _selectedObjectLocationMask; + bool _selectedObjectLocationMask; struct { - int xDefaultPos; - int yDefaultPos; - int xPos; - int yPos; - int locationObject_locationNum; - int locationObject_toX; - int locationObject_toY; - int locationObject_toX2; - int locationObject_toY2; - int locationObject_toWalkX2; - int locationObject_toWalkY2; + int _xDefaultPos; + int _yDefaultPos; + int _xPos; + int _yPos; + int _locationObjectLocationNum; + int _locationObjectToX; + int _locationObjectToY; + int _locationObjectToX2; + int _locationObjectToY2; + int _locationObjectToWalkX2; + int _locationObjectToWalkY2; } _selectedObject; int _selectedCharacterDirection; int _selectedCharacter2Num; @@ -814,15 +814,15 @@ protected: int _characterPrevBackFrontFacing; int _characterAnimationNum; int _noCharacterAnimationChange; - int _changeBackgroundSprite; int _characterSpriteAnimationFrameCounter; int _locationMaskIgnore; int _locationMaskType; int _locationMaskCounter; - int _updateSpriteFlag1; - int _updateSpriteFlag2; int _handleMapCounter; bool _noPositionChangeAfterMap; + bool _changeBackgroundSprite; + bool _updateSpriteFlag1; + bool _updateSpriteFlag2; int _mirroredDrawing; uint8 *_loadLocBufPtr; diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp index 9e29ae4618..3ab5716991 100644 --- a/engines/voyeur/data.cpp +++ b/engines/voyeur/data.cpp @@ -90,6 +90,8 @@ SVoy::SVoy(VoyeurEngine *vm):_vm(vm) { _events[i]._computerOff = 0; _events[i]._dead = 0; } + for (int i = 0; i < 6; i++) + _evCmPtrs[i] = nullptr; } void SVoy::addEvent(int hour, int minute, VoyeurEventType type, int audioVideoId, diff --git a/engines/voyeur/data.h b/engines/voyeur/data.h index 60876ec92b..98c884d0c1 100644 --- a/engines/voyeur/data.h +++ b/engines/voyeur/data.h @@ -148,7 +148,7 @@ public: HotspotTimes<3> _evidenceHotspotTimes; HotspotTimes<8> _videoHotspotTimes; - Common::Rect _computerButtonRect; + Common::Rect _computerScreenRect; RectResource *_viewBounds; PictureResource *_evPicPtrs[6]; CMapResource *_evCmPtrs[6]; diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 4c1ed419a2..03ea4d3252 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -82,6 +82,9 @@ EventsManager::EventsManager(VoyeurEngine *vm) : _intPtr(_gameData), _fadeFirstCol = _fadeLastCol = 0; _fadeCount = 1; + + for (int i = 0; i < 4; i++) + _cycleNext[i] = nullptr; } void EventsManager::startMainClockInt() { diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 9d1ff58b67..b93388c49e 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -1127,6 +1127,7 @@ PictureResource::PictureResource(Graphics::Surface *surface) { _onOff = 0; _maskData = 0; _planeSize = 0; + _keyColor = 0; _bounds = Common::Rect(0, 0, surface->w, surface->h); _imgData = (byte *)surface->getPixels(); @@ -1140,6 +1141,7 @@ PictureResource::PictureResource() { _onOff = 0; _maskData = 0; _planeSize = 0; + _keyColor = 0; _imgData = NULL; _freeImgData = DisposeAfterUse::NO; diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index 76063c874e..d2ac182030 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -622,14 +622,14 @@ void ThreadResource::parsePlayCommands() { v2 = READ_LE_UINT16(dataP); if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) { - _vm->_voy->_computerTextId = READ_LE_UINT16(dataP + 2); + _vm->_voy->_computerTextId = READ_LE_UINT16(dataP + 2) - 1; _vm->_voy->_computerTimeMin = READ_LE_UINT16(dataP + 4); _vm->_voy->_computerTimeMax = READ_LE_UINT16(dataP + 6); - _vm->_voy->_computerButtonRect.left = COMPUTER_BUTTON_TABLE[_vm->_voy->_computerTextId * 4]; - _vm->_voy->_computerButtonRect.top = COMPUTER_BUTTON_TABLE[_vm->_voy->_computerTextId * 4 + 1]; - _vm->_voy->_computerButtonRect.right = COMPUTER_BUTTON_TABLE[_vm->_voy->_computerTextId * 4 + 2]; - _vm->_voy->_computerButtonRect.bottom = COMPUTER_BUTTON_TABLE[_vm->_voy->_computerTextId * 4 + 3]; + _vm->_voy->_computerScreenRect.left = COMPUTER_SCREEN_TABLE[_vm->_voy->_computerTextId * 4]; + _vm->_voy->_computerScreenRect.top = COMPUTER_SCREEN_TABLE[_vm->_voy->_computerTextId * 4 + 1]; + _vm->_voy->_computerScreenRect.right = COMPUTER_SCREEN_TABLE[_vm->_voy->_computerTextId * 4 + 2]; + _vm->_voy->_computerScreenRect.bottom = COMPUTER_SCREEN_TABLE[_vm->_voy->_computerTextId * 4 + 3]; } dataP += 8; @@ -1152,7 +1152,8 @@ void ThreadResource::doRoom() { pt += Common::Point(30, 15); hotspotId = -1; - if (voy._computerTextId != -1 && voy._computerButtonRect.contains(pt)) + + if (voy._computerTextId != -1 && voy._computerScreenRect.contains(pt)) hotspotId = 999; for (uint idx = 0; idx < hotspots.size(); ++idx) { diff --git a/engines/voyeur/staticres.cpp b/engines/voyeur/staticres.cpp index 6fa61e027a..7016793ddc 100644 --- a/engines/voyeur/staticres.cpp +++ b/engines/voyeur/staticres.cpp @@ -57,7 +57,7 @@ const int BLIND_TABLE[] = { 5, 12, 6, 6, 13, 14, 13 }; -const int COMPUTER_BUTTON_TABLE[] = { +const int COMPUTER_SCREEN_TABLE[] = { 269, 128, 307, 163, 269, 128, 307, 163, 68, 79, 98, 102, diff --git a/engines/voyeur/staticres.h b/engines/voyeur/staticres.h index 56a05b4176..ea3a8003ac 100644 --- a/engines/voyeur/staticres.h +++ b/engines/voyeur/staticres.h @@ -37,7 +37,7 @@ extern const int LEVEL_M[]; extern const int BLIND_TABLE[]; -extern const int COMPUTER_BUTTON_TABLE[]; +extern const int COMPUTER_SCREEN_TABLE[]; extern const char *const SZ_FILENAMES[]; diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index 19e047de05..a35473ba93 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -42,10 +42,10 @@ /** * This is the namespace of the Voyeur engine. * - * Status of this engine: In Development + * Status of this engine: Complete * * Games using this engine: - * - Voyeur + * - Voyeur (Dos) */ namespace Voyeur { |