diff options
-rw-r--r-- | engines/mortevielle/actions.cpp | 66 | ||||
-rw-r--r-- | engines/mortevielle/dialogs.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 16 | ||||
-rw-r--r-- | engines/mortevielle/menu.h | 5 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 14 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 20 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 18 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.h | 8 | ||||
-rw-r--r-- | engines/mortevielle/prog.cpp | 12 | ||||
-rw-r--r-- | engines/mortevielle/taffich.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 24 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.h | 8 |
12 files changed, 86 insertions, 109 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index d4a53780e1..cd08177bcc 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -57,9 +57,9 @@ void fctMove() { if (!g_syn) ecr3(g_vm->getEngineString(S_GO_TO)); tfleche(); - if (g_iesc) + if (g_vm->_keyPressedEsc) g_okdes = false; - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(1); if (g_num == 0) @@ -224,7 +224,7 @@ void fctTake() { if (!g_syn) ecr3(g_vm->getEngineString(S_TAKE)); tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; if (g_caff == 3) { tcoord(2); @@ -322,12 +322,10 @@ void fctInventoryTake() { * @remarks Originally called 'tsoulever' */ void fctLift() { -// int cx; - if (!g_syn) ecr3(g_vm->getEngineString(S_LIFT)); tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(3); if (g_num == 0) { @@ -364,7 +362,7 @@ void fctRead() { if (!g_syn) ecr3(g_vm->getEngineString(S_READ)); tfleche(); - if (!(g_anyone) && !(g_iesc)) { + if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(4); if (g_num != 0) g_crep = 107; @@ -397,7 +395,7 @@ void fctLook() { if (!g_syn) ecr3(g_vm->getEngineString(S_LOOK)); tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(5); if (g_num == 0) { @@ -488,7 +486,7 @@ void fctSearch() { ecr3(g_vm->getEngineString(S_SEARCH)); tfleche(); - if (g_anyone || g_iesc) + if (g_anyone || g_vm->_keyPressedEsc) return; if (g_s._currPlace == 23) { @@ -599,7 +597,7 @@ void fctOpen() { } tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); @@ -652,10 +650,10 @@ void fctPlace() { ecr3(g_vm->getEngineString(S_PUT)); tfleche(); - if (g_iesc) + if (g_vm->_keyPressedEsc) g_crep = 998; - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(8); @@ -784,7 +782,7 @@ void fctTurn() { if (!g_syn) ecr3(g_vm->getEngineString(S_TURN)); tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(9); if (g_num != 0) { @@ -820,12 +818,12 @@ void fctSelfHide() { if (!g_syn) ecr3(g_vm->getEngineString(S_HIDE_SELF)); tfleche(); - if (!(g_anyone) && !(g_iesc)) { + if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(10); if (g_num == 0) - g_cache = false; + g_vm->_hiddenHero = false; else { - g_cache = true; + g_vm->_hiddenHero = true; g_crep = 999; } } @@ -842,7 +840,7 @@ void fctAttach() { if (!g_syn) ecr3(g_vm->getEngineString(S_TIE)); tfleche(); - if (!(g_anyone) && !(g_iesc)) { + if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { tcoord(8); g_crep = 997; if ((g_num != 0) && (g_s._currPlace == WELL)) { @@ -868,9 +866,9 @@ void fctClose() { if (g_caff < 26) { tfleche(); - if (g_iesc) + if (g_vm->_keyPressedEsc) g_crep = 998; - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); if (g_num != 0) { @@ -915,7 +913,7 @@ void fctKnock() { if (g_s._currPlace < DOOR) { tfleche(); - if (!(g_anyone) && !(g_iesc)) { + if (!(g_anyone) && !(g_vm->_keyPressedEsc)) { if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING)) g_crep = 133; else @@ -966,7 +964,7 @@ void fctSelfPut() { return; } tfleche(); - if ((g_anyone) || (g_iesc)) + if ((g_anyone) || (g_vm->_keyPressedEsc)) return; tcoord(7); g_crep = 124; @@ -1138,7 +1136,7 @@ void fctEnter() { g_s._teauto[8] = '*'; } else { int z = 0; - if (!g_vm->g_blo) + if (!g_vm->_blo) z = t11(g_ment); if (z != 0) { if ((g_ment == 3) || (g_ment == 7)) @@ -1155,12 +1153,12 @@ void fctEnter() { g_msg[4] = g_vm->_menu._discussMenu[g_x]; g_syn = true; if (g_ment == 9) { - g_col = true; + g_vm->_col = true; g_caff = 70; afdes(0); repon(2, g_caff); } else - g_col = false; + g_vm->_col = false; debloc(g_ment); g_ment = 0; } @@ -1237,7 +1235,7 @@ void fctForce() { if (g_caff < 25) tfleche(); - if ((!g_anyone) && (!g_iesc)) { + if ((!g_anyone) && (!g_vm->_keyPressedEsc)) { if (g_s._currPlace != 26) g_crep = 997; else { @@ -1297,7 +1295,7 @@ void fctWait() { do { ++g_jh; tinke(); - if (!g_vm->g_blo) + if (!g_vm->_blo) quel = t11(g_s._currPlace); if ((g_ipers != 0) && (g_mpers == 0)) { g_crep = 998; @@ -1327,7 +1325,7 @@ void fctSound() { ecr3(g_vm->getEngineString(S_PROBE2)); if (g_caff < 27) { tfleche(); - if (!(g_anyone) && (!g_iesc)) + if (!(g_anyone) && (!g_vm->_keyPressedEsc)) g_crep = 145; g_num = 0; } @@ -1345,7 +1343,7 @@ void fctDiscuss() { bool f; endSearch(); - if (g_col) + if (g_vm->_col) suj = 128; else { cx = 0; @@ -1463,8 +1461,8 @@ void fctDiscuss() { g_vm->setMouseClick(false); if (choi != 46) { int ix = choi - 1; - if (g_col) { - g_col = false; + if (g_vm->_col) { + g_vm->_col = false; g_s._currPlace = 15; if (g_iouv > 0) max = 8; @@ -1507,15 +1505,15 @@ void fctDiscuss() { showMouse(); } } while ((choi != 46) && (suj != 138)); - if (g_col) { + if (g_vm->_col) { g_s._faithScore += (3 * (g_s._faithScore / 10)); hideMouse(); hirs(); premtet(); sparl(0, 138); showMouse(); - g_col = false; - g_s._currPlace = 15; + g_vm->_col = false; + g_s._currPlace = LANDING; } g_ctrm = 0; hideMouse(); @@ -1541,7 +1539,7 @@ void fctSmell() { if (!g_syn) ecr3(g_vm->getEngineString(S_SMELL)); tfleche(); - if (!(g_anyone) && !(g_iesc)) + if (!(g_anyone) && !(g_vm->_keyPressedEsc)) if (g_caff == 16) g_crep = 153; } else if (g_caff == 123) diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index 717a256b8f..c4b476c73e 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -468,7 +468,7 @@ void f3f8::ani50() { pictout(adani, g_crep, 63, 12); g_crep = animof(2, 1); pictout(adani, g_crep, 63, 12); - g_largestClearScreen = (g_res == 1); + g_vm->_largestClearScreen = (g_res == 1); repon(2, kDialogStringIndex + 143); } diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index f2f19b6eee..9a0bcec2de 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -192,9 +192,9 @@ void Menu::drawMenu() { _menuActive = true; g_msg4 = OPCODE_NONE; g_msg3 = OPCODE_NONE; - g_choisi = false; + _menuSelected = false; g_vm->setMouseClick(false); - g_test0 = false; + _multiTitle = false; } void Menu::invers(int ix) { @@ -353,7 +353,7 @@ void Menu::menuDown(int ii) { } g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8); } while (cx != nb_lig); - g_test0 = true; + _multiTitle = true; showMouse(); } @@ -361,7 +361,7 @@ void Menu::menuDown(int ii) { * Menu is being removed, so restore the previous background area. */ void Menu::menuUp(int xx) { - if (g_test0) { + if (_multiTitle) { charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1); /* Restore the background area */ @@ -375,7 +375,7 @@ void Menu::menuUp(int xx) { // Copy the data Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest); - g_test0 = false; + _multiTitle = false; } } @@ -428,7 +428,7 @@ void Menu::mdn() { else ix = MENU_FILE; - if ((ix != g_msg3) || (!g_test0)) + if ((ix != g_msg3) || (!_multiTitle)) if (!((ix == MENU_FILE) && ((g_msg3 == MENU_SAVE) || (g_msg3 == MENU_LOAD)))) { menuUp(g_msg3); menuDown(ix); @@ -436,7 +436,7 @@ void Menu::mdn() { g_msg4 = OPCODE_NONE; } } else { // Not in the MenuTitle line - if ((y > 11) && (g_test0)) + if ((y > 11) && (_multiTitle)) util(x, y); } } else { // There was a click @@ -453,7 +453,7 @@ void Menu::mdn() { g_vm->setMouseClick(false); } else { // A menu was clicked on - g_choisi = (g_test0) && (g_msg4 != OPCODE_NONE); + _menuSelected = (_multiTitle) && (g_msg4 != OPCODE_NONE); menuUp(g_msg3); g_msg[4] = g_msg4; g_msg[3] = g_msg3; diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h index cdd343a9ed..5672ef7864 100644 --- a/engines/mortevielle/menu.h +++ b/engines/mortevielle/menu.h @@ -39,6 +39,9 @@ private: void menuDown(int ii); public: bool _menuActive; + bool _menuSelected; + bool _multiTitle; + bool _menuDisplayed; Common::String _inventoryStringArray[9]; Common::String _moveStringArray[8]; Common::String _actionStringArray[22]; @@ -47,7 +50,7 @@ public: int _discussMenu[9]; int _inventoryMenu[9]; int _moveMenu[8]; -public: + void setText(int menuId, Common::String name); void disableMenuItem(int menuId); void enableMenuItem(int menuId); diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index 24548fab13..e3bc5243f9 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -166,10 +166,10 @@ void clsf1() { */ void clearScreenType2() { hideMouse(); - if (g_largestClearScreen) { + if (g_vm->_largestClearScreen) { g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199)); g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15); - g_largestClearScreen = false; + g_vm->_largestClearScreen = false; } else { g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190)); g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15); @@ -194,7 +194,7 @@ void ecr2(Common::String str_) { g_vm->_screenSurface.putxy(8, 182); g_vm->_screenSurface.drawString(copy(str_, tlig, tlig << 1), 5); } else { - g_largestClearScreen = true; + g_vm->_largestClearScreen = true; clearScreenType2(); g_vm->_screenSurface.putxy(8, 176); g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5); @@ -318,9 +318,9 @@ void repon(int f, int m) { tmpStr = deline(m - 501 + kInventoryStringIndex); if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1)) - g_largestClearScreen = true; + g_vm->_largestClearScreen = true; else - g_largestClearScreen = false; + g_vm->_largestClearScreen = false; clearScreenType2(); displayStr(tmpStr, 8, 176, 85, 3, 5); @@ -385,7 +385,7 @@ void repon(int f, int m) { void t5(int cx) { if (cx == 10) - g_vm->g_blo = false; + g_vm->_blo = false; if (cx != 1) { g_vm->_roomPresenceLuc = false; @@ -1201,7 +1201,7 @@ void dprog() { g_li = 21; g_jh = 0; if (!g_s._ipre) - g_vm->g_blo = true; + g_vm->_blo = true; g_t = kTime1; g_mh = readclock(); } diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index bbe4a7734e..4c3342b900 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -96,7 +96,7 @@ void tinke() { if (y_s < 12) return; - if (!g_vm->g_blo) { + if (!g_vm->_blo) { if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7))) g_t = kTime2; else @@ -301,7 +301,7 @@ void tperd() { g_iouv = 0; g_mchai = 0; unsetSearchMenu(); - if (!g_vm->g_blo) { + if (!g_vm->_blo) { int cx; cx = t11(21); } @@ -312,7 +312,7 @@ void tperd() { repon(9, g_crep); clearScreenType2(); clsf3(); - g_col = false; + g_vm->_col = false; g_syn = false; g_okdes = false; } @@ -514,7 +514,7 @@ void t1sama() { //Entering manor g_s._currPlace = OWN_ROOM; affrep(); t5(10); - if (!g_vm->g_blo) + if (!g_vm->_blo) minute = t11(0); g_ipers = 0; g_mpers = 0; @@ -563,13 +563,13 @@ void tctrm() { void quelquun() { - if (g_imen) + if (g_vm->_menu._menuDisplayed) g_vm->_menu.eraseMenu(); endSearch(); g_crep = 997; L1: - if (!g_cache) { + if (!g_vm->_hiddenHero) { if (g_crep == 997) g_crep = 138; repon(2, g_crep); @@ -592,10 +592,10 @@ L1: g_msg[3] = MENU_DISCUSS; g_msg[4] = g_vm->_menu._discussMenu[cx]; g_syn = true; - g_col = true; + g_vm->_col = true; } else { if (getRandomNumber(1, 3) == 2) { - g_cache = false; + g_vm->_hiddenHero = false; g_crep = 137; goto L1; } else { @@ -608,7 +608,7 @@ L1: affrep(); } } - if (g_imen) + if (g_vm->_menu._menuDisplayed) g_vm->_menu.drawMenu(); } @@ -665,7 +665,7 @@ void tfleche() { } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect))); if (touch == '\73') - g_iesc = true; + g_vm->_keyPressedEsc = true; if (g_rect) { g_x = x_s; diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 95701ca3bd..42c714e456 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -154,8 +154,8 @@ Common::ErrorCode MortevielleEngine::initialise() { initMouse(); init_lieu(); - g_vm->_soundOff = false; - g_largestClearScreen = false; + _soundOff = false; + _largestClearScreen = false; teskbd(); dialpre(); @@ -553,9 +553,9 @@ void MortevielleEngine::handleAction() { clsf3(); oo = false; g_ctrm = 0; - if (!g_iesc) { + if (!_keyPressedEsc) { g_vm->_menu.drawMenu(); - g_imen = true; + g_vm->_menu._menuDisplayed = true; temps = 0; g_key = 0; funct = false; @@ -568,20 +568,20 @@ void MortevielleEngine::handleAction() { moveMouse(funct, inkey); CHECK_QUIT; temps = temps + 1; - } while (!((g_choisi) || (temps > lim) || (funct) || (g_anyone))); + } while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (g_anyone))); _inMainGameLoop = false; g_vm->_menu.eraseMenu(); - g_imen = false; + g_vm->_menu._menuDisplayed = false; if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) { changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1); return; } - if (g_choisi && (g_msg[3] == MENU_SAVE)) { + if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_SAVE)) { Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7); g_vm->_savegameManager.saveGame(g_msg[4] & 7, saveName); } - if (g_choisi && (g_msg[3] == MENU_LOAD)) + if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_LOAD)) g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1); if (inkey == '\103') { /* F9 */ temps = Alert::show(g_hintPctMessage, 1); @@ -639,7 +639,7 @@ void MortevielleEngine::handleAction() { g_okdes = false; dessin(0); } - if ((!g_syn) || (g_col)) + if ((!g_syn) || (_col)) repon(2, g_crep); } } while (g_syn); diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index d00d318d96..30b1b982e9 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -102,7 +102,6 @@ private: void playGame(); void handleAction(); public: - bool g_blo; bool _roomPresenceLuc; bool _roomPresenceIda; bool _purpleRoomPresenceLeo; @@ -116,6 +115,13 @@ public: bool _room9PresenceLeo; bool _soundOff; + bool _largestClearScreen; + bool _hiddenHero; + bool _keyPressedEsc; + + bool _blo; + bool _col; + ScreenSurface _screenSurface; PaletteManager _paletteManager; diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp index 36d5265ed3..a74def2eb4 100644 --- a/engines/mortevielle/prog.cpp +++ b/engines/mortevielle/prog.cpp @@ -70,12 +70,12 @@ void changeGraphicalDevice(int newDevice) { */ void MortevielleEngine::gameLoaded() { hideMouse(); - g_imen = false; + _menu._menuDisplayed = false; _loseGame = true; g_anyone = false; g_okdes = true; - g_col = false; - g_cache = false; + _col = false; + _hiddenHero = false; g_brt = false; g_maff = 68; g_mnumo = 0; @@ -132,10 +132,10 @@ void tmaj3() { } void tsitu() { - if (!g_col) + if (!g_vm->_col) clearScreenType2(); g_syn = false; - g_iesc = false; + g_vm->_keyPressedEsc = false; if (!g_anyone) { if (g_brt) if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) { @@ -199,7 +199,7 @@ void tsitu() { fctSelfPut(); if (g_msg[4] == OPCODE_SLOOK) fctSelftLook(); - g_cache = false; + g_vm->_hiddenHero = false; if (g_msg[4] == OPCODE_SHIDE) fctSelfHide(); diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 47954804ce..6fe9f61b60 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -252,7 +252,7 @@ void taffich() { if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) { if ((a == 13) || (a == 14)) displayAloneText(); - else if (!g_vm->g_blo) + else if (!g_vm->_blo) cx = t11(g_s._currPlace); g_mpers = 0; } diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 0fe22fc64d..d9aa291e3f 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -78,29 +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_blo, - g_bh1, - g_bf1, - g_bh2, - g_bh4, - g_bf4, - g_bh5, - g_bh6, - g_bh8, - g_bt3, - g_bt7, - g_bh9, - - g_soundOff, - g_main1, - g_choisi, - g_test0, - g_largestClearScreen, - g_imen, - g_cache, - g_iesc, - g_col, - g_syn, +bool g_syn, g_heroSearching, g_zuul, g_obpart, diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index 1a5f137be1..610b302e45 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -224,14 +224,6 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU /*---------------------------------------------------------------------------*/ extern bool - g_main1, - g_choisi, - g_test0, - g_largestClearScreen, - g_imen, - g_cache, - g_iesc, - g_col, g_syn, g_heroSearching, g_zuul, |