From 1a70cee6a6e59290819f516736bb3123f232e342 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 2 Mar 2012 02:04:43 +0100 Subject: MORTEVIELLE: Silent a bunch of GCC warnings and errors --- engines/mortevielle/actions.cpp | 610 ++++++++++++++++++------------------ engines/mortevielle/dialogs.cpp | 19 +- engines/mortevielle/keyboard.cpp | 2 +- engines/mortevielle/level15.cpp | 8 +- engines/mortevielle/menu.cpp | 10 +- engines/mortevielle/mor.cpp | 145 +++++---- engines/mortevielle/mor2.cpp | 148 +++++---- engines/mortevielle/mortevielle.cpp | 52 +-- engines/mortevielle/mouse.cpp | 6 +- engines/mortevielle/ovd1.cpp | 6 +- engines/mortevielle/parole.cpp | 4 +- engines/mortevielle/parole2.cpp | 6 +- engines/mortevielle/prog.cpp | 104 +++--- engines/mortevielle/saveload.cpp | 6 +- engines/mortevielle/taffich.cpp | 44 +-- engines/mortevielle/var_mor.cpp | 32 +- engines/mortevielle/var_mor.h | 32 +- 17 files changed, 614 insertions(+), 620 deletions(-) (limited to 'engines/mortevielle') diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 49d6a00c0a..56c87efdf8 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -49,13 +49,13 @@ namespace Mortevielle { void fctMove() { int cx; - if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._moveMenu[6])) { - s.mlieu = 15; - caff = s.mlieu; + if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { + g_s.mlieu = 15; + caff = g_s.mlieu; afdes(0); - repon(2, s.mlieu); + repon(2, g_s.mlieu); } - if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._moveMenu[6])) { + if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { if (!syn) ecr3(g_vm->getEngineString(S_GO_TO)); tfleche(); @@ -64,21 +64,21 @@ void fctMove() { if ((anyone) || (iesc)) return; tcoord(1); - if (num == 0) + if (g_num == 0) return; - if (num == 1) { - s.mlieu = 0; + if (g_num == 1) { + g_s.mlieu = 0; tmlieu(0); - } else if (num == 7) { - s.mlieu = 13; + } else if (g_num == 7) { + g_s.mlieu = 13; tmlieu(13); - } else if (num != 6) - s.mlieu = 26; - if ((num > 1) && (num < 6)) - ment = num - 1; - if (num > 7) - ment = num - 3; - if (num != 6) + } else if (g_num != 6) + g_s.mlieu = 26; + if ((g_num > 1) && (g_num < 6)) + ment = g_num - 1; + if (g_num > 7) + ment = g_num - 3; + if (g_num != 6) affrep(); else aldepl(); @@ -88,56 +88,56 @@ void fctMove() { cx = 0; do { ++cx; - } while (g_vm->_menu._moveMenu[cx] != msg[4]); - if (s.mlieu == 19) { + } while (g_vm->_menu._moveMenu[cx] != g_msg[4]); + if (g_s.mlieu == 19) { if (cx == 1) t1deva(); if (cx == 2) t1neig(); goto L2; } - if (s.mlieu == 23) { + if (g_s.mlieu == 23) { if (cx == 1) t1deau(); if (cx == 2) t1derr(); goto L2; } - if ((s.mlieu == 11) && (cx == 1)) + if ((g_s.mlieu == 11) && (cx == 1)) cx = 6; - if (s.mlieu == 12) { + if (g_s.mlieu == 12) { if (cx == 2) cx = 6; if (cx == 5) cx = 16; } - if ((s.mlieu == 14) && (cx == 3)) + if ((g_s.mlieu == 14) && (cx == 3)) cx = 6; - if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4)) + if (((g_s.mlieu == 15) || (g_s.mlieu == 26)) && (cx == 4)) cx = 6; - if ((s.mlieu > 19) && (s.mlieu != 26)) + if ((g_s.mlieu > 19) && (g_s.mlieu != 26)) cx += 10; - if ((s.mlieu == 20) && (cx == 13)) + if ((g_s.mlieu == 20) && (cx == 13)) cx = 16; - if (s.mlieu == 21) { + if (g_s.mlieu == 21) { if (cx == 12) cx = 16; else if (cx > 13) cx = 15; } - if ((s.mlieu == 22) && (cx > 14)) + if ((g_s.mlieu == 22) && (cx > 14)) cx = 15; - if ((s.mlieu == 24) && (cx != 17)) + if ((g_s.mlieu == 24) && (cx != 17)) if (cx > 13) cx = 15; if (cx == 1) - s.mlieu = 11; + g_s.mlieu = 11; else if (cx == 2) - s.mlieu = 12; + g_s.mlieu = 12; else if (cx == 3) - s.mlieu = 14; + g_s.mlieu = 14; else if (cx == 4) - s.mlieu = 15; + g_s.mlieu = 15; else if (cx == 5) cx = 12; if (cx == 6) @@ -147,31 +147,31 @@ void fctMove() { else if (cx == 12) t1deva(); else if (cx == 13) - s.mlieu = 20; + g_s.mlieu = 20; else if (cx == 14) - s.mlieu = 24; + g_s.mlieu = 24; else if (cx == 15) t1neig(); else if (cx == 16) t1derr(); else if (cx == 17) { - if ((s.ipuit != 120) && (s.ipuit != 140)) + if ((g_s.ipuit != 120) && (g_s.ipuit != 140)) crep = 997; - else if (s.ipuit == 120) + else if (g_s.ipuit == 120) crep = 181; - else if (s.conf > 80) { + else if (g_s.conf > 80) { crep = 1505; tperd(); } else { - s.mlieu = 23; + g_s.mlieu = 23; affrep(); } } if ((cx < 5) || (cx == 13) || (cx == 14)) affrep(); - debloc(s.mlieu); + debloc(g_s.mlieu); L2: - tmlieu(s.mlieu); + tmlieu(g_s.mlieu); } /** @@ -184,24 +184,24 @@ void fctTake() { avpoing(cx); if (crep != 139) { if (ipers > 0) - s.conf += 3; + g_s.conf += 3; if (obpart) { - if (s.mlieu == 2) - s.iloic = 0; - if (s.mlieu == 13) { - if (s.iboul == caff) - s.iboul = 0; - if (s.ibag == caff) - s.ibag = 0; + if (g_s.mlieu == 2) + g_s.iloic = 0; + if (g_s.mlieu == 13) { + if (g_s.iboul == caff) + g_s.iboul = 0; + if (g_s.ibag == caff) + g_s.ibag = 0; } - if (s.mlieu == 14) - s.icave = 0; - if (s.mlieu == 16) - s.icryp = 0; - if (s.mlieu == 17) - s.ivier = 0; - if (s.mlieu == 24) - s.ipuit = 0; + if (g_s.mlieu == 14) + g_s.icave = 0; + if (g_s.mlieu == 16) + g_s.icryp = 0; + if (g_s.mlieu == 17) + g_s.ivier = 0; + if (g_s.mlieu == 24) + g_s.ipuit = 0; mfouen(); obpart = false; affrep(); @@ -210,7 +210,7 @@ void fctTake() { tsuiv(); ++dobj; if (dobj > 6) { - s.conf += 2; + g_s.conf += 2; dobj = 0; } } @@ -224,46 +224,46 @@ void fctTake() { return; if (caff == 3) { tcoord(2); - if (num == 1) { + if (g_num == 1) { crep = 152; return; } } tcoord(5); - if ((num == 0) || ((num == 1) && (s.mlieu == 16))) { + if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) { tcoord(8); - if (num != 0) { + if (g_num != 0) { if (ipers > 0) - s.conf += 3; + g_s.conf += 3; crep = 997; - if ((s.mlieu == 2) && (s.iloic != 0)) - avpoing(s.iloic); - if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) { - avpoing(s.iboul); + if ((g_s.mlieu == 2) && (g_s.iloic != 0)) + avpoing(g_s.iloic); + if ((g_s.mlieu == 13) && (g_num == 1) && (g_s.iboul != 0)) { + avpoing(g_s.iboul); if ((crep != 997) && (crep != 139)) aniof(2, 7); } - if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) { - avpoing(s.ibag); + if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) { + avpoing(g_s.ibag); if ((crep != 997) && (crep != 139)) aniof(2, 6); } - if ((s.mlieu == 14) && (s.icave != 0)) { - avpoing(s.icave); + if ((g_s.mlieu == 14) && (g_s.icave != 0)) { + avpoing(g_s.icave); if ((crep != 997) && (crep != 139)) aniof(2, 2); } - if ((s.mlieu == 16) && (s.icryp != 0)) - avpoing(s.icryp); - if ((s.mlieu == 17) && (s.ivier != 0)) { - avpoing(s.ivier); + if ((g_s.mlieu == 16) && (g_s.icryp != 0)) + avpoing(g_s.icryp); + if ((g_s.mlieu == 17) && (g_s.ivier != 0)) { + avpoing(g_s.ivier); if ((crep != 997) && (crep != 139)) { crep = 182; aniof(2, 1); } } - if ((s.mlieu == 24) && (s.ipuit != 0)) { - avpoing(s.ipuit); + if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) { + avpoing(g_s.ipuit); if ((crep != 997) && (crep != 139)) aniof(2, 1); } @@ -271,15 +271,15 @@ void fctTake() { crep = 999; } } else { - if ( ((s.mlieu == 0) && (num == 3)) || ((s.mlieu == 1) && (num == 4)) - || ((s.mlieu == 2) && (num == 1)) || ((s.mlieu == 4) && (num == 3)) - || ((s.mlieu == 5) && (num == 6)) || ((s.mlieu == 6) && (num == 2)) - || ((s.mlieu == 7) && (num == 6)) || ((s.mlieu == 8) && (num == 4)) - || ((s.mlieu == 9) && (num == 4)) || ((s.mlieu == 10) && (num > 2)) - || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6)) - || ((s.mlieu == 13) && (num > 4)) || ((s.mlieu > 13) && (s.mlieu != 23)) ) + if ( ((g_s.mlieu == 0) && (g_num == 3)) || ((g_s.mlieu == 1) && (g_num == 4)) + || ((g_s.mlieu == 2) && (g_num == 1)) || ((g_s.mlieu == 4) && (g_num == 3)) + || ((g_s.mlieu == 5) && (g_num == 6)) || ((g_s.mlieu == 6) && (g_num == 2)) + || ((g_s.mlieu == 7) && (g_num == 6)) || ((g_s.mlieu == 8) && (g_num == 4)) + || ((g_s.mlieu == 9) && (g_num == 4)) || ((g_s.mlieu == 10) && (g_num > 2)) + || ((g_s.mlieu == 11) && (g_num == 7)) || ((g_s.mlieu == 12) && (g_num == 6)) + || ((g_s.mlieu == 13) && (g_num > 4)) || ((g_s.mlieu > 13) && (g_s.mlieu != 23)) ) crep = 997; - else if (s.mlieu == 23) { + else if (g_s.mlieu == 23) { crep = 1504; tperd(); } else @@ -296,16 +296,16 @@ void fctInventoryTake() { cx = 0; do { ++cx; - } while (g_vm->_menu._inventoryMenu[cx] != msg[4]); + } while (g_vm->_menu._inventoryMenu[cx] != g_msg[4]); cz = 0; cy = 0; do { ++cy; - if (ord(s.sjer[cy]) != 0) + if (ord(g_s.sjer[cy]) != 0) ++cz; } while (cz != cx); - cz = ord(s.sjer[cy]); - s.sjer[cy] = chr(0); + cz = ord(g_s.sjer[cy]); + g_s.sjer[cy] = chr(0); modinv(); avpoing(cz); crep = 998; @@ -325,25 +325,25 @@ void fctLift() { if ((anyone) || (iesc)) return; tcoord(3); - if (num == 0) { + if (g_num == 0) { tcoord(8); - if (num != 0) { + if (g_num != 0) { if (ipers > 0) - ++s.conf; + ++g_s.conf; crep = 997; - if ((s.mlieu == 2) && (s.iloic != 0)) - treg(s.iloic); + if ((g_s.mlieu == 2) && (g_s.iloic != 0)) + treg(g_s.iloic); } return; } if (ipers > 0) - ++s.conf; - cx = s.mlieu; - if (s.mlieu == 16) + ++g_s.conf; + cx = g_s.mlieu; + if (g_s.mlieu == 16) cx = 14; - else if (s.mlieu == 19) + else if (g_s.mlieu == 19) cx = 15; - crep = tabdon[asoul + (cx << 3) + (num - 1)]; + crep = tabdon[asoul + (cx << 3) + (g_num - 1)]; if (crep == 255) crep = 997; } @@ -361,7 +361,7 @@ void fctRead() { tfleche(); if (!(anyone) && !(iesc)) { tcoord(4); - if (num != 0) + if (g_num != 0) crep = 107; } } @@ -372,10 +372,10 @@ void fctRead() { * @remarks Originally called 'tslire' */ void fctSelfRead() { - if (s.derobj == 0) + if (g_s.derobj == 0) crep = 186; else - st4(s.derobj); + st4(g_s.derobj); } /** @@ -395,64 +395,64 @@ void fctLook() { if ((anyone) || (iesc)) return; tcoord(5); - if (num == 0) { + if (g_num == 0) { tcoord(8); crep = 131; - if (num != 0) { - if (s.mlieu == 13) { - if (num == 1) { + if (g_num != 0) { + if (g_s.mlieu == 13) { + if (g_num == 1) { crep = 164; - if (s.ibag != 0) - treg(s.ibag); - else if (s.iboul != 0) - treg(s.iboul); + if (g_s.ibag != 0) + treg(g_s.ibag); + else if (g_s.iboul != 0) + treg(g_s.iboul); } else { crep = 193; - if (s.ibag != 0) - treg(s.ibag); + if (g_s.ibag != 0) + treg(g_s.ibag); } } - if (s.mlieu == 14) { + if (g_s.mlieu == 14) { crep = 164; - if (s.icave != 0) - treg(s.icave); + if (g_s.icave != 0) + treg(g_s.icave); } - if (s.mlieu == 17) { + if (g_s.mlieu == 17) { crep = 174; - if (s.ivier != 0) - treg(s.ivier); + if (g_s.ivier != 0) + treg(g_s.ivier); } - if (s.mlieu == 24) { + if (g_s.mlieu == 24) { crep = 131; - if (s.ipuit != 0) - treg(s.ipuit); + if (g_s.ipuit != 0) + treg(g_s.ipuit); } } return; } - cx = s.mlieu; - if (s.mlieu == 20) + cx = g_s.mlieu; + if (g_s.mlieu == 20) cx = 17; - if ((s.mlieu > 21) && (s.mlieu < 25)) + if ((g_s.mlieu > 21) && (g_s.mlieu < 25)) cx -= 4; - if (s.mlieu == 26) + if (g_s.mlieu == 26) cx = 21; - crep = tabdon[arega + (cx * 7) + num - 1]; - if ((s.mlieu == 13) && (num == 8)) + crep = tabdon[arega + (cx * 7) + g_num - 1]; + if ((g_s.mlieu == 13) && (g_num == 8)) crep = 126; - if (s.mlieu == 19) + if (g_s.mlieu == 19) crep = 103; if (crep == 255) crep = 131; - if ((s.mlieu == 1) && (num == 1)) + if ((g_s.mlieu == 1) && (g_num == 1)) treg(144); - if ((s.mlieu == 5) && (num == 3)) + if ((g_s.mlieu == 5) && (g_num == 3)) treg(147); - if ((s.mlieu == 8) && (num == 3)) + if ((g_s.mlieu == 8) && (g_num == 3)) treg(149); - if ((s.mlieu == 9) && (num == 2)) + if ((g_s.mlieu == 9) && (g_num == 2)) treg(30); - if ((s.mlieu == 10) && (num == 3)) + if ((g_s.mlieu == 10) && (g_num == 3)) treg(31); } @@ -461,8 +461,8 @@ void fctLook() { * @remarks Originally called 'tsregarder' */ void fctSelftLook() { - if (s.derobj != 0) - treg(s.derobj); + if (g_s.derobj != 0) + treg(g_s.derobj); else crep = 186; } @@ -486,25 +486,25 @@ void fctSearch() { if (anyone || iesc) return; - if (s.mlieu == 23) { + if (g_s.mlieu == 23) { crep = 1504; tperd(); return; } tcoord(6); - if (num == 0) { + if (g_num == 0) { tcoord(7); - if (num != 0) { + if (g_num != 0) { int cx = 0; do { ++cx; - } while ((cx <= 6) && (num != ord(touv[cx]))); - if (num != ord(touv[cx])) + } while ((cx <= 6) && (g_num != ord(touv[cx]))); + if (g_num != ord(touv[cx])) crep = 187; else { if (ipers > 0) - s.conf += 3; + g_s.conf += 3; rechai(mchai); if (mchai != 0) { @@ -519,43 +519,43 @@ void fctSearch() { } else { tcoord(8); crep = 997; - if (num != 0) { + if (g_num != 0) { if (ipers > 0) - s.conf += 3; - if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) { - if (s.mlieu == 2) { + g_s.conf += 3; + if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) { + if (g_s.mlieu == 2) { crep = 123; - if (s.iloic != 0) - treg(s.iloic); + if (g_s.iloic != 0) + treg(g_s.iloic); } - if (s.mlieu == 16) { + if (g_s.mlieu == 16) { crep = 123; - if (s.icryp != 0) - treg(s.icryp); + if (g_s.icryp != 0) + treg(g_s.icryp); } } } } } else { if (ipers > 0) - s.conf += 3; + g_s.conf += 3; crep = 997; - if (s.mlieu < 14) - crep = r[s.mlieu]; + if (g_s.mlieu < 14) + crep = r[g_s.mlieu]; - if ((s.mlieu == 3) && (num == 2)) + if ((g_s.mlieu == 3) && (g_num == 2)) crep = 162; - if (s.mlieu == 12) { - if ((num == 3) || (num == 4)) + if (g_s.mlieu == 12) { + if ((g_num == 3) || (g_num == 4)) crep = 162; - else if (num == 5) + else if (g_num == 5) crep = 159; } - if (s.mlieu == 19) + if (g_s.mlieu == 19) crep = 104; - else if (s.mlieu == 16) + else if (g_s.mlieu == 16) crep = 155; } } @@ -565,8 +565,8 @@ void fctSearch() { * @remarks Originally called 'tsfouiller' */ void fctSelfSearch() { - if (s.derobj != 0) - st7(s.derobj); + if (g_s.derobj != 0) + st7(g_s.derobj); else crep = 186; } @@ -581,7 +581,7 @@ void fctOpen() { if (caff == 26) { if (ment != 0) { - msg[4] = OPCODE_ENTER; + g_msg[4] = OPCODE_ENTER; syn = true; } else crep = 997; @@ -598,34 +598,34 @@ void fctOpen() { return; tcoord(7); - if (num != 0) { + if (g_num != 0) { if (ipers > 0) - s.conf += 2; + g_s.conf += 2; ++iouv; int cx = 0; do { ++cx; - } while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num))); - if (ord(touv[cx]) != num) { - if (!( ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7))) - || ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6))) - || ((s.mlieu == 4) && (num == 5)) - || ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) || (s.mlieu == 8) || (s.mlieu == 13))) - || ((s.mlieu == 8) && (num == 2)) - || ((s.mlieu == 12) && (num == 7))) ) { - if ( ((s.mlieu > 10) && (s.mlieu < 14)) - || ((s.mlieu > 6) && (s.mlieu < 10)) - || (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) { + } while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == g_num))); + if (ord(touv[cx]) != g_num) { + if (!( ((g_num == 3) && ((g_s.mlieu == 0) || (g_s.mlieu == 9) || (g_s.mlieu == 5) || (g_s.mlieu == 7))) + || ((g_num == 4) && ((g_s.mlieu == 1) || (g_s.mlieu == 2) || (g_s.mlieu == 6))) + || ((g_s.mlieu == 4) && (g_num == 5)) + || ((g_num == 6) && ((g_s.mlieu == 7) || (g_s.mlieu == 10) || (g_s.mlieu == 8) || (g_s.mlieu == 13))) + || ((g_s.mlieu == 8) && (g_num == 2)) + || ((g_s.mlieu == 12) && (g_num == 7))) ) { + if ( ((g_s.mlieu > 10) && (g_s.mlieu < 14)) + || ((g_s.mlieu > 6) && (g_s.mlieu < 10)) + || (g_s.mlieu == 0) || (g_s.mlieu == 2) || (g_s.mlieu == 5)) { if (hazard(1, 4) == 3) parole(7, 9, 1); } - touv[cx] = chr(num); - aniof(1, num); + touv[cx] = chr(g_num); + aniof(1, g_num); } - cx = s.mlieu; - if (s.mlieu == 16) + cx = g_s.mlieu; + if (g_s.mlieu == 16) cx = 14; - crep = tabdon[aouvr + (cx * 7) + num - 1]; + crep = tabdon[aouvr + (cx * 7) + g_num - 1]; if (crep == 254) crep = 999; } else @@ -638,7 +638,7 @@ void fctOpen() { * @remarks Originally called 'tmettre' */ void fctPlace() { - if (s.derobj == 0) { + if (g_s.derobj == 0) { crep = 186; return; } @@ -654,32 +654,32 @@ void fctPlace() { return; tcoord(8); - if (num != 0) { + if (g_num != 0) { crep = 999; if (caff == 13) { - if (num == 1) { - if (s.iboul != 0) { + if (g_num == 1) { + if (g_s.iboul != 0) { crep = 188; } else { - s.iboul = s.derobj; - if (s.derobj == 141) + g_s.iboul = g_s.derobj; + if (g_s.derobj == 141) aniof(1, 7); } - } else if (s.ibag != 0) { + } else if (g_s.ibag != 0) { crep = 188; } else { - s.ibag = s.derobj; - if (s.derobj == 159) + g_s.ibag = g_s.derobj; + if (g_s.derobj == 159) aniof(1, 6); } } if (caff == 14) { - if (s.icave != 0) { + if (g_s.icave != 0) { crep = 188; } else { - s.icave = s.derobj; - if (s.derobj == 151) { + g_s.icave = g_s.derobj; + if (g_s.derobj == 151) { // Open hidden passage aniof(1, 2); aniof(1, 1); @@ -710,10 +710,10 @@ void fctPlace() { g_vm->_menu.displayMenu(); if (enterPassageFl) { - s.mlieu = 17; + g_s.mlieu = 17; tmlieu(17); } else { - tmlieu(s.mlieu); + tmlieu(g_s.mlieu); writepal(14); dessin(0); aniof(1, 2); @@ -735,17 +735,17 @@ void fctPlace() { } if (caff == 16) { - if (s.icryp == 0) - s.icryp = s.derobj; + if (g_s.icryp == 0) + g_s.icryp = g_s.derobj; else crep = 188; } if (caff == 17) { - if (s.ivier != 0) { + if (g_s.ivier != 0) { crep = 188; - } else if (s.derobj == 143) { - s.ivier = 143; + } else if (g_s.derobj == 143) { + g_s.ivier = 143; aniof(1, 1); } else { crep = 1512; @@ -754,10 +754,10 @@ void fctPlace() { } if (caff == 24) { - if (s.ipuit != 0) { + if (g_s.ipuit != 0) { crep = 188; - } else if ((s.derobj == 140) || (s.derobj == 120)) { - s.ipuit = s.derobj; + } else if ((g_s.derobj == 140) || (g_s.derobj == 120)) { + g_s.ipuit = g_s.derobj; aniof(1, 1); } else { crep = 185; @@ -784,9 +784,9 @@ void fctTurn() { if ((anyone) || (iesc)) return; tcoord(9); - if (num != 0) { + if (g_num != 0) { crep = 997; - if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) { + if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) { repon(2, 167); parole(7, 9, 1); int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); @@ -795,13 +795,13 @@ void fctTurn() { else crep = 168; } - if ((s.mlieu == 17) && (s.ivier == 143)) { + if ((g_s.mlieu == 17) && (g_s.ivier == 143)) { repon(2, 175); clsf3(); parole(6, -9, 1); int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); if (answer == 1) { - s.mlieu = 16; + g_s.mlieu = 16; affrep(); } else crep = 176; @@ -819,7 +819,7 @@ void fctSelfHide() { tfleche(); if (!(anyone) && !(iesc)) { tcoord(10); - if (num == 0) + if (g_num == 0) cache = false; else { cache = true; @@ -833,7 +833,7 @@ void fctSelfHide() { * @remarks Originally called 'tattacher' */ void fctAttach() { - if (s.derobj == 0) + if (g_s.derobj == 0) crep = 186; else { if (!syn) @@ -842,10 +842,10 @@ void fctAttach() { if (!(anyone) && !(iesc)) { tcoord(8); crep = 997; - if ((num != 0) && (s.mlieu == 24)) { + if ((g_num != 0) && (g_s.mlieu == 24)) { crep = 999; - if ((s.derobj == 120) || (s.derobj == 140)) { - s.ipuit = s.derobj; + if ((g_s.derobj == 120) || (g_s.derobj == 140)) { + g_s.ipuit = g_s.derobj; aniof(1, 1); } else crep = 185; @@ -870,13 +870,13 @@ void fctClose() { if ((anyone) || (iesc)) return; tcoord(7); - if (num != 0) { + if (g_num != 0) { int cx = 0; do { ++cx; - } while ((cx <= 6) && (num != ord(touv[cx]))); - if (num == ord(touv[cx])) { - aniof(2, num); + } while ((cx <= 6) && (g_num != ord(touv[cx]))); + if (g_num == ord(touv[cx])) { + aniof(2, g_num); crep = 998; touv[cx] = chr(0); iouv = iouv - 1; @@ -901,15 +901,15 @@ void fctKnock() { if (!syn) ecr3(g_vm->getEngineString(S_HIT)); - if (s.mlieu == 15) { + if (g_s.mlieu == 15) { Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1); return; } - if (s.mlieu < 25) { + if (g_s.mlieu < 25) { tfleche(); if (!(anyone) && !(iesc)) { - if ((s.mlieu < 19) && (s.mlieu != 15)) + if ((g_s.mlieu < 19) && (g_s.mlieu != 15)) crep = 133; else crep = 997; @@ -918,11 +918,11 @@ void fctKnock() { return; } - if (s.mlieu == 26) { + if (g_s.mlieu == 26) { int haz = (hazard(0, 8)) - 4; parole(11, haz, 1); int p; - ecfren(p, haz, s.conf, ment); + ecfren(p, haz, g_s.conf, ment); int l = ment; if (l != 0) { if (p != -500) { @@ -948,7 +948,7 @@ void fctKnock() { void fctSelfPut() { if (!syn) ecr3(g_vm->getEngineString(S_POSE)); - if (s.derobj == 0) + if (g_s.derobj == 0) crep = 186; else { if (caff > 99) { @@ -963,7 +963,7 @@ void fctSelfPut() { return; tcoord(7); crep = 124; - if (num != 0) { + if (g_num != 0) { int chai; rechai(chai); if (chai == 0) @@ -972,8 +972,8 @@ void fctSelfPut() { int cx = 0; do { ++cx; - } while ((cx <= 6) && (num != ord(touv[cx]))); - if (num != ord(touv[cx])) + } while ((cx <= 6) && (g_num != ord(touv[cx]))); + if (g_num != ord(touv[cx])) crep = 187; else { mchai = chai; @@ -982,33 +982,33 @@ void fctSelfPut() { } } else { tcoord(8); - if (num != 0) { + if (g_num != 0) { crep = 998; if (caff == 2) { - if (s.iloic != 0) + if (g_s.iloic != 0) crep = 188; else - s.iloic = s.derobj; + g_s.iloic = g_s.derobj; } if (caff == 13) { - if (num == 1) { - if (s.iboul != 0) + if (g_num == 1) { + if (g_s.iboul != 0) crep = 188; else - s.iboul = s.derobj; - } else if (s.ibag != 0) { + g_s.iboul = g_s.derobj; + } else if (g_s.ibag != 0) { crep = 188; } else { - s.ibag = s.derobj; + g_s.ibag = g_s.derobj; } } if (caff == 16) { - if (s.icryp != 0) + if (g_s.icryp != 0) crep = 188; else - s.icryp = s.derobj; + g_s.icryp = g_s.derobj; } if (caff == 24) @@ -1019,7 +1019,7 @@ void fctSelfPut() { crep = 124; if (caff == 24) { tcoord(5); - if (num != 0) + if (g_num != 0) crep = 185; } } @@ -1040,13 +1040,13 @@ void fctSelfPut() { * @remarks Originally called 'tecouter' */ void fctListen() { - if (s.mlieu != 26) + if (g_s.mlieu != 26) crep = 101; else { if (ipers != 0) - ++s.conf; + ++g_s.conf; int p, haz; - ecfren(p, haz, s.conf, ment); + ecfren(p, haz, g_s.conf, ment); int l = ment; if (l != 0) { if (p != -500) { @@ -1078,19 +1078,19 @@ void fctListen() { * @remarks Originally called 'tmanger' */ void fctEat() { - if ((s.mlieu > 15) && (s.mlieu < 26)) { + if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) { crep = 148; } else { tsort(); - s.mlieu = 10; + g_s.mlieu = 10; caff = 10; - debloc(s.mlieu); - tmlieu(s.mlieu); + debloc(g_s.mlieu); + tmlieu(g_s.mlieu); int j, h, m; calch(j, h, m); if ((h == 12) || (h == 13) || (h == 19)) { - s.conf = s.conf - (s.conf / 7); + g_s.conf -= (g_s.conf / 7); if (h == 12) { if (m == 0) h = 4; @@ -1121,16 +1121,16 @@ void fctEat() { void fctEnter() { // int x; - if ((s.mlieu == 21) || (s.mlieu == 22)) { + if ((g_s.mlieu == 21) || (g_s.mlieu == 22)) { t1sama(); - tmlieu(s.mlieu); - } else if (s.mlieu == 15) + tmlieu(g_s.mlieu); + } else if (g_s.mlieu == 15) aldepl(); else if (ment == 0) crep = 997; - else if ((ment == 9) && (s.derobj != 136)) { + else if ((ment == 9) && (g_s.derobj != 136)) { crep = 189; - s.teauto[8] = '*'; + g_s.teauto[8] = '*'; } else { int z = 0; if (! blo) @@ -1144,18 +1144,18 @@ void fctEnter() { aniof(1, 1); tip(z, g_x); - ++s.conf; - s.mlieu = 15; - msg[3] = MENU_DISCUSS; - msg[4] = g_vm->_menu._discussMenu[g_x]; + ++g_s.conf; + g_s.mlieu = 15; + g_msg[3] = MENU_DISCUSS; + g_msg[4] = g_vm->_menu._discussMenu[g_x]; syn = true; if (ment == 9) { - col = true; + g_col = true; caff = 70; afdes(0); repon(2, caff); } else - col = false; + g_col = false; debloc(ment); ment = 0; } @@ -1164,10 +1164,10 @@ void fctEnter() { parole(7, g_x, 1); aniof(1, 1); - s.mlieu = ment; + g_s.mlieu = ment; affrep(); - debloc(s.mlieu); - tmlieu(s.mlieu); + debloc(g_s.mlieu); + tmlieu(g_s.mlieu); ment = 0; mpers = 0; ipers = 0; @@ -1182,17 +1182,17 @@ void fctEnter() { void fctSleep() { int z, j, h, m; - if ((s.mlieu > 15) && (s.mlieu < 26)) { + if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) { crep = 148; return; } - if (s.mlieu != 0) { + if (g_s.mlieu != 0) { tsort(); - s.mlieu = 0; + g_s.mlieu = 0; affrep(); afdes(0); - debloc(s.mlieu); - tmlieu(s.mlieu); + debloc(g_s.mlieu); + tmlieu(g_s.mlieu); } clsf3(); clsf2(); @@ -1203,7 +1203,7 @@ void fctSleep() { int answer; do { if (h < 8) { - s.conf = s.conf - (s.conf / 20); + g_s.conf -= (g_s.conf / 20); z = (7 - h) * 2; if (m == 30) --z; @@ -1219,7 +1219,7 @@ void fctSleep() { anyone = false; } while (answer != 1); crep = 998; - num = 0; + g_num = 0; } /** @@ -1233,11 +1233,11 @@ void fctForce() { tfleche(); if ((! anyone) && (! iesc)) { - if (s.mlieu != 26) + if (g_s.mlieu != 26) crep = 997; else { crep = 143; - s.conf += 2; + g_s.conf += 2; } } } @@ -1249,27 +1249,27 @@ void fctForce() { void fctLeave() { tsort(); crep = 0; - if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22) || (s.mlieu == 24)) + if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24)) crep = 997; else { int lx = 0; - if ((s.mlieu < 16) || (s.mlieu == 26)) + if ((g_s.mlieu < 16) || (g_s.mlieu == 26)) lx = 10; - if ((s.mlieu == 10) || (s.mlieu == 20)) + if ((g_s.mlieu == 10) || (g_s.mlieu == 20)) lx = 21; - if ((s.mlieu < 10) || (s.mlieu == 13)) + if ((g_s.mlieu < 10) || (g_s.mlieu == 13)) lx = 15; - if (s.mlieu == 16) { + if (g_s.mlieu == 16) { lx = 17; crep = 176; } - if (s.mlieu == 17) + if (g_s.mlieu == 17) t23coul(lx); - if (s.mlieu == 23) + if (g_s.mlieu == 23) lx = 24; if (crep != 997) - s.mlieu = lx; + g_s.mlieu = lx; caff = lx; if (crep == 0) crep = lx; @@ -1293,12 +1293,12 @@ void fctWait() { ++jh; tinke(); if (!blo) - t11(s.mlieu, quel); + t11(g_s.mlieu, quel); if ((ipers != 0) && (mpers == 0)) { crep = 998; - if ((s.mlieu == 13) || (s.mlieu == 14)) + if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) cavegre(); - if ((s.mlieu > 0) && (s.mlieu < 10)) + if ((g_s.mlieu > 0) && (g_s.mlieu < 10)) anyone = true; mpers = ipers; if (!anyone) @@ -1324,7 +1324,7 @@ void fctSound() { tfleche(); if (!(anyone) && (!iesc)) crep = 145; - num = 0; + g_num = 0; } } @@ -1340,13 +1340,13 @@ void fctDiscuss() { bool f; finfouil(); - if (col) + if (g_col) suj = 128; else { cx = 0; do { ++cx; - } while (g_vm->_menu._discussMenu[cx] != msg[4]); + } while (g_vm->_menu._discussMenu[cx] != g_msg[4]); caff = 69 + cx; afdes(0); repon(2, caff); @@ -1377,11 +1377,13 @@ void fctDiscuss() { do { ++icm; g_vm->_screenSurface.putxy(co, lig); - if (s.teauto[icm] == '*') + if (g_s.teauto[icm] == '*') { if (te[icm]) writetp(lib[icm], 1); else writetp(lib[icm], 0); + } + if (icm == 23) { lig = 0; co = 320; @@ -1396,7 +1398,7 @@ void fctDiscuss() { CHECK_QUIT; getMousePos(x, y, c); - x = x * (3 - res); + x *= (3 - res); if (x > 319) cx = 41; else @@ -1435,7 +1437,7 @@ void fctDiscuss() { writetp(lib[choi], 1); te[choi] = ! te[choi]; } - if ((s.teauto[ix] == '*') || (ix == 46)) { + if ((g_s.teauto[ix] == '*') || (ix == 46)) { lig = ((ix - 1) % 23) << 3; if (ix > 23) co = 320; @@ -1456,9 +1458,9 @@ void fctDiscuss() { g_vm->setMouseClick(false); if (choi != 46) { int ix = choi - 1; - if (col) { - col = false; - s.mlieu = 15; + if (g_col) { + g_col = false; + g_s.mlieu = 15; if (iouv > 0) max = 8; else @@ -1468,14 +1470,14 @@ void fctDiscuss() { suj = 129; else { suj = 138; - s.conf = s.conf + (3 * (s.conf / 10)); + g_s.conf += (3 * (g_s.conf / 10)); } } else if (nbrep[caff - 69] < nbrepm[caff - 69]) { suj = tabdon[arep + (ix << 3) + (caff - 70)]; - s.conf += tabdon[arcf + ix]; + g_s.conf += tabdon[arcf + ix]; ++nbrep[caff - 69]; } else { - s.conf += 3; + g_s.conf += 3; suj = 139; } hideMouse(); @@ -1484,32 +1486,32 @@ void fctDiscuss() { sparl(0, suj); showMouse(); if ((suj == 84) || (suj == 86)) { - s.pourc[5] = '*'; - s.teauto[7] = '*'; + g_s.pourc[5] = '*'; + g_s.teauto[7] = '*'; } if ((suj == 106) || (suj == 108) || (suj == 94)) { for (int indx = 29; indx <= 31; ++indx) - s.teauto[indx] = '*'; - s.pourc[7] = '*'; + g_s.teauto[indx] = '*'; + g_s.pourc[7] = '*'; } if (suj == 70) { - s.pourc[8] = '*'; - s.teauto[32] = '*'; + g_s.pourc[8] = '*'; + g_s.teauto[32] = '*'; } hideMouse(); hirs(); showMouse(); } } while ((choi != 46) && (suj != 138)); - if (col) { - s.conf = s.conf + (3 * (s.conf / 10)); + if (g_col) { + g_s.conf += (3 * (g_s.conf / 10)); hideMouse(); hirs(); premtet(); sparl(0, 138); showMouse(); - col = false; - s.mlieu = 15; + g_col = false; + g_s.mlieu = 15; } ctrm = 0; hideMouse(); @@ -1521,7 +1523,7 @@ void fctDiscuss() { drawClock(); affrep(); /* chech;*/ - tmlieu(s.mlieu); + tmlieu(g_s.mlieu); clsf3(); } @@ -1540,7 +1542,7 @@ void fctSmell() { crep = 153; } else if (caff == 123) crep = 110; - num = 0; + g_num = 0; } /** @@ -1554,7 +1556,7 @@ void fctScratch() { ecr3(g_vm->getEngineString(S_SCRATCH)); tfleche(); } - num = 0; + g_num = 0; } /** @@ -1608,9 +1610,9 @@ void MortevielleEngine::loseGame() { vh = 10; vm = 0; vj = 0; - _minute = 0; - _hour = 10; - _day = 0; + g_minute = 0; + g_hour = 10; + g_day = 0; repon(2, 180); answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); _quitGame = (answer != 1); diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index 9d7ea2fa4c..fec8b2f81f 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -326,7 +326,8 @@ bool Ques::show() { optionPosY = 35; maxLength = 0; - for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) { + prevChoice = 1; + for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) { tmpStr = deline(j); if ((int) tmpStr.size() > maxLength) maxLength = tmpStr.size(); @@ -369,16 +370,16 @@ bool Ques::show() { ++currChoice; if (coor[currChoice].enabled) { if ((prevChoice != 0) && (prevChoice != currChoice)) { - Common::String tmpStr = choiceArray[prevChoice] + '$'; + tmpStr = choiceArray[prevChoice] + '$'; afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0); } if (prevChoice != currChoice) { - Common::String tmpStr = choiceArray[currChoice] + '$'; + tmpStr = choiceArray[currChoice] + '$'; afftex(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1); prevChoice = currChoice; } } else if (prevChoice != 0) { - Common::String tmpStr = choiceArray[prevChoice] + '$'; + tmpStr = choiceArray[prevChoice] + '$'; afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0); prevChoice = 0; } @@ -438,15 +439,15 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) { teskbd(); do { parole(SpeechNum, 0, 0); - waitForF3F8(key); + waitForF3F8(g_key); CHECK_QUIT; - if (_newGraphicalDevice != _currGraphicalDevice) { - _currGraphicalDevice = _newGraphicalDevice; + if (g_newGraphicalDevice != g_currGraphicalDevice) { + g_currGraphicalDevice = g_newGraphicalDevice; hirs(); aff50(drawAni50Fl); } - } while (key != 66); // keycode for F8 + } while (g_key != 66); // keycode for F8 } /** @@ -462,7 +463,7 @@ void f3f8::waitForF3F8(int &key) { void f3f8::aff50(bool drawAni50Fl) { caff = 50; - _maff = 0; + g_maff = 0; taffich(); dessine(ades, 63, 12); if (drawAni50Fl) diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp index 0cf22b35d8..d6ebe986df 100644 --- a/engines/mortevielle/keyboard.cpp +++ b/engines/mortevielle/keyboard.cpp @@ -42,7 +42,7 @@ int testou() { switch (ch) { case '\23' : - _soundOff = !_soundOff; + g_soundOff = !g_soundOff; break; case '\26' : if ((c_zzz == 1) || (c_zzz == 2)) { diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp index f90e1aa714..5030da9acb 100644 --- a/engines/mortevielle/level15.cpp +++ b/engines/mortevielle/level15.cpp @@ -68,7 +68,7 @@ void outbloc(int n, pattern p, t_nhom pal) { void writepal(int n) { t_nhom pal; - switch (_currGraphicalDevice) { + switch (g_currGraphicalDevice) { case MODE_TANDY: case MODE_EGA: case MODE_AMSTRAD1512: @@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) { GfxSurface surface; surface.decode(&mem[seg * 16 + dep]); - if (_currGraphicalDevice == MODE_HERCULES) { + if (g_currGraphicalDevice == MODE_HERCULES) { mem[0x7000 * 16 + 2] = 0; mem[0x7000 * 16 + 32] = 15; } @@ -109,13 +109,13 @@ void pictout(int seg, int dep, int x, int y) { void sauvecr(int y, int dy) { hideMouse(); - s_sauv(_currGraphicalDevice, y, dy); + s_sauv(g_currGraphicalDevice, y, dy); showMouse(); } void charecr(int y, int dy) { hideMouse(); - s_char(_currGraphicalDevice, y, dy); + s_char(g_currGraphicalDevice, y, dy); showMouse(); } diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index 6ff97164f0..998b70fa35 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -154,7 +154,7 @@ void Menu::displayMenu() { g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10)); col = 28 * res; - if (_currGraphicalDevice == MODE_CGA) + if (g_currGraphicalDevice == MODE_CGA) color = 1; else color = 9; @@ -456,8 +456,8 @@ void Menu::mdn() { // A menu was clicked on choisi = (test0) && (msg4 != OPCODE_NONE); menuUp(msg3); - msg[4] = msg4; - msg[3] = msg3; + g_msg[4] = msg4; + g_msg[3] = msg3; msg3 = OPCODE_NONE; msg4 = OPCODE_NONE; @@ -513,8 +513,8 @@ void Menu::initMenu() { } msg3 = OPCODE_NONE; msg4 = OPCODE_NONE; - msg[3] = OPCODE_NONE; - msg[4] = OPCODE_NONE; + g_msg[3] = OPCODE_NONE; + g_msg[4] = OPCODE_NONE; g_vm->setMouseClick(false); } diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index 8b99fcc4a1..d3eb248574 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -114,7 +114,7 @@ void dessine(int ad, int x, int y) { void dessine_rouleau() { writepal(89); - if (_currGraphicalDevice == MODE_HERCULES) { + if (g_currGraphicalDevice == MODE_HERCULES) { mem[0x7000 * 16 + 14] = 15; } hideMouse(); @@ -236,11 +236,11 @@ void clsf10() { cod = 544; } g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98)); - if (s.conf < 33) + if (g_s.conf < 33) st = g_vm->getEngineString(S_COOL); - else if (s.conf < 66) + else if (g_s.conf < 66) st = g_vm->getEngineString(S_LOURDE); - else if (s.conf > 65) + else if (g_s.conf > 65) st = g_vm->getEngineString(S_MALSAINE); co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2); @@ -259,7 +259,7 @@ void clsf10() { void stop() { hirs(); - _currGraphicalDevice = MODE_AMSTRAD1512; + g_currGraphicalDevice = MODE_AMSTRAD1512; hirs(); g_vm->quitGame(); } @@ -267,7 +267,7 @@ void stop() { void paint_rect(int x, int y, int dx, int dy) { int co; - if (_currGraphicalDevice == MODE_CGA) + if (g_currGraphicalDevice == MODE_CGA) co = 3; else co = 11; @@ -280,7 +280,7 @@ int hazard(int min, int max) { void calch(int &j, int &h, int &m) { int nh = readclock(); - int th = jh + ((nh - mh) / t); + int th = jh + ((nh - mh) / g_t); m = ((th % 2) + vm) * 30; h = ((uint)th >> 1) + vh; if (m == 60) { @@ -357,12 +357,12 @@ void repon(int f, int m) { ecrf2(); text1(8, 182, 103, m); if ((m == 68) || (m == 69)) - s.teauto[40] = '*'; + g_s.teauto[40] = '*'; if ((m == 104) && (caff == 14)) { - s.teauto[36] = '*'; - if (s.teauto[39] == '*') { - s.pourc[3] = '*'; - s.teauto[38] = '*'; + g_s.teauto[36] = '*'; + if (g_s.teauto[39] == '*') { + g_s.pourc[3] = '*'; + g_s.teauto[38] = '*'; } } } @@ -377,10 +377,10 @@ void repon(int f, int m) { afftex(tmpStr, 80, 40, 60, 25, i); if (m == 180) - s.pourc[6] = '*'; + g_s.pourc[6] = '*'; if (m == 179) - s.pourc[10] = '*'; + g_s.pourc[10] = '*'; } if (f == 7) { /* messint */ ecrf7(); @@ -635,17 +635,17 @@ void drawClock() { paint_rect(570, 118, 20, 10); paint_rect(578, 114, 6, 18); - if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES)) + if ((g_currGraphicalDevice == MODE_CGA) || (g_currGraphicalDevice == MODE_HERCULES)) co = 0; else co = 1; - if (_minute == 0) + if (g_minute == 0) g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co); else g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co); - h = _hour; + h = g_hour; if (h > 12) h -= 12; if (h == 0) @@ -655,15 +655,15 @@ void drawClock() { showMouse(); g_vm->_screenSurface.putxy(568, 154); - if (_hour > 11) + if (g_hour > 11) g_vm->_screenSurface.writeg("PM ", 1); else g_vm->_screenSurface.writeg("AM ", 1); g_vm->_screenSurface.putxy(550, 160); - if ((_day >= 0) && (_day <= 8)) { + if ((g_day >= 0) && (g_day <= 8)) { Common::String tmp = g_vm->getEngineString(S_DAY); - tmp.insertChar((char)(_day + 49), 0); + tmp.insertChar((char)(g_day + 49), 0); g_vm->_screenSurface.writeg(tmp, 1); } } @@ -673,9 +673,9 @@ void drawClock() { *************/ void debloc(int l) { - num = 0; + g_num = 0; g_x = 0; - y = 0; + g_y = 0; if ((l != 26) && (l != 15)) t5(l); mpers = ipers; @@ -1033,46 +1033,44 @@ void phaz(int &haz, int &p, int cf) { } void inzon() { - int cx; - copcha(); - s.ipre = false; - s.derobj = 0; - s.icave = 0; - s.iboul = 0; - s.ibag = 0; - s.ipuit = 0; - s.ivier = 0; - s.iloic = 136; - s.icryp = 141; - s.conf = hazard(4, 10); - s.mlieu = 21; + g_s.ipre = false; + g_s.derobj = 0; + g_s.icave = 0; + g_s.iboul = 0; + g_s.ibag = 0; + g_s.ipuit = 0; + g_s.ivier = 0; + g_s.iloic = 136; + g_s.icryp = 141; + g_s.conf = hazard(4, 10); + g_s.mlieu = 21; - for (cx = 2; cx <= 6; ++cx) - s.sjer[cx] = chr(0); + for (int cx = 2; cx <= 6; ++cx) + g_s.sjer[cx] = chr(0); - s.sjer[1] = chr(113); - s.heure = chr(20); + g_s.sjer[1] = chr(113); + g_s.heure = chr(20); - for (cx = 1; cx <= 10; ++cx) - s.pourc[cx] = ' '; + for (int cx = 1; cx <= 10; ++cx) + g_s.pourc[cx] = ' '; - for (cx = 1; cx <= 6; ++cx) - s.teauto[cx] = '*'; + for (int cx = 1; cx <= 6; ++cx) + g_s.teauto[cx] = '*'; - for (cx = 7; cx <= 9; ++cx) - s.teauto[cx] = ' '; + for (int cx = 7; cx <= 9; ++cx) + g_s.teauto[cx] = ' '; - for (cx = 10; cx <= 28; ++cx) - s.teauto[cx] = '*'; + for (int cx = 10; cx <= 28; ++cx) + g_s.teauto[cx] = '*'; - for (cx = 29; cx <= 42; ++cx) - s.teauto[cx] = ' '; + for (int cx = 29; cx <= 42; ++cx) + g_s.teauto[cx] = ' '; - s.teauto[33] = '*'; + g_s.teauto[33] = '*'; - for (cx = 1; cx <= 8; ++cx) + for (int cx = 1; cx <= 8; ++cx) nbrep[cx] = 0; init_nbrepm(); @@ -1081,9 +1079,9 @@ void inzon() { void dprog() { li = 21; jh = 0; - if (! s.ipre) + if (!g_s.ipre) blo = true; - t = ti1; + g_t = ti1; mh = readclock(); } @@ -1221,7 +1219,7 @@ void pl20(int cf) { void t11(int l11, int &a) { int p, haz; - ecfren(p, haz, s.conf, l11); + ecfren(p, haz, g_s.conf, l11); li = l11; if ((l11 > 0) && (l11 < 10)) { if (p != -500) { @@ -1253,7 +1251,7 @@ void t11(int l11, int &a) { cpl15(p); if (l11 == 20) cpl20(p, h); - p = p + s.conf; + p += g_s.conf; haz = hazard(1, 100); if (haz > p) { person(); @@ -1276,20 +1274,17 @@ void t11(int l11, int &a) { } void cavegre() { - int haz; - - s.conf = s.conf + 2; - if (s.conf > 69) - s.conf += (s.conf / 10); + g_s.conf += 2; + if (g_s.conf > 69) + g_s.conf += (g_s.conf / 10); clsf3(); ecrf2(); ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS)); - haz = (hazard(0, 4)) - 2; + int haz = (hazard(0, 4)) - 2; parole(2, haz, 1); - // Useless? - for (haz = 0; haz <= 3000; ++haz) - ; + // The original was doing here a useless loop. + // It has been removed clsf3(); person(); @@ -1340,12 +1335,12 @@ void musique(int so) { if (so == 0) { /* musik(0) */ ; - } else if ((prebru == 0) && (! s.ipre)) { + } else if ((prebru == 0) && (!g_s.ipre)) { parole(10, 1, 1); ++prebru; } else { bool i = false; - if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) { + if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22)) { int haz = hazard(1, 3); if (haz == 2) { haz = hazard(2, 4); @@ -1353,21 +1348,23 @@ void musique(int so) { i = true; } } - if (s.mlieu == 20) { + if (g_s.mlieu == 20) { int haz = hazard(1, 2); if (haz == 1) { parole(8, 1, 1); i = true; } } - if (s.mlieu == 24) { + + if (g_s.mlieu == 24) { int haz = hazard(1, 2); if (haz == 2) { parole(12, 1, 1); i = true; } } - if (s.mlieu == 23) { + + if (g_s.mlieu == 23) { parole(13, 1, 1); i = true; } @@ -1400,19 +1397,19 @@ void dessin(int ad) { } if (caff == 13) { - if (s.iboul == 141) + if (g_s.iboul == 141) aniof(1, 7); - if (s.ibag == 159) + if (g_s.ibag == 159) aniof(1, 6); } - if ((caff == 14) && (s.icave == 151)) + if ((caff == 14) && (g_s.icave == 151)) aniof(1, 2); - if ((caff == 17) && (s.ivier == 143)) + if ((caff == 17) && (g_s.ivier == 143)) aniof(1, 1); - if ((caff == 24) && (s.ipuit != 0)) + if ((caff == 24) && (g_s.ipuit != 0)) aniof(1, 1); } diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index 8edafa8c2c..42e1d0f9fa 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -51,8 +51,8 @@ void tinke() { anyone = false; calch(j, h, m); - if (j != _day) { - _day = j; + if (j != g_day) { + g_day = j; cx = 0; do { ++cx; @@ -61,13 +61,13 @@ void tinke() { nbrep[cx] = 0; } while (cx != 8); } - if ((h > _hour) || ((h == 0) && (_hour == 23))) { - _hour = h; - _minute = 0; + if ((h > g_hour) || ((h == 0) && (g_hour == 23))) { + g_hour = h; + g_minute = 0; drawClock(); cf = 0; for (cx = 1; cx <= 10; ++cx) { - if (s.pourc[cx] == '*') + if (g_s.pourc[cx] == '*') ++cf; } @@ -89,8 +89,8 @@ void tinke() { _hintPctMessage += d6; _hintPctMessage += d4; } - if (m > _minute) { - _minute = 30; + if (m > g_minute) { + g_minute = 30; drawClock(); } if (y_s < 12) @@ -98,21 +98,21 @@ void tinke() { if (! blo) { if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7))) - t = ti2; + g_t = ti2; else - t = ti1; - cf = s.conf; + g_t = ti1; + cf = g_s.conf; if ((cf > 33) && (cf < 66)) - t -= (t / 3); + g_t -= (g_t / 3); if (cf > 65) - t -= ((t / 3) * 2); + g_t -= ((g_t / 3) * 2); int nh = readclock(); - if ((nh - mh) > t) { + if ((nh - mh) > g_t) { bool activeMenu = g_vm->_menu._menuActive; g_vm->_menu.eraseMenu(); - jh += ((nh - mh) / t); + jh += ((nh - mh) / g_t); mh = nh; switch (li) { case 1: @@ -157,7 +157,7 @@ void tinke() { mpers = ipers; if ((mpers == 0) && (ipers > 0)) { - if ((s.mlieu == 13) || (s.mlieu == 14)) { + if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) { cavegre(); } else if (ipers == 10) { ipers = 0; @@ -186,7 +186,7 @@ void tinke() { nouvp(li, cx); brt = false; hdb = 0; - if ((s.mlieu > 0) && (s.mlieu < 10)) + if ((g_s.mlieu > 0) && (g_s.mlieu < 10)) anyone = true; } } @@ -195,9 +195,9 @@ void fenat(char ans) { int coul; hideMouse(); - if (_currGraphicalDevice == MODE_CGA) + if (g_currGraphicalDevice == MODE_CGA) coul = 2; - else if (_currGraphicalDevice == MODE_HERCULES) + else if (g_currGraphicalDevice == MODE_HERCULES) coul = 1; else coul = 12; @@ -222,7 +222,7 @@ void tkey1(bool d) { hideMouse(); fenat('K'); while (keypressed()) - key = testou(); + g_key = testou(); do { if (d) @@ -265,20 +265,18 @@ void tlu(int af, int ob) { repon(2, 999); tkey1(true); caff = af; - msg[3] = OPCODE_NONE; + g_msg[3] = OPCODE_NONE; crep = 998; } void affrep() { - caff = s.mlieu; - crep = s.mlieu; + caff = g_s.mlieu; + crep = g_s.mlieu; } void mfouen() { - int cx; - - tmlieu(s.mlieu); - for (cx = 1; cx <= 11; ++cx) + tmlieu(g_s.mlieu); + for (int cx = 1; cx <= 11; ++cx) g_vm->_menu.enableMenuItem(_actionMenu[cx]); g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE)); @@ -304,18 +302,18 @@ void tperd() { repon(9, crep); clsf2(); clsf3(); - col = false; + g_col = false; syn = false; okdes = false; } void tsort() { - if ((iouv > 0) && (s.mlieu != 0)) { - if (s.conf < 50) - s.conf += 2; + if ((iouv > 0) && (g_s.mlieu != 0)) { + if (g_s.conf < 50) + g_s.conf += 2; else - s.conf += (s.conf / 10); + g_s.conf += (g_s.conf / 10); } for (int cx = 1; cx <= 7; ++cx) @@ -323,7 +321,7 @@ void tsort() { ment = 0; iouv = 0; mchai = 0; - debloc(s.mlieu); + debloc(g_s.mlieu); } void st4(int ob) { @@ -361,14 +359,14 @@ void cherjer(int ob, bool &d) { d = false; for (cx = 1; cx <= 6; ++cx) - d = (d || (ord(s.sjer[cx]) == ob)); + d = (d || (ord(g_s.sjer[cx]) == ob)); - if (s.derobj == ob) + if (g_s.derobj == ob) d = true; } void st1sama() { - s.mlieu = 10; + g_s.mlieu = 10; affrep(); } @@ -378,9 +376,9 @@ void modinv() { int cy = 0; for (int cx = 1; cx <= 6; ++cx) - if (s.sjer[cx] != chr(0)) { + if (g_s.sjer[cx] != chr(0)) { ++cy; - r = (ord(s.sjer[cx]) + 400); + r = (ord(g_s.sjer[cx]) + 400); nomp = deline(r - 501 + c_st41); g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp); g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]); @@ -432,7 +430,7 @@ void mfoudi() { } void mennor() { - g_vm->_menu.menuUp(msg[3]); + g_vm->_menu.menuUp(g_msg[3]); } void premtet() { @@ -449,7 +447,7 @@ void ajchai() { } while ((cx <= 9) && (tabdon[cy + cx] != 0)); if (tabdon[cy + cx] == 0) { - int lderobj = s.derobj; + int lderobj = g_s.derobj; tabdon[cy + cx] = lderobj; } else crep = 192; @@ -459,10 +457,10 @@ void ajjer(int ob) { int cx = 0; do { ++cx; - } while ((cx <= 5) && (ord(s.sjer[cx]) != 0)); + } while ((cx <= 5) && (ord(g_s.sjer[cx]) != 0)); - if (ord(s.sjer[cx]) == 0) { - s.sjer[(cx)] = chr(ob); + if (ord(g_s.sjer[cx]) == 0) { + g_s.sjer[(cx)] = chr(ob); modinv(); } else crep = 139; @@ -472,7 +470,7 @@ void t1sama() { //Entering manor int j, h, m; calch(j, h, m); - if ((h < 5) && (s.mlieu > 18)) { + if ((h < 5) && (g_s.mlieu > 18)) { bool d; cherjer(137, d); if (!d) { //You don't have the keys, and it's late @@ -480,7 +478,7 @@ void t1sama() { //Entering manor tperd(); } else st1sama(); - } else if (!s.ipre) { //Is it your first time? + } else if (!g_s.ipre) { //Is it your first time? ipers = 255; affper(ipers); caff = 77; @@ -496,21 +494,21 @@ void t1sama() { //Entering manor dessine_rouleau(); drawClock(); showMouse(); - s.mlieu = 0; + g_s.mlieu = 0; affrep(); t5(10); if (! blo) t11(0, m); ipers = 0; mpers = 0; - s.ipre = true; + g_s.ipre = true; /*chech;*/ } else st1sama(); } void t1vier() { - s.mlieu = 17; + g_s.mlieu = 17; affrep(); } @@ -521,19 +519,19 @@ void t1neig() { tperd(); } else { okdes = true; - s.mlieu = 19; + g_s.mlieu = 19; affrep(); } } void t1deva() { inei = 0; - s.mlieu = 21; + g_s.mlieu = 21; affrep(); } void t1derr() { - s.mlieu = 22; + g_s.mlieu = 22; affrep(); } @@ -565,21 +563,21 @@ L1: parole(4, 4, 1); if (iouv == 0) - s.conf += 2; - else if (s.conf < 50) - s.conf += 4; + g_s.conf += 2; + else if (g_s.conf < 50) + g_s.conf += 4; else - s.conf += 3 * (s.conf / 10); + g_s.conf += 3 * (g_s.conf / 10); tsort(); tmlieu(15); int cx; tip(ipers, cx); caff = 69 + cx; crep = caff; - msg[3] = MENU_DISCUSS; - msg[4] = g_vm->_menu._discussMenu[cx]; + g_msg[3] = MENU_DISCUSS; + g_msg[4] = g_vm->_menu._discussMenu[cx]; syn = true; - col = true; + g_col = true; } else { int haz = hazard(1, 3); if (haz == 2) { @@ -618,7 +616,7 @@ void tsuiv() { caff = tbcl; crep = caff + 400; if (ipers != 0) - s.conf = s.conf + 2; + g_s.conf = g_s.conf + 2; } else { affrep(); finfouil(); @@ -631,7 +629,7 @@ void tfleche() { bool qust; char touch; - if (num == 9999) + if (g_num == 9999) return; fenat(chr(152)); @@ -650,14 +648,14 @@ void tfleche() { if (qust && (touch == '\103')) Alert::show(_hintPctMessage, 1); - } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (y != 0)) || (anyone) || (rect))); + } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (anyone) || (rect))); if (touch == '\73') iesc = true; if (rect) { g_x = x_s; - y = y_s; + g_y = y_s; } } @@ -666,7 +664,7 @@ void tcoord(int sx) { int ib; - num = 0; + g_num = 0; crep = 999; int a = 0; int atdon = amzon + 3; @@ -703,10 +701,10 @@ void tcoord(int sx) { ix = tabdon[a + cb] * res; iy = tabdon[(a + cb + 1)]; ++cy; - } while (!(((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib))); + } while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib))); - if ((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) { - num = cy - 1; + if ((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) { + g_num = cy - 1; return; } @@ -740,7 +738,7 @@ void treg(int ob) { int mdes = caff; caff = ob; - if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == OPCODE_SLOOK)) { + if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (g_msg[4] == OPCODE_SLOOK)) { afdes(0); if ((caff > 29) && (caff < 33)) repon(2, caff); @@ -748,7 +746,7 @@ void treg(int ob) { repon(2, (caff + 400)); tkey1(true); caff = mdes; - msg[3] = 0; + g_msg[3] = 0; crep = 998; } else { obpart = true; @@ -759,22 +757,22 @@ void treg(int ob) { void avpoing(int &ob) { crep = 999; - if (s.derobj != 0) - ajjer(s.derobj); + if (g_s.derobj != 0) + ajjer(g_s.derobj); if (crep != 139) { modobj(ob + 400); - s.derobj = ob; + g_s.derobj = ob; ob = 0; } } void rechai(int &ch) { - int cx = s.mlieu; + int cx = g_s.mlieu; - if (s.mlieu == 16) + if (g_s.mlieu == 16) cx = 14; - ch = tabdon[achai + (cx * 7) + num - 1]; + ch = tabdon[achai + (cx * 7) + g_num - 1]; } void t23coul(int &l) { @@ -789,7 +787,7 @@ void t23coul(int &l) { } void maivid() { - s.derobj = 0; + g_s.derobj = 0; modobj(500); } diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 50631663e1..7d0e7bc8ed 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -121,7 +121,7 @@ Common::ErrorCode MortevielleEngine::initialise() { _screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); // Set the screen mode - _currGraphicalDevice = MODE_EGA; + g_currGraphicalDevice = MODE_EGA; res = 2; _txxFileFl = false; @@ -142,8 +142,8 @@ Common::ErrorCode MortevielleEngine::initialise() { // Setup the mouse cursor initMouse(); - _currGraphicalDevice = MODE_EGA; - _newGraphicalDevice = _currGraphicalDevice; + g_currGraphicalDevice = MODE_EGA; + g_newGraphicalDevice = g_currGraphicalDevice; zuul = false; tesok = false; charpal(); @@ -155,15 +155,15 @@ Common::ErrorCode MortevielleEngine::initialise() { initMouse(); init_lieu(); - _soundOff = false; + g_soundOff = false; f2_all = false; teskbd(); dialpre(); - _newGraphicalDevice = _currGraphicalDevice; + g_newGraphicalDevice = g_currGraphicalDevice; teskbd(); - if (_newGraphicalDevice != _currGraphicalDevice) - _currGraphicalDevice = _newGraphicalDevice; + if (g_newGraphicalDevice != g_currGraphicalDevice) + g_currGraphicalDevice = g_newGraphicalDevice; hirs(); ades = 0x7000; @@ -558,7 +558,7 @@ void MortevielleEngine::handleAction() { g_vm->_menu.drawMenu(); imen = true; temps = 0; - key = 0; + g_key = 0; funct = false; inkey = '.'; @@ -578,24 +578,24 @@ void MortevielleEngine::handleAction() { changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1); return; } - if (choisi && (msg[3] == MENU_SAVE)) { - Common::String saveName = Common::String::format("Savegame #%d", msg[4] & 7); - g_vm->_savegameManager.saveGame(msg[4] & 7, saveName); + if (choisi && (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 (choisi && (msg[3] == MENU_LOAD)) - g_vm->_savegameManager.loadGame((msg[4] & 7) - 1); + if (choisi && (g_msg[3] == MENU_LOAD)) + g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1); if (inkey == '\103') { /* F9 */ temps = Alert::show(_hintPctMessage, 1); return; } else if (inkey == '\77') { - if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF))) { - msg[4] = mnumo; + if ((mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) { + g_msg[4] = mnumo; ecr3(g_vm->getEngineString(S_IDEM)); } else return; } else if (inkey == '\104') { - if ((g_x != 0) && (y != 0)) - num = 9999; + if ((g_x != 0) && (g_y != 0)) + g_num = 9999; return; } } @@ -607,22 +607,22 @@ void MortevielleEngine::handleAction() { return; if (temps > lim) { repon(2, 141); - if (num == 9999) - num = 0; + if (g_num == 9999) + g_num = 0; } else { - mnumo = msg[3]; - if ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF)) - mnumo = msg[4]; + mnumo = g_msg[3]; + if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF)) + mnumo = g_msg[4]; if (! anyone) { if ((fouil) || (obpart)) { if (y_s < 12) return; - if ((msg[4] == OPCODE_SOUND) || (msg[4] == OPCODE_LIFT)) { + if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) { oo = true; - if ((msg[4] == OPCODE_LIFT) || (obpart)) { + if ((g_msg[4] == OPCODE_LIFT) || (obpart)) { finfouil(); - caff = s.mlieu; + caff = g_s.mlieu; crep = 998; } else tsuiv(); @@ -640,7 +640,7 @@ void MortevielleEngine::handleAction() { okdes = false; dessin(0); } - if ((! syn) || (col)) + if ((! syn) || (g_col)) repon(2, crep); } } while (syn); diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp index d607b0597b..9baae57eb6 100644 --- a/engines/mortevielle/mouse.cpp +++ b/engines/mortevielle/mouse.cpp @@ -86,7 +86,7 @@ void hideMouse() { if (mouse_shwn == 0) { bool imp = odd(y_s); int j = p_o_s; - switch (_currGraphicalDevice) { + switch (g_currGraphicalDevice) { case MODE_CGA: { int k = 0; j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2); @@ -183,7 +183,7 @@ void showMouse() { j = p_o_s; imp = odd(y_s); i = x_s & 7; - switch (_currGraphicalDevice) { + switch (g_currGraphicalDevice) { case MODE_CGA: k = 0; j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2); @@ -418,7 +418,7 @@ void moveMouse(bool &funct, char &key) { cy = 8; break; case '\23': - _soundOff = !_soundOff; + g_soundOff = !g_soundOff; return; break; case '\26': diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp index e1374d4f04..7b2dcabee9 100644 --- a/engines/mortevielle/ovd1.cpp +++ b/engines/mortevielle/ovd1.cpp @@ -174,7 +174,7 @@ void music() { bool fin; /* debug('o3 music'); */ - if (_soundOff) + if (g_soundOff) return; rech_cfiec = true; @@ -244,8 +244,8 @@ void suite() { caff = 51; taffich(); teskbd(); - if (_newGraphicalDevice != _currGraphicalDevice) - _currGraphicalDevice = _newGraphicalDevice; + if (g_newGraphicalDevice != g_currGraphicalDevice) + g_currGraphicalDevice = g_newGraphicalDevice; hirs(); dessine(ades, 0, 0); diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp index 791bfd7d61..cbe460a43d 100644 --- a/engines/mortevielle/parole.cpp +++ b/engines/mortevielle/parole.cpp @@ -35,8 +35,8 @@ namespace Mortevielle { void spfrac(int wor) { c3.rep = (uint)wor >> 12; if ((typlec == 0) && (c3.code != 9)) - if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) || - ((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9))))) { + if (((c3.code > 4) && (c3.val != 20) && (c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) || + ((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9)))) { ++c3.rep; } diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp index 19b44191b0..2402e37195 100644 --- a/engines/mortevielle/parole2.cpp +++ b/engines/mortevielle/parole2.cpp @@ -87,17 +87,17 @@ void parole(int rep, int ht, int typ) { int savph[501]; int tempo; - if (_soundOff) + if (g_soundOff) return; num_ph = rep; - haut = ht; + g_haut = ht; typlec = typ; if (typlec != 0) { for (int i = 0; i <= 500; ++i) savph[i] = t_cph[i]; tempo = tempo_bruit; - } else if (haut > 5) + } else if (g_haut > 5) tempo = tempo_f; else tempo = tempo_m; diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp index 635140f048..6dd8df10a6 100644 --- a/engines/mortevielle/prog.cpp +++ b/engines/mortevielle/prog.cpp @@ -45,7 +45,7 @@ namespace Mortevielle { */ void changeGraphicalDevice(int newDevice) { hideMouse(); - _currGraphicalDevice = newDevice; + g_currGraphicalDevice = newDevice; hirs(); initMouse(); showMouse(); @@ -58,7 +58,7 @@ void changeGraphicalDevice(int newDevice) { person(); clsf2(); clsf3(); - _maff = 68; + g_maff = 68; afdes(0); repon(2, crep); g_vm->_menu.displayMenu(); @@ -82,21 +82,21 @@ void MortevielleEngine::gameLoaded() { test[0] = false; test[1] = false; g[0] = '\040'; - col = false; + g_col = false; tesok = true; test[2] = false; g[7] = g[0]; g[2] = 'A'; cache = false; brt = false; - _maff = 68; + g_maff = 68; g[5] = 'E'; mnumo = 0; prebru = 0; g[4] = 'T'; g_x = 0; - y = 0; - num = 0; + g_y = 0; + g_num = 0; hdb = 0; hfb = 0; cs = 0; @@ -133,10 +133,10 @@ void MortevielleEngine::gameLoaded() { repon(2, crep); clsf3(); _endGame = false; - tmlieu(s.mlieu); + tmlieu(g_s.mlieu); modinv(); - if (s.derobj != 0) - modobj2(s.derobj + 400, test[1], test[2]); + if (g_s.derobj != 0) + modobj2(g_s.derobj + 400, test[1], test[2]); else tesok = test[1] || test[2]; showMouse(); @@ -153,82 +153,82 @@ void tmaj3() { m = 1; h += j * 24; m += h * 2; - s.heure = chr(m); + g_s.heure = chr(m); } void tsitu() { int h, j, m; - if (! col) + if (!g_col) clsf2(); syn = false; iesc = false; if (!anyone) { if (brt) - if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) { + if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) { ctrm = 4; mennor(); return; } - if (msg[3] == MENU_MOVE) + if (g_msg[3] == MENU_MOVE) fctMove(); - if (msg[3] == MENU_DISCUSS) + if (g_msg[3] == MENU_DISCUSS) fctDiscuss(); - if (msg[3] == MENU_INVENTORY) + if (g_msg[3] == MENU_INVENTORY) fctInventoryTake(); - if (msg[4] == OPCODE_ATTACH) + if (g_msg[4] == OPCODE_ATTACH) fctAttach(); - if (msg[4] == OPCODE_WAIT) + if (g_msg[4] == OPCODE_WAIT) fctWait(); - if (msg[4] == OPCODE_FORCE) + if (g_msg[4] == OPCODE_FORCE) fctForce(); - if (msg[4] == OPCODE_SLEEP) + if (g_msg[4] == OPCODE_SLEEP) fctSleep(); - if (msg[4] == OPCODE_LISTEN) + if (g_msg[4] == OPCODE_LISTEN) fctListen(); - if (msg[4] == OPCODE_ENTER) + if (g_msg[4] == OPCODE_ENTER) fctEnter(); - if (msg[4] == OPCODE_CLOSE) + if (g_msg[4] == OPCODE_CLOSE) fctClose(); - if (msg[4] == OPCODE_SEARCH) + if (g_msg[4] == OPCODE_SEARCH) fctSearch(); - if (msg[4] == OPCODE_KNOCK) + if (g_msg[4] == OPCODE_KNOCK) fctKnock(); - if (msg[4] == OPCODE_SCRATCH) + if (g_msg[4] == OPCODE_SCRATCH) fctScratch(); - if (msg[4] == OPCODE_READ) + if (g_msg[4] == OPCODE_READ) fctRead(); - if (msg[4] == OPCODE_EAT) + if (g_msg[4] == OPCODE_EAT) fctEat(); - if (msg[4] == OPCODE_PLACE) + if (g_msg[4] == OPCODE_PLACE) fctPlace(); - if (msg[4] == OPCODE_OPEN) + if (g_msg[4] == OPCODE_OPEN) fctOpen(); - if (msg[4] == OPCODE_TAKE) + if (g_msg[4] == OPCODE_TAKE) fctTake(); - if (msg[4] == OPCODE_LOOK) + if (g_msg[4] == OPCODE_LOOK) fctLook(); - if (msg[4] == OPCODE_SMELL) + if (g_msg[4] == OPCODE_SMELL) fctSmell(); - if (msg[4] == OPCODE_SOUND) + if (g_msg[4] == OPCODE_SOUND) fctSound(); - if (msg[4] == OPCODE_LEAVE) + if (g_msg[4] == OPCODE_LEAVE) fctLeave(); - if (msg[4] == OPCODE_LIFT) + if (g_msg[4] == OPCODE_LIFT) fctLift(); - if (msg[4] == OPCODE_TURN) + if (g_msg[4] == OPCODE_TURN) fctTurn(); - if (msg[4] == OPCODE_SSEARCH) + if (g_msg[4] == OPCODE_SSEARCH) fctSelfSearch(); - if (msg[4] == OPCODE_SREAD) + if (g_msg[4] == OPCODE_SREAD) fctSelfRead(); - if (msg[4] == OPCODE_SPUT) + if (g_msg[4] == OPCODE_SPUT) fctSelfPut(); - if (msg[4] == OPCODE_SLOOK) + if (g_msg[4] == OPCODE_SLOOK) fctSelftLook(); cache = false; - if (msg[4] == OPCODE_SHIDE) + if (g_msg[4] == OPCODE_SHIDE) fctSelfHide(); } else { if (anyone) { @@ -239,16 +239,16 @@ void tsitu() { } } calch(j, h, m); - if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) || - ((h > 0) && (h < 6) && (s.mlieu != 0))) - s.conf = s.conf + 1; - if (((s.mlieu < 16) || (s.mlieu > 19)) && (s.mlieu != 23) - && (s.mlieu != 0) && (s.derobj != 152) && (!g_vm->_loseGame)) { - if ((s.conf > 99) && (h > 8) && (h < 16)) { + if ((((h == 12) || (h == 13) || (h == 19)) && (g_s.mlieu != 10)) || + ((h > 0) && (h < 6) && (g_s.mlieu != 0))) + ++g_s.conf; + if (((g_s.mlieu < 16) || (g_s.mlieu > 19)) && (g_s.mlieu != 23) + && (g_s.mlieu != 0) && (g_s.derobj != 152) && (!g_vm->_loseGame)) { + if ((g_s.conf > 99) && (h > 8) && (h < 16)) { crep = 1501; tperd(); } - if ((s.conf > 99) && (h > 0) && (h < 9)) { + if ((g_s.conf > 99) && (h > 0) && (h < 9)) { crep = 1508; tperd(); } @@ -263,16 +263,16 @@ void tsitu() { /* NIVEAU 1 */ void theure() { - vj = ord(s.heure); + vj = ord(g_s.heure); vh = vj % 48; vj /= 48; vm = vh % 2; vh /= 2; - _hour = vh; + g_hour = vh; if (vm == 1) - _minute = 30; + g_minute = 30; else - _minute = 0; + g_minute = 0; } } // End of namespace Mortevielle diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp index 929b0880f6..7afaa47da0 100644 --- a/engines/mortevielle/saveload.cpp +++ b/engines/mortevielle/saveload.cpp @@ -85,7 +85,7 @@ void SavegameManager::takesav(int n) { Common::File f; if (stream == NULL) { if (!f.open(filename)) - error("Unable to open save file '%s'", filename); + error("Unable to open save file '%s'", filename.c_str()); stream = f.readStream(f.size()); f.close(); @@ -107,7 +107,7 @@ void SavegameManager::takesav(int n) { Common::Serializer sz(stream, NULL); sync_save(sz); - s = s1; + g_s = s1; for (i = 0; i <= 389; ++i) tabdon[i + acha] = bufcha[i]; @@ -143,7 +143,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) { for (i = 0; i <= 389; ++i) bufcha[i] = tabdon[i + acha]; - s1 = s; + s1 = g_s; if (s1.mlieu == 26) s1.mlieu = 15; diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 82abc27989..1694387964 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -106,42 +106,42 @@ void taffich() { else if ((a >= 136) && (a <= 140)) a = tran1[a - 136]; int b = a; - if (_maff == a) + if (g_maff == a) return; switch (a) { case 16: - s.pourc[9] = '*'; - s.teauto[42] = '*'; + g_s.pourc[9] = '*'; + g_s.teauto[42] = '*'; break; case 20: - s.teauto[39] = '*'; - if (s.teauto[36] == '*') { - s.pourc[3] = '*'; - s.teauto[38] = '*'; + g_s.teauto[39] = '*'; + if (g_s.teauto[36] == '*') { + g_s.pourc[3] = '*'; + g_s.teauto[38] = '*'; } break; case 24: - s.teauto[37] = '*'; + g_s.teauto[37] = '*'; break; case 30: - s.teauto[9] = '*'; + g_s.teauto[9] = '*'; break; case 31: - s.pourc[4] = '*'; - s.teauto[35] = '*'; + g_s.pourc[4] = '*'; + g_s.teauto[35] = '*'; break; case 118: - s.teauto[41] = '*'; + g_s.teauto[41] = '*'; break; case 143: - s.pourc[1] = '*'; + g_s.pourc[1] = '*'; break; case 150: - s.teauto[34] = '*'; + g_s.teauto[34] = '*'; break; case 151: - s.pourc[2] = '*'; + g_s.pourc[2] = '*'; break; default: break; @@ -160,7 +160,7 @@ void taffich() { m = 2010; if (a == 32) m = 2034; - if ((a == 17) && (_maff == 14)) + if ((a == 17) && (g_maff == 14)) m = 2018; if (a > 99) if ((is == 1) || (is == 0)) @@ -169,10 +169,10 @@ void taffich() { m = 2032; if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149)) m = 2030; - if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99))) || ((_maff > 29) && (_maff < 33))) + if (((a < 27) && (((g_maff > 69) && (!g_s.ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33))) m = 2033; messint(m); - _maff = a; + g_maff = a; if (a == 159) a = 86; else if (a > 140) @@ -203,11 +203,11 @@ void taffich() { lgt = handle; handle = g_l[88]; } - _maff = a; + g_maff = a; npal = a + 37; } chardes(filename, lgt, handle); - if (_currGraphicalDevice == MODE_HERCULES) { + if (g_currGraphicalDevice == MODE_HERCULES) { for (int i = 0; i <= 15; ++i) { int palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]); alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15); @@ -244,11 +244,11 @@ void taffich() { charani(filename, lgt, handle); } showMouse(); - if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != OPCODE_ENTER)) { + if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) { if ((a == 13) || (a == 14)) person(); else if (! blo) - t11(s.mlieu, cx); + t11(g_s.mlieu, cx); mpers = 0; } } diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 42fab06f7c..138b604c3a 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -91,7 +91,7 @@ bool blo, bt7, bh9, - _soundOff, + g_soundOff, main1, choisi, test0, @@ -99,7 +99,7 @@ bool blo, imen, cache, iesc, - col, + g_col, syn, fouil, zuul, @@ -114,8 +114,8 @@ bool blo, int g_x, - y, - t, + g_y, + g_t, vj, li, vh, @@ -123,20 +123,19 @@ int g_x, jh, mh, cs, - _currGraphicalDevice, + g_currGraphicalDevice, hdb, hfb, - _hour, - _day, - key, - _minute, - num, - max, + g_hour, + g_day, + g_key, + g_minute, + g_num, res, ment, - haut, + g_haut, caff, - _maff, + g_maff, crep, ades, iouv, @@ -146,7 +145,7 @@ int g_x, msg3, msg4, mlec, - _newGraphicalDevice, + g_newGraphicalDevice, c_zzz, mchai, menup, @@ -162,7 +161,6 @@ int g_x, typlec, num_ph, numpal, - lderobj, nb_word, ptr_oct, k_tempo, @@ -179,9 +177,9 @@ byte mode; int nbrep[9]; int nbrepm[9]; -int msg[5]; +int g_msg[5]; byte touv[8]; -sav_chaine s, s1; +sav_chaine g_s, s1; byte bufcha[391]; byte lettres[7][24]; diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h index 5769b61064..1ccea2c7b3 100644 --- a/engines/mortevielle/var_mor.h +++ b/engines/mortevielle/var_mor.h @@ -232,7 +232,7 @@ extern bool blo, bt7, bh9, - _soundOff, + g_soundOff, main1, choisi, test0, @@ -240,7 +240,7 @@ extern bool blo, imen, cache, iesc, - col, + g_col, syn, fouil, zuul, @@ -254,8 +254,8 @@ extern bool blo, extern int g_x, - y, - t, + g_y, + g_t, vj, li, vh, @@ -263,20 +263,19 @@ extern int g_x, jh, mh, cs, - _currGraphicalDevice, + g_currGraphicalDevice, hdb, hfb, - _hour, - _day, - key, - _minute, - num, - max, + g_hour, + g_day, + g_key, + g_minute, + g_num, res, ment, - haut, + g_haut, caff, - _maff, + g_maff, crep, ades, iouv, @@ -286,7 +285,7 @@ extern int g_x, msg3, msg4, mlec, - _newGraphicalDevice, + g_newGraphicalDevice, c_zzz, mchai, menup, @@ -302,7 +301,6 @@ extern int g_x, typlec, num_ph, numpal, - lderobj, nb_word, ptr_oct, k_tempo, @@ -319,9 +317,9 @@ extern byte mode; extern int nbrep[9]; extern int nbrepm[9]; -extern int msg[5]; +extern int g_msg[5]; extern byte touv[8]; -extern sav_chaine s, s1; +extern sav_chaine g_s, s1; extern byte bufcha[391]; extern byte lettres[7][24]; -- cgit v1.2.3