aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-03-03 00:23:27 +0100
committerStrangerke2012-04-06 08:22:26 +0200
commitb2b16cefce08dbdad76b9057ff97d08c7e14c56e (patch)
tree6e449e0a4dd034ffafc1af5bbddad8e31d20930f
parent7764caaadee89b9eb1922acc93abf157ce84e4f7 (diff)
downloadscummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.tar.gz
scummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.tar.bz2
scummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.zip
MORTEVIELLE: rename more globals and constants, remove t_nhom usage
-rw-r--r--engines/mortevielle/actions.cpp524
-rw-r--r--engines/mortevielle/dialogs.cpp24
-rw-r--r--engines/mortevielle/level15.cpp41
-rw-r--r--engines/mortevielle/level15.h4
-rw-r--r--engines/mortevielle/menu.cpp34
-rw-r--r--engines/mortevielle/mor.cpp108
-rw-r--r--engines/mortevielle/mor2.cpp155
-rw-r--r--engines/mortevielle/mortevielle.cpp6
-rw-r--r--engines/mortevielle/mouse.cpp10
-rw-r--r--engines/mortevielle/outtext.cpp4
-rw-r--r--engines/mortevielle/ovd1.cpp28
-rw-r--r--engines/mortevielle/parole.cpp216
-rw-r--r--engines/mortevielle/parole2.cpp28
-rw-r--r--engines/mortevielle/prog.cpp28
-rw-r--r--engines/mortevielle/saveload.cpp46
-rw-r--r--engines/mortevielle/taffich.cpp45
-rw-r--r--engines/mortevielle/var_mor.cpp37
-rw-r--r--engines/mortevielle/var_mor.h121
18 files changed, 733 insertions, 726 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index d115ef3976..8441315bd7 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,13 +49,13 @@ namespace Mortevielle {
void fctMove() {
int cx;
- if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
- g_s.mlieu = 15;
- g_caff = g_s.mlieu;
+ if ((g_s._mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+ g_s._mlieu = 15;
+ g_caff = g_s._mlieu;
afdes(0);
- repon(2, g_s.mlieu);
+ repon(2, g_s._mlieu);
}
- if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+ if ((g_s._mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
if (!g_syn)
ecr3(g_vm->getEngineString(S_GO_TO));
tfleche();
@@ -67,13 +67,13 @@ void fctMove() {
if (g_num == 0)
return;
if (g_num == 1) {
- g_s.mlieu = 0;
+ g_s._mlieu = 0;
tmlieu(0);
} else if (g_num == 7) {
- g_s.mlieu = 13;
+ g_s._mlieu = 13;
tmlieu(13);
} else if (g_num != 6)
- g_s.mlieu = 26;
+ g_s._mlieu = 26;
if ((g_num > 1) && (g_num < 6))
g_ment = g_num - 1;
if (g_num > 7)
@@ -89,55 +89,60 @@ void fctMove() {
do {
++cx;
} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
- if (g_s.mlieu == 19) {
+
+ if (g_s._mlieu == 19) {
if (cx == 1)
t1deva();
if (cx == 2)
t1neig();
goto L2;
}
- if (g_s.mlieu == 23) {
+
+ if (g_s._mlieu == 23) {
if (cx == 1)
t1deau();
if (cx == 2)
t1derr();
goto L2;
}
- if ((g_s.mlieu == 11) && (cx == 1))
+
+ if ((g_s._mlieu == 11) && (cx == 1))
cx = 6;
- if (g_s.mlieu == 12) {
+
+ if (g_s._mlieu == 12) {
if (cx == 2)
cx = 6;
if (cx == 5)
cx = 16;
}
- if ((g_s.mlieu == 14) && (cx == 3))
+
+ if ((g_s._mlieu == 14) && (cx == 3))
cx = 6;
- if (((g_s.mlieu == 15) || (g_s.mlieu == 26)) && (cx == 4))
+ if (((g_s._mlieu == 15) || (g_s._mlieu == 26)) && (cx == 4))
cx = 6;
- if ((g_s.mlieu > 19) && (g_s.mlieu != 26))
+ if ((g_s._mlieu > 19) && (g_s._mlieu != 26))
cx += 10;
- if ((g_s.mlieu == 20) && (cx == 13))
+ if ((g_s._mlieu == 20) && (cx == 13))
cx = 16;
- if (g_s.mlieu == 21) {
+ if (g_s._mlieu == 21) {
if (cx == 12)
cx = 16;
else if (cx > 13)
cx = 15;
}
- if ((g_s.mlieu == 22) && (cx > 14))
+ if ((g_s._mlieu == 22) && (cx > 14))
cx = 15;
- if ((g_s.mlieu == 24) && (cx != 17))
+ if ((g_s._mlieu == 24) && (cx != 17))
if (cx > 13)
cx = 15;
if (cx == 1)
- g_s.mlieu = 11;
+ g_s._mlieu = 11;
else if (cx == 2)
- g_s.mlieu = 12;
+ g_s._mlieu = 12;
else if (cx == 3)
- g_s.mlieu = 14;
+ g_s._mlieu = 14;
else if (cx == 4)
- g_s.mlieu = 15;
+ g_s._mlieu = 15;
else if (cx == 5)
cx = 12;
if (cx == 6)
@@ -147,31 +152,31 @@ void fctMove() {
else if (cx == 12)
t1deva();
else if (cx == 13)
- g_s.mlieu = 20;
+ g_s._mlieu = 20;
else if (cx == 14)
- g_s.mlieu = 24;
+ g_s._mlieu = 24;
else if (cx == 15)
t1neig();
else if (cx == 16)
t1derr();
else if (cx == 17) {
- if ((g_s.ipuit != 120) && (g_s.ipuit != 140))
+ if ((g_s._ipuit != 120) && (g_s._ipuit != 140))
g_crep = 997;
- else if (g_s.ipuit == 120)
+ else if (g_s._ipuit == 120)
g_crep = 181;
- else if (g_s.conf > 80) {
+ else if (g_s._conf > 80) {
g_crep = 1505;
tperd();
} else {
- g_s.mlieu = 23;
+ g_s._mlieu = 23;
affrep();
}
}
if ((cx < 5) || (cx == 13) || (cx == 14))
affrep();
- debloc(g_s.mlieu);
+ debloc(g_s._mlieu);
L2:
- tmlieu(g_s.mlieu);
+ tmlieu(g_s._mlieu);
}
/**
@@ -184,33 +189,33 @@ void fctTake() {
avpoing(cx);
if (g_crep != 139) {
if (g_ipers > 0)
- g_s.conf += 3;
+ g_s._conf += 3;
if (g_obpart) {
- if (g_s.mlieu == 2)
- g_s.iloic = 0;
- if (g_s.mlieu == 13) {
- if (g_s.iboul == g_caff)
- g_s.iboul = 0;
- if (g_s.ibag == g_caff)
- g_s.ibag = 0;
+ if (g_s._mlieu == 2)
+ g_s._iloic = 0;
+ if (g_s._mlieu == 13) {
+ if (g_s._iboul == g_caff)
+ g_s._iboul = 0;
+ if (g_s._ibag == g_caff)
+ g_s._ibag = 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;
+ 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();
g_obpart = false;
affrep();
} else {
- tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
+ g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
tsuiv();
++g_dobj;
if (g_dobj > 6) {
- g_s.conf += 2;
+ g_s._conf += 2;
g_dobj = 0;
}
}
@@ -230,40 +235,40 @@ void fctTake() {
}
}
tcoord(5);
- if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) {
+ if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == 16))) {
tcoord(8);
if (g_num != 0) {
if (g_ipers > 0)
- g_s.conf += 3;
+ g_s._conf += 3;
g_crep = 997;
- 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 ((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 ((g_crep != 997) && (g_crep != 139))
aniof(2, 7);
}
- if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) {
- avpoing(g_s.ibag);
+ if ((g_s._mlieu == 13) && (g_num == 2) && (g_s._ibag != 0)) {
+ avpoing(g_s._ibag);
if ((g_crep != 997) && (g_crep != 139))
aniof(2, 6);
}
- if ((g_s.mlieu == 14) && (g_s.icave != 0)) {
- avpoing(g_s.icave);
+ if ((g_s._mlieu == 14) && (g_s._icave != 0)) {
+ avpoing(g_s._icave);
if ((g_crep != 997) && (g_crep != 139))
aniof(2, 2);
}
- 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 ((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 ((g_crep != 997) && (g_crep != 139)) {
g_crep = 182;
aniof(2, 1);
}
}
- if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) {
- avpoing(g_s.ipuit);
+ if ((g_s._mlieu == 24) && (g_s._ipuit != 0)) {
+ avpoing(g_s._ipuit);
if ((g_crep != 997) && (g_crep != 139))
aniof(2, 1);
}
@@ -271,15 +276,15 @@ void fctTake() {
g_crep = 999;
}
} else {
- 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)) )
+ 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)) )
g_crep = 997;
- else if (g_s.mlieu == 23) {
+ else if (g_s._mlieu == 23) {
g_crep = 1504;
tperd();
} else
@@ -301,11 +306,11 @@ void fctInventoryTake() {
cy = 0;
do {
++cy;
- if (ord(g_s.sjer[cy]) != 0)
+ if (ord(g_s._sjer[cy]) != 0)
++cz;
} while (cz != cx);
- cz = ord(g_s.sjer[cy]);
- g_s.sjer[cy] = chr(0);
+ cz = ord(g_s._sjer[cy]);
+ g_s._sjer[cy] = chr(0);
modinv();
avpoing(cz);
g_crep = 998;
@@ -329,21 +334,21 @@ void fctLift() {
tcoord(8);
if (g_num != 0) {
if (g_ipers > 0)
- ++g_s.conf;
+ ++g_s._conf;
g_crep = 997;
- if ((g_s.mlieu == 2) && (g_s.iloic != 0))
- treg(g_s.iloic);
+ if ((g_s._mlieu == 2) && (g_s._iloic != 0))
+ treg(g_s._iloic);
}
return;
}
if (g_ipers > 0)
- ++g_s.conf;
- cx = g_s.mlieu;
- if (g_s.mlieu == 16)
+ ++g_s._conf;
+ cx = g_s._mlieu;
+ if (g_s._mlieu == 16)
cx = 14;
- else if (g_s.mlieu == 19)
+ else if (g_s._mlieu == 19)
cx = 15;
- g_crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
+ g_crep = g_tabdon[asoul + (cx << 3) + (g_num - 1)];
if (g_crep == 255)
g_crep = 997;
}
@@ -372,10 +377,10 @@ void fctRead() {
* @remarks Originally called 'tslire'
*/
void fctSelfRead() {
- if (g_s.derobj == 0)
+ if (g_s._derobj == 0)
g_crep = 186;
else
- st4(g_s.derobj);
+ st4(g_s._derobj);
}
/**
@@ -399,60 +404,60 @@ void fctLook() {
tcoord(8);
g_crep = 131;
if (g_num != 0) {
- if (g_s.mlieu == 13) {
+ if (g_s._mlieu == 13) {
if (g_num == 1) {
g_crep = 164;
- if (g_s.ibag != 0)
- treg(g_s.ibag);
- else if (g_s.iboul != 0)
- treg(g_s.iboul);
+ if (g_s._ibag != 0)
+ treg(g_s._ibag);
+ else if (g_s._iboul != 0)
+ treg(g_s._iboul);
} else {
g_crep = 193;
- if (g_s.ibag != 0)
- treg(g_s.ibag);
+ if (g_s._ibag != 0)
+ treg(g_s._ibag);
}
}
- if (g_s.mlieu == 14) {
+ if (g_s._mlieu == 14) {
g_crep = 164;
- if (g_s.icave != 0)
- treg(g_s.icave);
+ if (g_s._icave != 0)
+ treg(g_s._icave);
}
- if (g_s.mlieu == 17) {
+ if (g_s._mlieu == 17) {
g_crep = 174;
- if (g_s.ivier != 0)
- treg(g_s.ivier);
+ if (g_s._ivier != 0)
+ treg(g_s._ivier);
}
- if (g_s.mlieu == 24) {
+ if (g_s._mlieu == 24) {
g_crep = 131;
- if (g_s.ipuit != 0)
- treg(g_s.ipuit);
+ if (g_s._ipuit != 0)
+ treg(g_s._ipuit);
}
}
return;
}
- cx = g_s.mlieu;
- if (g_s.mlieu == 20)
+ cx = g_s._mlieu;
+ if (g_s._mlieu == 20)
cx = 17;
- if ((g_s.mlieu > 21) && (g_s.mlieu < 25))
+ if ((g_s._mlieu > 21) && (g_s._mlieu < 25))
cx -= 4;
- if (g_s.mlieu == 26)
+ if (g_s._mlieu == 26)
cx = 21;
- g_crep = tabdon[arega + (cx * 7) + g_num - 1];
- if ((g_s.mlieu == 13) && (g_num == 8))
+ g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
+ if ((g_s._mlieu == 13) && (g_num == 8))
g_crep = 126;
- if (g_s.mlieu == 19)
+ if (g_s._mlieu == 19)
g_crep = 103;
if (g_crep == 255)
g_crep = 131;
- if ((g_s.mlieu == 1) && (g_num == 1))
+ if ((g_s._mlieu == 1) && (g_num == 1))
treg(144);
- if ((g_s.mlieu == 5) && (g_num == 3))
+ if ((g_s._mlieu == 5) && (g_num == 3))
treg(147);
- if ((g_s.mlieu == 8) && (g_num == 3))
+ if ((g_s._mlieu == 8) && (g_num == 3))
treg(149);
- if ((g_s.mlieu == 9) && (g_num == 2))
+ if ((g_s._mlieu == 9) && (g_num == 2))
treg(30);
- if ((g_s.mlieu == 10) && (g_num == 3))
+ if ((g_s._mlieu == 10) && (g_num == 3))
treg(31);
}
@@ -461,8 +466,8 @@ void fctLook() {
* @remarks Originally called 'tsregarder'
*/
void fctSelftLook() {
- if (g_s.derobj != 0)
- treg(g_s.derobj);
+ if (g_s._derobj != 0)
+ treg(g_s._derobj);
else
g_crep = 186;
}
@@ -486,7 +491,7 @@ void fctSearch() {
if (g_anyone || g_iesc)
return;
- if (g_s.mlieu == 23) {
+ if (g_s._mlieu == 23) {
g_crep = 1504;
tperd();
return;
@@ -499,17 +504,17 @@ void fctSearch() {
int cx = 0;
do {
++cx;
- } while ((cx <= 6) && (g_num != ord(touv[cx])));
- if (g_num != ord(touv[cx]))
+ } while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+ if (g_num != ord(g_touv[cx]))
g_crep = 187;
else {
if (g_ipers > 0)
- g_s.conf += 3;
+ g_s._conf += 3;
rechai(g_mchai);
if (g_mchai != 0) {
g_cs = 0;
- is = 0;
+ g_is = 0;
g_fouil = true;
mfoudi();
tsuiv();
@@ -521,41 +526,41 @@ void fctSearch() {
g_crep = 997;
if (g_num != 0) {
if (g_ipers > 0)
- g_s.conf += 3;
- if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) {
- if (g_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) {
g_crep = 123;
- if (g_s.iloic != 0)
- treg(g_s.iloic);
+ if (g_s._iloic != 0)
+ treg(g_s._iloic);
}
- if (g_s.mlieu == 16) {
+ if (g_s._mlieu == 16) {
g_crep = 123;
- if (g_s.icryp != 0)
- treg(g_s.icryp);
+ if (g_s._icryp != 0)
+ treg(g_s._icryp);
}
}
}
}
} else {
if (g_ipers > 0)
- g_s.conf += 3;
+ g_s._conf += 3;
g_crep = 997;
- if (g_s.mlieu < 14)
- g_crep = r[g_s.mlieu];
+ if (g_s._mlieu < 14)
+ g_crep = r[g_s._mlieu];
- if ((g_s.mlieu == 3) && (g_num == 2))
+ if ((g_s._mlieu == 3) && (g_num == 2))
g_crep = 162;
- if (g_s.mlieu == 12) {
+ if (g_s._mlieu == 12) {
if ((g_num == 3) || (g_num == 4))
g_crep = 162;
else if (g_num == 5)
g_crep = 159;
}
- if (g_s.mlieu == 19)
+ if (g_s._mlieu == 19)
g_crep = 104;
- else if (g_s.mlieu == 16)
+ else if (g_s._mlieu == 16)
g_crep = 155;
}
}
@@ -565,8 +570,8 @@ void fctSearch() {
* @remarks Originally called 'tsfouiller'
*/
void fctSelfSearch() {
- if (g_s.derobj != 0)
- st7(g_s.derobj);
+ if (g_s._derobj != 0)
+ st7(g_s._derobj);
else
g_crep = 186;
}
@@ -600,32 +605,32 @@ void fctOpen() {
tcoord(7);
if (g_num != 0) {
if (g_ipers > 0)
- g_s.conf += 2;
+ g_s._conf += 2;
++g_iouv;
int cx = 0;
do {
++cx;
- } 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)) {
+ } while (!((cx > 6) || (ord(g_touv[cx]) == 0) || (ord(g_touv[cx]) == g_num)));
+ if (ord(g_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(g_num);
+ g_touv[cx] = chr(g_num);
aniof(1, g_num);
}
- cx = g_s.mlieu;
- if (g_s.mlieu == 16)
+ cx = g_s._mlieu;
+ if (g_s._mlieu == 16)
cx = 14;
- g_crep = tabdon[aouvr + (cx * 7) + g_num - 1];
+ g_crep = g_tabdon[aouvr + (cx * 7) + g_num - 1];
if (g_crep == 254)
g_crep = 999;
} else
@@ -638,7 +643,7 @@ void fctOpen() {
* @remarks Originally called 'tmettre'
*/
void fctPlace() {
- if (g_s.derobj == 0) {
+ if (g_s._derobj == 0) {
g_crep = 186;
return;
}
@@ -658,28 +663,28 @@ void fctPlace() {
g_crep = 999;
if (g_caff == 13) {
if (g_num == 1) {
- if (g_s.iboul != 0) {
+ if (g_s._iboul != 0) {
g_crep = 188;
} else {
- g_s.iboul = g_s.derobj;
- if (g_s.derobj == 141)
+ g_s._iboul = g_s._derobj;
+ if (g_s._derobj == 141)
aniof(1, 7);
}
- } else if (g_s.ibag != 0) {
+ } else if (g_s._ibag != 0) {
g_crep = 188;
} else {
- g_s.ibag = g_s.derobj;
- if (g_s.derobj == 159)
+ g_s._ibag = g_s._derobj;
+ if (g_s._derobj == 159)
aniof(1, 6);
}
}
if (g_caff == 14) {
- if (g_s.icave != 0) {
+ if (g_s._icave != 0) {
g_crep = 188;
} else {
- g_s.icave = g_s.derobj;
- if (g_s.derobj == 151) {
+ g_s._icave = g_s._derobj;
+ if (g_s._derobj == 151) {
// Open hidden passage
aniof(1, 2);
aniof(1, 1);
@@ -689,7 +694,7 @@ void fctPlace() {
// Do you want to enter the hidden passage?
int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
- if (answer== 1) {
+ if (answer == 1) {
Common::String alertTxt = deline(582);
Alert::show(alertTxt, 1);
@@ -710,10 +715,10 @@ void fctPlace() {
g_vm->_menu.displayMenu();
if (enterPassageFl) {
- g_s.mlieu = 17;
+ g_s._mlieu = 17;
tmlieu(17);
} else {
- tmlieu(g_s.mlieu);
+ tmlieu(g_s._mlieu);
writepal(14);
dessin(0);
aniof(1, 2);
@@ -735,17 +740,17 @@ void fctPlace() {
}
if (g_caff == 16) {
- if (g_s.icryp == 0)
- g_s.icryp = g_s.derobj;
+ if (g_s._icryp == 0)
+ g_s._icryp = g_s._derobj;
else
g_crep = 188;
}
if (g_caff == 17) {
- if (g_s.ivier != 0) {
+ if (g_s._ivier != 0) {
g_crep = 188;
- } else if (g_s.derobj == 143) {
- g_s.ivier = 143;
+ } else if (g_s._derobj == 143) {
+ g_s._ivier = 143;
aniof(1, 1);
} else {
g_crep = 1512;
@@ -754,10 +759,10 @@ void fctPlace() {
}
if (g_caff == 24) {
- if (g_s.ipuit != 0) {
+ if (g_s._ipuit != 0) {
g_crep = 188;
- } else if ((g_s.derobj == 140) || (g_s.derobj == 120)) {
- g_s.ipuit = g_s.derobj;
+ } else if ((g_s._derobj == 140) || (g_s._derobj == 120)) {
+ g_s._ipuit = g_s._derobj;
aniof(1, 1);
} else {
g_crep = 185;
@@ -786,7 +791,7 @@ void fctTurn() {
tcoord(9);
if (g_num != 0) {
g_crep = 997;
- if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_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 +800,13 @@ void fctTurn() {
else
g_crep = 168;
}
- if ((g_s.mlieu == 17) && (g_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) {
- g_s.mlieu = 16;
+ g_s._mlieu = 16;
affrep();
} else
g_crep = 176;
@@ -833,7 +838,7 @@ void fctSelfHide() {
* @remarks Originally called 'tattacher'
*/
void fctAttach() {
- if (g_s.derobj == 0)
+ if (g_s._derobj == 0)
g_crep = 186;
else {
if (!g_syn)
@@ -842,10 +847,10 @@ void fctAttach() {
if (!(g_anyone) && !(g_iesc)) {
tcoord(8);
g_crep = 997;
- if ((g_num != 0) && (g_s.mlieu == 24)) {
+ if ((g_num != 0) && (g_s._mlieu == 24)) {
g_crep = 999;
- if ((g_s.derobj == 120) || (g_s.derobj == 140)) {
- g_s.ipuit = g_s.derobj;
+ if ((g_s._derobj == 120) || (g_s._derobj == 140)) {
+ g_s._ipuit = g_s._derobj;
aniof(1, 1);
} else
g_crep = 185;
@@ -874,11 +879,11 @@ void fctClose() {
int cx = 0;
do {
++cx;
- } while ((cx <= 6) && (g_num != ord(touv[cx])));
- if (g_num == ord(touv[cx])) {
+ } while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+ if (g_num == ord(g_touv[cx])) {
aniof(2, g_num);
g_crep = 998;
- touv[cx] = chr(0);
+ g_touv[cx] = chr(0);
--g_iouv;
if (g_iouv < 0)
g_iouv = 0;
@@ -903,15 +908,15 @@ void fctKnock() {
if (!g_syn)
ecr3(g_vm->getEngineString(S_HIT));
- if (g_s.mlieu == 15) {
+ if (g_s._mlieu == 15) {
Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
return;
}
- if (g_s.mlieu < 25) {
+ if (g_s._mlieu < 25) {
tfleche();
if (!(g_anyone) && !(g_iesc)) {
- if ((g_s.mlieu < 19) && (g_s.mlieu != 15))
+ if ((g_s._mlieu < 19) && (g_s._mlieu != 15))
g_crep = 133;
else
g_crep = 997;
@@ -920,11 +925,11 @@ void fctKnock() {
return;
}
- if (g_s.mlieu == 26) {
+ if (g_s._mlieu == 26) {
int haz = (hazard(0, 8)) - 4;
parole(11, haz, 1);
int p;
- ecfren(p, haz, g_s.conf, g_ment);
+ ecfren(p, haz, g_s._conf, g_ment);
int l = g_ment;
if (l != 0) {
if (p != -500) {
@@ -950,7 +955,7 @@ void fctKnock() {
void fctSelfPut() {
if (!g_syn)
ecr3(g_vm->getEngineString(S_POSE));
- if (g_s.derobj == 0)
+ if (g_s._derobj == 0)
g_crep = 186;
else {
if (g_caff > 99) {
@@ -974,8 +979,8 @@ void fctSelfPut() {
int cx = 0;
do {
++cx;
- } while ((cx <= 6) && (g_num != ord(touv[cx])));
- if (g_num != ord(touv[cx]))
+ } while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+ if (g_num != ord(g_touv[cx]))
g_crep = 187;
else {
g_mchai = chai;
@@ -987,30 +992,30 @@ void fctSelfPut() {
if (g_num != 0) {
g_crep = 998;
if (g_caff == 2) {
- if (g_s.iloic != 0)
+ if (g_s._iloic != 0)
g_crep = 188;
else
- g_s.iloic = g_s.derobj;
+ g_s._iloic = g_s._derobj;
}
if (g_caff == 13) {
if (g_num == 1) {
- if (g_s.iboul != 0)
+ if (g_s._iboul != 0)
g_crep = 188;
else
- g_s.iboul = g_s.derobj;
- } else if (g_s.ibag != 0) {
+ g_s._iboul = g_s._derobj;
+ } else if (g_s._ibag != 0) {
g_crep = 188;
} else {
- g_s.ibag = g_s.derobj;
+ g_s._ibag = g_s._derobj;
}
}
if (g_caff == 16) {
- if (g_s.icryp != 0)
+ if (g_s._icryp != 0)
g_crep = 188;
else
- g_s.icryp = g_s.derobj;
+ g_s._icryp = g_s._derobj;
}
if (g_caff == 24)
@@ -1042,13 +1047,13 @@ void fctSelfPut() {
* @remarks Originally called 'tecouter'
*/
void fctListen() {
- if (g_s.mlieu != 26)
+ if (g_s._mlieu != 26)
g_crep = 101;
else {
if (g_ipers != 0)
- ++g_s.conf;
+ ++g_s._conf;
int p, haz;
- ecfren(p, haz, g_s.conf, g_ment);
+ ecfren(p, haz, g_s._conf, g_ment);
int l = g_ment;
if (l != 0) {
if (p != -500) {
@@ -1080,19 +1085,19 @@ void fctListen() {
* @remarks Originally called 'tmanger'
*/
void fctEat() {
- if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
+ if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
g_crep = 148;
} else {
tsort();
- g_s.mlieu = 10;
+ g_s._mlieu = 10;
g_caff = 10;
- debloc(g_s.mlieu);
- tmlieu(g_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)) {
- g_s.conf -= (g_s.conf / 7);
+ g_s._conf -= (g_s._conf / 7);
if (h == 12) {
if (m == 0)
h = 4;
@@ -1123,16 +1128,16 @@ void fctEat() {
void fctEnter() {
// int x;
- if ((g_s.mlieu == 21) || (g_s.mlieu == 22)) {
+ if ((g_s._mlieu == 21) || (g_s._mlieu == 22)) {
t1sama();
- tmlieu(g_s.mlieu);
- } else if (g_s.mlieu == 15)
+ tmlieu(g_s._mlieu);
+ } else if (g_s._mlieu == 15)
aldepl();
else if (g_ment == 0)
g_crep = 997;
- else if ((g_ment == 9) && (g_s.derobj != 136)) {
+ else if ((g_ment == 9) && (g_s._derobj != 136)) {
g_crep = 189;
- g_s.teauto[8] = '*';
+ g_s._teauto[8] = '*';
} else {
int z = 0;
if (!g_blo)
@@ -1146,8 +1151,8 @@ void fctEnter() {
aniof(1, 1);
tip(z, g_x);
- ++g_s.conf;
- g_s.mlieu = 15;
+ ++g_s._conf;
+ g_s._mlieu = 15;
g_msg[3] = MENU_DISCUSS;
g_msg[4] = g_vm->_menu._discussMenu[g_x];
g_syn = true;
@@ -1166,10 +1171,10 @@ void fctEnter() {
parole(7, g_x, 1);
aniof(1, 1);
- g_s.mlieu = g_ment;
+ g_s._mlieu = g_ment;
affrep();
- debloc(g_s.mlieu);
- tmlieu(g_s.mlieu);
+ debloc(g_s._mlieu);
+ tmlieu(g_s._mlieu);
g_ment = 0;
g_mpers = 0;
g_ipers = 0;
@@ -1184,17 +1189,17 @@ void fctEnter() {
void fctSleep() {
int z, j, h, m;
- if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
+ if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
g_crep = 148;
return;
}
- if (g_s.mlieu != 0) {
+ if (g_s._mlieu != 0) {
tsort();
- g_s.mlieu = 0;
+ g_s._mlieu = 0;
affrep();
afdes(0);
- debloc(g_s.mlieu);
- tmlieu(g_s.mlieu);
+ debloc(g_s._mlieu);
+ tmlieu(g_s._mlieu);
}
clsf3();
clsf2();
@@ -1205,7 +1210,7 @@ void fctSleep() {
int answer;
do {
if (h < 8) {
- g_s.conf -= (g_s.conf / 20);
+ g_s._conf -= (g_s._conf / 20);
z = (7 - h) * 2;
if (m == 30)
--z;
@@ -1235,11 +1240,11 @@ void fctForce() {
tfleche();
if ((!g_anyone) && (!g_iesc)) {
- if (g_s.mlieu != 26)
+ if (g_s._mlieu != 26)
g_crep = 997;
else {
g_crep = 143;
- g_s.conf += 2;
+ g_s._conf += 2;
}
}
}
@@ -1251,27 +1256,27 @@ void fctForce() {
void fctLeave() {
tsort();
g_crep = 0;
- if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24))
+ if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22) || (g_s._mlieu == 24))
g_crep = 997;
else {
int lx = 0;
- if ((g_s.mlieu < 16) || (g_s.mlieu == 26))
+ if ((g_s._mlieu < 16) || (g_s._mlieu == 26))
lx = 10;
- if ((g_s.mlieu == 10) || (g_s.mlieu == 20))
+ if ((g_s._mlieu == 10) || (g_s._mlieu == 20))
lx = 21;
- if ((g_s.mlieu < 10) || (g_s.mlieu == 13))
+ if ((g_s._mlieu < 10) || (g_s._mlieu == 13))
lx = 15;
- if (g_s.mlieu == 16) {
+ if (g_s._mlieu == 16) {
lx = 17;
g_crep = 176;
}
- if (g_s.mlieu == 17)
+ if (g_s._mlieu == 17)
t23coul(lx);
- if (g_s.mlieu == 23)
+ if (g_s._mlieu == 23)
lx = 24;
if (g_crep != 997)
- g_s.mlieu = lx;
+ g_s._mlieu = lx;
g_caff = lx;
if (g_crep == 0)
g_crep = lx;
@@ -1295,12 +1300,12 @@ void fctWait() {
++g_jh;
tinke();
if (!g_blo)
- t11(g_s.mlieu, quel);
+ t11(g_s._mlieu, quel);
if ((g_ipers != 0) && (g_mpers == 0)) {
g_crep = 998;
- if ((g_s.mlieu == 13) || (g_s.mlieu == 14))
+ if ((g_s._mlieu == 13) || (g_s._mlieu == 14))
cavegre();
- if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
+ if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
g_anyone = true;
g_mpers = g_ipers;
if (!g_anyone)
@@ -1364,7 +1369,7 @@ void fctDiscuss() {
for (int ix = 1; ix <= 46; ++ix)
te[ix] = false;
for (int ix = 1; ix <= 45; ++ix) {
- lib[ix] = deline(ix + c_tparler);
+ lib[ix] = deline(ix + kQuestionStringIndex);
for (i = lib[ix].size(); i <= 40; ++i)
lib[ix] = lib[ix] + ' ';
}
@@ -1379,7 +1384,7 @@ void fctDiscuss() {
do {
++icm;
g_vm->_screenSurface.putxy(co, lig);
- if (g_s.teauto[icm] == '*') {
+ if (g_s._teauto[icm] == '*') {
if (te[icm])
writetp(lib[icm], 1);
else
@@ -1439,7 +1444,7 @@ void fctDiscuss() {
writetp(lib[choi], 1);
te[choi] = ! te[choi];
}
- if ((g_s.teauto[ix] == '*') || (ix == 46)) {
+ if ((g_s._teauto[ix] == '*') || (ix == 46)) {
lig = ((ix - 1) % 23) << 3;
if (ix > 23)
co = 320;
@@ -1462,7 +1467,7 @@ void fctDiscuss() {
int ix = choi - 1;
if (g_col) {
g_col = false;
- g_s.mlieu = 15;
+ g_s._mlieu = 15;
if (g_iouv > 0)
max = 8;
else
@@ -1472,14 +1477,14 @@ void fctDiscuss() {
suj = 129;
else {
suj = 138;
- g_s.conf += (3 * (g_s.conf / 10));
+ g_s._conf += (3 * (g_s._conf / 10));
}
- } else if (nbrep[g_caff - 69] < nbrepm[g_caff - 69]) {
- suj = tabdon[arep + (ix << 3) + (g_caff - 70)];
- g_s.conf += tabdon[arcf + ix];
- ++nbrep[g_caff - 69];
+ } else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) {
+ suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)];
+ g_s._conf += g_tabdon[arcf + ix];
+ ++g_nbrep[g_caff - 69];
} else {
- g_s.conf += 3;
+ g_s._conf += 3;
suj = 139;
}
hideMouse();
@@ -1488,17 +1493,17 @@ void fctDiscuss() {
sparl(0, suj);
showMouse();
if ((suj == 84) || (suj == 86)) {
- g_s.pourc[5] = '*';
- g_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)
- g_s.teauto[indx] = '*';
- g_s.pourc[7] = '*';
+ g_s._teauto[indx] = '*';
+ g_s._pourc[7] = '*';
}
if (suj == 70) {
- g_s.pourc[8] = '*';
- g_s.teauto[32] = '*';
+ g_s._pourc[8] = '*';
+ g_s._teauto[32] = '*';
}
hideMouse();
hirs();
@@ -1506,14 +1511,14 @@ void fctDiscuss() {
}
} while ((choi != 46) && (suj != 138));
if (g_col) {
- g_s.conf += (3 * (g_s.conf / 10));
+ g_s._conf += (3 * (g_s._conf / 10));
hideMouse();
hirs();
premtet();
sparl(0, 138);
showMouse();
g_col = false;
- g_s.mlieu = 15;
+ g_s._mlieu = 15;
}
g_ctrm = 0;
hideMouse();
@@ -1525,7 +1530,7 @@ void fctDiscuss() {
drawClock();
affrep();
/* chech;*/
- tmlieu(g_s.mlieu);
+ tmlieu(g_s._mlieu);
clsf3();
}
@@ -1601,8 +1606,6 @@ void MortevielleEngine::endGame() {
* @remarks Originally called 'tencore'
*/
void MortevielleEngine::loseGame() {
- int answer;
-
clsf2();
musique(0);
tkey1(false);
@@ -1616,7 +1619,8 @@ void MortevielleEngine::loseGame() {
g_hour = 10;
g_day = 0;
repon(2, 180);
- answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+
+ int 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 96264c8b5d..a586ccf972 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -294,7 +294,7 @@ bool Ques::show() {
int rep;
int firstOption, lastOption;
char key;
- rectangle coor[max_rect];
+ rectangle coor[kMaxRect];
Common::String choiceArray[15];
int currChoice, prevChoice;
@@ -336,19 +336,17 @@ bool Ques::show() {
optionPosY += 8;
}
for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
- rectangle &with = coor[j];
-
- with.x1 = 45 * g_res;
- with.x2 = (maxLength * 3 + 55) * g_res;
- with.y1 = 27 + j * 8;
- with.y2 = 34 + j * 8;
- with.enabled = true;
+ coor[j]._x1 = 45 * g_res;
+ coor[j]._x2 = (maxLength * 3 + 55) * g_res;
+ coor[j]._y1 = 27 + j * 8;
+ coor[j]._y2 = 34 + j * 8;
+ coor[j]._enabled = true;
while ((int)choiceArray[j].size() < maxLength) {
choiceArray[j] += ' ';
}
}
- coor[lastOption - firstOption + 2].enabled = false;
+ coor[lastOption - firstOption + 2]._enabled = false;
if (g_res == 1)
rep = 10;
else
@@ -366,9 +364,9 @@ bool Ques::show() {
CHECK_QUIT0;
currChoice = 1;
- while (coor[currChoice].enabled && !dans_rect(coor[currChoice]))
+ while (coor[currChoice]._enabled && !isMouseIn(coor[currChoice]))
++currChoice;
- if (coor[currChoice].enabled) {
+ if (coor[currChoice]._enabled) {
if ((prevChoice != 0) && (prevChoice != currChoice)) {
tmpStr = choiceArray[prevChoice] + '$';
afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
@@ -469,7 +467,7 @@ void f3f8::aff50(bool drawAni50Fl) {
if (drawAni50Fl)
ani50();
else
- repon(2, c_paroles + 142);
+ repon(2, kDialogStringIndex + 142);
// Draw the f3/f8 dialog
draw();
@@ -481,7 +479,7 @@ void f3f8::ani50() {
g_crep = animof(2, 1);
pictout(adani, g_crep, 63, 12);
g_f2_all = (g_res == 1);
- repon(2, c_paroles + 143);
+ repon(2, kDialogStringIndex + 143);
}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 68fff8aa00..aabbe29528 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -39,35 +39,37 @@ namespace Mortevielle {
void copcha() {
int i = acha;
do {
- tabdon[i] = tabdon[i + 390];
+ g_tabdon[i] = g_tabdon[i + 390];
++i;
} while (i != acha + 390);
}
-bool dans_rect(rectangle r) {
+/**
+ * Engine function : Is mouse in a given rect?
+ * @remarks Originally called 'dans_rect'
+ */
+bool isMouseIn(rectangle r) {
int x, y, c;
getMousePos(x, y, c);
- if ((x > r.x1) && (x < r.x2) && (y > r.y1) && (y < r.y2))
+ if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
return true;
return false;
}
-void outbloc(int n, pattern p, t_nhom pal) {
+void outbloc(int n, pattern p, nhom *pal) {
int ad = n * 404 + 0xd700;
- WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
- WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
+ WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p._tax);
+ WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p._tay);
ad += 4;
- for (int i = 1; i <= p.tax; ++i)
- for (int j = 1; j <= p.tay; ++j)
- mem[(0x6000 * 16) + ad + (j - 1) * p.tax + i - 1] = pal[n].hom[p.des[i][j]];
+ for (int i = 1; i <= p._tax; ++i)
+ for (int j = 1; j <= p._tay; ++j)
+ mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
}
void writepal(int n) {
- t_nhom pal;
-
switch (g_currGraphicalDevice) {
case MODE_TANDY:
case MODE_EGA:
@@ -77,14 +79,19 @@ void writepal(int n) {
mem[(0x7000 * 16) + (2 * i) + 1] = tabpal[n][i].y;
}
break;
- case MODE_CGA:
+ case MODE_CGA: {
warning("TODO: If this code is needed, resolve the incompatible types");
-// pal = palcga[n].a;
+ nhom pal[16];
+ for (int i = 0; i < 16; ++i) {
+ pal[i] = palcga[n]._a[i];
+ }
+// nhom pal[16] = palcga[n]._a;
if (n < 89)
- palette(palcga[n].p);
+ palette(palcga[n]._p);
for (int i = 0; i <= 15; ++i)
- outbloc(i, tpt[pal[i].n], pal);
+ outbloc(i, tpt[pal[i]._id], pal);
+ }
break;
default:
break;
@@ -125,13 +132,13 @@ void adzon() {
if (!f.open("don.mor"))
error("Missing file - don.mor");
- f.read(tabdon, 7 * 256);
+ f.read(g_tabdon, 7 * 256);
f.close();
if (!f.open("bmor.mor"))
error("Missing file - bmor.mor");
- f.read(&tabdon[fleche], 1 * 1916);
+ f.read(&g_tabdon[fleche], 1 * 1916);
f.close();
if (!f.open("dec.mor"))
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index c3df5e5d6c..34e1026f2c 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -34,8 +34,8 @@ namespace Mortevielle {
/* NIVEAU 15 */
extern void copcha();
-extern bool dans_rect(rectangle r);
-extern void outbloc(int n, pattern p, t_nhom pal);
+extern bool isMouseIn(rectangle r);
+extern void outbloc(int n, pattern p, nhom *pal);
extern void writepal(int n);
extern void pictout(int seg, int dep, int x, int y);
// extern int calad(int x, int y);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index ac199594b7..7de738dc28 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -169,7 +169,7 @@ void Menu::displayMenu() {
do { // One line after the other
msk = 0x80;
for (pt = 0; pt <= 7; ++pt) {
- if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
+ if ((g_lettres[num_letr - 1][ind_tabl] & msk) != 0) {
g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
@@ -208,7 +208,7 @@ void Menu::invers(int ix) {
int menuIndex = lo(g_msg4);
- g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+ g_vm->_screenSurface.putxy(g_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
switch (g_msg3) {
case 1:
s = _inventoryStringArray[menuIndex];
@@ -253,9 +253,9 @@ void Menu::invers(int ix) {
void Menu::util(int x, int y) {
- int ymx = (_menuConstants[g_msg3 - 1][3] << 3) + 16;
- int dxcar = _menuConstants[g_msg3 - 1][2];
- int xmn = (_menuConstants[g_msg3 - 1][0] << 2) * g_res;
+ int ymx = (g_menuConstants[g_msg3 - 1][3] << 3) + 16;
+ int dxcar = g_menuConstants[g_msg3 - 1][2];
+ int xmn = (g_menuConstants[g_msg3 - 1][0] << 2) * g_res;
int ix;
if (g_res == 1)
@@ -289,19 +289,19 @@ void Menu::menuDown(int ii) {
g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
// Draw the menu
- xco = _menuConstants[ii - 1][0];
- nb_lig = _menuConstants[ii - 1][3];
+ xco = g_menuConstants[ii - 1][0];
+ nb_lig = g_menuConstants[ii - 1][3];
hideMouse();
- sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
+ sauvecr(10, (g_menuConstants[ii - 1][1] + 1) << 1);
xco = xco << 3;
if (g_res == 1)
cx = 10;
else
cx = 6;
- xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
- g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
- g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
- g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
+ xcc = xco + (g_menuConstants[ii - 1][2] * cx) + 6;
+ g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (g_menuConstants[ii - 1][1] << 1)));
+ g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (g_menuConstants[ii - 1][1] << 1)));
+ g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (g_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (g_menuConstants[ii - 1][1] << 1)));
g_vm->_screenSurface.putxy(xco, 16);
cx = 0;
do {
@@ -362,7 +362,7 @@ void Menu::menuDown(int ii) {
void Menu::menuUp(int xx) {
/* debug('menuUp'); */
if (g_test0) {
- charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
+ charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1);
/* Restore the background area */
assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
@@ -475,7 +475,7 @@ void Menu::initMenu() {
if (!f.open("menu.mor"))
error("Missing file - menufr.mor or menual.mor or menu.mor");
- f.read(lettres, 7 * 24);
+ f.read(g_lettres, 7 * 24);
f.close();
// Ask to swap floppy
@@ -488,18 +488,18 @@ void Menu::initMenu() {
_moveStringArray[i] = "* ";
i = 1;
do {
- _actionStringArray[i] = deline(i + c_action);
+ _actionStringArray[i] = deline(i + kMenuActionStringIndex);
while (_actionStringArray[i].size() < 10)
_actionStringArray[i] += ' ';
if (i < 9) {
if (i < 6) {
- _selfStringArray[i] = deline(i + c_saction);
+ _selfStringArray[i] = deline(i + kMenuSelfStringIndex);
while (_selfStringArray[i].size() < 10)
_selfStringArray[i] += ' ';
}
- _discussStringArray[i] = deline(i + c_dis) + ' ';
+ _discussStringArray[i] = deline(i + kMenuSayStringIndex) + ' ';
}
++i;
} while (i != 22);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 20882eb41a..ab3467e89f 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -145,7 +145,7 @@ void text1(int x, int y, int nb, int m) {
void initouv() {
for (int cx = 1; cx <= 7; ++cx)
- touv[cx] = chr(0);
+ g_touv[cx] = chr(0);
}
void ecrf1() {
@@ -236,11 +236,11 @@ void clsf10() {
cod = 544;
}
g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
- if (g_s.conf < 33)
+ if (g_s._conf < 33)
st = g_vm->getEngineString(S_COOL);
- else if (g_s.conf < 66)
+ else if (g_s._conf < 66)
st = g_vm->getEngineString(S_LOURDE);
- else if (g_s.conf > 65)
+ else if (g_s._conf > 65)
st = g_vm->getEngineString(S_MALSAINE);
co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
@@ -309,7 +309,7 @@ void modobj(int m) {
Common::String strp = Common::String(' ');
if (m != 500)
- strp = deline(m - 501 + c_st41);
+ strp = deline(m - 501 + kInventoryStringIndex);
g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -324,7 +324,7 @@ void modobj2(int m, bool t1, bool t2) {
g_tesok = false;;
if (m != 500)
- strp = deline(m - 501 + c_st41);
+ strp = deline(m - 501 + kInventoryStringIndex);
g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -337,7 +337,7 @@ void repon(int f, int m) {
Common::String tmpStr;
if ((m > 499) && (m < 563)) {
- tmpStr = deline(m - 501 + c_st41);
+ tmpStr = deline(m - 501 + kInventoryStringIndex);
if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
g_f2_all = true;
@@ -357,12 +357,12 @@ void repon(int f, int m) {
ecrf2();
text1(8, 182, 103, m);
if ((m == 68) || (m == 69))
- g_s.teauto[40] = '*';
+ g_s._teauto[40] = '*';
if ((m == 104) && (g_caff == 14)) {
- g_s.teauto[36] = '*';
- if (g_s.teauto[39] == '*') {
- g_s.pourc[3] = '*';
- g_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)
- g_s.pourc[6] = '*';
+ g_s._pourc[6] = '*';
if (m == 179)
- g_s.pourc[10] = '*';
+ g_s._pourc[10] = '*';
}
if (f == 7) { /* messint */
ecrf7();
@@ -1024,7 +1024,7 @@ void init_nbrepm() {
const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
for (int idx = 0; idx < 9; ++idx)
- nbrepm[idx] = ipm[idx];
+ g_nbrepm[idx] = ipm[idx];
}
void phaz(int &haz, int &p, int cf) {
@@ -1035,43 +1035,43 @@ void phaz(int &haz, int &p, int cf) {
void inzon() {
copcha();
- 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;
+ 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 (int cx = 2; cx <= 6; ++cx)
- g_s.sjer[cx] = chr(0);
+ g_s._sjer[cx] = chr(0);
- g_s.sjer[1] = chr(113);
- g_s.heure = chr(20);
+ g_s._sjer[1] = chr(113);
+ g_s._heure = chr(20);
for (int cx = 1; cx <= 10; ++cx)
- g_s.pourc[cx] = ' ';
+ g_s._pourc[cx] = ' ';
for (int cx = 1; cx <= 6; ++cx)
- g_s.teauto[cx] = '*';
+ g_s._teauto[cx] = '*';
for (int cx = 7; cx <= 9; ++cx)
- g_s.teauto[cx] = ' ';
+ g_s._teauto[cx] = ' ';
for (int cx = 10; cx <= 28; ++cx)
- g_s.teauto[cx] = '*';
+ g_s._teauto[cx] = '*';
for (int cx = 29; cx <= 42; ++cx)
- g_s.teauto[cx] = ' ';
+ g_s._teauto[cx] = ' ';
- g_s.teauto[33] = '*';
+ g_s._teauto[33] = '*';
for (int cx = 1; cx <= 8; ++cx)
- nbrep[cx] = 0;
+ g_nbrep[cx] = 0;
init_nbrepm();
}
@@ -1079,7 +1079,7 @@ void inzon() {
void dprog() {
g_li = 21;
g_jh = 0;
- if (!g_s.ipre)
+ if (!g_s._ipre)
g_blo = true;
g_t = ti1;
g_mh = readclock();
@@ -1219,7 +1219,7 @@ void pl20(int cf) {
void t11(int l11, int &a) {
int p, haz;
- ecfren(p, haz, g_s.conf, l11);
+ ecfren(p, haz, g_s._conf, l11);
g_li = l11;
if ((l11 > 0) && (l11 < 10)) {
if (p != -500) {
@@ -1251,7 +1251,7 @@ void t11(int l11, int &a) {
cpl15(p);
if (l11 == 20)
cpl20(p, h);
- p += g_s.conf;
+ p += g_s._conf;
haz = hazard(1, 100);
if (haz > p) {
person();
@@ -1274,9 +1274,9 @@ void t11(int l11, int &a) {
}
void cavegre() {
- g_s.conf += 2;
- if (g_s.conf > 69)
- g_s.conf += (g_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));
@@ -1335,12 +1335,12 @@ void musique(int so) {
if (so == 0) {
/* musik(0) */
;
- } else if ((g_prebru == 0) && (!g_s.ipre)) {
+ } else if ((g_prebru == 0) && (!g_s._ipre)) {
parole(10, 1, 1);
++g_prebru;
} else {
bool i = false;
- if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_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);
@@ -1348,7 +1348,7 @@ void musique(int so) {
i = true;
}
}
- if (g_s.mlieu == 20) {
+ if (g_s._mlieu == 20) {
int haz = hazard(1, 2);
if (haz == 1) {
parole(8, 1, 1);
@@ -1356,7 +1356,7 @@ void musique(int so) {
}
}
- if (g_s.mlieu == 24) {
+ if (g_s._mlieu == 24) {
int haz = hazard(1, 2);
if (haz == 2) {
parole(12, 1, 1);
@@ -1364,7 +1364,7 @@ void musique(int so) {
}
}
- if (g_s.mlieu == 23) {
+ if (g_s._mlieu == 23) {
parole(13, 1, 1);
i = true;
}
@@ -1392,24 +1392,24 @@ void dessin(int ad) {
ecrf1();
if ((g_caff < 30) || (g_caff > 32)) {
for (int cx = 1; cx <= 6; ++cx) {
- if (ord(touv[cx]) != 0)
- aniof(1, ord(touv[cx]));
+ if (ord(g_touv[cx]) != 0)
+ aniof(1, ord(g_touv[cx]));
}
if (g_caff == 13) {
- if (g_s.iboul == 141)
+ if (g_s._iboul == 141)
aniof(1, 7);
- if (g_s.ibag == 159)
+ if (g_s._ibag == 159)
aniof(1, 6);
}
- if ((g_caff == 14) && (g_s.icave == 151))
+ if ((g_caff == 14) && (g_s._icave == 151))
aniof(1, 2);
- if ((g_caff == 17) && (g_s.ivier == 143))
+ if ((g_caff == 17) && (g_s._ivier == 143))
aniof(1, 1);
- if ((g_caff == 24) && (g_s.ipuit != 0))
+ if ((g_caff == 24) && (g_s._ipuit != 0))
aniof(1, 1);
}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c592ddc996..326010ad8c 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -56,9 +56,9 @@ void tinke() {
cx = 0;
do {
++cx;
- if (nbrepm[cx] != 0)
- --nbrepm[cx];
- nbrep[cx] = 0;
+ if (g_nbrepm[cx] != 0)
+ --g_nbrepm[cx];
+ g_nbrep[cx] = 0;
} while (cx != 8);
}
if ((h > g_hour) || ((h == 0) && (g_hour == 23))) {
@@ -67,7 +67,7 @@ void tinke() {
drawClock();
cf = 0;
for (cx = 1; cx <= 10; ++cx) {
- if (g_s.pourc[cx] == '*')
+ if (g_s._pourc[cx] == '*')
++cf;
}
@@ -76,18 +76,18 @@ void tinke() {
else
stpo = chr(cf + 48);
- _hintPctMessage = Common::String(d3);
- _hintPctMessage += d5;
- _hintPctMessage += d4;
- _hintPctMessage += d3;
- _hintPctMessage += d1;
- _hintPctMessage += stpo;
- _hintPctMessage += '0';
- _hintPctMessage += d2;
- _hintPctMessage += d4;
- _hintPctMessage += d3;
- _hintPctMessage += d6;
- _hintPctMessage += d4;
+ g_hintPctMessage = Common::String(d3);
+ g_hintPctMessage += d5;
+ g_hintPctMessage += d4;
+ g_hintPctMessage += d3;
+ g_hintPctMessage += d1;
+ g_hintPctMessage += stpo;
+ g_hintPctMessage += '0';
+ g_hintPctMessage += d2;
+ g_hintPctMessage += d4;
+ g_hintPctMessage += d3;
+ g_hintPctMessage += d6;
+ g_hintPctMessage += d4;
}
if (m > g_minute) {
g_minute = 30;
@@ -101,7 +101,7 @@ void tinke() {
g_t = ti2;
else
g_t = ti1;
- cf = g_s.conf;
+ cf = g_s._conf;
if ((cf > 33) && (cf < 66))
g_t -= (g_t / 3);
@@ -157,7 +157,7 @@ void tinke() {
g_mpers = g_ipers;
if ((g_mpers == 0) && (g_ipers > 0)) {
- if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) {
+ if ((g_s._mlieu == 13) || (g_s._mlieu == 14)) {
cavegre();
} else if (g_ipers == 10) {
g_ipers = 0;
@@ -186,7 +186,7 @@ void tinke() {
nouvp(g_li, cx);
g_brt = false;
g_hdb = 0;
- if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
+ if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
g_anyone = true;
}
}
@@ -245,7 +245,7 @@ void tmlieu(int mli) {
int i = 1;
while ((i < 8) && (v_lieu[i][mli] != 0)) {
- nomp = deline(v_lieu[i][mli] + c_tmlieu);
+ nomp = deline(v_lieu[i][mli] + kMenuPlaceStringIndex);
while (nomp.size() < 20)
nomp += ' ';
g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
@@ -270,12 +270,12 @@ void tlu(int af, int ob) {
}
void affrep() {
- g_caff = g_s.mlieu;
- g_crep = g_s.mlieu;
+ g_caff = g_s._mlieu;
+ g_crep = g_s._mlieu;
}
void mfouen() {
- tmlieu(g_s.mlieu);
+ tmlieu(g_s._mlieu);
for (int cx = 1; cx <= 11; ++cx)
g_vm->_menu.enableMenuItem(_actionMenu[cx]);
@@ -309,19 +309,19 @@ void tperd() {
void tsort() {
- if ((g_iouv > 0) && (g_s.mlieu != 0)) {
- if (g_s.conf < 50)
- g_s.conf += 2;
+ if ((g_iouv > 0) && (g_s._mlieu != 0)) {
+ if (g_s._conf < 50)
+ g_s._conf += 2;
else
- g_s.conf += (g_s.conf / 10);
+ g_s._conf += (g_s._conf / 10);
}
for (int cx = 1; cx <= 7; ++cx)
- touv[cx] = chr(0);
+ g_touv[cx] = chr(0);
g_ment = 0;
g_iouv = 0;
g_mchai = 0;
- debloc(g_s.mlieu);
+ debloc(g_s._mlieu);
}
void st4(int ob) {
@@ -359,14 +359,14 @@ void cherjer(int ob, bool &d) {
d = false;
for (cx = 1; cx <= 6; ++cx)
- d = (d || (ord(g_s.sjer[cx]) == ob));
+ d = (d || (ord(g_s._sjer[cx]) == ob));
- if (g_s.derobj == ob)
+ if (g_s._derobj == ob)
d = true;
}
void st1sama() {
- g_s.mlieu = 10;
+ g_s._mlieu = 10;
affrep();
}
@@ -376,10 +376,10 @@ void modinv() {
int cy = 0;
for (int cx = 1; cx <= 6; ++cx)
- if (g_s.sjer[cx] != chr(0)) {
+ if (g_s._sjer[cx] != chr(0)) {
++cy;
- r = (ord(g_s.sjer[cx]) + 400);
- nomp = deline(r - 501 + c_st41);
+ r = (ord(g_s._sjer[cx]) + 400);
+ nomp = deline(r - 501 + kInventoryStringIndex);
g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
}
@@ -396,7 +396,7 @@ void sparl(float adr, float rep) {
repint = abs((int)rep);
hideMouse();
- Common::String tmpStr = deline(repint + c_paroles);
+ Common::String tmpStr = deline(repint + kDialogStringIndex);
afftex(tmpStr, 230, 4, 65, 24, 5);
f3f8::draw();
@@ -414,7 +414,7 @@ void finfouil() {
g_fouil = false;
g_obpart = false;
g_cs = 0;
- is = 0;
+ g_is = 0;
mfouen();
}
@@ -444,12 +444,11 @@ void ajchai() {
int cx = 0;
do {
++cx;
- } while ((cx <= 9) && (tabdon[cy + cx] != 0));
+ } while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
- if (tabdon[cy + cx] == 0) {
- int lderobj = g_s.derobj;
- tabdon[cy + cx] = lderobj;
- } else
+ if (g_tabdon[cy + cx] == 0)
+ g_tabdon[cy + cx] = g_s._derobj;
+ else
g_crep = 192;
}
@@ -457,10 +456,10 @@ void ajjer(int ob) {
int cx = 0;
do {
++cx;
- } while ((cx <= 5) && (ord(g_s.sjer[cx]) != 0));
+ } while ((cx <= 5) && (ord(g_s._sjer[cx]) != 0));
- if (ord(g_s.sjer[cx]) == 0) {
- g_s.sjer[(cx)] = chr(ob);
+ if (ord(g_s._sjer[cx]) == 0) {
+ g_s._sjer[(cx)] = chr(ob);
modinv();
} else
g_crep = 139;
@@ -470,7 +469,7 @@ void t1sama() { //Entering manor
int j, h, m;
calch(j, h, m);
- if ((h < 5) && (g_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
@@ -478,7 +477,7 @@ void t1sama() { //Entering manor
tperd();
} else
st1sama();
- } else if (!g_s.ipre) { //Is it your first time?
+ } else if (!g_s._ipre) { //Is it your first time?
g_ipers = 255;
affper(g_ipers);
g_caff = 77;
@@ -494,21 +493,21 @@ void t1sama() { //Entering manor
dessine_rouleau();
drawClock();
showMouse();
- g_s.mlieu = 0;
+ g_s._mlieu = 0;
affrep();
t5(10);
if (!g_blo)
t11(0, m);
g_ipers = 0;
g_mpers = 0;
- g_s.ipre = true;
+ g_s._ipre = true;
/*chech;*/
} else
st1sama();
}
void t1vier() {
- g_s.mlieu = 17;
+ g_s._mlieu = 17;
affrep();
}
@@ -519,19 +518,19 @@ void t1neig() {
tperd();
} else {
g_okdes = true;
- g_s.mlieu = 19;
+ g_s._mlieu = 19;
affrep();
}
}
void t1deva() {
g_inei = 0;
- g_s.mlieu = 21;
+ g_s._mlieu = 21;
affrep();
}
void t1derr() {
- g_s.mlieu = 22;
+ g_s._mlieu = 22;
affrep();
}
@@ -563,11 +562,11 @@ L1:
parole(4, 4, 1);
if (g_iouv == 0)
- g_s.conf += 2;
- else if (g_s.conf < 50)
- g_s.conf += 4;
+ g_s._conf += 2;
+ else if (g_s._conf < 50)
+ g_s._conf += 4;
else
- g_s.conf += 3 * (g_s.conf / 10);
+ g_s._conf += 3 * (g_s._conf / 10);
tsort();
tmlieu(15);
int cx;
@@ -605,18 +604,18 @@ void tsuiv() {
int cy = acha + ((g_mchai - 1) * 10) - 1;
int cx = 0;
do {
- cx = cx + 1;
- g_cs = g_cs + 1;
+ ++cx;
+ ++g_cs;
cl = cy + g_cs;
- tbcl = tabdon[cl];
+ tbcl = g_tabdon[cl];
} while ((tbcl == 0) && (g_cs <= 9));
if ((tbcl != 0) && (g_cs < 11)) {
- is = is + 1;
+ ++g_is;
g_caff = tbcl;
g_crep = g_caff + 400;
if (g_ipers != 0)
- g_s.conf = g_s.conf + 2;
+ g_s._conf += 2;
} else {
affrep();
finfouil();
@@ -647,7 +646,7 @@ void tfleche() {
} while (!(qust || g_rect || g_anyone));
if (qust && (touch == '\103'))
- Alert::show(_hintPctMessage, 1);
+ Alert::show(g_hintPctMessage, 1);
} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
if (touch == '\73')
@@ -670,12 +669,12 @@ void tcoord(int sx) {
int atdon = amzon + 3;
int cy = 0;
while (cy < g_caff) {
- a += tabdon[atdon];
+ a += g_tabdon[atdon];
atdon += 4;
++cy;
}
- if (tabdon[atdon] == 0) {
+ if (g_tabdon[atdon] == 0) {
g_crep = 997;
return;
}
@@ -683,10 +682,10 @@ void tcoord(int sx) {
a += fleche;
int cb = 0;
for (cy = 0; cy <= (sx - 2); ++cy) {
- ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
+ ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
cb += (ib * 4) + 2;
}
- ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
+ ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
if (ib == 0) {
g_crep = 997;
return;
@@ -695,11 +694,11 @@ void tcoord(int sx) {
cy = 1;
do {
cb += 2;
- sx = tabdon[a + cb] * g_res;
- sy = tabdon[(a + cb + 1)];
+ sx = g_tabdon[a + cb] * g_res;
+ sy = g_tabdon[(a + cb + 1)];
cb += 2;
- ix = tabdon[a + cb] * g_res;
- iy = tabdon[(a + cb + 1)];
+ ix = g_tabdon[a + cb] * g_res;
+ iy = g_tabdon[(a + cb + 1)];
++cy;
} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
@@ -757,22 +756,22 @@ void treg(int ob) {
void avpoing(int &ob) {
g_crep = 999;
- if (g_s.derobj != 0)
- ajjer(g_s.derobj);
+ if (g_s._derobj != 0)
+ ajjer(g_s._derobj);
if (g_crep != 139) {
modobj(ob + 400);
- g_s.derobj = ob;
+ g_s._derobj = ob;
ob = 0;
}
}
void rechai(int &ch) {
- int cx = g_s.mlieu;
+ int cx = g_s._mlieu;
- if (g_s.mlieu == 16)
+ if (g_s._mlieu == 16)
cx = 14;
- ch = tabdon[achai + (cx * 7) + g_num - 1];
+ ch = g_tabdon[achai + (cx * 7) + g_num - 1];
}
void t23coul(int &l) {
@@ -787,7 +786,7 @@ void t23coul(int &l) {
}
void maivid() {
- g_s.derobj = 0;
+ g_s._derobj = 0;
modobj(500);
}
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index dceb5c7d55..4a410f0b81 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,7 +134,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
return result;
// Load some error messages (was previously in chartex())
- _hintPctMessage = deline(580); // You should have noticed %d hints
+ g_hintPctMessage = deline(580); // You should have noticed %d hints
// Set default EGA palette
_paletteManager.setDefaultPalette();
@@ -585,7 +585,7 @@ void MortevielleEngine::handleAction() {
if (g_choisi && (g_msg[3] == MENU_LOAD))
g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
if (inkey == '\103') { /* F9 */
- temps = Alert::show(_hintPctMessage, 1);
+ temps = Alert::show(g_hintPctMessage, 1);
return;
} else if (inkey == '\77') {
if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
@@ -622,7 +622,7 @@ void MortevielleEngine::handleAction() {
oo = true;
if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
finfouil();
- g_caff = g_s.mlieu;
+ g_caff = g_s._mlieu;
g_crep = 998;
} else
tsuiv();
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index f26c7051a6..ca88a79da3 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -64,13 +64,13 @@ void initMouse() {
int_m = false;
if (int_m) {
- reg.ax = 0;
+ reg._ax = 0;
intr(0x33, reg);
- int_m = (reg.ax == -1);
+ int_m = (reg._ax == -1);
if (int_m) {
- reg.ax = 4;
- reg.cx = 0;
- reg.dx = 0;
+ reg._ax = 4;
+ reg._cx = 0;
+ reg._dx = 0;
intr(0x33, reg);
}
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 80eeaa7cab..4d54040749 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -134,8 +134,8 @@ Common::String deline(int num) {
} else if (!g_vm->_txxFileFl) {
wrkStr = g_vm->getGameString(num);
} else {
- int i = t_rec[num].indis;
- byte k = t_rec[num].point;
+ int i = t_rec[num]._indis;
+ byte k = t_rec[num]._point;
int length = 0;
bool endFl = false;
char let;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 1ad58ed996..e69e7ae64c 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -78,23 +78,23 @@ void charpal() {
error("Missing file - cxx.mor");
for (int j = 0; j <= 90; ++j) {
- palcga[j].p = fb.readByte();
+ palcga[j]._p = fb.readByte();
for (int i = 0; i <= 15; ++i) {
- nhom &with = palcga[j].a[i];
+ nhom &with = palcga[j]._a[i];
b = fb.readByte();
- with.n = (uint)b >> 4;
- with.hom[0] = ((uint)b >> 2) & 3;
- with.hom[1] = b & 3;
+ with._id = (uint)b >> 4;
+ with._hom[0] = ((uint)b >> 2) & 3;
+ with._hom[1] = b & 3;
}
}
- palcga[10].a[9] = palcga[10].a[5];
+ palcga[10]._a[9] = palcga[10]._a[5];
for (int j = 0; j <= 14; ++j) {
- tpt[j].tax = fb.readByte();
- tpt[j].tay = fb.readByte();
+ tpt[j]._tax = fb.readByte();
+ tpt[j]._tay = fb.readByte();
for (int i = 1; i <= 20; ++i)
for (int k = 1; k <= 20; ++k)
- tpt[j].des[i][k] = fb.readByte();
+ tpt[j]._des[i][k] = fb.readByte();
}
fb.close();
}
@@ -134,8 +134,8 @@ void chartex() {
inpFile.close();
for (int i = 0; i < (ntpFile.size() / 3); ++i) {
- t_rec[i].indis = ntpFile.readSint16LE();
- t_rec[i].point = ntpFile.readByte();
+ t_rec[i]._indis = ntpFile.readSint16LE();
+ t_rec[i]._point = ntpFile.readByte();
}
ntpFile.close();
@@ -187,14 +187,14 @@ void music() {
fic.close();
g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
- addfix = (float)((tempo_mus - addv[1])) / 256;
+ addfix = (float)((kTempoMusic - g_addv[1])) / 256;
cctable(tbi);
fin = false;
k = 0;
do {
fin = keypressed();
- g_vm->_soundManager.musyc(tbi, 9958 , tempo_mus);
+ g_vm->_soundManager.musyc(tbi, 9958, kTempoMusic);
++k;
fin = fin | keypressed() | (k >= 5);
} while (!fin);
@@ -233,7 +233,7 @@ void charge_cfiph() {
error("Missing file - cfiph.mor");
for (int i = 0; i < (f.size() / 2); ++i)
- t_cph[i] = f.readSint16LE();
+ g_t_cph[i] = f.readSint16LE();
f.close();
}
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 9bfbaaf560..f0d755201f 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -33,15 +33,15 @@
namespace Mortevielle {
void spfrac(int wor) {
- c3.rep = (uint)wor >> 12;
- if ((g_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)))) {
- ++c3.rep;
+ c3._rep = (uint)wor >> 12;
+ if ((g_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)))) {
+ ++c3._rep;
}
- c3.freq = ((uint)wor >> 6) & 7;
- c3.acc = ((uint)wor >> 9) & 7;
+ c3._freq = ((uint)wor >> 6) & 7;
+ c3._acc = ((uint)wor >> 9) & 7;
}
void charg_car() {
@@ -51,31 +51,31 @@ void charg_car() {
int_ = wor & 0x3f;
if ((int_ >= 0) && (int_ <= 13)) {
- c3.val = int_;
- c3.code = 5;
+ c3._val = int_;
+ c3._code = 5;
} else if ((int_ >= 14) && (int_ <= 21)) {
- c3.val = int_;
- c3.code = 6;
+ c3._val = int_;
+ c3._code = 6;
} else if ((int_ >= 22) && (int_ <= 47)) {
int_ = int_ - 22;
- c3.val = int_;
- c3.code = typcon[int_];
+ c3._val = int_;
+ c3._code = g_typcon[int_];
} else if ((int_ >= 48) && (int_ <= 56)) {
- c3.val = int_ - 22;
- c3.code = 4;
+ c3._val = int_ - 22;
+ c3._code = 4;
} else {
switch (int_) {
case 60:
- c3.val = 32; /* " " */
- c3.code = 9;
+ c3._val = 32; /* " " */
+ c3._code = 9;
break;
case 61:
- c3.val = 46; /* "." */
- c3.code = 9;
+ c3._val = 46; /* "." */
+ c3._code = 9;
break;
case 62:
- c3.val = 35; /* "#" */
- c3.code = 9;
+ c3._val = 35; /* "#" */
+ c3._code = 9;
default:
break;
}
@@ -109,7 +109,7 @@ void regenbruit() {
int i = offsetb3 + 8590;
int j = 0;
do {
- t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
+ g_t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
i += 2;
++j;
} while (i < offsetb3 + 8790);
@@ -134,7 +134,7 @@ void charge_phbruit() {
error("Missing file - phbrui.mor");
for (int i = 1; i <= 3; ++i)
- t_cph[i] = f.readSint16LE();
+ g_t_cph[i] = f.readSint16LE();
f.close();
}
@@ -158,40 +158,40 @@ void trait_car() {
byte d3;
int d2, i;
- switch (c2.code) {
+ switch (c2._code) {
case 9:
- if (c2.val != ord('#'))
- for (i = 0; i <= c2.rep; ++i)
- entroct(c2.val);
+ if (c2._val != ord('#'))
+ for (i = 0; i <= c2._rep; ++i)
+ entroct(c2._val);
break;
case 5:
case 6:
- if (c2.code == 6)
- d3 = tabdph[(c2.val - 14) << 1];
+ if (c2._code == 6)
+ d3 = g_tabdph[(c2._val - 14) << 1];
else
d3 = null;
- if (c1.code >= 5) {
- veracf(c2.acc);
- if (c1.code == 9) {
+ if (c1._code >= 5) {
+ veracf(c2._acc);
+ if (c1._code == 9) {
entroct(4);
if (d3 == null)
- entroct(c2.val);
+ entroct(c2._val);
else
entroct(d3);
entroct(22);
}
}
- switch (c2.rep) {
+ switch (c2._rep) {
case 0:
entroct(0);
- entroct(c2.val);
+ entroct(c2._val);
if (d3 == null)
- if (c3.code == 9)
+ if (c3._code == 9)
entroct(2);
else
entroct(4);
- else if (c3.code == 9)
+ else if (c3._code == 9)
entroct(0);
else
entroct(1);
@@ -199,13 +199,13 @@ void trait_car() {
case 4:
case 5:
case 6:
- if (c2.rep != 4) {
- i = c2.rep - 5;
+ if (c2._rep != 4) {
+ i = c2._rep - 5;
do {
--i;
entroct(0);
if (d3 == null)
- entroct(c2.val);
+ entroct(c2._val);
else
entroct(d3);
entroct(3);
@@ -213,24 +213,24 @@ void trait_car() {
}
if (d3 == null) {
entroct(4);
- entroct(c2.val);
+ entroct(c2._val);
entroct(0);
} else {
entroct(0);
- entroct(c2.val);
+ entroct(c2._val);
entroct(3);
}
break;
case 7:
case 8:
case 9:
- if (c2.rep != 7) {
- i = c2.rep - 8;
+ if (c2._rep != 7) {
+ i = c2._rep - 8;
do {
--i;
entroct(0);
if (d3 == null)
- entroct(c2.val);
+ entroct(c2._val);
else
entroct(d3);
entroct(3);
@@ -238,32 +238,32 @@ void trait_car() {
}
if (d3 == null) {
entroct(0);
- entroct(c2.val);
+ entroct(c2._val);
entroct(2);
} else {
entroct(0);
- entroct(c2.val);
+ entroct(c2._val);
entroct(0);
}
break;
case 1:
case 2:
case 3:
- if (c2.rep != 1) {
- i = c2.rep - 2;
+ if (c2._rep != 1) {
+ i = c2._rep - 2;
do {
--i;
entroct(0);
if (d3 == null)
- entroct(c2.val);
+ entroct(c2._val);
else
entroct(d3);
entroct(3);
} while (i >= 0);
}
entroct(0);
- entroct(c2.val);
- if (c3.code == 9)
+ entroct(c2._val);
+ if (c3._code == 9)
entroct(0);
else
entroct(1);
@@ -275,16 +275,16 @@ void trait_car() {
case 2:
case 3:
- d3 = c2.code + 5; // 7 ou 8 => Corresponding vowel
- if (c1.code > 4) {
- veracf(c2.acc);
- if (c1.code == 9) {
+ d3 = c2._code + 5; // 7 ou 8 => Corresponding vowel
+ if (c1._code > 4) {
+ veracf(c2._acc);
+ if (c1._code == 9) {
entroct(4);
entroct(d3);
entroct(22);
}
}
- i = c2.rep;
+ i = c2._rep;
assert(i >= 0);
if (i != 0) {
do {
@@ -294,24 +294,24 @@ void trait_car() {
entroct(3);
} while (i > 0);
}
- veracf(c3.acc);
- if (c3.code == 6) {
+ veracf(c3._acc);
+ if (c3._code == 6) {
entroct(4);
- entroct(tabdph[(c3.val - 14) << 1]);
- entroct(c2.val);
+ entroct(g_tabdph[(c3._val - 14) << 1]);
+ entroct(c2._val);
} else {
entroct(4);
- if (c3.val == 4)
+ if (c3._val == 4)
entroct(3);
else
- entroct(c3.val);
- entroct(c2.val);
+ entroct(c3._val);
+ entroct(c2._val);
}
break;
case 0:
case 1:
- veracf(c2.acc);
- switch (c3.code) {
+ veracf(c2._acc);
+ switch (c3._code) {
case 2:
d2 = 7;
break;
@@ -319,130 +319,130 @@ void trait_car() {
d2 = 8;
break;
case 6:
- d2 = tabdph[(c3.val - 14) << 1];
+ d2 = g_tabdph[(c3._val - 14) << 1];
break;
case 5:
- d2 = c3.val;
+ d2 = c3._val;
break;
default:
d2 = 10;
break;
- } // switch c3.code
- d2 = d2 * 26 + c2.val;
- if (tnocon[d2] == 0)
+ } // switch c3._code
+ d2 = d2 * 26 + c2._val;
+ if (g_tnocon[d2] == 0)
d3 = 2;
else
d3 = 6;
- if (c2.rep >= 5) {
- c2.rep = c2.rep - 5;
+ if (c2._rep >= 5) {
+ c2._rep = c2._rep - 5;
d3 = 8 - d3; // Swap 2 and 6
}
- if (c2.code == 0) {
- i = c2.rep;
+ if (c2._code == 0) {
+ i = c2._rep;
if (i != 0) {
do {
--i;
entroct(d3);
- entroct(c2.val);
+ entroct(c2._val);
entroct(3);
} while (i > 0);
}
entroct(d3);
- entroct(c2.val);
+ entroct(c2._val);
entroct(4);
} else {
entroct(d3);
- entroct(c2.val);
+ entroct(c2._val);
entroct(3);
- i = c2.rep;
+ i = c2._rep;
if (i != 0) {
do {
--i;
entroct(d3);
- entroct(c2.val);
+ entroct(c2._val);
entroct(4);
} while (i > 0);
}
}
- if (c3.code == 9) {
+ if (c3._code == 9) {
entroct(d3);
- entroct(c2.val);
+ entroct(c2._val);
entroct(5);
- } else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
- veracf(c3.acc);
- switch (c3.code) {
+ } else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
+ veracf(c3._acc);
+ switch (c3._code) {
case 3:
d2 = 8;
break;
case 6:
- d2 = tabdph[(c3.val - 14) << 1];
+ d2 = g_tabdph[(c3._val - 14) << 1];
break;
case 5:
- d2 = c3.val;
+ d2 = c3._val;
break;
default:
d2 = 7;
break;
- } // switch c3.code
+ } // switch c3._code
if (d2 == 4)
d2 = 3;
- if (intcon[c2.val] != 0)
- ++c2.val;
+ if (g_intcon[c2._val] != 0)
+ ++c2._val;
- if ((c2.val == 17) || (c2.val == 18))
- c2.val = 16;
+ if ((c2._val == 17) || (c2._val == 18))
+ c2._val = 16;
entroct(4);
entroct(d2);
- entroct(c2.val);
+ entroct(c2._val);
}
break;
case 4:
- veracf(c2.acc);
- i = c2.rep;
+ veracf(c2._acc);
+ i = c2._rep;
if (i != 0) {
do {
--i;
entroct(2);
- entroct(c2.val);
+ entroct(c2._val);
entroct(3);
} while (i > 0);
}
entroct(2);
- entroct(c2.val);
+ entroct(c2._val);
entroct(4);
- if (c3.code == 9) {
+ if (c3._code == 9) {
entroct(2);
- entroct(c2.val);
+ entroct(c2._val);
entroct(5);
- } else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
- veracf(c3.acc);
- switch (c3.code) {
+ } else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
+ veracf(c3._acc);
+ switch (c3._code) {
case 3:
d2 = 8;
break;
case 6:
- d2 = tabdph[(c3.val - 14) << 1];
+ d2 = g_tabdph[(c3._val - 14) << 1];
break;
case 5:
- d2 = c3.val;
+ d2 = c3._val;
break;
default:
d2 = 7;
break;
- } // switch c3.code
+ } // switch c3._code
if (d2 == 4)
d2 = 3;
- if (intcon[c2.val] != 0)
- ++c2.val;
+ if (g_intcon[c2._val] != 0)
+ ++c2._val;
entroct(4);
entroct(d2);
- entroct(tabdbc[((c2.val - 26) << 1) + 1]);
+ entroct(g_tabdbc[((c2._val - 26) << 1) + 1]);
}
break;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index a96edde281..8d781b74fc 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -38,14 +38,14 @@ namespace Mortevielle {
void rot_chariot() {
c1 = c2;
c2 = c3;
- c3.val = 32;
- c3.code = 9;
+ c3._val = 32;
+ c3._code = 9;
}
void init_chariot() {
- c3.rep = 0;
- c3.freq = 0;
- c3.acc = 0;
+ c3._rep = 0;
+ c3._freq = 0;
+ c3._acc = 0;
rot_chariot();
rot_chariot();
}
@@ -55,13 +55,13 @@ void trait_ph() {
const int deca[3] = {300, 30, 40};
g_ptr_tcph = g_num_ph - 1;
- g_ledeb = swap(t_cph[g_ptr_tcph]) + deca[g_typlec];
- g_lefin = swap(t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
+ g_ledeb = swap(g_t_cph[g_ptr_tcph]) + deca[g_typlec];
+ g_lefin = swap(g_t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
g_nb_word = g_lefin - g_ledeb;
g_ptr_tcph = (uint)g_ledeb >> 1;
g_ptr_word = 0;
do {
- WRITE_LE_UINT16(&mem[adword + g_ptr_word], t_cph[g_ptr_tcph]);
+ WRITE_LE_UINT16(&mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
g_ptr_word += 2;
++g_ptr_tcph;
} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
@@ -95,13 +95,13 @@ void parole(int rep, int ht, int typ) {
g_typlec = typ;
if (g_typlec != 0) {
for (int i = 0; i <= 500; ++i)
- savph[i] = t_cph[i];
- tempo = tempo_bruit;
+ savph[i] = g_t_cph[i];
+ tempo = kTempoNoise;
} else if (g_haut > 5)
- tempo = tempo_f;
+ tempo = kTempoF;
else
- tempo = tempo_m;
- addfix = (float)((tempo - addv[0])) / 256;
+ tempo = kTempoM;
+ addfix = (float)((tempo - g_addv[0])) / 256;
cctable(tbi);
switch (typ) {
case 1:
@@ -120,7 +120,7 @@ void parole(int rep, int ht, int typ) {
g_vm->_soundManager.litph(tbi, typ, tempo);
if (g_typlec != 0)
for (int i = 0; i <= 500; ++i) {
- t_cph[i] = savph[i];
+ g_t_cph[i] = savph[i];
g_mlec = g_typlec;
}
writepal(g_numpal);
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index b34e64aa5a..0731418023 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -100,7 +100,7 @@ void MortevielleEngine::gameLoaded() {
g_hdb = 0;
g_hfb = 0;
g_cs = 0;
- is = 0;
+ g_is = 0;
k = 0;
g_ment = 0;
g_syn = true;
@@ -113,7 +113,7 @@ void MortevielleEngine::gameLoaded() {
g_iouv = 0;
g_dobj = 0;
affrep();
- _hintPctMessage = deline(580);
+ g_hintPctMessage = deline(580);
while ((test[k] == false) && (k < 2)) {
++k;
@@ -133,10 +133,10 @@ void MortevielleEngine::gameLoaded() {
repon(2, g_crep);
clsf3();
_endGame = false;
- tmlieu(g_s.mlieu);
+ tmlieu(g_s._mlieu);
modinv();
- if (g_s.derobj != 0)
- modobj2(g_s.derobj + 400, test[1], test[2]);
+ if (g_s._derobj != 0)
+ modobj2(g_s._derobj + 400, test[1], test[2]);
else
g_tesok = test[1] || test[2];
showMouse();
@@ -153,7 +153,7 @@ void tmaj3() {
m = 1;
h += j * 24;
m += h * 2;
- g_s.heure = chr(m);
+ g_s._heure = chr(m);
}
void tsitu() {
@@ -239,16 +239,16 @@ void tsitu() {
}
}
calch(j, h, m);
- 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)) {
+ 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)) {
g_crep = 1501;
tperd();
}
- if ((g_s.conf > 99) && (h > 0) && (h < 9)) {
+ if ((g_s._conf > 99) && (h > 0) && (h < 9)) {
g_crep = 1508;
tperd();
}
@@ -263,7 +263,7 @@ void tsitu() {
/* NIVEAU 1 */
void theure() {
- g_vj = ord(g_s.heure);
+ g_vj = ord(g_s._heure);
g_vh = g_vj % 48;
g_vj /= 48;
g_vm__ = g_vh % 2;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 7afaa47da0..cbff7b7d3f 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -49,23 +49,23 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
* Handle saving or loading savegame data
*/
void SavegameManager::sync_save(Common::Serializer &sz) {
- sz.syncAsSint16LE(s1.conf);
- sz.syncBytes((byte *)&s1.pourc[0], 11);
- sz.syncBytes((byte *)&s1.teauto[0], 43);
- sz.syncBytes((byte *)&s1.sjer[0], 31);
- sz.syncAsSint16LE(s1.mlieu);
- sz.syncAsSint16LE(s1.iboul);
- sz.syncAsSint16LE(s1.ibag);
- sz.syncAsSint16LE(s1.icave);
- sz.syncAsSint16LE(s1.ivier);
- sz.syncAsSint16LE(s1.ipuit);
- sz.syncAsSint16LE(s1.derobj);
- sz.syncAsSint16LE(s1.iloic);
- sz.syncAsSint16LE(s1.icryp);
- sz.syncAsByte(s1.ipre);
- sz.syncAsByte(s1.heure);
-
- sz.syncBytes(bufcha, 391);
+ sz.syncAsSint16LE(g_s1._conf);
+ sz.syncBytes((byte *)&g_s1._pourc[0], 11);
+ sz.syncBytes((byte *)&g_s1._teauto[0], 43);
+ sz.syncBytes((byte *)&g_s1._sjer[0], 31);
+ sz.syncAsSint16LE(g_s1._mlieu);
+ sz.syncAsSint16LE(g_s1._iboul);
+ sz.syncAsSint16LE(g_s1._ibag);
+ sz.syncAsSint16LE(g_s1._icave);
+ sz.syncAsSint16LE(g_s1._ivier);
+ sz.syncAsSint16LE(g_s1._ipuit);
+ sz.syncAsSint16LE(g_s1._derobj);
+ sz.syncAsSint16LE(g_s1._iloic);
+ sz.syncAsSint16LE(g_s1._icryp);
+ sz.syncAsByte(g_s1._ipre);
+ sz.syncAsByte(g_s1._heure);
+
+ sz.syncBytes(g_bufcha, 391);
}
/**
@@ -107,9 +107,9 @@ void SavegameManager::takesav(int n) {
Common::Serializer sz(stream, NULL);
sync_save(sz);
- g_s = s1;
+ g_s = g_s1;
for (i = 0; i <= 389; ++i)
- tabdon[i + acha] = bufcha[i];
+ g_tabdon[i + acha] = g_bufcha[i];
// Close the stream
delete stream;
@@ -142,10 +142,10 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
tmaj3();
for (i = 0; i <= 389; ++i)
- bufcha[i] = tabdon[i + acha];
- s1 = g_s;
- if (s1.mlieu == 26)
- s1.mlieu = 15;
+ g_bufcha[i] = g_tabdon[i + acha];
+ g_s1 = g_s;
+ if (g_s1._mlieu == 26)
+ g_s1._mlieu = 15;
Common::String filename = generateSaveName(n);
f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 8d9e67f818..d49feacedd 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -111,37 +111,37 @@ void taffich() {
switch (a) {
case 16:
- g_s.pourc[9] = '*';
- g_s.teauto[42] = '*';
+ g_s._pourc[9] = '*';
+ g_s._teauto[42] = '*';
break;
case 20:
- g_s.teauto[39] = '*';
- if (g_s.teauto[36] == '*') {
- g_s.pourc[3] = '*';
- g_s.teauto[38] = '*';
+ g_s._teauto[39] = '*';
+ if (g_s._teauto[36] == '*') {
+ g_s._pourc[3] = '*';
+ g_s._teauto[38] = '*';
}
break;
case 24:
- g_s.teauto[37] = '*';
+ g_s._teauto[37] = '*';
break;
case 30:
- g_s.teauto[9] = '*';
+ g_s._teauto[9] = '*';
break;
case 31:
- g_s.pourc[4] = '*';
- g_s.teauto[35] = '*';
+ g_s._pourc[4] = '*';
+ g_s._teauto[35] = '*';
break;
case 118:
- g_s.teauto[41] = '*';
+ g_s._teauto[41] = '*';
break;
case 143:
- g_s.pourc[1] = '*';
+ g_s._pourc[1] = '*';
break;
case 150:
- g_s.teauto[34] = '*';
+ g_s._teauto[34] = '*';
break;
case 151:
- g_s.pourc[2] = '*';
+ g_s._pourc[2] = '*';
break;
default:
break;
@@ -162,15 +162,20 @@ void taffich() {
m = 2034;
if ((a == 17) && (g_maff == 14))
m = 2018;
- if (a > 99)
- if ((is == 1) || (is == 0))
+
+ if (a > 99) {
+ if ((g_is == 1) || (g_is == 0))
m = 2031;
else
m = 2032;
+ }
+
if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
m = 2030;
- if (((a < 27) && (((g_maff > 69) && (!g_s.ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+
+ if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
m = 2033;
+
messint(m);
g_maff = a;
if (a == 159)
@@ -217,7 +222,7 @@ void taffich() {
for (int j = 0; j <= 15; ++j)
if (alllum[j] > alllum[k])
k = j;
- mem[(0x7000 * 16) + 2 + (k << 1)] = rang[i];
+ mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
alllum[k] = -1;
}
}
@@ -244,11 +249,11 @@ void taffich() {
charani(filename, lgt, handle);
}
showMouse();
- if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_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 (!g_blo)
- t11(g_s.mlieu, cx);
+ t11(g_s._mlieu, cx);
g_mpers = 0;
}
}
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 8873c7e70a..0b8a5d7432 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -37,11 +37,11 @@ namespace Mortevielle {
/*------------------------------ CONSTANTS ------------------------------*/
/*---------------------------------------------------------------------------*/
-const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
-const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
-const byte tnocon[364] = {
+const byte g_tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+const byte g_tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte g_typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte g_intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte g_tnocon[364] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -59,7 +59,7 @@ const byte tnocon[364] = {
};
-const byte _menuConstants[8][4] = {
+const byte g_menuConstants[8][4] = {
{ 7, 37, 22, 8},
{19, 33, 23, 7},
{31, 89, 10, 21},
@@ -70,9 +70,9 @@ const byte _menuConstants[8][4] = {
{62, 25, 13, 5}
};
-const byte addv[2] = {8, 8};
+const byte g_addv[2] = {8, 8};
-const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
/*---------------------------------------------------------------------------*/
/*------------------------------ VARIABLES ------------------------------*/
@@ -168,21 +168,20 @@ int g_x,
g_ptr_word,
g_color_txt;
-int t_cph[6401];
-byte tabdon[4001];
+int g_t_cph[6401];
+byte g_tabdon[4001];
-Common::String _hintPctMessage; // Provides the % of hints
-byte is;
-byte mode;
+Common::String g_hintPctMessage; // Provides the % of hints
+byte g_is;
-int nbrep[9];
-int nbrepm[9];
+int g_nbrep[9];
+int g_nbrepm[9];
int g_msg[5];
-byte touv[8];
-sav_chaine g_s, s1;
-byte bufcha[391];
+byte g_touv[8];
+sav_chaine g_s, g_s1;
+byte g_bufcha[391];
-byte lettres[7][24];
+byte g_lettres[7][24];
byte palher[16];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 3b2e44d843..cff75128de 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -95,27 +95,26 @@ const int offsetb3 = 6;
const int null = 255;
-const int tempo_mus = 71;
-const int tempo_bruit = 78;
-const int tempo_f = 80;
-const int tempo_m = 89;
+const int kTempoMusic = 71;
+const int kTempoNoise = 78;
+const int kTempoF = 80;
+const int kTempoM = 89;
const int ti1 = 410;
const int ti2 = 250;
const int maxti = 7975;
const int maxtd = 600;
-const int max_rect = 14;
-
-const int c_repon = 0;
-const int c_st41 = 186;
-const int c_tparler = 247;
-const int c_paroles = 292;
-const int c_tmlieu = 435;
-const int c_dialpre = 456;
-const int c_action = 476;
-const int c_saction = 497;
-const int c_dis = 502;
-const int c_fin = 510; /* => n'existe pas ; si !! */
+const int kMaxRect = 14;
+
+const int kDescriptionStringIndex = 0; // Unused
+const int kInventoryStringIndex = 186;
+const int kQuestionStringIndex = 247;
+const int kDialogStringIndex = 292;
+const int kMenuPlaceStringIndex = 435;
+const int kMenuActionStringIndex = 476;
+const int kMenuSelfStringIndex = 497;
+const int kMenuSayStringIndex = 502;
+const int kSecretPassageQuestionStringIndex = 510; // Unusued?
const int arega = 0;
const int asoul = 154;
@@ -128,7 +127,6 @@ const int amzon = 1650;
const int fleche = 1758;
const int OPCODE_NONE = 0;
-
enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302, OPCODE_FORCE = 0x303, OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305,
OPCODE_ENTER = 0x306, OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308, OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
OPCODE_READ = 0x30b, OPCODE_EAT = 0x30c, OPCODE_PLACE = 0x30d, OPCODE_OPEN = 0x30e, OPCODE_TAKE = 0x30f,
@@ -136,73 +134,71 @@ enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302, OPCODE_FORCE = 0x303,
OPCODE_TURN = 0x315, OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
OPCODE_SLOOK = 0x405};
-const int max_patt = 20;
+const int kMaxPatt = 20;
-extern const byte tabdbc[18];
-extern const byte tabdph[16];
-extern const byte typcon[26];
-extern const byte intcon[26];
-extern const byte tnocon[364];
+extern const byte g_tabdbc[18];
+extern const byte g_tabdph[16];
+extern const byte g_typcon[26];
+extern const byte g_intcon[26];
+extern const byte g_tnocon[364];
-extern const byte _menuConstants[8][4];
+extern const byte g_menuConstants[8][4];
-extern const byte addv[2];
+extern const byte g_addv[2];
-extern const byte rang[16];
+extern const byte g_rang[16];
/*---------------------------------------------------------------------------*/
/*-------------------------------- TYPES --------------------------------*/
/*---------------------------------------------------------------------------*/
struct sav_chaine {
- int conf;
- byte pourc[11];
- byte teauto[43];
- byte sjer[31];
- int mlieu, iboul, ibag, icave, ivier, ipuit;
- int derobj, iloic, icryp;
- bool ipre;
- byte heure;
+ int _conf;
+ byte _pourc[11];
+ byte _teauto[43];
+ byte _sjer[31];
+ int _mlieu, _iboul, _ibag, _icave, _ivier, _ipuit;
+ int _derobj, _iloic, _icryp;
+ bool _ipre;
+ byte _heure;
};
struct registres {
- int ax, bx, cx, dx, bp, si, di, ds, es, flags;
+ int _ax, _bx, _cx, _dx, _bp, _si, _di, _ds, _es, _flags;
};
struct ind {
- int indis;
- byte point;
+ int _indis;
+ byte _point;
};
struct chariot {
- int val,
- code,
- acc,
- freq,
- rep;
+ int _val,
+ _code,
+ _acc,
+ _freq,
+ _rep;
};
struct rectangle {
- int x1, x2, y1, y2;
- bool enabled;
+ int _x1, _x2, _y1, _y2;
+ bool _enabled;
};
struct pattern {
- byte tay, tax;
- byte des[max_patt+1][max_patt+1];
+ byte _tay, _tax;
+ byte _des[kMaxPatt + 1][kMaxPatt + 1];
};
struct nhom {
- byte n; /* numero entre 0 et 32 */
- byte hom[4];
+ byte _id; /* number betwwen 0 and 32 */
+ byte _hom[4];
};
-typedef nhom t_nhom[16];
-
struct t_pcga {
- byte p;
- nhom a[16];
+ byte _p;
+ nhom _a[16];
};
typedef int tablint[256];
@@ -308,21 +304,20 @@ extern int g_x,
g_ptr_word,
g_color_txt;
-extern int t_cph[6401];
-extern byte tabdon[4001];
+extern int g_t_cph[6401];
+extern byte g_tabdon[4001];
-extern Common::String _hintPctMessage; // gives the pct of hints found
-extern byte is;
-extern byte mode;
+extern Common::String g_hintPctMessage; // gives the pct of hints found
+extern byte g_is;
-extern int nbrep[9];
-extern int nbrepm[9];
+extern int g_nbrep[9];
+extern int g_nbrepm[9];
extern int g_msg[5];
-extern byte touv[8];
-extern sav_chaine g_s, s1;
-extern byte bufcha[391];
+extern byte g_touv[8];
+extern sav_chaine g_s, g_s1;
+extern byte g_bufcha[391];
-extern byte lettres[7][24];
+extern byte g_lettres[7][24];
extern byte palher[16];