aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/actions.cpp594
-rw-r--r--engines/mortevielle/dialogs.cpp34
-rw-r--r--engines/mortevielle/graphics.cpp6
-rw-r--r--engines/mortevielle/keyboard.cpp4
-rw-r--r--engines/mortevielle/level15.cpp2
-rw-r--r--engines/mortevielle/menu.cpp122
-rw-r--r--engines/mortevielle/mor.cpp250
-rw-r--r--engines/mortevielle/mor2.cpp246
-rw-r--r--engines/mortevielle/mortevielle.cpp64
-rw-r--r--engines/mortevielle/mouse.cpp24
-rw-r--r--engines/mortevielle/outtext.cpp2
-rw-r--r--engines/mortevielle/ovd1.cpp12
-rw-r--r--engines/mortevielle/parole.cpp10
-rw-r--r--engines/mortevielle/parole2.cpp38
-rw-r--r--engines/mortevielle/prog.cpp86
-rw-r--r--engines/mortevielle/taffich.cpp10
-rw-r--r--engines/mortevielle/var_mor.cpp144
-rw-r--r--engines/mortevielle/var_mor.h142
18 files changed, 896 insertions, 894 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 56c87efdf8..d115ef3976 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -51,17 +51,17 @@ void fctMove() {
if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
g_s.mlieu = 15;
- caff = g_s.mlieu;
+ g_caff = g_s.mlieu;
afdes(0);
repon(2, g_s.mlieu);
}
if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_GO_TO));
tfleche();
- if (iesc)
- okdes = false;
- if ((anyone) || (iesc))
+ if (g_iesc)
+ g_okdes = false;
+ if ((g_anyone) || (g_iesc))
return;
tcoord(1);
if (g_num == 0)
@@ -75,9 +75,9 @@ void fctMove() {
} else if (g_num != 6)
g_s.mlieu = 26;
if ((g_num > 1) && (g_num < 6))
- ment = g_num - 1;
+ g_ment = g_num - 1;
if (g_num > 7)
- ment = g_num - 3;
+ g_ment = g_num - 3;
if (g_num != 6)
affrep();
else
@@ -156,11 +156,11 @@ void fctMove() {
t1derr();
else if (cx == 17) {
if ((g_s.ipuit != 120) && (g_s.ipuit != 140))
- crep = 997;
+ g_crep = 997;
else if (g_s.ipuit == 120)
- crep = 181;
+ g_crep = 181;
else if (g_s.conf > 80) {
- crep = 1505;
+ g_crep = 1505;
tperd();
} else {
g_s.mlieu = 23;
@@ -179,19 +179,19 @@ L2:
* @remarks Originally called 'tprendre'
*/
void fctTake() {
- if (caff > 99) {
- int cx = caff;
+ if (g_caff > 99) {
+ int cx = g_caff;
avpoing(cx);
- if (crep != 139) {
- if (ipers > 0)
+ if (g_crep != 139) {
+ if (g_ipers > 0)
g_s.conf += 3;
- if (obpart) {
+ if (g_obpart) {
if (g_s.mlieu == 2)
g_s.iloic = 0;
if (g_s.mlieu == 13) {
- if (g_s.iboul == caff)
+ if (g_s.iboul == g_caff)
g_s.iboul = 0;
- if (g_s.ibag == caff)
+ if (g_s.ibag == g_caff)
g_s.ibag = 0;
}
if (g_s.mlieu == 14)
@@ -203,29 +203,29 @@ void fctTake() {
if (g_s.mlieu == 24)
g_s.ipuit = 0;
mfouen();
- obpart = false;
+ g_obpart = false;
affrep();
} else {
- tabdon[acha + ((mchai - 1) * 10) + cs - 1] = 0;
+ tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
tsuiv();
- ++dobj;
- if (dobj > 6) {
+ ++g_dobj;
+ if (g_dobj > 6) {
g_s.conf += 2;
- dobj = 0;
+ g_dobj = 0;
}
}
}
return;
}
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_TAKE));
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
- if (caff == 3) {
+ if (g_caff == 3) {
tcoord(2);
if (g_num == 1) {
- crep = 152;
+ g_crep = 152;
return;
}
}
@@ -233,42 +233,42 @@ void fctTake() {
if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) {
tcoord(8);
if (g_num != 0) {
- if (ipers > 0)
+ if (g_ipers > 0)
g_s.conf += 3;
- crep = 997;
+ 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 ((crep != 997) && (crep != 139))
+ 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 ((crep != 997) && (crep != 139))
+ if ((g_crep != 997) && (g_crep != 139))
aniof(2, 6);
}
if ((g_s.mlieu == 14) && (g_s.icave != 0)) {
avpoing(g_s.icave);
- if ((crep != 997) && (crep != 139))
+ 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 ((crep != 997) && (crep != 139)) {
- crep = 182;
+ 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 ((crep != 997) && (crep != 139))
+ if ((g_crep != 997) && (g_crep != 139))
aniof(2, 1);
}
- if ((crep != 997) && (crep != 182) && (crep != 139))
- crep = 999;
+ if ((g_crep != 997) && (g_crep != 182) && (g_crep != 139))
+ g_crep = 999;
}
} else {
if ( ((g_s.mlieu == 0) && (g_num == 3)) || ((g_s.mlieu == 1) && (g_num == 4))
@@ -278,12 +278,12 @@ void fctTake() {
|| ((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;
+ g_crep = 997;
else if (g_s.mlieu == 23) {
- crep = 1504;
+ g_crep = 1504;
tperd();
} else
- crep = 120;
+ g_crep = 120;
}
}
/**
@@ -308,7 +308,7 @@ void fctInventoryTake() {
g_s.sjer[cy] = chr(0);
modinv();
avpoing(cz);
- crep = 998;
+ g_crep = 998;
clsf2();
}
@@ -319,33 +319,33 @@ void fctInventoryTake() {
void fctLift() {
int cx;
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_LIFT));
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(3);
if (g_num == 0) {
tcoord(8);
if (g_num != 0) {
- if (ipers > 0)
+ if (g_ipers > 0)
++g_s.conf;
- crep = 997;
+ g_crep = 997;
if ((g_s.mlieu == 2) && (g_s.iloic != 0))
treg(g_s.iloic);
}
return;
}
- if (ipers > 0)
+ if (g_ipers > 0)
++g_s.conf;
cx = g_s.mlieu;
if (g_s.mlieu == 16)
cx = 14;
else if (g_s.mlieu == 19)
cx = 15;
- crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
- if (crep == 255)
- crep = 997;
+ g_crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
+ if (g_crep == 255)
+ g_crep = 997;
}
/**
@@ -353,16 +353,16 @@ void fctLift() {
* @remarks Originally called 'tlire'
*/
void fctRead() {
- if (caff > 99)
- st4(caff);
+ if (g_caff > 99)
+ st4(g_caff);
else {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_READ));
tfleche();
- if (!(anyone) && !(iesc)) {
+ if (!(g_anyone) && !(g_iesc)) {
tcoord(4);
if (g_num != 0)
- crep = 107;
+ g_crep = 107;
}
}
}
@@ -373,7 +373,7 @@ void fctRead() {
*/
void fctSelfRead() {
if (g_s.derobj == 0)
- crep = 186;
+ g_crep = 186;
else
st4(g_s.derobj);
}
@@ -385,45 +385,45 @@ void fctSelfRead() {
void fctLook() {
int cx;
- if (caff > 99) {
- crep = 103;
+ if (g_caff > 99) {
+ g_crep = 103;
return;
}
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_LOOK));
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(5);
if (g_num == 0) {
tcoord(8);
- crep = 131;
+ g_crep = 131;
if (g_num != 0) {
if (g_s.mlieu == 13) {
if (g_num == 1) {
- crep = 164;
+ g_crep = 164;
if (g_s.ibag != 0)
treg(g_s.ibag);
else if (g_s.iboul != 0)
treg(g_s.iboul);
} else {
- crep = 193;
+ g_crep = 193;
if (g_s.ibag != 0)
treg(g_s.ibag);
}
}
if (g_s.mlieu == 14) {
- crep = 164;
+ g_crep = 164;
if (g_s.icave != 0)
treg(g_s.icave);
}
if (g_s.mlieu == 17) {
- crep = 174;
+ g_crep = 174;
if (g_s.ivier != 0)
treg(g_s.ivier);
}
if (g_s.mlieu == 24) {
- crep = 131;
+ g_crep = 131;
if (g_s.ipuit != 0)
treg(g_s.ipuit);
}
@@ -437,13 +437,13 @@ void fctLook() {
cx -= 4;
if (g_s.mlieu == 26)
cx = 21;
- crep = tabdon[arega + (cx * 7) + g_num - 1];
+ g_crep = tabdon[arega + (cx * 7) + g_num - 1];
if ((g_s.mlieu == 13) && (g_num == 8))
- crep = 126;
+ g_crep = 126;
if (g_s.mlieu == 19)
- crep = 103;
- if (crep == 255)
- crep = 131;
+ g_crep = 103;
+ if (g_crep == 255)
+ g_crep = 131;
if ((g_s.mlieu == 1) && (g_num == 1))
treg(144);
if ((g_s.mlieu == 5) && (g_num == 3))
@@ -464,7 +464,7 @@ void fctSelftLook() {
if (g_s.derobj != 0)
treg(g_s.derobj);
else
- crep = 186;
+ g_crep = 186;
}
/**
@@ -474,20 +474,20 @@ void fctSelftLook() {
void fctSearch() {
const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
- if (caff > 99) {
- st7(caff);
+ if (g_caff > 99) {
+ st7(g_caff);
return;
}
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_SEARCH));
tfleche();
- if (anyone || iesc)
+ if (g_anyone || g_iesc)
return;
if (g_s.mlieu == 23) {
- crep = 1504;
+ g_crep = 1504;
tperd();
return;
}
@@ -501,35 +501,35 @@ void fctSearch() {
++cx;
} while ((cx <= 6) && (g_num != ord(touv[cx])));
if (g_num != ord(touv[cx]))
- crep = 187;
+ g_crep = 187;
else {
- if (ipers > 0)
+ if (g_ipers > 0)
g_s.conf += 3;
- rechai(mchai);
- if (mchai != 0) {
- cs = 0;
+ rechai(g_mchai);
+ if (g_mchai != 0) {
+ g_cs = 0;
is = 0;
- fouil = true;
+ g_fouil = true;
mfoudi();
tsuiv();
} else
- crep = 997;
+ g_crep = 997;
}
} else {
tcoord(8);
- crep = 997;
+ g_crep = 997;
if (g_num != 0) {
- if (ipers > 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) {
- crep = 123;
+ g_crep = 123;
if (g_s.iloic != 0)
treg(g_s.iloic);
}
if (g_s.mlieu == 16) {
- crep = 123;
+ g_crep = 123;
if (g_s.icryp != 0)
treg(g_s.icryp);
}
@@ -537,26 +537,26 @@ void fctSearch() {
}
}
} else {
- if (ipers > 0)
+ if (g_ipers > 0)
g_s.conf += 3;
- crep = 997;
+ g_crep = 997;
if (g_s.mlieu < 14)
- crep = r[g_s.mlieu];
+ g_crep = r[g_s.mlieu];
if ((g_s.mlieu == 3) && (g_num == 2))
- crep = 162;
+ g_crep = 162;
if (g_s.mlieu == 12) {
if ((g_num == 3) || (g_num == 4))
- crep = 162;
+ g_crep = 162;
else if (g_num == 5)
- crep = 159;
+ g_crep = 159;
}
if (g_s.mlieu == 19)
- crep = 104;
+ g_crep = 104;
else if (g_s.mlieu == 16)
- crep = 155;
+ g_crep = 155;
}
}
@@ -568,7 +568,7 @@ void fctSelfSearch() {
if (g_s.derobj != 0)
st7(g_s.derobj);
else
- crep = 186;
+ g_crep = 186;
}
/**
@@ -576,32 +576,32 @@ void fctSelfSearch() {
* @remarks Originally called 'touvrir'
*/
void fctOpen() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_OPEN));
- if (caff == 26) {
- if (ment != 0) {
+ if (g_caff == 26) {
+ if (g_ment != 0) {
g_msg[4] = OPCODE_ENTER;
- syn = true;
+ g_syn = true;
} else
- crep = 997;
+ g_crep = 997;
return;
}
- if (caff == 15) {
+ if (g_caff == 15) {
aldepl();
return;
}
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(7);
if (g_num != 0) {
- if (ipers > 0)
+ if (g_ipers > 0)
g_s.conf += 2;
- ++iouv;
+ ++g_iouv;
int cx = 0;
do {
++cx;
@@ -625,11 +625,11 @@ void fctOpen() {
cx = g_s.mlieu;
if (g_s.mlieu == 16)
cx = 14;
- crep = tabdon[aouvr + (cx * 7) + g_num - 1];
- if (crep == 254)
- crep = 999;
+ g_crep = tabdon[aouvr + (cx * 7) + g_num - 1];
+ if (g_crep == 254)
+ g_crep = 999;
} else
- crep = 18;
+ g_crep = 18;
}
}
@@ -639,34 +639,34 @@ void fctOpen() {
*/
void fctPlace() {
if (g_s.derobj == 0) {
- crep = 186;
+ g_crep = 186;
return;
}
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_PUT));
tfleche();
- if (iesc)
- crep = 998;
+ if (g_iesc)
+ g_crep = 998;
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(8);
if (g_num != 0) {
- crep = 999;
- if (caff == 13) {
+ g_crep = 999;
+ if (g_caff == 13) {
if (g_num == 1) {
if (g_s.iboul != 0) {
- crep = 188;
+ g_crep = 188;
} else {
g_s.iboul = g_s.derobj;
if (g_s.derobj == 141)
aniof(1, 7);
}
} else if (g_s.ibag != 0) {
- crep = 188;
+ g_crep = 188;
} else {
g_s.ibag = g_s.derobj;
if (g_s.derobj == 159)
@@ -674,9 +674,9 @@ void fctPlace() {
}
}
- if (caff == 14) {
+ if (g_caff == 14) {
if (g_s.icave != 0) {
- crep = 188;
+ g_crep = 188;
} else {
g_s.icave = g_s.derobj;
if (g_s.derobj == 151) {
@@ -693,7 +693,7 @@ void fctPlace() {
Common::String alertTxt = deline(582);
Alert::show(alertTxt, 1);
- tesok = false;
+ g_tesok = false;
bool enterPassageFl = Ques::show();
hideMouse();
hirs();
@@ -703,8 +703,8 @@ void fctPlace() {
showMouse();
tinke();
drawClock();
- if (ipers != 0)
- affper(ipers);
+ if (g_ipers != 0)
+ affper(g_ipers);
else
person();
@@ -721,50 +721,50 @@ void fctPlace() {
alertTxt = deline(577);
Alert::show(alertTxt, 1);
aniof(2, 1);
- crep = 166;
+ g_crep = 166;
}
affrep();
} else {
aniof(2, 1);
- crep = 166;
- tesok = true;
+ g_crep = 166;
+ g_tesok = true;
}
return;
}
}
}
- if (caff == 16) {
+ if (g_caff == 16) {
if (g_s.icryp == 0)
g_s.icryp = g_s.derobj;
else
- crep = 188;
+ g_crep = 188;
}
- if (caff == 17) {
+ if (g_caff == 17) {
if (g_s.ivier != 0) {
- crep = 188;
+ g_crep = 188;
} else if (g_s.derobj == 143) {
g_s.ivier = 143;
aniof(1, 1);
} else {
- crep = 1512;
+ g_crep = 1512;
tperd();
}
}
- if (caff == 24) {
+ if (g_caff == 24) {
if (g_s.ipuit != 0) {
- crep = 188;
+ g_crep = 188;
} else if ((g_s.derobj == 140) || (g_s.derobj == 120)) {
g_s.ipuit = g_s.derobj;
aniof(1, 1);
} else {
- crep = 185;
+ g_crep = 185;
}
}
- if (crep != 188)
+ if (g_crep != 188)
maivid();
}
}
@@ -774,18 +774,18 @@ void fctPlace() {
* @remarks Originally called 'ttourner'
*/
void fctTurn() {
- if (caff > 99) {
- crep = 149;
+ if (g_caff > 99) {
+ g_crep = 149;
return;
}
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_TURN));
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(9);
if (g_num != 0) {
- crep = 997;
+ g_crep = 997;
if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) {
repon(2, 167);
parole(7, 9, 1);
@@ -793,7 +793,7 @@ void fctTurn() {
if (answer == 1)
g_vm->_endGame = true;
else
- crep = 168;
+ g_crep = 168;
}
if ((g_s.mlieu == 17) && (g_s.ivier == 143)) {
repon(2, 175);
@@ -804,7 +804,7 @@ void fctTurn() {
g_s.mlieu = 16;
affrep();
} else
- crep = 176;
+ g_crep = 176;
}
}
}
@@ -814,16 +814,16 @@ void fctTurn() {
* @remarks Originally called 'tcacher'
*/
void fctSelfHide() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_HIDE_SELF));
tfleche();
- if (!(anyone) && !(iesc)) {
+ if (!(g_anyone) && !(g_iesc)) {
tcoord(10);
if (g_num == 0)
- cache = false;
+ g_cache = false;
else {
- cache = true;
- crep = 999;
+ g_cache = true;
+ g_crep = 999;
}
}
}
@@ -834,21 +834,21 @@ void fctSelfHide() {
*/
void fctAttach() {
if (g_s.derobj == 0)
- crep = 186;
+ g_crep = 186;
else {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_TIE));
tfleche();
- if (!(anyone) && !(iesc)) {
+ if (!(g_anyone) && !(g_iesc)) {
tcoord(8);
- crep = 997;
+ g_crep = 997;
if ((g_num != 0) && (g_s.mlieu == 24)) {
- crep = 999;
+ g_crep = 999;
if ((g_s.derobj == 120) || (g_s.derobj == 140)) {
g_s.ipuit = g_s.derobj;
aniof(1, 1);
} else
- crep = 185;
+ g_crep = 185;
maivid();
}
}
@@ -860,14 +860,14 @@ void fctAttach() {
* @remarks Originally called 'tfermer'
*/
void fctClose() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_CLOSE));
- if (caff < 26) {
+ if (g_caff < 26) {
tfleche();
- if (iesc)
- crep = 998;
- if ((anyone) || (iesc))
+ if (g_iesc)
+ g_crep = 998;
+ if ((g_anyone) || (g_iesc))
return;
tcoord(7);
if (g_num != 0) {
@@ -877,20 +877,22 @@ void fctClose() {
} while ((cx <= 6) && (g_num != ord(touv[cx])));
if (g_num == ord(touv[cx])) {
aniof(2, g_num);
- crep = 998;
+ g_crep = 998;
touv[cx] = chr(0);
- iouv = iouv - 1;
- if (iouv < 0)
- iouv = 0;
+ --g_iouv;
+ if (g_iouv < 0)
+ g_iouv = 0;
int chai = 9999;
rechai(chai);
- if (mchai == chai)
- mchai = 0;
- } else crep = 187;
+ if (g_mchai == chai)
+ g_mchai = 0;
+ } else {
+ g_crep = 187;
+ }
}
}
- if (caff == 26)
- crep = 999;
+ if (g_caff == 26)
+ g_crep = 999;
}
/**
@@ -898,7 +900,7 @@ void fctClose() {
* @remarks Originally called 'tfrapper'
*/
void fctKnock() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_HIT));
if (g_s.mlieu == 15) {
@@ -908,11 +910,11 @@ void fctKnock() {
if (g_s.mlieu < 25) {
tfleche();
- if (!(anyone) && !(iesc)) {
+ if (!(g_anyone) && !(g_iesc)) {
if ((g_s.mlieu < 19) && (g_s.mlieu != 15))
- crep = 133;
+ g_crep = 133;
else
- crep = 997;
+ g_crep = 997;
}
return;
@@ -922,12 +924,12 @@ void fctKnock() {
int haz = (hazard(0, 8)) - 4;
parole(11, haz, 1);
int p;
- ecfren(p, haz, g_s.conf, ment);
- int l = ment;
+ ecfren(p, haz, g_s.conf, g_ment);
+ int l = g_ment;
if (l != 0) {
if (p != -500) {
if (haz > p)
- crep = 190;
+ g_crep = 190;
else {
becfren(l);
frap();
@@ -936,8 +938,8 @@ void fctKnock() {
frap();
}
- if (ment == 8)
- crep = 190;
+ if (g_ment == 8)
+ g_crep = 190;
}
}
@@ -946,90 +948,90 @@ void fctKnock() {
* @remarks Originally called 'tposer'
*/
void fctSelfPut() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_POSE));
if (g_s.derobj == 0)
- crep = 186;
+ g_crep = 186;
else {
- if (caff > 99) {
- crep = 999;
+ if (g_caff > 99) {
+ g_crep = 999;
ajchai();
- if (crep != 192)
+ if (g_crep != 192)
maivid();
return;
}
tfleche();
- if ((anyone) || (iesc))
+ if ((g_anyone) || (g_iesc))
return;
tcoord(7);
- crep = 124;
+ g_crep = 124;
if (g_num != 0) {
int chai;
rechai(chai);
if (chai == 0)
- crep = 997;
+ g_crep = 997;
else {
int cx = 0;
do {
++cx;
} while ((cx <= 6) && (g_num != ord(touv[cx])));
if (g_num != ord(touv[cx]))
- crep = 187;
+ g_crep = 187;
else {
- mchai = chai;
- crep = 999;
+ g_mchai = chai;
+ g_crep = 999;
}
}
} else {
tcoord(8);
if (g_num != 0) {
- crep = 998;
- if (caff == 2) {
+ g_crep = 998;
+ if (g_caff == 2) {
if (g_s.iloic != 0)
- crep = 188;
+ g_crep = 188;
else
g_s.iloic = g_s.derobj;
}
- if (caff == 13) {
+ if (g_caff == 13) {
if (g_num == 1) {
if (g_s.iboul != 0)
- crep = 188;
+ g_crep = 188;
else
g_s.iboul = g_s.derobj;
} else if (g_s.ibag != 0) {
- crep = 188;
+ g_crep = 188;
} else {
g_s.ibag = g_s.derobj;
}
}
- if (caff == 16) {
+ if (g_caff == 16) {
if (g_s.icryp != 0)
- crep = 188;
+ g_crep = 188;
else
g_s.icryp = g_s.derobj;
}
- if (caff == 24)
- crep = 185;
- if ((caff == 14) || (caff == 17))
- crep = 124;
+ if (g_caff == 24)
+ g_crep = 185;
+ if ((g_caff == 14) || (g_caff == 17))
+ g_crep = 124;
} else {
- crep = 124;
- if (caff == 24) {
+ g_crep = 124;
+ if (g_caff == 24) {
tcoord(5);
if (g_num != 0)
- crep = 185;
+ g_crep = 185;
}
}
}
- if (caff == 23)
- crep = 185;
- if ((crep == 999) || (crep == 185) || (crep == 998)) {
- if (crep == 999)
+ if (g_caff == 23)
+ g_crep = 185;
+ if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
+ if (g_crep == 999)
ajchai();
- if (crep != 192)
+ if (g_crep != 192)
maivid();
}
}
@@ -1041,17 +1043,17 @@ void fctSelfPut() {
*/
void fctListen() {
if (g_s.mlieu != 26)
- crep = 101;
+ g_crep = 101;
else {
- if (ipers != 0)
+ if (g_ipers != 0)
++g_s.conf;
int p, haz;
- ecfren(p, haz, g_s.conf, ment);
- int l = ment;
+ ecfren(p, haz, g_s.conf, g_ment);
+ int l = g_ment;
if (l != 0) {
if (p != -500) {
if (haz > p)
- crep = 101;
+ g_crep = 101;
else {
becfren(l);
int j, h, m;
@@ -1059,16 +1061,16 @@ void fctListen() {
haz = hazard(1, 100);
if ((h >= 0) && (h < 8)) {
if (haz > 30)
- crep = 101;
+ g_crep = 101;
else
- crep = 178;
+ g_crep = 178;
} else if (haz > 70)
- crep = 101;
+ g_crep = 101;
else
- crep = 178;
+ g_crep = 178;
}
} else
- crep = 178;
+ g_crep = 178;
}
}
}
@@ -1079,11 +1081,11 @@ void fctListen() {
*/
void fctEat() {
if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
- crep = 148;
+ g_crep = 148;
} else {
tsort();
g_s.mlieu = 10;
- caff = 10;
+ g_caff = 10;
debloc(g_s.mlieu);
tmlieu(g_s.mlieu);
@@ -1105,11 +1107,11 @@ void fctEat() {
h = 1;
}
- jh += h;
- crep = 135;
+ g_jh += h;
+ g_crep = 135;
tinke();
} else {
- crep = 134;
+ g_crep = 134;
}
}
}
@@ -1126,18 +1128,18 @@ void fctEnter() {
tmlieu(g_s.mlieu);
} else if (g_s.mlieu == 15)
aldepl();
- else if (ment == 0)
- crep = 997;
- else if ((ment == 9) && (g_s.derobj != 136)) {
- crep = 189;
+ else if (g_ment == 0)
+ g_crep = 997;
+ else if ((g_ment == 9) && (g_s.derobj != 136)) {
+ g_crep = 189;
g_s.teauto[8] = '*';
} else {
int z = 0;
- if (! blo)
- t11(ment, z);
+ if (!g_blo)
+ t11(g_ment, z);
if (z != 0) {
- if ((ment == 3) || (ment == 7))
- crep = 179;
+ if ((g_ment == 3) || (g_ment == 7))
+ g_crep = 179;
else {
g_x = (hazard(0, 10)) - 5;
parole(7, g_x, 1);
@@ -1148,29 +1150,29 @@ void fctEnter() {
g_s.mlieu = 15;
g_msg[3] = MENU_DISCUSS;
g_msg[4] = g_vm->_menu._discussMenu[g_x];
- syn = true;
- if (ment == 9) {
+ g_syn = true;
+ if (g_ment == 9) {
g_col = true;
- caff = 70;
+ g_caff = 70;
afdes(0);
- repon(2, caff);
+ repon(2, g_caff);
} else
g_col = false;
- debloc(ment);
- ment = 0;
+ debloc(g_ment);
+ g_ment = 0;
}
} else {
g_x = (hazard(0, 10)) - 5;
parole(7, g_x, 1);
aniof(1, 1);
- g_s.mlieu = ment;
+ g_s.mlieu = g_ment;
affrep();
debloc(g_s.mlieu);
tmlieu(g_s.mlieu);
- ment = 0;
- mpers = 0;
- ipers = 0;
+ g_ment = 0;
+ g_mpers = 0;
+ g_ipers = 0;
}
}
}
@@ -1183,7 +1185,7 @@ void fctSleep() {
int z, j, h, m;
if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
- crep = 148;
+ g_crep = 148;
return;
}
if (g_s.mlieu != 0) {
@@ -1207,18 +1209,18 @@ void fctSleep() {
z = (7 - h) * 2;
if (m == 30)
--z;
- jh += z;
+ g_jh += z;
h = 7;
}
- jh += 2;
+ g_jh += 2;
++h;
if (h > 23)
h = 0;
tinke();
answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
- anyone = false;
+ g_anyone = false;
} while (answer != 1);
- crep = 998;
+ g_crep = 998;
g_num = 0;
}
@@ -1227,16 +1229,16 @@ void fctSleep() {
* @remarks Originally called 'tdefoncer'
*/
void fctForce() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_SMASH));
- if (caff < 25)
+ if (g_caff < 25)
tfleche();
- if ((! anyone) && (! iesc)) {
+ if ((!g_anyone) && (!g_iesc)) {
if (g_s.mlieu != 26)
- crep = 997;
+ g_crep = 997;
else {
- crep = 143;
+ g_crep = 143;
g_s.conf += 2;
}
}
@@ -1248,9 +1250,9 @@ void fctForce() {
*/
void fctLeave() {
tsort();
- crep = 0;
+ g_crep = 0;
if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24))
- crep = 997;
+ g_crep = 997;
else {
int lx = 0;
@@ -1262,17 +1264,17 @@ void fctLeave() {
lx = 15;
if (g_s.mlieu == 16) {
lx = 17;
- crep = 176;
+ g_crep = 176;
}
if (g_s.mlieu == 17)
t23coul(lx);
if (g_s.mlieu == 23)
lx = 24;
- if (crep != 997)
+ if (g_crep != 997)
g_s.mlieu = lx;
- caff = lx;
- if (crep == 0)
- crep = lx;
+ g_caff = lx;
+ if (g_crep == 0)
+ g_crep = lx;
debloc(lx);
tmlieu(lx);
}
@@ -1285,31 +1287,31 @@ void fctLeave() {
void fctWait() {
int quel;
- mpers = 0;
+ g_mpers = 0;
clsf3();
int answer;
do {
- ++jh;
+ ++g_jh;
tinke();
- if (!blo)
+ if (!g_blo)
t11(g_s.mlieu, quel);
- if ((ipers != 0) && (mpers == 0)) {
- crep = 998;
+ if ((g_ipers != 0) && (g_mpers == 0)) {
+ g_crep = 998;
if ((g_s.mlieu == 13) || (g_s.mlieu == 14))
cavegre();
if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
- anyone = true;
- mpers = ipers;
- if (!anyone)
+ g_anyone = true;
+ g_mpers = g_ipers;
+ if (!g_anyone)
tinke();
return;
}
repon(2, 102);
answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
} while (answer != 2);
- crep = 998;
- if (!anyone)
+ g_crep = 998;
+ if (!g_anyone)
tinke();
}
@@ -1318,12 +1320,12 @@ void fctWait() {
* @remarks Originally called 'tsonder'
*/
void fctSound() {
- if (!syn)
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_PROBE2));
- if (caff < 27) {
+ if (g_caff < 27) {
tfleche();
- if (!(anyone) && (!iesc))
- crep = 145;
+ if (!(g_anyone) && (!g_iesc))
+ g_crep = 145;
g_num = 0;
}
}
@@ -1347,10 +1349,10 @@ void fctDiscuss() {
do {
++cx;
} while (g_vm->_menu._discussMenu[cx] != g_msg[4]);
- caff = 69 + cx;
+ g_caff = 69 + cx;
afdes(0);
- repon(2, caff);
- suj = caff + 60;
+ repon(2, g_caff);
+ suj = g_caff + 60;
}
tkey1(false);
mennor();
@@ -1398,7 +1400,7 @@ void fctDiscuss() {
CHECK_QUIT;
getMousePos(x, y, c);
- x *= (3 - res);
+ x *= (3 - g_res);
if (x > 319)
cx = 41;
else
@@ -1461,7 +1463,7 @@ void fctDiscuss() {
if (g_col) {
g_col = false;
g_s.mlieu = 15;
- if (iouv > 0)
+ if (g_iouv > 0)
max = 8;
else
max = 4;
@@ -1472,10 +1474,10 @@ void fctDiscuss() {
suj = 138;
g_s.conf += (3 * (g_s.conf / 10));
}
- } else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
- suj = tabdon[arep + (ix << 3) + (caff - 70)];
+ } 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[caff - 69];
+ ++nbrep[g_caff - 69];
} else {
g_s.conf += 3;
suj = 139;
@@ -1513,12 +1515,12 @@ void fctDiscuss() {
g_col = false;
g_s.mlieu = 15;
}
- ctrm = 0;
+ g_ctrm = 0;
hideMouse();
hirs();
dessine_rouleau();
showMouse();
- affper(ipers);
+ affper(g_ipers);
tinke();
drawClock();
affrep();
@@ -1532,16 +1534,16 @@ void fctDiscuss() {
* @remarks Originally called 'tsentir'
*/
void fctSmell() {
- crep = 119;
- if (caff < 26) {
- if (!syn)
+ g_crep = 119;
+ if (g_caff < 26) {
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_SMELL));
tfleche();
- if (!(anyone) && !(iesc))
- if (caff == 16)
- crep = 153;
- } else if (caff == 123)
- crep = 110;
+ if (!(g_anyone) && !(g_iesc))
+ if (g_caff == 16)
+ g_crep = 153;
+ } else if (g_caff == 123)
+ g_crep = 110;
g_num = 0;
}
@@ -1550,9 +1552,9 @@ void fctSmell() {
* @remarks Originally called 'tgratter'
*/
void fctScratch() {
- crep = 155;
- if (caff < 27) {
- if (!syn)
+ g_crep = 155;
+ if (g_caff < 27) {
+ if (!g_syn)
ecr3(g_vm->getEngineString(S_SCRATCH));
tfleche();
}
@@ -1573,7 +1575,7 @@ void MortevielleEngine::endGame() {
repon(9, 1509);
tkey1(false);
hideMouse();
- caff = 70;
+ g_caff = 70;
taffich();
hirs();
premtet();
@@ -1583,7 +1585,7 @@ void MortevielleEngine::endGame() {
repon(9, 1509);
repon(2, 142);
tkey1(false);
- caff = 32;
+ g_caff = 32;
afdes(0);
repon(6, 34);
repon(2, 35);
@@ -1607,9 +1609,9 @@ void MortevielleEngine::loseGame() {
maivid();
inzon();
dprog();
- vh = 10;
- vm = 0;
- vj = 0;
+ g_vh = 10;
+ g_vm__ = 0;
+ g_vj = 0;
g_minute = 0;
g_hour = 10;
g_day = 0;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index fec8b2f81f..96264c8b5d 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -78,7 +78,7 @@ int Alert::show(const Common::String &msg, int n) {
while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
++i;
st = st + chaine[i];
- if (res == 2)
+ if (g_res == 2)
cx -= 3;
else
cx -= 5;
@@ -95,12 +95,12 @@ int Alert::show(const Common::String &msg, int n) {
esp = (uint)(nbcol - caseNumb * 40) >> 1;
coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
setButtonText(cas, coldep, caseNumb, &s[0], esp);
- limit[1][1] = ((uint)(coldep) >> 1) * res;
+ limit[1][1] = ((uint)(coldep) >> 1) * g_res;
limit[1][2] = limit[1][1] + 40;
if (caseNumb == 1) {
limit[2][1] = limit[2][2];
} else {
- limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
+ limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_res;
limit[2][2] = (limit[2][1]) + 40;
}
showMouse();
@@ -221,7 +221,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
}
++i;
choiceListStr = copy(inputStr, i, 30);
- if (res == 2)
+ if (g_res == 2)
col *= 6;
else
col *= 10;
@@ -308,7 +308,7 @@ bool Ques::show() {
showMouse();
++indx;
int dialogHeight;
- if (res == 1)
+ if (g_res == 1)
dialogHeight = 29;
else
dialogHeight = 23;
@@ -338,8 +338,8 @@ bool Ques::show() {
for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
rectangle &with = coor[j];
- with.x1 = 45 * res;
- with.x2 = (maxLength * 3 + 55) * res;
+ 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;
@@ -349,7 +349,7 @@ bool Ques::show() {
}
}
coor[lastOption - firstOption + 2].enabled = false;
- if (res == 1)
+ if (g_res == 1)
rep = 10;
else
rep = 6;
@@ -360,7 +360,7 @@ bool Ques::show() {
warning("Expected answer: %d", correctAnswerArr[indx]);
do {
g_vm->setMouseClick(false);
- tesok = false;
+ g_tesok = false;
bool flag;
moveMouse(flag, key);
CHECK_QUIT0;
@@ -400,7 +400,7 @@ bool Ques::show() {
warning("Skipping protection check: testprot()");
protectionCheck = true;
// tesok is set to true in testprot()
- tesok = true;
+ g_tesok = true;
}
} while (indx != 10);
@@ -462,10 +462,10 @@ void f3f8::waitForF3F8(int &key) {
}
void f3f8::aff50(bool drawAni50Fl) {
- caff = 50;
+ g_caff = 50;
g_maff = 0;
taffich();
- dessine(ades, 63, 12);
+ dessine(g_ades, 63, 12);
if (drawAni50Fl)
ani50();
else
@@ -476,11 +476,11 @@ void f3f8::aff50(bool drawAni50Fl) {
}
void f3f8::ani50() {
- crep = animof(1, 1);
- pictout(adani, crep, 63, 12);
- crep = animof(2, 1);
- pictout(adani, crep, 63, 12);
- f2_all = (res == 1);
+ g_crep = animof(1, 1);
+ pictout(adani, g_crep, 63, 12);
+ g_crep = animof(2, 1);
+ pictout(adani, g_crep, 63, 12);
+ g_f2_all = (g_res == 1);
repon(2, c_paroles + 143);
}
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index bec7ef4073..3108594f40 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -985,7 +985,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
* simulate the original 640x400 surface, all Y values have to be doubled
*/
void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
- if (res == 1) {
+ if (g_res == 1) {
x = (uint)x >> 1;
dx = (uint)dx >> 1;
}
@@ -1052,7 +1052,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
hideMouse();
pt = _textPos;
- if (res == 2)
+ if (g_res == 2)
i = 6;
else
i = 10;
@@ -1093,7 +1093,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
* Gets the width in pixels of the specified string
*/
int ScreenSurface::getStringWidth(const Common::String &s) {
- int charWidth = (res == 2) ? 6 : 10;
+ int charWidth = (g_res == 2) ? 6 : 10;
return s.size() * charWidth;
}
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index d6ebe986df..602d53deb2 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -45,9 +45,9 @@ int testou() {
g_soundOff = !g_soundOff;
break;
case '\26' :
- if ((c_zzz == 1) || (c_zzz == 2)) {
+ if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
- ++c_zzz;
+ ++g_c_zzz;
return 61;
}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 5030da9acb..68fff8aa00 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -101,7 +101,7 @@ void pictout(int seg, int dep, int x, int y) {
mem[0x7000 * 16 + 32] = 15;
}
- if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
+ if ((g_caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
g_vm->_screenSurface.drawPicture(surface, x, y);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 998b70fa35..ac199594b7 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,7 +48,7 @@ void Menu::menut(int no, Common::String name) {
byte l = lo(no);
Common::String s = name;
- if (! tesok)
+ if (!g_tesok)
g_vm->quitGame();
@@ -153,7 +153,7 @@ void Menu::displayMenu() {
hideMouse();
g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
- col = 28 * res;
+ col = 28 * g_res;
if (g_currGraphicalDevice == MODE_CGA)
color = 1;
else
@@ -182,7 +182,7 @@ void Menu::displayMenu() {
} while (k != 3);
++y;
} while (y != 9);
- col += 48 * res;
+ col += 48 * g_res;
} while (num_letr != 6);
showMouse();
}
@@ -193,23 +193,23 @@ void Menu::displayMenu() {
void Menu::drawMenu() {
displayMenu();
_menuActive = true;
- msg4 = OPCODE_NONE;
- msg3 = OPCODE_NONE;
- choisi = false;
+ g_msg4 = OPCODE_NONE;
+ g_msg3 = OPCODE_NONE;
+ g_choisi = false;
g_vm->setMouseClick(false);
- test0 = false;
+ g_test0 = false;
}
void Menu::invers(int ix) {
Common::String s;
- if (msg4 == OPCODE_NONE)
+ if (g_msg4 == OPCODE_NONE)
return;
- int menuIndex = lo(msg4);
+ int menuIndex = lo(g_msg4);
- g_vm->_screenSurface.putxy(_menuConstants[msg3 - 1][0] << 3, (menuIndex + 1) << 3);
- switch (msg3) {
+ g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+ switch (g_msg3) {
case 1:
s = _inventoryStringArray[menuIndex];
break;
@@ -248,31 +248,31 @@ void Menu::invers(int ix) {
if ((s[0] != '*') && (s[0] != '<'))
g_vm->_screenSurface.writeg(s, ix);
else
- msg4 = OPCODE_NONE;
+ g_msg4 = OPCODE_NONE;
}
void Menu::util(int x, int y) {
- int ymx = (_menuConstants[msg3 - 1][3] << 3) + 16;
- int dxcar = _menuConstants[msg3 - 1][2];
- int xmn = (_menuConstants[msg3 - 1][0] << 2) * res;
+ 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 ix;
- if (res == 1)
+ if (g_res == 1)
ix = 5;
else
ix = 3;
- int xmx = dxcar * ix * res + xmn + 2;
+ int xmx = dxcar * ix * g_res + xmn + 2;
if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
- ix = (((uint)y >> 3) - 1) + (msg3 << 8);
- if (ix != msg4) {
+ ix = (((uint)y >> 3) - 1) + (g_msg3 << 8);
+ if (ix != g_msg4) {
invers(1);
- msg4 = ix;
+ g_msg4 = ix;
invers(0);
}
- } else if (msg4 != OPCODE_NONE) {
+ } else if (g_msg4 != OPCODE_NONE) {
invers(1);
- msg4 = OPCODE_NONE;
+ g_msg4 = OPCODE_NONE;
}
}
@@ -294,7 +294,7 @@ void Menu::menuDown(int ii) {
hideMouse();
sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
xco = xco << 3;
- if (res == 1)
+ if (g_res == 1)
cx = 10;
else
cx = 6;
@@ -352,7 +352,7 @@ void Menu::menuDown(int ii) {
}
g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
} while (cx != nb_lig);
- test0 = true;
+ g_test0 = true;
showMouse();
}
@@ -361,7 +361,7 @@ void Menu::menuDown(int ii) {
*/
void Menu::menuUp(int xx) {
/* debug('menuUp'); */
- if (test0) {
+ if (g_test0) {
charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
/* Restore the background area */
@@ -375,7 +375,7 @@ void Menu::menuUp(int xx) {
// Copy the data
Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest);
- test0 = false;
+ g_test0 = false;
}
}
@@ -386,7 +386,7 @@ void Menu::eraseMenu() {
/* debug('eraseMenu'); */
_menuActive = false;
g_vm->setMouseClick(false);
- menuUp(msg3);
+ menuUp(g_msg3);
}
/**
@@ -399,67 +399,67 @@ void Menu::mdn() {
int x = x_s;
int y = y_s;
if (!g_vm->getMouseClick()) {
- if ((x == xprec) && (y == yprec))
+ if ((x == g_xprec) && (y == g_yprec))
return;
else {
- xprec = x;
- yprec = y;
+ g_xprec = x;
+ g_yprec = y;
}
bool tes = (y < 11)
- && ((x >= (28 * res) && x <= (28 * res + 24))
- || (x >= (76 * res) && x <= (76 * res + 24))
- || ((x > 124 * res) && (x < 124 * res + 24))
- || ((x > 172 * res) && (x < 172 * res + 24))
- || ((x > 220 * res) && (x < 220 * res + 24))
- || ((x > 268 * res) && (x < 268 * res + 24)));
+ && ((x >= (28 * g_res) && x <= (28 * g_res + 24))
+ || (x >= (76 * g_res) && x <= (76 * g_res + 24))
+ || ((x > 124 * g_res) && (x < 124 * g_res + 24))
+ || ((x > 172 * g_res) && (x < 172 * g_res + 24))
+ || ((x > 220 * g_res) && (x < 220 * g_res + 24))
+ || ((x > 268 * g_res) && (x < 268 * g_res + 24)));
if (tes) {
int ix;
- if (x < 76 * res)
+ if (x < 76 * g_res)
ix = MENU_INVENTORY;
- else if (x < 124 * res)
+ else if (x < 124 * g_res)
ix = MENU_MOVE;
- else if (x < 172 * res)
+ else if (x < 172 * g_res)
ix = MENU_ACTION;
- else if (x < 220 * res)
+ else if (x < 220 * g_res)
ix = MENU_SELF;
- else if (x < 268 * res)
+ else if (x < 268 * g_res)
ix = MENU_DISCUSS;
else
ix = MENU_FILE;
- if ((ix != msg3) || (! test0))
- if (!((ix == MENU_FILE) && ((msg3 == MENU_SAVE) || (msg3 == MENU_LOAD)))) {
- menuUp(msg3);
+ if ((ix != g_msg3) || (!g_test0))
+ if (!((ix == MENU_FILE) && ((g_msg3 == MENU_SAVE) || (g_msg3 == MENU_LOAD)))) {
+ menuUp(g_msg3);
menuDown(ix);
- msg3 = ix;
- msg4 = OPCODE_NONE;
+ g_msg3 = ix;
+ g_msg4 = OPCODE_NONE;
}
} else { // Not in the MenuTitle line
- if ((y > 11) && (test0))
+ if ((y > 11) && (g_test0))
util(x, y);
}
} else { // There was a click
- if ((msg3 == MENU_FILE) && (msg4 != OPCODE_NONE)) {
+ if ((g_msg3 == MENU_FILE) && (g_msg4 != OPCODE_NONE)) {
// Another menu to be _displayed
g_vm->setMouseClick(false);
- menuUp(msg3);
- if (lo(msg4) == 1)
- msg3 = 7;
+ menuUp(g_msg3);
+ if (lo(g_msg4) == 1)
+ g_msg3 = 7;
else
- msg3 = 8;
- menuDown(msg3);
+ g_msg3 = 8;
+ menuDown(g_msg3);
g_vm->setMouseClick(false);
} else {
// A menu was clicked on
- choisi = (test0) && (msg4 != OPCODE_NONE);
- menuUp(msg3);
- g_msg[4] = msg4;
- g_msg[3] = msg3;
- msg3 = OPCODE_NONE;
- msg4 = OPCODE_NONE;
+ g_choisi = (g_test0) && (g_msg4 != OPCODE_NONE);
+ menuUp(g_msg3);
+ g_msg[4] = g_msg4;
+ g_msg[3] = g_msg3;
+ g_msg3 = OPCODE_NONE;
+ g_msg4 = OPCODE_NONE;
g_vm->setMouseClick(false);
}
@@ -511,8 +511,8 @@ void Menu::initMenu() {
if (i > 6)
g_vm->_menu.disableMenuItem(_inventoryMenu[i]);
}
- msg3 = OPCODE_NONE;
- msg4 = OPCODE_NONE;
+ g_msg3 = OPCODE_NONE;
+ g_msg4 = 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 d3eb248574..20882eb41a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -107,7 +107,7 @@ void modif(int &nu) {
void dessine(int ad, int x, int y) {
hideMouse();
- writepal(numpal);
+ writepal(g_numpal);
pictout(ad, 0, x, y);
showMouse();
}
@@ -124,7 +124,7 @@ void dessine_rouleau() {
void text_color(int c) {
- color_txt = c;
+ g_color_txt = c;
}
/* NIVEAU 13 */
@@ -133,14 +133,14 @@ void text_color(int c) {
void text1(int x, int y, int nb, int m) {
int co;
- if (res == 1)
+ if (g_res == 1)
co = 10;
else
co = 6;
Common::String tmpStr = deline(m);
if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
y = 176;
- afftex(tmpStr, x, y, nb, 20, color_txt);
+ afftex(tmpStr, x, y, nb, 20, g_color_txt);
}
void initouv() {
@@ -162,10 +162,10 @@ void clsf1() {
void clsf2() {
hideMouse();
- if (f2_all) {
+ if (g_f2_all) {
g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
- f2_all = false;
+ g_f2_all = false;
} else {
g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
@@ -180,7 +180,7 @@ void ecrf2() {
void ecr2(Common::String str_) {
// Some dead code was present in the original: removed
g_vm->_screenSurface.putxy(8, 177);
- int tlig = 59 + (res - 1) * 36;
+ int tlig = 59 + (g_res - 1) * 36;
if ((int)str_.size() < tlig)
g_vm->_screenSurface.writeg(str_, 5);
@@ -190,7 +190,7 @@ void ecr2(Common::String str_) {
g_vm->_screenSurface.putxy(8, 182);
g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
} else {
- f2_all = true;
+ g_f2_all = true;
clsf2();
g_vm->_screenSurface.putxy(8, 176);
g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
@@ -228,7 +228,7 @@ void clsf10() {
Common::String st;
hideMouse();
- if (res == 1) {
+ if (g_res == 1) {
co = 634;
cod = 534;
} else {
@@ -247,7 +247,7 @@ void clsf10() {
g_vm->_screenSurface.putxy(co, 92);
g_vm->_screenSurface.writeg(st, 4);
- if (res == 1)
+ if (g_res == 1)
co = 620;
else
co = 584;
@@ -280,15 +280,15 @@ int hazard(int min, int max) {
void calch(int &j, int &h, int &m) {
int nh = readclock();
- int th = jh + ((nh - mh) / g_t);
- m = ((th % 2) + vm) * 30;
- h = ((uint)th >> 1) + vh;
+ int th = g_jh + ((nh - g_mh) / g_t);
+ m = ((th % 2) + g_vm__) * 30;
+ h = ((uint)th >> 1) + g_vh;
if (m == 60) {
m = 0;
h = h + 1;
}
- j = (h / 24) + vj;
- h = h - ((j - vj) * 24);
+ j = (h / 24) + g_vj;
+ h = h - ((j - g_vj) * 24);
}
void conv(int x, int &y) {
@@ -302,7 +302,7 @@ void conv(int x, int &y) {
/* NIVEAU 12 */
void okpas() {
- tesok = true;
+ g_tesok = true;
}
void modobj(int m) {
@@ -321,7 +321,7 @@ void modobj2(int m, bool t1, bool t2) {
if (t1 || t2)
okpas();
else
- tesok = false;;
+ g_tesok = false;;
if (m != 500)
strp = deline(m - 501 + c_st41);
@@ -339,10 +339,10 @@ void repon(int f, int m) {
if ((m > 499) && (m < 563)) {
tmpStr = deline(m - 501 + c_st41);
- if ((int) tmpStr.size() > ((58 + (res - 1) * 37) << 1))
- f2_all = true;
+ if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
+ g_f2_all = true;
else
- f2_all = false;
+ g_f2_all = false;
clsf2();
afftex(tmpStr, 8, 176, 85, 3, 5);
@@ -358,7 +358,7 @@ void repon(int f, int m) {
text1(8, 182, 103, m);
if ((m == 68) || (m == 69))
g_s.teauto[40] = '*';
- if ((m == 104) && (caff == 14)) {
+ if ((m == 104) && (g_caff == 14)) {
g_s.teauto[36] = '*';
if (g_s.teauto[39] == '*') {
g_s.pourc[3] = '*';
@@ -387,7 +387,7 @@ void repon(int f, int m) {
tmpStr = deline(m);
int xco, dx, caspe;
- if (res == 1) {
+ if (g_res == 1) {
xco = 252 - tmpStr.size() * 5;
caspe = 100;
dx = 80;
@@ -407,33 +407,33 @@ void repon(int f, int m) {
void t5(int cx) {
if (cx == 10)
- blo = false;
+ g_blo = false;
if (cx != 1) {
- bh1 = false;
- bf1 = false;
+ g_bh1 = false;
+ g_bf1 = false;
}
if (cx != 2)
- bh2 = false;
+ g_bh2 = false;
if (cx != 4) {
- bh4 = false;
- bf4 = false;
+ g_bh4 = false;
+ g_bf4 = false;
}
if (cx != 5)
- bh5 = false;
+ g_bh5 = false;
if (cx != 6)
- bh6 = false;
+ g_bh6 = false;
if (cx != 8)
- bh8 = false;
+ g_bh8 = false;
if (cx != 3)
- bt3 = false;
+ g_bt3 = false;
if (cx != 7)
- bt7 = false;
+ g_bt7 = false;
if (cx != 9)
- bh9 = false;
+ g_bh9 = false;
}
void affper(int per) {
@@ -482,7 +482,7 @@ void affper(int per) {
g_vm->_screenSurface.writeg("MAX", 4);
g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
}
- ipers = per;
+ g_ipers = per;
}
void choix(int min, int max, int &per) {
@@ -609,7 +609,7 @@ void person() {
g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAlone) / 2), 70);
g_vm->_screenSurface.writeg(sAlone, 4);
- ipers = 0;
+ g_ipers = 0;
}
void chlm(int &per) {
@@ -641,9 +641,9 @@ void drawClock() {
co = 1;
if (g_minute == 0)
- g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
+ g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
else
- g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
+ g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
h = g_hour;
if (h > 12)
@@ -651,7 +651,7 @@ void drawClock() {
if (h == 0)
h = 12;
- g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[0][h - 1]) >> 1)*res, y + cv[1][h - 1], co);
+ g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
showMouse();
g_vm->_screenSurface.putxy(568, 154);
@@ -678,7 +678,7 @@ void debloc(int l) {
g_y = 0;
if ((l != 26) && (l != 15))
t5(l);
- mpers = ipers;
+ g_mpers = g_ipers;
}
void cpl10(int &p, int &h) {
@@ -773,40 +773,40 @@ void quelq1(int l) {
per = hazard(1, 2);
if (l == 1) {
if (per == 1)
- bh1 = true;
+ g_bh1 = true;
else
- bf1 = true;
+ g_bf1 = true;
} else if (l == 4) {
if (per == 1)
- bh4 = true;
+ g_bh4 = true;
else
- bf4 = true;
+ g_bf4 = true;
}
- ipers = 10;
+ g_ipers = 10;
}
void quelq2() {
- if (li == 2)
- bh2 = true;
+ if (g_li == 2)
+ g_bh2 = true;
else
- bh9 = true;
+ g_bh9 = true;
- ipers = 10;
+ g_ipers = 10;
}
void quelq5() {
- bh5 = true;
- ipers = 10;
+ g_bh5 = true;
+ g_ipers = 10;
}
void quelq6(int l) {
if (l == 6)
- bh6 = true;
+ g_bh6 = true;
else if (l == 8)
- bh8 = true;
+ g_bh8 = true;
- ipers = 10;
+ g_ipers = 10;
}
void quelq10(int h, int &per) {
@@ -865,14 +865,14 @@ void quelq15(int &per) {
do {
cx = hazard(1, 8);
- test = (((cx == 1) && (bh2 || bh9)) ||
- ((cx == 2) && bh8) ||
- ((cx == 3) && bh4) ||
- ((cx == 4) && bf4) ||
- ((cx == 5) && bh6) ||
- ((cx == 6) && bh1) ||
- ((cx == 7) && bf1) ||
- ((cx == 8) && bh5));
+ test = (((cx == 1) && (g_bh2 || g_bh9)) ||
+ ((cx == 2) && g_bh8) ||
+ ((cx == 3) && g_bh4) ||
+ ((cx == 4) && g_bf4) ||
+ ((cx == 5) && g_bh6) ||
+ ((cx == 6) && g_bh1) ||
+ ((cx == 7) && g_bf1) ||
+ ((cx == 8) && g_bh5));
} while (test);
conv(cx, per);
@@ -905,37 +905,37 @@ void frap() {
calch(j, h, m);
if ((h >= 0) && (h < 8))
- crep = 190;
+ g_crep = 190;
else {
int haz = hazard(1, 100);
if (haz > 70)
- crep = 190;
+ g_crep = 190;
else
- crep = 147;
+ g_crep = 147;
}
}
void nouvp(int l, int &p) {
p = 0;
if (l == 1) {
- if (bh1)
+ if (g_bh1)
p = 4;
- if (bf1)
+ if (g_bf1)
p = 2;
- } else if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))
+ } else if (((l == 2) && (g_bh2)) || ((l == 9) && (g_bh9)))
p = 128;
else if (l == 4) {
- if (bh4)
+ if (g_bh4)
p = 32;
- if (bf4)
+ if (g_bf4)
p = 16;
- } else if ((l == 5) && (bh5))
+ } else if ((l == 5) && (g_bh5))
p = 1;
- else if ((l == 6) && (bh6))
+ else if ((l == 6) && (g_bh6))
p = 8;
- else if ((l == 8) && (bh8))
+ else if ((l == 8) && (g_bh8))
p = 64;
- else if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))
+ else if (((l == 3) && (g_bt3)) || ((l == 7) && (g_bt7)))
p = 9;
if (p != 9)
@@ -969,19 +969,19 @@ void ecfren(int &p, int &haz, int cf, int l) {
person();
p = -500;
haz = 0;
- if (((l == 1) && (! bh1) && (! bf1)) || ((l == 4) && (! bh4) && (! bf4)))
+ if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
cpl1(p);
- if ((l == 2) && (! bh2) && (! bh9))
+ if ((l == 2) && (!g_bh2) && (!g_bh9))
cpl2(p);
- if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))
+ if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
cpl3(p);
- if ((l == 5) && (! bh5))
+ if ((l == 5) && (!g_bh5))
cpl5(p);
- if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))
+ if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
cpl6(p);
- if ((l == 9) && (! bh9) && (! bh2))
+ if ((l == 9) && (!g_bh9) && (!g_bh2))
p = 10;
- if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))
+ if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
p = -400;
if (p != -500) {
p = p + cf;
@@ -994,29 +994,29 @@ void becfren(int l) {
int haz = hazard(1, 2);
if (l == 1) {
if (haz == 1)
- bh1 = true;
+ g_bh1 = true;
else
- bf1 = true;
+ g_bf1 = true;
} else { // l == 4
if (haz == 1)
- bh4 = true;
+ g_bh4 = true;
else
- bf4 = true;
+ g_bf4 = true;
}
} else if (l == 2)
- bh2 = true;
+ g_bh2 = true;
else if (l == 3)
- bt3 = true;
+ g_bt3 = true;
else if (l == 5)
- bh5 = true;
+ g_bh5 = true;
else if (l == 6)
- bh6 = true;
+ g_bh6 = true;
else if (l == 7)
- bt7 = true;
+ g_bt7 = true;
else if (l == 8)
- bh8 = true;
+ g_bh8 = true;
else if (l == 9)
- bh9 = true;
+ g_bh9 = true;
}
/* NIVEAU 10 */
@@ -1077,16 +1077,16 @@ void inzon() {
}
void dprog() {
- li = 21;
- jh = 0;
+ g_li = 21;
+ g_jh = 0;
if (!g_s.ipre)
- blo = true;
+ g_blo = true;
g_t = ti1;
- mh = readclock();
+ g_mh = readclock();
}
void pl1(int cf) {
- if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) {
+ if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
int p, haz;
cpl1(p);
phaz(haz, p, cf);
@@ -1094,12 +1094,12 @@ void pl1(int cf) {
if (haz > p)
person();
else
- quelq1(li);
+ quelq1(g_li);
}
}
void pl2(int cf) {
- if (! bh2) {
+ if (!g_bh2) {
int p, haz;
cpl2(p);
phaz(haz, p, cf);
@@ -1112,7 +1112,7 @@ void pl2(int cf) {
}
void pl5(int cf) {
- if (! bh5) {
+ if (!g_bh5) {
int p, haz;
cpl5(p);
phaz(haz, p, cf);
@@ -1125,7 +1125,7 @@ void pl5(int cf) {
}
void pl6(int cf) {
- if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
+ if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
int p, haz;
cpl6(p);
phaz(haz, p, cf);
@@ -1133,12 +1133,12 @@ void pl6(int cf) {
if (haz > p)
person();
else
- quelq6(li);
+ quelq6(g_li);
}
}
void pl9(int cf) {
- if (! bh9) {
+ if (!g_bh9) {
cf = -10;
int p, haz;
phaz(haz, p, cf);
@@ -1220,18 +1220,18 @@ void t11(int l11, int &a) {
int p, haz;
ecfren(p, haz, g_s.conf, l11);
- li = l11;
+ g_li = l11;
if ((l11 > 0) && (l11 < 10)) {
if (p != -500) {
if (haz > p) {
person();
a = 0;
} else {
- becfren(li);
- nouvp(li, a);
+ becfren(g_li);
+ nouvp(g_li, a);
}
} else
- nouvp(li, a);
+ nouvp(g_li, a);
}
if (l11 > 9) {
@@ -1291,7 +1291,7 @@ void cavegre() {
}
void writetp(Common::String s, int t) {
- if (res == 2)
+ if (g_res == 2)
g_vm->_screenSurface.writeg(s, t);
else
g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
@@ -1308,13 +1308,13 @@ void messint(int nu) {
}
void aniof(int ouf, int num) {
- if ((caff == 7) && ((num == 4) || (num == 5)))
+ if ((g_caff == 7) && ((num == 4) || (num == 5)))
return;
- if ((caff == 10) && (num == 7))
+ if ((g_caff == 10) && (num == 7))
num = 6;
- if (caff == 12) {
+ if (g_caff == 12) {
if (num == 3)
num = 4;
else if (num == 4)
@@ -1335,9 +1335,9 @@ void musique(int so) {
if (so == 0) {
/* musik(0) */
;
- } else if ((prebru == 0) && (!g_s.ipre)) {
+ } else if ((g_prebru == 0) && (!g_s.ipre)) {
parole(10, 1, 1);
- ++prebru;
+ ++g_prebru;
} else {
bool i = false;
if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22)) {
@@ -1378,42 +1378,42 @@ void musique(int so) {
/* NIVEAU 9 */
void dessin(int ad) {
if (ad != 0)
- dessine(ades, ((ad % 160) * 2), (ad / 160));
+ dessine(g_ades, ((ad % 160) * 2), (ad / 160));
else {
clsf1();
- if (caff > 99) {
- dessine(ades, 60, 33);
+ if (g_caff > 99) {
+ dessine(g_ades, 60, 33);
g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15); // Medium box
- } else if (caff > 69) {
- dessine(ades, 112, 48); // Heads
+ } else if (g_caff > 69) {
+ dessine(g_ades, 112, 48); // Heads
g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
} else {
- dessine(ades, 0, 12);
+ dessine(g_ades, 0, 12);
ecrf1();
- if ((caff < 30) || (caff > 32)) {
+ 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 (caff == 13) {
+ if (g_caff == 13) {
if (g_s.iboul == 141)
aniof(1, 7);
if (g_s.ibag == 159)
aniof(1, 6);
}
- if ((caff == 14) && (g_s.icave == 151))
+ if ((g_caff == 14) && (g_s.icave == 151))
aniof(1, 2);
- if ((caff == 17) && (g_s.ivier == 143))
+ if ((g_caff == 17) && (g_s.ivier == 143))
aniof(1, 1);
- if ((caff == 24) && (g_s.ipuit != 0))
+ if ((g_caff == 24) && (g_s.ipuit != 0))
aniof(1, 1);
}
- if (caff < 26)
+ if (g_caff < 26)
musique(1);
}
}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 42e1d0f9fa..c592ddc996 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -49,7 +49,7 @@ void tinke() {
int cx, cf, j, h, m;
Common::String stpo;
- anyone = false;
+ g_anyone = false;
calch(j, h, m);
if (j != g_day) {
g_day = j;
@@ -96,7 +96,7 @@ void tinke() {
if (y_s < 12)
return;
- if (! blo) {
+ if (!g_blo) {
if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
g_t = ti2;
else
@@ -109,12 +109,12 @@ void tinke() {
g_t -= ((g_t / 3) * 2);
int nh = readclock();
- if ((nh - mh) > g_t) {
+ if ((nh - g_mh) > g_t) {
bool activeMenu = g_vm->_menu._menuActive;
g_vm->_menu.eraseMenu();
- jh += ((nh - mh) / g_t);
- mh = nh;
- switch (li) {
+ g_jh += ((nh - g_mh) / g_t);
+ g_mh = nh;
+ switch (g_li) {
case 1:
case 4 :
pl1(cf);
@@ -153,17 +153,17 @@ void tinke() {
pl20(cf);
break;
}
- if ((mpers != 0) && (ipers != 10))
- mpers = ipers;
+ if ((g_mpers != 0) && (g_ipers != 10))
+ g_mpers = g_ipers;
- if ((mpers == 0) && (ipers > 0)) {
+ if ((g_mpers == 0) && (g_ipers > 0)) {
if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) {
cavegre();
- } else if (ipers == 10) {
- ipers = 0;
- if (! brt) {
- brt = true;
- hdb = readclock();
+ } else if (g_ipers == 10) {
+ g_ipers = 0;
+ if (!g_brt) {
+ g_brt = true;
+ g_hdb = readclock();
int haz = hazard(1, 5);
if (haz < 5) {
clsf3();
@@ -181,13 +181,13 @@ void tinke() {
g_vm->_menu.drawMenu();
}
}
- hfb = readclock();
- if ((brt) && ((hfb - hdb) > 17)) {
- nouvp(li, cx);
- brt = false;
- hdb = 0;
+ g_hfb = readclock();
+ if ((g_brt) && ((g_hfb - g_hdb) > 17)) {
+ nouvp(g_li, cx);
+ g_brt = false;
+ g_hdb = 0;
if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
- anyone = true;
+ g_anyone = true;
}
}
@@ -212,7 +212,7 @@ void fenat(char ans) {
void afdes(int ad) {
taffich();
dessin(ad);
- okdes = false;
+ g_okdes = false;
}
void tkey1(bool d) {
@@ -230,7 +230,7 @@ void tkey1(bool d) {
quest = keypressed();
getMousePos(x, y, c);
CHECK_QUIT;
- } while (!(quest || (c != 0) || (d && anyone)));
+ } while (!(quest || (c != 0) || (d && g_anyone)));
if (quest)
testou();
g_vm->setMouseClick(false);
@@ -259,19 +259,19 @@ void tmlieu(int mli) {
/* NIVEAU 7 */
void tlu(int af, int ob) {
- caff = 32;
+ g_caff = 32;
afdes(0);
repon(6, ob + 4000);
repon(2, 999);
tkey1(true);
- caff = af;
+ g_caff = af;
g_msg[3] = OPCODE_NONE;
- crep = 998;
+ g_crep = 998;
}
void affrep() {
- caff = g_s.mlieu;
- crep = g_s.mlieu;
+ g_caff = g_s.mlieu;
+ g_crep = g_s.mlieu;
}
void mfouen() {
@@ -287,11 +287,11 @@ void mfouen() {
void tperd() {
initouv();
- ment = 0;
- iouv = 0;
- mchai = 0;
+ g_ment = 0;
+ g_iouv = 0;
+ g_mchai = 0;
mfouen();
- if (!blo) {
+ if (!g_blo) {
int cx;
t11(21, cx);
}
@@ -299,17 +299,17 @@ void tperd() {
g_vm->_loseGame = true;
clsf1();
g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
- repon(9, crep);
+ repon(9, g_crep);
clsf2();
clsf3();
g_col = false;
- syn = false;
- okdes = false;
+ g_syn = false;
+ g_okdes = false;
}
void tsort() {
- if ((iouv > 0) && (g_s.mlieu != 0)) {
+ if ((g_iouv > 0) && (g_s.mlieu != 0)) {
if (g_s.conf < 50)
g_s.conf += 2;
else
@@ -318,24 +318,24 @@ void tsort() {
for (int cx = 1; cx <= 7; ++cx)
touv[cx] = chr(0);
- ment = 0;
- iouv = 0;
- mchai = 0;
+ g_ment = 0;
+ g_iouv = 0;
+ g_mchai = 0;
debloc(g_s.mlieu);
}
void st4(int ob) {
- crep = 997;
+ g_crep = 997;
switch (ob) {
case 114 :
- crep = 109;
+ g_crep = 109;
break;
case 110 :
- crep = 107;
+ g_crep = 107;
break;
case 158 :
- crep = 113;
+ g_crep = 113;
break;
case 152:
case 153:
@@ -347,7 +347,7 @@ void st4(int ob) {
case 157:
case 160:
case 161 :
- tlu(caff, ob);
+ tlu(g_caff, ob);
break;
default:
break;
@@ -402,7 +402,7 @@ void sparl(float adr, float rep) {
key = 0;
do {
- parole(repint, haut[caff - 69], 0);
+ parole(repint, haut[g_caff - 69], 0);
f3f8::waitForF3F8(key);
CHECK_QUIT;
} while (key != 66);
@@ -411,9 +411,9 @@ void sparl(float adr, float rep) {
}
void finfouil() {
- fouil = false;
- obpart = false;
- cs = 0;
+ g_fouil = false;
+ g_obpart = false;
+ g_cs = 0;
is = 0;
mfouen();
}
@@ -434,13 +434,13 @@ void mennor() {
}
void premtet() {
- dessine(ades, 10, 80);
+ dessine(g_ades, 10, 80);
g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
}
/* NIVEAU 5 */
void ajchai() {
- int cy = acha + ((mchai - 1) * 10) - 1;
+ int cy = acha + ((g_mchai - 1) * 10) - 1;
int cx = 0;
do {
++cx;
@@ -450,7 +450,7 @@ void ajchai() {
int lderobj = g_s.derobj;
tabdon[cy + cx] = lderobj;
} else
- crep = 192;
+ g_crep = 192;
}
void ajjer(int ob) {
@@ -463,7 +463,7 @@ void ajjer(int ob) {
g_s.sjer[(cx)] = chr(ob);
modinv();
} else
- crep = 139;
+ g_crep = 139;
}
void t1sama() { //Entering manor
@@ -474,14 +474,14 @@ void t1sama() { //Entering manor
bool d;
cherjer(137, d);
if (!d) { //You don't have the keys, and it's late
- crep = 1511;
+ g_crep = 1511;
tperd();
} else
st1sama();
} else if (!g_s.ipre) { //Is it your first time?
- ipers = 255;
- affper(ipers);
- caff = 77;
+ g_ipers = 255;
+ affper(g_ipers);
+ g_caff = 77;
afdes(0);
g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
repon(2, 33);
@@ -497,10 +497,10 @@ void t1sama() { //Entering manor
g_s.mlieu = 0;
affrep();
t5(10);
- if (! blo)
+ if (!g_blo)
t11(0, m);
- ipers = 0;
- mpers = 0;
+ g_ipers = 0;
+ g_mpers = 0;
g_s.ipre = true;
/*chech;*/
} else
@@ -513,19 +513,19 @@ void t1vier() {
}
void t1neig() {
- ++inei;
- if (inei > 2) {
- crep = 1506;
+ ++g_inei;
+ if (g_inei > 2) {
+ g_crep = 1506;
tperd();
} else {
- okdes = true;
+ g_okdes = true;
g_s.mlieu = 19;
affrep();
}
}
void t1deva() {
- inei = 0;
+ g_inei = 0;
g_s.mlieu = 21;
affrep();
}
@@ -536,33 +536,33 @@ void t1derr() {
}
void t1deau() {
- crep = 1503;
+ g_crep = 1503;
tperd();
}
void tctrm() {
- repon(2, (3000 + ctrm));
- ctrm = 0;
+ repon(2, (3000 + g_ctrm));
+ g_ctrm = 0;
}
void quelquun() {
- if (imen)
+ if (g_imen)
g_vm->_menu.eraseMenu();
finfouil();
- crep = 997;
+ g_crep = 997;
L1:
- if (! cache) {
- if (crep == 997)
- crep = 138;
- repon(2, crep);
- if (crep == 138)
+ if (!g_cache) {
+ if (g_crep == 997)
+ g_crep = 138;
+ repon(2, g_crep);
+ if (g_crep == 138)
parole(5, 2, 1);
else
parole(4, 4, 1);
- if (iouv == 0)
+ if (g_iouv == 0)
g_s.conf += 2;
else if (g_s.conf < 50)
g_s.conf += 4;
@@ -571,18 +571,18 @@ L1:
tsort();
tmlieu(15);
int cx;
- tip(ipers, cx);
- caff = 69 + cx;
- crep = caff;
+ tip(g_ipers, cx);
+ g_caff = 69 + cx;
+ g_crep = g_caff;
g_msg[3] = MENU_DISCUSS;
g_msg[4] = g_vm->_menu._discussMenu[cx];
- syn = true;
+ g_syn = true;
g_col = true;
} else {
int haz = hazard(1, 3);
if (haz == 2) {
- cache = false;
- crep = 137;
+ g_cache = false;
+ g_crep = 137;
goto L1;
} else {
repon(2, 136);
@@ -594,7 +594,7 @@ L1:
affrep();
}
}
- if (imen)
+ if (g_imen)
g_vm->_menu.drawMenu();
}
@@ -602,26 +602,26 @@ void tsuiv() {
int tbcl;
int cl;
- int cy = acha + ((mchai - 1) * 10) - 1;
+ int cy = acha + ((g_mchai - 1) * 10) - 1;
int cx = 0;
do {
cx = cx + 1;
- cs = cs + 1;
- cl = cy + cs;
+ g_cs = g_cs + 1;
+ cl = cy + g_cs;
tbcl = tabdon[cl];
- } while ((tbcl == 0) && (cs <= 9));
+ } while ((tbcl == 0) && (g_cs <= 9));
- if ((tbcl != 0) && (cs < 11)) {
+ if ((tbcl != 0) && (g_cs < 11)) {
is = is + 1;
- caff = tbcl;
- crep = caff + 400;
- if (ipers != 0)
+ g_caff = tbcl;
+ g_crep = g_caff + 400;
+ if (g_ipers != 0)
g_s.conf = g_s.conf + 2;
} else {
affrep();
finfouil();
if (cx > 9)
- crep = 131;
+ g_crep = 131;
}
}
@@ -633,7 +633,7 @@ void tfleche() {
return;
fenat(chr(152));
- rect = false;
+ g_rect = false;
do {
touch = '\0';
@@ -642,18 +642,18 @@ void tfleche() {
CHECK_QUIT;
if (g_vm->getMouseClick())
- rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
+ g_rect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
tinke();
- } while (!(qust || rect || anyone));
+ } while (!(qust || g_rect || g_anyone));
if (qust && (touch == '\103'))
Alert::show(_hintPctMessage, 1);
- } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (anyone) || (rect)));
+ } while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
if (touch == '\73')
- iesc = true;
+ g_iesc = true;
- if (rect) {
+ if (g_rect) {
g_x = x_s;
g_y = y_s;
}
@@ -665,18 +665,18 @@ void tcoord(int sx) {
g_num = 0;
- crep = 999;
+ g_crep = 999;
int a = 0;
int atdon = amzon + 3;
int cy = 0;
- while (cy < caff) {
+ while (cy < g_caff) {
a += tabdon[atdon];
atdon += 4;
++cy;
}
if (tabdon[atdon] == 0) {
- crep = 997;
+ g_crep = 997;
return;
}
@@ -688,17 +688,17 @@ void tcoord(int sx) {
}
ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
if (ib == 0) {
- crep = 997;
+ g_crep = 997;
return;
}
cy = 1;
do {
cb += 2;
- sx = tabdon[a + cb] * res;
+ sx = tabdon[a + cb] * g_res;
sy = tabdon[(a + cb + 1)];
cb += 2;
- ix = tabdon[a + cb] * res;
+ ix = tabdon[a + cb] * g_res;
iy = tabdon[(a + cb + 1)];
++cy;
} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
@@ -708,7 +708,7 @@ void tcoord(int sx) {
return;
}
- crep = 997;
+ g_crep = 997;
}
@@ -716,51 +716,51 @@ void st7(int ob) {
switch (ob) {
case 116:
case 144:
- crep = 104;
+ g_crep = 104;
break;
case 126:
case 111:
- crep = 108;
+ g_crep = 108;
break;
case 132:
- crep = 111;
+ g_crep = 111;
break;
case 142:
- crep = 112;
+ g_crep = 112;
break;
default:
- crep = 183;
+ g_crep = 183;
st4(ob);
}
}
void treg(int ob) {
- int mdes = caff;
- caff = ob;
+ int mdes = g_caff;
+ g_caff = ob;
- if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
+ if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
afdes(0);
- if ((caff > 29) && (caff < 33))
- repon(2, caff);
+ if ((g_caff > 29) && (g_caff < 33))
+ repon(2, g_caff);
else
- repon(2, (caff + 400));
+ repon(2, g_caff + 400);
tkey1(true);
- caff = mdes;
+ g_caff = mdes;
g_msg[3] = 0;
- crep = 998;
+ g_crep = 998;
} else {
- obpart = true;
- crep = caff + 400;
+ g_obpart = true;
+ g_crep = g_caff + 400;
mfoudi();
}
}
void avpoing(int &ob) {
- crep = 999;
+ g_crep = 999;
if (g_s.derobj != 0)
ajjer(g_s.derobj);
- if (crep != 139) {
+ if (g_crep != 139) {
modobj(ob + 400);
g_s.derobj = ob;
ob = 0;
@@ -781,7 +781,7 @@ void t23coul(int &l) {
cherjer(143, d);
l = 14;
if (!d) {
- crep = 1512;
+ g_crep = 1512;
tperd();
}
}
@@ -797,9 +797,9 @@ void st13(int ob) {
(ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
(ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
(ob == 150) || (ob == 152))
- crep = 999;
+ g_crep = 999;
else
- crep = 105;
+ g_crep = 105;
}
void aldepl() {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7d0e7bc8ed..dceb5c7d55 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -122,7 +122,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
// Set the screen mode
g_currGraphicalDevice = MODE_EGA;
- res = 2;
+ g_res = 2;
_txxFileFl = false;
// Load texts from TXX files
@@ -144,19 +144,19 @@ Common::ErrorCode MortevielleEngine::initialise() {
g_currGraphicalDevice = MODE_EGA;
g_newGraphicalDevice = g_currGraphicalDevice;
- zuul = false;
- tesok = false;
+ g_zuul = false;
+ g_tesok = false;
charpal();
charge_cfiph();
charge_cfiec();
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
- c_zzz = 1;
+ g_c_zzz = 1;
init_nbrepm();
initMouse();
init_lieu();
g_soundOff = false;
- f2_all = false;
+ g_f2_all = false;
teskbd();
dialpre();
@@ -165,7 +165,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
if (g_newGraphicalDevice != g_currGraphicalDevice)
g_currGraphicalDevice = g_newGraphicalDevice;
hirs();
- ades = 0x7000;
+ g_ades = 0x7000;
return Common::kNoError;
}
@@ -481,7 +481,7 @@ Common::Error MortevielleEngine::run() {
*/
void MortevielleEngine::showIntroduction() {
f3f8::aff50(false);
- mlec = 0;
+ g_mlec = 0;
f3f8::checkForF8(142, false);
CHECK_QUIT;
@@ -500,10 +500,10 @@ void MortevielleEngine::showIntroduction() {
* loses, and chooses to start playing the game again.
*/
void MortevielleEngine::mainGame() {
- if (rech_cfiec)
+ if (g_rech_cfiec)
charge_cfiec();
- for (crep = 1; crep <= c_zzz; ++crep)
+ for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep)
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
charge_bruit5();
@@ -553,10 +553,10 @@ void MortevielleEngine::handleAction() {
clsf3();
oo = false;
- ctrm = 0;
- if (! iesc) {
+ g_ctrm = 0;
+ if (!g_iesc) {
g_vm->_menu.drawMenu();
- imen = true;
+ g_imen = true;
temps = 0;
g_key = 0;
funct = false;
@@ -569,27 +569,27 @@ void MortevielleEngine::handleAction() {
moveMouse(funct, inkey);
CHECK_QUIT;
temps = temps + 1;
- } while (!((choisi) || (temps > lim) || (funct) || (anyone)));
+ } while (!((g_choisi) || (temps > lim) || (funct) || (g_anyone)));
_inMainGameLoop = false;
g_vm->_menu.eraseMenu();
- imen = false;
+ g_imen = false;
if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
return;
}
- if (choisi && (g_msg[3] == MENU_SAVE)) {
+ if (g_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 && (g_msg[3] == MENU_LOAD))
+ 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);
return;
} else if (inkey == '\77') {
- if ((mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
- g_msg[4] = mnumo;
+ if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
+ g_msg[4] = g_mnumo;
ecr3(g_vm->getEngineString(S_IDEM));
} else
return;
@@ -610,20 +610,20 @@ void MortevielleEngine::handleAction() {
if (g_num == 9999)
g_num = 0;
} else {
- mnumo = g_msg[3];
+ g_mnumo = g_msg[3];
if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
- mnumo = g_msg[4];
- if (! anyone) {
- if ((fouil) || (obpart)) {
+ g_mnumo = g_msg[4];
+ if (!g_anyone) {
+ if ((g_fouil) || (g_obpart)) {
if (y_s < 12)
return;
if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
oo = true;
- if ((g_msg[4] == OPCODE_LIFT) || (obpart)) {
+ if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
finfouil();
- caff = g_s.mlieu;
- crep = 998;
+ g_caff = g_s.mlieu;
+ g_crep = 998;
} else
tsuiv();
mennor();
@@ -634,17 +634,17 @@ void MortevielleEngine::handleAction() {
if (! oo)
tsitu();
- if ((ctrm == 0) && (! _loseGame) && (! _endGame)) {
+ if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
taffich();
- if (okdes) {
- okdes = false;
+ if (g_okdes) {
+ g_okdes = false;
dessin(0);
}
- if ((! syn) || (g_col))
- repon(2, crep);
+ if ((!g_syn) || (g_col))
+ repon(2, g_crep);
}
- } while (syn);
- if (ctrm != 0)
+ } while (g_syn);
+ if (g_ctrm != 0)
tctrm();
}
}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 9baae57eb6..f26c7051a6 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -260,8 +260,8 @@ void showMouse() {
* @remarks Originally called 'pos_mouse'
*/
void setMousePos(int x, int y) {
- if (x > 314 * res)
- x = 314 * res;
+ if (x > 314 * g_res)
+ x = 314 * g_res;
else if (x < 0)
x = 0;
if (y > 199)
@@ -331,16 +331,16 @@ void moveMouse(bool &funct, char &key) {
cy = 190;
break;
case '9':
- cx = 315 * res;
+ cx = 315 * g_res;
cy = 1;
break;
case '3':
cy = 190;
- cx = 315 * res;
+ cx = 315 * g_res;
break;
case '5':
cy = 100;
- cx = 155 * res;
+ cx = 155 * g_res;
break;
case ' ':
case '\15':
@@ -394,27 +394,27 @@ void moveMouse(bool &funct, char &key) {
}
break;
case 'I':
- cx = res * 32;
+ cx = g_res * 32;
cy = 8;
break;
case 'D':
- cx = 80 * res;
+ cx = 80 * g_res;
cy = 8;
break;
case 'A':
- cx = 126 * res;
+ cx = 126 * g_res;
cy = 8;
break;
case 'S':
- cx = 174 * res;
+ cx = 174 * g_res;
cy = 8;
break;
case 'P':
- cx = 222 * res;
+ cx = 222 * g_res;
cy = 8;
break;
case 'F':
- cx = res * 270;
+ cx = g_res * 270;
cy = 8;
break;
case '\23':
@@ -422,7 +422,7 @@ void moveMouse(bool &funct, char &key) {
return;
break;
case '\26':
- zuul = true;
+ g_zuul = true;
return;
break;
case '\24': // ^T => mode tandy
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 3cc9b342fd..80eeaa7cab 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -174,7 +174,7 @@ void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
/* debug(' .. Afftex');*/
g_vm->_screenSurface.putxy(x, y);
- if (res == 1)
+ if (g_res == 1)
tab = 10;
else
tab = 6;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 7b2dcabee9..1ad58ed996 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -149,7 +149,7 @@ void chartex() {
*/
void dialpre() {
/* debug('o3 dialpre'); */
- crep = 998;
+ g_crep = 998;
int_m = true;
}
@@ -177,7 +177,7 @@ void music() {
if (g_soundOff)
return;
- rech_cfiec = true;
+ g_rech_cfiec = true;
if (!fic.open("mort.img"))
error("Missing file - mort.img");
@@ -222,7 +222,7 @@ void charge_cfiec() {
f.read(&adcfiec[0], 822 * 128);
f.close();
- rech_cfiec = false;
+ g_rech_cfiec = false;
}
@@ -241,16 +241,16 @@ void charge_cfiph() {
void suite() {
hirs();
repon(7, 2035);
- caff = 51;
+ g_caff = 51;
taffich();
teskbd();
if (g_newGraphicalDevice != g_currGraphicalDevice)
g_currGraphicalDevice = g_newGraphicalDevice;
hirs();
- dessine(ades, 0, 0);
+ dessine(g_ades, 0, 0);
Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
- g_vm->_screenSurface.putxy(104 + 72 * res, 185);
+ g_vm->_screenSurface.putxy(104 + 72 * g_res, 185);
g_vm->_screenSurface.writeg(cpr, 0);
}
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index cbe460a43d..9bfbaaf560 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -34,7 +34,7 @@ namespace Mortevielle {
void spfrac(int wor) {
c3.rep = (uint)wor >> 12;
- if ((typlec == 0) && (c3.code != 9))
+ 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;
@@ -47,7 +47,7 @@ void spfrac(int wor) {
void charg_car() {
int wor, int_;
- wor = swap(READ_LE_UINT16(&mem[adword + ptr_word]));
+ wor = swap(READ_LE_UINT16(&mem[adword + g_ptr_word]));
int_ = wor & 0x3f;
if ((int_ >= 0) && (int_ <= 13)) {
@@ -82,13 +82,13 @@ void charg_car() {
}
spfrac(wor);
- ptr_word = ptr_word + 2;
+ g_ptr_word += 2;
}
void entroct(byte o) {
- mem[adtroct * 16 + ptr_oct] = o;
- ++ptr_oct;
+ mem[adtroct * 16 + g_ptr_oct] = o;
+ ++g_ptr_oct;
}
void veracf(byte b) {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 2402e37195..a96edde281 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -54,27 +54,27 @@ void init_chariot() {
void trait_ph() {
const int deca[3] = {300, 30, 40};
- ptr_tcph = num_ph - 1;
- ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
- lefin = swap(t_cph[ptr_tcph + 1]) + deca[typlec];
- nb_word = lefin - ledeb;
- ptr_tcph = (uint)ledeb >> 1;
- ptr_word = 0;
+ 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_nb_word = g_lefin - g_ledeb;
+ g_ptr_tcph = (uint)g_ledeb >> 1;
+ g_ptr_word = 0;
do {
- WRITE_LE_UINT16(&mem[adword + ptr_word], t_cph[ptr_tcph]);
- ptr_word = ptr_word + 2;
- ptr_tcph = ptr_tcph + 1;
- } while (ptr_tcph < (int)((uint)lefin >> 1));
+ WRITE_LE_UINT16(&mem[adword + g_ptr_word], t_cph[g_ptr_tcph]);
+ g_ptr_word += 2;
+ ++g_ptr_tcph;
+ } while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
- ptr_oct = 0;
- ptr_word = 0;
+ g_ptr_oct = 0;
+ g_ptr_word = 0;
init_chariot();
do {
rot_chariot();
charg_car();
trait_car();
- } while (ptr_word < nb_word);
+ } while (g_ptr_word < g_nb_word);
rot_chariot();
trait_car();
@@ -90,10 +90,10 @@ void parole(int rep, int ht, int typ) {
if (g_soundOff)
return;
- num_ph = rep;
+ g_num_ph = rep;
g_haut = ht;
- typlec = typ;
- if (typlec != 0) {
+ g_typlec = typ;
+ if (g_typlec != 0) {
for (int i = 0; i <= 500; ++i)
savph[i] = t_cph[i];
tempo = tempo_bruit;
@@ -118,12 +118,12 @@ void parole(int rep, int ht, int typ) {
}
trait_ph();
g_vm->_soundManager.litph(tbi, typ, tempo);
- if (typlec != 0)
+ if (g_typlec != 0)
for (int i = 0; i <= 500; ++i) {
t_cph[i] = savph[i];
- mlec = typlec;
+ g_mlec = g_typlec;
}
- writepal(numpal);
+ writepal(g_numpal);
}
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 6dd8df10a6..b34e64aa5a 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -52,15 +52,15 @@ void changeGraphicalDevice(int newDevice) {
dessine_rouleau();
tinke();
drawClock();
- if (ipers != 0)
- affper(ipers);
+ if (g_ipers != 0)
+ affper(g_ipers);
else
person();
clsf2();
clsf3();
g_maff = 68;
afdes(0);
- repon(2, crep);
+ repon(2, g_crep);
g_vm->_menu.displayMenu();
}
@@ -74,44 +74,44 @@ void MortevielleEngine::gameLoaded() {
char g[8];
hideMouse();
- imen = false;
+ g_imen = false;
g[1] = 'M';
_loseGame = true;
- anyone = false;
- okdes = true;
+ g_anyone = false;
+ g_okdes = true;
test[0] = false;
test[1] = false;
g[0] = '\040';
g_col = false;
- tesok = true;
+ g_tesok = true;
test[2] = false;
g[7] = g[0];
g[2] = 'A';
- cache = false;
- brt = false;
+ g_cache = false;
+ g_brt = false;
g_maff = 68;
g[5] = 'E';
- mnumo = 0;
- prebru = 0;
+ g_mnumo = 0;
+ g_prebru = 0;
g[4] = 'T';
g_x = 0;
g_y = 0;
g_num = 0;
- hdb = 0;
- hfb = 0;
- cs = 0;
+ g_hdb = 0;
+ g_hfb = 0;
+ g_cs = 0;
is = 0;
k = 0;
- ment = 0;
- syn = true;
- fouil = true;
- mchai = 0;
- inei = 0;
+ g_ment = 0;
+ g_syn = true;
+ g_fouil = true;
+ g_mchai = 0;
+ g_inei = 0;
initouv();
g[3] = 'S';
g[6] = 'R';
- iouv = 0;
- dobj = 0;
+ g_iouv = 0;
+ g_dobj = 0;
affrep();
_hintPctMessage = deline(580);
while ((test[k] == false) && (k < 2)) {
@@ -121,16 +121,16 @@ void MortevielleEngine::gameLoaded() {
// presumably for copy protection. This has been replaced with hardcoded success
test[k] = true;
- okdes = false;
+ g_okdes = false;
_endGame = true;
_loseGame = false;
- fouil = false;
+ g_fouil = false;
}
person();
tinke();
drawClock();
afdes(0);
- repon(2, crep);
+ repon(2, g_crep);
clsf3();
_endGame = false;
tmlieu(g_s.mlieu);
@@ -138,7 +138,7 @@ void MortevielleEngine::gameLoaded() {
if (g_s.derobj != 0)
modobj2(g_s.derobj + 400, test[1], test[2]);
else
- tesok = test[1] || test[2];
+ g_tesok = test[1] || test[2];
showMouse();
}
@@ -161,12 +161,12 @@ void tsitu() {
if (!g_col)
clsf2();
- syn = false;
- iesc = false;
- if (!anyone) {
- if (brt)
+ g_syn = false;
+ g_iesc = false;
+ if (!g_anyone) {
+ if (g_brt)
if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
- ctrm = 4;
+ g_ctrm = 4;
mennor();
return;
}
@@ -226,14 +226,14 @@ void tsitu() {
fctSelfPut();
if (g_msg[4] == OPCODE_SLOOK)
fctSelftLook();
- cache = false;
+ g_cache = false;
if (g_msg[4] == OPCODE_SHIDE)
fctSelfHide();
} else {
- if (anyone) {
+ if (g_anyone) {
quelquun();
- anyone = false;
+ g_anyone = false;
mennor();
return;
}
@@ -245,15 +245,15 @@ void tsitu() {
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;
+ g_crep = 1501;
tperd();
}
if ((g_s.conf > 99) && (h > 0) && (h < 9)) {
- crep = 1508;
+ g_crep = 1508;
tperd();
}
if ((j > 1) && (h > 8) && (!g_vm->_loseGame)) {
- crep = 1502;
+ g_crep = 1502;
tperd();
}
}
@@ -263,13 +263,13 @@ void tsitu() {
/* NIVEAU 1 */
void theure() {
- vj = ord(g_s.heure);
- vh = vj % 48;
- vj /= 48;
- vm = vh % 2;
- vh /= 2;
- g_hour = vh;
- if (vm == 1)
+ g_vj = ord(g_s.heure);
+ g_vh = g_vj % 48;
+ g_vj /= 48;
+ g_vm__ = g_vh % 2;
+ g_vh /= 2;
+ g_hour = g_vh;
+ if (g_vm__ == 1)
g_minute = 30;
else
g_minute = 0;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1694387964..8d9e67f818 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -100,7 +100,7 @@ void taffich() {
int alllum[16];
- int a = caff;
+ int a = g_caff;
if ((a >= 153) && (a <= 161))
a = tran2[a - 153];
else if ((a >= 136) && (a <= 140))
@@ -147,7 +147,7 @@ void taffich() {
break;
}
- okdes = true;
+ g_okdes = true;
hideMouse();
lgt = 0;
Common::String filename;
@@ -221,7 +221,7 @@ void taffich() {
alllum[k] = -1;
}
}
- numpal = npal;
+ g_numpal = npal;
writepal(npal);
if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
@@ -247,9 +247,9 @@ void taffich() {
if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
if ((a == 13) || (a == 14))
person();
- else if (! blo)
+ else if (!g_blo)
t11(g_s.mlieu, cx);
- mpers = 0;
+ g_mpers = 0;
}
}
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 138b604c3a..8873c7e70a 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,95 +78,95 @@ const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
/*------------------------------ VARIABLES ------------------------------*/
/*---------------------------------------------------------------------------*/
-bool blo,
- bh1,
- bf1,
- bh2,
- bh4,
- bf4,
- bh5,
- bh6,
- bh8,
- bt3,
- bt7,
- bh9,
+bool g_blo,
+ g_bh1,
+ g_bf1,
+ g_bh2,
+ g_bh4,
+ g_bf4,
+ g_bh5,
+ g_bh6,
+ g_bh8,
+ g_bt3,
+ g_bt7,
+ g_bh9,
g_soundOff,
- main1,
- choisi,
- test0,
- f2_all,
- imen,
- cache,
- iesc,
+ g_main1,
+ g_choisi,
+ g_test0,
+ g_f2_all,
+ g_imen,
+ g_cache,
+ g_iesc,
g_col,
- syn,
- fouil,
- zuul,
- tesok,
- obpart,
- okdes,
- arret,
- anyone,
- brt,
- rect,
- rech_cfiec;
+ g_syn,
+ g_fouil,
+ g_zuul,
+ g_tesok,
+ g_obpart,
+ g_okdes,
+ g_arret,
+ g_anyone,
+ g_brt,
+ g_rect,
+ g_rech_cfiec;
int g_x,
g_y,
g_t,
- vj,
- li,
- vh,
- vm,
- jh,
- mh,
- cs,
+ g_vj,
+ g_li,
+ g_vh,
+ g_vm__,
+ g_jh,
+ g_mh,
+ g_cs,
g_currGraphicalDevice,
- hdb,
- hfb,
+ g_hdb,
+ g_hfb,
g_hour,
g_day,
g_key,
g_minute,
g_num,
- res,
- ment,
+ g_res,
+ g_ment,
g_haut,
- caff,
+ g_caff,
g_maff,
- crep,
- ades,
- iouv,
- inei,
- ctrm,
- dobj,
- msg3,
- msg4,
- mlec,
+ g_crep,
+ g_ades,
+ g_iouv,
+ g_inei,
+ g_ctrm,
+ g_dobj,
+ g_msg3,
+ g_msg4,
+ g_mlec,
g_newGraphicalDevice,
- c_zzz,
- mchai,
- menup,
- ipers,
- ledeb,
- lefin,
- mpers,
- mnumo,
- xprec,
- yprec,
- perdep,
- prebru,
- typlec,
- num_ph,
- numpal,
- nb_word,
- ptr_oct,
- k_tempo,
- ptr_tcph,
- ptr_word,
- color_txt;
+ g_c_zzz,
+ g_mchai,
+ g_menup,
+ g_ipers,
+ g_ledeb,
+ g_lefin,
+ g_mpers,
+ g_mnumo,
+ g_xprec,
+ g_yprec,
+ g_perdep,
+ g_prebru,
+ g_typlec,
+ g_num_ph,
+ g_numpal,
+ g_nb_word,
+ g_ptr_oct,
+ g_k_tempo,
+ g_ptr_tcph,
+ g_ptr_word,
+ g_color_txt;
int t_cph[6401];
byte tabdon[4001];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 1ccea2c7b3..3b2e44d843 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -219,94 +219,94 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
/*------------------------------ VARIABLES ------------------------------*/
/*---------------------------------------------------------------------------*/
-extern bool blo,
- bh1,
- bf1,
- bh2,
- bh4,
- bf4,
- bh5,
- bh6,
- bh8,
- bt3,
- bt7,
- bh9,
+extern bool g_blo,
+ g_bh1,
+ g_bf1,
+ g_bh2,
+ g_bh4,
+ g_bf4,
+ g_bh5,
+ g_bh6,
+ g_bh8,
+ g_bt3,
+ g_bt7,
+ g_bh9,
g_soundOff,
- main1,
- choisi,
- test0,
- f2_all,
- imen,
- cache,
- iesc,
+ g_main1,
+ g_choisi,
+ g_test0,
+ g_f2_all,
+ g_imen,
+ g_cache,
+ g_iesc,
g_col,
- syn,
- fouil,
- zuul,
- tesok,
- obpart,
- okdes,
- anyone,
- brt,
- rect,
- rech_cfiec;
+ g_syn,
+ g_fouil,
+ g_zuul,
+ g_tesok,
+ g_obpart,
+ g_okdes,
+ g_anyone,
+ g_brt,
+ g_rect,
+ g_rech_cfiec;
extern int g_x,
g_y,
g_t,
- vj,
- li,
- vh,
- vm,
- jh,
- mh,
- cs,
+ g_vj,
+ g_li,
+ g_vh,
+ g_vm__,
+ g_jh,
+ g_mh,
+ g_cs,
g_currGraphicalDevice,
- hdb,
- hfb,
+ g_hdb,
+ g_hfb,
g_hour,
g_day,
g_key,
g_minute,
g_num,
- res,
- ment,
+ g_res,
+ g_ment,
g_haut,
- caff,
+ g_caff,
g_maff,
- crep,
- ades,
- iouv,
- inei,
- ctrm,
- dobj,
- msg3,
- msg4,
- mlec,
+ g_crep,
+ g_ades,
+ g_iouv,
+ g_inei,
+ g_ctrm,
+ g_dobj,
+ g_msg3,
+ g_msg4,
+ g_mlec,
g_newGraphicalDevice,
- c_zzz,
- mchai,
- menup,
- ipers,
- ledeb,
- lefin,
- mpers,
- mnumo,
- xprec,
- yprec,
- perdep,
- prebru,
- typlec,
- num_ph,
- numpal,
- nb_word,
- ptr_oct,
- k_tempo,
- ptr_tcph,
- ptr_word,
- color_txt;
+ g_c_zzz,
+ g_mchai,
+ g_menup,
+ g_ipers,
+ g_ledeb,
+ g_lefin,
+ g_mpers,
+ g_mnumo,
+ g_xprec,
+ g_yprec,
+ g_perdep,
+ g_prebru,
+ g_typlec,
+ g_num_ph,
+ g_numpal,
+ g_nb_word,
+ g_ptr_oct,
+ g_k_tempo,
+ g_ptr_tcph,
+ g_ptr_word,
+ g_color_txt;
extern int t_cph[6401];
extern byte tabdon[4001];