diff options
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/actions.cpp | 45 | ||||
-rw-r--r-- | engines/mortevielle/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/graphics.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 18 | ||||
-rw-r--r-- | engines/mortevielle/mor.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 26 | ||||
-rw-r--r-- | engines/mortevielle/prog.cpp | 12 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 6 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.h | 6 |
9 files changed, 61 insertions, 58 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 66215170ce..975992ee2a 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -621,7 +621,6 @@ void fctOpen() { * @remarks Originally called 'tmettre' */ void fctPlace() { - int quel; bool entre; char st[1410]; Common::String str_; @@ -669,8 +668,8 @@ void fctPlace() { repon(2, 165); maivid(); parole(6, -9, 1); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); - if (quel == 1) { + int answer = Alert::show(g_vm->getString(S_YES_NO), 1); + if (answer== 1) { deline(582, st, tay); i = Alert::show(delig, 1); tesok = false; @@ -682,7 +681,7 @@ void fctPlace() { clsf3(); showMouse(); tinke(); - pendule(); + drawClock(); if (ipers != 0) affper(ipers); else @@ -745,8 +744,6 @@ void fctPlace() { * @remarks Originally called 'ttourner' */ void fctTurn() { - int quel; - if (caff > 99) { crep = 149; return; @@ -762,8 +759,8 @@ void fctTurn() { if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) { repon(2, 167); parole(7, 9, 1); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); - if (quel == 1) + int answer = Alert::show(g_vm->getString(S_YES_NO), 1); + if (answer == 1) g_vm->_endGame = true; else crep = 168; @@ -772,8 +769,8 @@ void fctTurn() { repon(2, 175); clsf3(); parole(6, -9, 1); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); - if (quel == 1) { + int answer = Alert::show(g_vm->getString(S_YES_NO), 1); + if (answer == 1) { s.mlieu = 16; affrep(); } else @@ -1137,7 +1134,7 @@ void fctEnter() { * @remarks Originally called 'tdormir' */ void fctSleep() { - int z, j, h, m, quel; + int z, j, h, m; if ((s.mlieu > 15) && (s.mlieu < 26)) { crep = 148; @@ -1156,6 +1153,8 @@ void fctSleep() { ecrf2(); ecr2(g_vm->getString(S_WANT_TO_WAKE_UP)); calch(j, h, m); + + int answer; do { if (h < 8) { s.conf = s.conf - (s.conf / 20); @@ -1170,9 +1169,9 @@ void fctSleep() { if (h > 23) h = 0; tinke(); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); + answer = Alert::show(g_vm->getString(S_YES_NO), 1); anyone = false; - } while (!(quel == 1)); + } while (!(answer == 1)); crep = 998; num = 0; } @@ -1240,6 +1239,8 @@ void fctWait() { mpers = 0; clsf3(); + + int answer; do { ++jh; tinke(); @@ -1257,8 +1258,8 @@ void fctWait() { return; } repon(2, 102); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); - } while (!(quel == 2)); + answer = Alert::show(g_vm->getString(S_YES_NO), 1); + } while (!(answer == 2)); crep = 998; if (!anyone) tinke(); @@ -1472,7 +1473,7 @@ void fctDiscuss() { showMouse(); affper(ipers); tinke(); - pendule(); + drawClock(); affrep(); /* chech;*/ tmlieu(s.mlieu); @@ -1551,7 +1552,7 @@ void MortevielleEngine::endGame() { * @remarks Originally called 'tencore' */ void MortevielleEngine::loseGame() { - int quel; + int answer; clsf2(); musique(0); @@ -1562,12 +1563,12 @@ void MortevielleEngine::loseGame() { vh = 10; vm = 0; vj = 0; - min = 0; - heu = 10; - jou = 0; + _minute = 0; + _hour = 10; + _day = 0; repon(2, 180); - quel = Alert::show(g_vm->getString(S_YES_NO), 1); - _quitGame = (quel != 1); + answer = Alert::show(g_vm->getString(S_YES_NO), 1); + _quitGame = (answer != 1); } } // End of namespace Mortevielle diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index 1c0a4fa0a3..e26901bc8e 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -1098,7 +1098,7 @@ int ScreenSurface::getStringWidth(const Common::String &s) { return s.size() * charWidth; } -void ScreenSurface::droite(int x, int y, int xx, int yy, int coul) { +void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) { int step, i; float a, b; float xr, yr, xro, yro; diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h index 1aab4cf34b..28a9d64b7c 100644 --- a/engines/mortevielle/graphics.h +++ b/engines/mortevielle/graphics.h @@ -92,7 +92,7 @@ public: void putxy(int x, int y) { _textPos = Common::Point(x, y); } void writeg(const Common::String &l, int c); int getStringWidth(const Common::String &s); - void droite(int x, int y, int xx, int yy, int coul); + void drawLine(int x, int y, int xx, int yy, int coul); // TODO: Refactor code to remove this method, for increased performance void setPixel(const Common::Point &pt, int palIndex); diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index bf9a480af7..a4283407c5 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -618,7 +618,7 @@ void chlm(int &per) { if (per == 2) per = 128; } -void pendule() { +void drawClock() { const int cv[3][13] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 5, 8, 10, 8, 5, 0, -5, -8, -10, -8, -5, 0 }, @@ -638,30 +638,30 @@ void pendule() { co = 0; else co = 1; - if (min == 0) - g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co); + if (_minute == 0) + g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co); else - g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co); + g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co); - h = heu; + h = _hour; if (h > 12) h -= 12; if (h == 0) h = 12; - g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co); + g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co); showMouse(); g_vm->_screenSurface.putxy(568, 154); - if (heu > 11) + if (_hour > 11) g_vm->_screenSurface.writeg("PM ", 1); else g_vm->_screenSurface.writeg("AM ", 1); g_vm->_screenSurface.putxy(550, 160); - if ((jou >= 0) && (jou <= 8)) { + if ((_day >= 0) && (_day <= 8)) { Common::String tmp = g_vm->getString(S_DAY); - tmp.insertChar((char)(jou + 49), 0); + tmp.insertChar((char)(_day + 49), 0); g_vm->_screenSurface.writeg(tmp, 1); } } diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h index 22879246f6..0351bd0b7c 100644 --- a/engines/mortevielle/mor.h +++ b/engines/mortevielle/mor.h @@ -72,7 +72,7 @@ extern void cpl5(int &p); extern void cpl6(int &p); extern void person(); extern void chlm(int &per); -extern void pendule(); +extern void drawClock(); /************* * NIVEAU 11 * *************/ diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index 73259aa7a0..9dcbb85b0e 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -58,8 +58,8 @@ void tinke() { anyone = false; calch(j, h, m); - if (j != jou) { - jou = j; + if (j != _day) { + _day = j; cx = 0; do { ++cx; @@ -68,10 +68,10 @@ void tinke() { nbrep[cx] = 0; } while (!(cx == 8)); } - if ((h > heu) || ((h == 0) && (heu == 23))) { - heu = h; - min = 0; - pendule(); + if ((h > _hour) || ((h == 0) && (_hour == 23))) { + _hour = h; + _minute = 0; + drawClock(); cf = 0; for (cx = 1; cx <= 10; cx ++) { if (s.pourc[cx] == '*') @@ -96,9 +96,9 @@ void tinke() { stpou += d6; stpou += d4; } - if (m > min) { - min = 30; - pendule(); + if (m > _minute) { + _minute = 30; + drawClock(); } if (y_s < 12) return; @@ -110,16 +110,16 @@ void tinke() { t = ti1; cf = s.conf; if ((cf > 33) && (cf < 66)) - t = t - (t / 3); + t -= (t / 3); if (cf > 65) - t = t - ((t / 3) * 2); + t -= ((t / 3) * 2); nh = readclock(); if ((nh - mh) > t) { am = g_vm->_menu._menuActive; g_vm->_menu.eraseMenu(); - jh = jh + ((nh - mh) / t); + jh += ((nh - mh) / t); mh = nh; switch (li) { case 1: @@ -516,7 +516,7 @@ void t1sama() { //Entering manor premtet(); sparl(0, 140); dessine_rouleau(); - pendule(); + drawClock(); showMouse(); s.mlieu = 0; affrep(); diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp index f478fc0d39..e6fd9b7f45 100644 --- a/engines/mortevielle/prog.cpp +++ b/engines/mortevielle/prog.cpp @@ -46,7 +46,7 @@ void change_gd(int ngd) { showMouse(); dessine_rouleau(); tinke(); - pendule(); + drawClock(); if (ipers != 0) affper(ipers); else person(); clsf2(); @@ -122,7 +122,7 @@ void MortevielleEngine::gameLoaded() { } person(); tinke(); - pendule(); + drawClock(); afdes(0); repon(2, crep); clsf3(); @@ -254,9 +254,11 @@ void theure() { vj = vj / 48; vm = vh % 2; vh = vh / 2; - heu = vh; - if (vm == 1) min = 30; - else min = 0; + _hour = vh; + if (vm == 1) + _minute = 30; + else + _minute = 0; } } // End of namespace Mortevielle diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 0caadadbff..6f88d8db9a 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -127,10 +127,10 @@ int x, gd, /* Gd = graph device */ hdb, hfb, - heu, - jou, + _hour, + _day, key, - min, + _minute, num, max, res, diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index e8f9282df3..f5cd3afdc3 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -276,10 +276,10 @@ extern int x, gd, /* Gd = graph device */ hdb, hfb, - heu, - jou, + _hour, + _day, key, - min, + _minute, num, max, res, |