diff options
author | Strangerke | 2012-03-09 22:25:28 +0100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:23:03 +0200 |
commit | 78b3939168a3b77e7087c2844fe10e94a6402d74 (patch) | |
tree | b8ce5488374b01f59aebe1a9e91533056b357183 /engines/mortevielle | |
parent | 2035dca6df49e492c281a940952ce507fec62cbc (diff) | |
download | scummvm-rg350-78b3939168a3b77e7087c2844fe10e94a6402d74.tar.gz scummvm-rg350-78b3939168a3b77e7087c2844fe10e94a6402d74.tar.bz2 scummvm-rg350-78b3939168a3b77e7087c2844fe10e94a6402d74.zip |
MORTEVIELLE: Fix regression due to uninitialized variable, move remaining global booleans
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/actions.cpp | 44 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 30 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 45 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.h | 4 | ||||
-rw-r--r-- | engines/mortevielle/ovd1.cpp | 10 | ||||
-rw-r--r-- | engines/mortevielle/ovd1.h | 6 | ||||
-rw-r--r-- | engines/mortevielle/prog.cpp | 22 | ||||
-rw-r--r-- | engines/mortevielle/taffich.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 7 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.h | 8 |
10 files changed, 98 insertions, 80 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index cabd0522dd..6733d24117 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -58,8 +58,8 @@ void fctMove() { ecr3(g_vm->getEngineString(S_GO_TO)); tfleche(); if (g_vm->_keyPressedEsc) - g_okdes = false; - if ((g_anyone) || (g_vm->_keyPressedEsc)) + g_vm->_okdes = false; + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(1); if (g_num == 0) @@ -224,7 +224,7 @@ void fctTake() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_TAKE)); tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; if (g_caff == 3) { tcoord(2); @@ -325,7 +325,7 @@ void fctLift() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_LIFT)); tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(3); if (g_num == 0) { @@ -362,7 +362,7 @@ void fctRead() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_READ)); tfleche(); - if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { + if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(4); if (g_num != 0) g_crep = 107; @@ -395,7 +395,7 @@ void fctLook() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_LOOK)); tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(5); if (g_num == 0) { @@ -486,7 +486,7 @@ void fctSearch() { ecr3(g_vm->getEngineString(S_SEARCH)); tfleche(); - if (g_anyone || g_vm->_keyPressedEsc) + if (g_vm->_anyone || g_vm->_keyPressedEsc) return; if (g_s._currPlace == 23) { @@ -597,7 +597,7 @@ void fctOpen() { } tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); @@ -653,7 +653,7 @@ void fctPlace() { if (g_vm->_keyPressedEsc) g_crep = 998; - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(8); @@ -782,7 +782,7 @@ void fctTurn() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_TURN)); tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(9); if (g_num != 0) { @@ -818,7 +818,7 @@ void fctSelfHide() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_HIDE_SELF)); tfleche(); - if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { + if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(10); if (g_num == 0) g_vm->_hiddenHero = false; @@ -840,7 +840,7 @@ void fctAttach() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_TIE)); tfleche(); - if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { + if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(8); g_crep = 997; if ((g_num != 0) && (g_s._currPlace == WELL)) { @@ -868,7 +868,7 @@ void fctClose() { tfleche(); if (g_vm->_keyPressedEsc) g_crep = 998; - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); if (g_num != 0) { @@ -913,7 +913,7 @@ void fctKnock() { if (g_s._currPlace < DOOR) { tfleche(); - if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { + if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) { if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING)) g_crep = 133; else @@ -964,7 +964,7 @@ void fctSelfPut() { return; } tfleche(); - if ((g_anyone) || (g_vm->_keyPressedEsc)) + if ((g_vm->_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); g_crep = 124; @@ -1219,7 +1219,7 @@ void fctSleep() { h = 0; tinke(); answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); - g_anyone = false; + g_vm->_anyone = false; } while (answer != 1); g_crep = 998; g_num = 0; @@ -1235,7 +1235,7 @@ void fctForce() { if (g_caff < 25) tfleche(); - if ((!g_anyone) && (!g_vm->_keyPressedEsc)) { + if ((!g_vm->_anyone) && (!g_vm->_keyPressedEsc)) { if (g_s._currPlace != 26) g_crep = 997; else { @@ -1300,9 +1300,9 @@ void fctWait() { if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) cavegre(); if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM)) - g_anyone = true; + g_vm->_anyone = true; g_mpers = g_ipers; - if (!g_anyone) + if (!g_vm->_anyone) tinke(); return; } @@ -1310,7 +1310,7 @@ void fctWait() { answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); } while (answer != 2); g_crep = 998; - if (!g_anyone) + if (!g_vm->_anyone) tinke(); } @@ -1323,7 +1323,7 @@ void fctSound() { ecr3(g_vm->getEngineString(S_PROBE2)); if (g_caff < 27) { tfleche(); - if (!(g_anyone) && (!g_vm->_keyPressedEsc)) + if (!(g_vm->_anyone) && (!g_vm->_keyPressedEsc)) g_crep = 145; g_num = 0; } @@ -1537,7 +1537,7 @@ void fctSmell() { if (!g_vm->_syn) ecr3(g_vm->getEngineString(S_SMELL)); tfleche(); - if (!(g_anyone) && !(g_vm->_keyPressedEsc)) + if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) if (g_caff == 16) g_crep = 153; } else if (g_caff == 123) diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index bf62fe3857..e6abc8e915 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -49,7 +49,7 @@ void tinke() { int cx, cf, day, hour, minute; Common::String stpo; - g_anyone = false; + g_vm->_anyone = false; updateHour(day, hour, minute); if (day != g_day) { g_day = day; @@ -161,8 +161,8 @@ void tinke() { cavegre(); } else if (g_ipers == 10) { g_ipers = 0; - if (!g_brt) { - g_brt = true; + if (!g_vm->_brt) { + g_vm->_brt = true; g_hdb = readclock(); if (getRandomNumber(1, 5) < 5) { clsf3(); @@ -181,12 +181,12 @@ void tinke() { } } g_hfb = readclock(); - if ((g_brt) && ((g_hfb - g_hdb) > 17)) { + if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) { cx = nouvp(g_li); - g_brt = false; + g_vm->_brt = false; g_hdb = 0; if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM)) - g_anyone = true; + g_vm->_anyone = true; } } @@ -211,7 +211,7 @@ void fenat(char ans) { void afdes(int ad) { taffich(); dessin(ad); - g_okdes = false; + g_vm->_okdes = false; } void tkey1(bool d) { @@ -236,7 +236,7 @@ void tkey1(bool d) { quest = keypressed(); getMousePos(x, y, c); CHECK_QUIT; - } while (!(quest || (c != 0) || (d && g_anyone))); + } while (!(quest || (c != 0) || (d && g_vm->_anyone))); if (quest) testou(); g_vm->setMouseClick(false); @@ -312,7 +312,7 @@ void tperd() { clsf3(); g_vm->_col = false; g_vm->_syn = false; - g_okdes = false; + g_vm->_okdes = false; } void tsort() { @@ -532,7 +532,7 @@ void t1neig() { g_crep = 1506; tperd(); } else { - g_okdes = true; + g_vm->_okdes = true; g_s._currPlace = MOUNTAIN; affrep(); } @@ -645,7 +645,7 @@ void tfleche() { return; fenat(chr(152)); - g_rect = false; + bool inRect = false; do { touch = '\0'; @@ -654,18 +654,18 @@ void tfleche() { CHECK_QUIT; if (g_vm->getMouseClick()) - g_rect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12); + inRect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12); tinke(); - } while (!(qust || g_rect || g_anyone)); + } while (!(qust || inRect || g_vm->_anyone)); if (qust && (touch == '\103')) Alert::show(g_hintPctMessage, 1); - } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect))); + } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect))); if (touch == '\73') g_vm->_keyPressedEsc = true; - if (g_rect) { + if (inRect) { g_x = x_s; g_y = y_s; } diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 38b2343c26..01ef472084 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -58,6 +58,33 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g _mouseClick = false; _inMainGameLoop = false; _quitGame = false; + + _roomPresenceLuc = false; + _roomPresenceIda = false; + _purpleRoomPresenceLeo = false; + _roomPresenceGuy = false; + _roomPresenceEva = false; + _roomPresenceMax = false; + _roomPresenceBob = false; + _roomPresencePat = false; + _toiletsPresenceBobMax = false; + _bathRoomPresenceBobMax = false; + _room9PresenceLeo = false; + + _soundOff = false; + _largestClearScreen = false; + _hiddenHero = false; + _heroSearching = false; + _keyPressedEsc = false; + _reloadCFIEC = false; + + _blo = false; + _col = false; + _syn = false; + _obpart = false; + _okdes = false; + _anyone = false; + _brt = false; } MortevielleEngine::~MortevielleEngine() { @@ -145,8 +172,8 @@ Common::ErrorCode MortevielleEngine::initialise() { g_currGraphicalDevice = MODE_EGA; g_newGraphicalDevice = g_currGraphicalDevice; charpal(); - charge_cfiph(); - charge_cfiec(); + loadCFIPH(); + loadCFIEC(); zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64); g_c_zzz = 1; init_nbrepm(); @@ -498,13 +525,13 @@ void MortevielleEngine::showIntroduction() { * loses, and chooses to start playing the game again. */ void MortevielleEngine::mainGame() { - if (g_rech_cfiec) - charge_cfiec(); + if (_reloadCFIEC) + loadCFIEC(); for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep) zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64); - charge_bruit5(); + loadBRUIT5(); _menu.initMenu(); theure(); @@ -567,7 +594,7 @@ void MortevielleEngine::handleAction() { moveMouse(funct, inkey); CHECK_QUIT; temps = temps + 1; - } while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (g_anyone))); + } while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (_anyone))); _inMainGameLoop = false; g_vm->_menu.eraseMenu(); @@ -611,7 +638,7 @@ void MortevielleEngine::handleAction() { g_mnumo = g_msg[3]; if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF)) g_mnumo = g_msg[4]; - if (!g_anyone) { + if (!_anyone) { if ((g_vm->_heroSearching) || (_obpart)) { if (y_s < 12) return; @@ -634,8 +661,8 @@ void MortevielleEngine::handleAction() { if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) { taffich(); - if (g_okdes) { - g_okdes = false; + if (g_vm->_okdes) { + g_vm->_okdes = false; dessin(0); } if ((!g_vm->_syn) || (_col)) diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index 69446ae8b9..5a8c0f911a 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -119,11 +119,15 @@ public: bool _hiddenHero; bool _heroSearching; bool _keyPressedEsc; + bool _reloadCFIEC; bool _blo; bool _col; bool _syn; bool _obpart; + bool _okdes; + bool _anyone; + bool _brt; ScreenSurface _screenSurface; diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp index 8641a18501..374a5f75df 100644 --- a/engines/mortevielle/ovd1.cpp +++ b/engines/mortevielle/ovd1.cpp @@ -167,7 +167,7 @@ void music() { if (g_vm->_soundOff) return; - g_rech_cfiec = true; + g_vm->_reloadCFIEC = true; if (!fic.open("mort.img")) error("Missing file - mort.img"); @@ -193,7 +193,7 @@ void music() { } -void charge_bruit5() { +void loadBRUIT5() { Common::File f; if (!f.open("bruit5")) @@ -203,7 +203,7 @@ void charge_bruit5() { f.close(); } -void charge_cfiec() { +void loadCFIEC() { Common::File f; if (!f.open("cfiec.mor")) @@ -212,11 +212,11 @@ void charge_cfiec() { f.read(&g_adcfiec[0], 822 * 128); f.close(); - g_rech_cfiec = false; + g_vm->_reloadCFIEC = false; } -void charge_cfiph() { +void loadCFIPH() { Common::File f; if (!f.open("cfiph.mor")) diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h index 25633a4111..ef9f401232 100644 --- a/engines/mortevielle/ovd1.h +++ b/engines/mortevielle/ovd1.h @@ -35,9 +35,9 @@ extern void chartex(); extern void dialpre(); extern void init_lieu(); extern void music(); -extern void charge_bruit5(); -extern void charge_cfiec(); -extern void charge_cfiph(); +extern void loadBRUIT5(); +extern void loadCFIEC(); +extern void loadCFIPH(); extern void suite(); } // End of namespace Mortevielle diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp index eb6b979368..95e8c011d7 100644 --- a/engines/mortevielle/prog.cpp +++ b/engines/mortevielle/prog.cpp @@ -72,11 +72,11 @@ void MortevielleEngine::gameLoaded() { hideMouse(); _menu._menuDisplayed = false; _loseGame = true; - g_anyone = false; - g_okdes = true; + _anyone = false; + _okdes = true; _col = false; _hiddenHero = false; - g_brt = false; + _brt = false; g_maff = 68; g_mnumo = 0; g_prebru = 0; @@ -88,8 +88,8 @@ void MortevielleEngine::gameLoaded() { g_cs = 0; g_is = 0; g_ment = 0; - g_vm->_syn = true; - g_vm->_heroSearching = true; + _syn = true; + _heroSearching = true; g_mchai = 0; g_inei = 0; initouv(); @@ -98,10 +98,10 @@ void MortevielleEngine::gameLoaded() { affrep(); g_hintPctMessage = deline(580); - g_okdes = false; + _okdes = false; _endGame = true; _loseGame = false; - g_vm->_heroSearching = false; + _heroSearching = false; displayAloneText(); tinke(); @@ -136,8 +136,8 @@ void tsitu() { clearScreenType2(); g_vm->_syn = false; g_vm->_keyPressedEsc = false; - if (!g_anyone) { - if (g_brt) + if (!g_vm->_anyone) { + if (g_vm->_brt) if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) { g_ctrm = 4; mennor(); @@ -204,9 +204,9 @@ void tsitu() { if (g_msg[4] == OPCODE_SHIDE) fctSelfHide(); } else { - if (g_anyone) { + if (g_vm->_anyone) { quelquun(); - g_anyone = false; + g_vm->_anyone = false; mennor(); return; } diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 6fe9f61b60..5bb172f527 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -148,7 +148,7 @@ void taffich() { break; } - g_okdes = true; + g_vm->_okdes = true; hideMouse(); lgt = 0; Common::String filename; diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 2903abfc43..14f440fff8 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -78,12 +78,7 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0}; /*------------------------------ VARIABLES ------------------------------*/ /*---------------------------------------------------------------------------*/ -bool g_okdes, - g_arret, - g_anyone, - g_brt, - g_rect, - g_rech_cfiec; +bool g_rech_cfiec; int g_x, diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index 0402cd6d48..cf7d6084e1 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -223,14 +223,6 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU /*------------------------------ VARIABLES ------------------------------*/ /*---------------------------------------------------------------------------*/ -extern bool - g_okdes, - g_anyone, - g_brt, - g_rect, - g_rech_cfiec; - - extern int g_x, g_y, g_t, |