aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2012-03-05 07:45:43 +0100
committerStrangerke2012-04-06 08:22:40 +0200
commit1ee4429601c0e009196d66d3e676deeb85b11b49 (patch)
tree530f3bfe949eed4d1db11ab45a2efd566ac5124e /engines
parent573925641204aac35361c1750af73658641edd8a (diff)
downloadscummvm-rg350-1ee4429601c0e009196d66d3e676deeb85b11b49.tar.gz
scummvm-rg350-1ee4429601c0e009196d66d3e676deeb85b11b49.tar.bz2
scummvm-rg350-1ee4429601c0e009196d66d3e676deeb85b11b49.zip
MORTEVIELLE: Rename some more functions and globals
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/actions.cpp42
-rw-r--r--engines/mortevielle/mor.cpp174
-rw-r--r--engines/mortevielle/mor.h18
-rw-r--r--engines/mortevielle/mor2.cpp18
-rw-r--r--engines/mortevielle/prog.cpp6
-rw-r--r--engines/mortevielle/saveload.cpp2
-rw-r--r--engines/mortevielle/var_mor.h2
7 files changed, 155 insertions, 107 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6b9388ab33..22c12d6a67 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -164,7 +164,7 @@ void fctMove() {
g_crep = 997;
else if (g_s._wellObjectId == 120)
g_crep = 181;
- else if (g_s._conf > 80) {
+ else if (g_s._faithScore > 80) {
g_crep = 1505;
tperd();
} else {
@@ -189,7 +189,7 @@ void fctTake() {
avpoing(cx);
if (g_crep != 139) {
if (g_ipers > 0)
- g_s._conf += 3;
+ g_s._faithScore += 3;
if (g_obpart) {
if (g_s._currPlace == PURPLE_ROOM)
g_s._purpleRoomObjectId = 0;
@@ -215,7 +215,7 @@ void fctTake() {
tsuiv();
++g_dobj;
if (g_dobj > 6) {
- g_s._conf += 2;
+ g_s._faithScore += 2;
g_dobj = 0;
}
}
@@ -239,7 +239,7 @@ void fctTake() {
tcoord(8);
if (g_num != 0) {
if (g_ipers > 0)
- g_s._conf += 3;
+ g_s._faithScore += 3;
g_crep = 997;
if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
avpoing(g_s._purpleRoomObjectId);
@@ -335,7 +335,7 @@ void fctLift() {
tcoord(8);
if (g_num != 0) {
if (g_ipers > 0)
- ++g_s._conf;
+ ++g_s._faithScore;
g_crep = 997;
if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
treg(g_s._purpleRoomObjectId);
@@ -343,7 +343,7 @@ void fctLift() {
return;
}
if (g_ipers > 0)
- ++g_s._conf;
+ ++g_s._faithScore;
int tmpPlace = g_s._currPlace;
if (g_s._currPlace == CRYPT)
tmpPlace = 14;
@@ -510,7 +510,7 @@ void fctSearch() {
g_crep = 187;
else {
if (g_ipers > 0)
- g_s._conf += 3;
+ g_s._faithScore += 3;
rechai(g_mchai);
if (g_mchai != 0) {
@@ -527,7 +527,7 @@ void fctSearch() {
g_crep = 997;
if (g_num != 0) {
if (g_ipers > 0)
- g_s._conf += 3;
+ g_s._faithScore += 3;
if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
if (g_s._currPlace == PURPLE_ROOM) {
g_crep = 123;
@@ -544,7 +544,7 @@ void fctSearch() {
}
} else {
if (g_ipers > 0)
- g_s._conf += 3;
+ g_s._faithScore += 3;
g_crep = 997;
if (g_s._currPlace < CELLAR)
g_crep = r[g_s._currPlace];
@@ -606,7 +606,7 @@ void fctOpen() {
tcoord(7);
if (g_num != 0) {
if (g_ipers > 0)
- g_s._conf += 2;
+ g_s._faithScore += 2;
++g_iouv;
int tmpPlace = 0;
do {
@@ -930,7 +930,7 @@ void fctKnock() {
int rand = (getRandomNumber(0, 8)) - 4;
parole(11, rand, 1);
int p;
- ecfren(p, rand, g_s._conf, g_ment);
+ ecfren(p, rand, g_s._faithScore, g_ment);
int l = g_ment;
if (l != 0) {
if (p != -500) {
@@ -1052,9 +1052,9 @@ void fctListen() {
g_crep = 101;
else {
if (g_ipers != 0)
- ++g_s._conf;
+ ++g_s._faithScore;
int p, rand;
- ecfren(p, rand, g_s._conf, g_ment);
+ ecfren(p, rand, g_s._faithScore, g_ment);
int l = g_ment;
if (l != 0) {
if (p != -500) {
@@ -1098,7 +1098,7 @@ void fctEat() {
int j, h, m;
calch(j, h, m);
if ((h == 12) || (h == 13) || (h == 19)) {
- g_s._conf -= (g_s._conf / 7);
+ g_s._faithScore -= (g_s._faithScore / 7);
if (h == 12) {
if (m == 0)
h = 4;
@@ -1150,7 +1150,7 @@ void fctEnter() {
aniof(1, 1);
tip(z, g_x);
- ++g_s._conf;
+ ++g_s._faithScore;
g_s._currPlace = LANDING;
g_msg[3] = MENU_DISCUSS;
g_msg[4] = g_vm->_menu._discussMenu[g_x];
@@ -1209,7 +1209,7 @@ void fctSleep() {
int answer;
do {
if (h < 8) {
- g_s._conf -= (g_s._conf / 20);
+ g_s._faithScore -= (g_s._faithScore / 20);
z = (7 - h) * 2;
if (m == 30)
--z;
@@ -1243,7 +1243,7 @@ void fctForce() {
g_crep = 997;
else {
g_crep = 143;
- g_s._conf += 2;
+ g_s._faithScore += 2;
}
}
}
@@ -1475,14 +1475,14 @@ void fctDiscuss() {
suj = 129;
else {
suj = 138;
- g_s._conf += (3 * (g_s._conf / 10));
+ g_s._faithScore += (3 * (g_s._faithScore / 10));
}
} 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_s._faithScore += g_tabdon[arcf + ix];
++g_nbrep[g_caff - 69];
} else {
- g_s._conf += 3;
+ g_s._faithScore += 3;
suj = 139;
}
hideMouse();
@@ -1509,7 +1509,7 @@ void fctDiscuss() {
}
} while ((choi != 46) && (suj != 138));
if (g_col) {
- g_s._conf += (3 * (g_s._conf / 10));
+ g_s._faithScore += (3 * (g_s._faithScore / 10));
hideMouse();
hirs();
premtet();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d6d52367e4..82d0ef1979 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -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._faithScore < 33)
st = g_vm->getEngineString(S_COOL);
- else if (g_s._conf < 66)
+ else if (g_s._faithScore < 66)
st = g_vm->getEngineString(S_LOURDE);
- else if (g_s._conf > 65)
+ else if (g_s._faithScore > 65)
st = g_vm->getEngineString(S_MALSAINE);
co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
@@ -746,10 +746,12 @@ void cpl20(int &p, int &h) {
p = -5;
}
-void quelq1(int l) {
- int per;
-
- per = getRandomNumber(1, 2);
+/**
+ * Engine function - Check who is in the Green Room
+ * @remarks Originally called 'quelq1'
+ */
+void setPresenceGreenRoom(int l) {
+ int per = getRandomNumber(1, 2);
if (l == 1) {
if (per == 1)
g_bh1 = true;
@@ -765,7 +767,11 @@ void quelq1(int l) {
g_ipers = 10;
}
-void quelq2() {
+/**
+ * Engine function - Check who is in the Purple Room
+ * @remarks Originally called 'quelq2'
+ */
+void setPresencePurpleRoom() {
if (g_li == 2)
g_bh2 = true;
else
@@ -774,12 +780,20 @@ void quelq2() {
g_ipers = 10;
}
-void quelq5() {
+/**
+ * Engine function - Check who is in the Blue Room
+ * @remarks Originally called 'quelq5'
+ */
+void setPresenceBlueRoom() {
g_bh5 = true;
g_ipers = 10;
}
-void quelq6(int l) {
+/**
+ * Engine function - Check who is in the Red Room
+ * @remarks Originally called 'quelq6'
+ */
+void setPresenceRedRoom(int l) {
if (l == 6)
g_bh6 = true;
else if (l == 8)
@@ -788,9 +802,15 @@ void quelq6(int l) {
g_ipers = 10;
}
-void quelq10(int h, int &per) {
+/**
+ * Engine function - Check who is in the Dining Room
+ * @remarks Originally called 'quelq10'
+ */
+int setPresenceDiningRoom(int h) {
+ int retVal = 0;
+
if ((h >= 0) && (h < 8))
- per = chlm();
+ retVal = chlm();
else {
int min = 0, max = 0;
if ((h > 7) && (h < 10)) {
@@ -806,14 +826,22 @@ void quelq10(int h, int &per) {
min = 1;
max = 5;
}
- choix(min, max, per);
+ choix(min, max, retVal);
}
- affper(per);
+ affper(retVal);
+
+ return retVal;
}
-void quelq11(int h, int &per) {
+/**
+ * Engine function - Check who is in the Bureau
+ * @remarks Originally called 'quelq11'
+ */
+int setPresenceBureau(int h) {
+ int retVal = 0;
+
if ((h >= 0) && (h < 8))
- per = chlm();
+ retVal = chlm();
else {
int min = 0, max = 0;
if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
@@ -826,41 +854,59 @@ void quelq11(int h, int &per) {
min = 1;
max = 2;
}
- choix(min, max, per);
+ choix(min, max, retVal);
}
- affper(per);
-}
+ affper(retVal);
-void quelq12(int &per) {
- per = chlm();
- affper(per);
+ return retVal;
}
-void quelq15(int &per) {
- int cx;
- bool test;
+/**
+ * Engine function - Check who is in the Kitchen
+ * @remarks Originally called 'quelq12'
+ */
+int setPresenceKitchen() {
+ int retVal = chlm();
+ affper(retVal);
- per = 0;
+ return retVal;
+}
+/**
+ * Engine function - Check who is in the Landing
+ * @remarks Originally called 'quelq15'
+ */
+int setPresenceLanding() {
+ bool test = false;
+ int rand = 0;
do {
- cx = getRandomNumber(1, 8);
- 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));
+ rand = getRandomNumber(1, 8);
+ test = (((rand == 1) && (g_bh2 || g_bh9)) ||
+ ((rand == 2) && g_bh8) ||
+ ((rand == 3) && g_bh4) ||
+ ((rand == 4) && g_bf4) ||
+ ((rand == 5) && g_bh6) ||
+ ((rand == 6) && g_bh1) ||
+ ((rand == 7) && g_bf1) ||
+ ((rand == 8) && g_bh5));
} while (test);
- conv(cx, per);
- affper(per);
+ int retVal = 0;
+ conv(rand, retVal);
+ affper(retVal);
+
+ return retVal;
}
-void quelq20(int h, int &per) {
+/**
+ * Engine function - Check who is in the chapel
+ * @remarks Originally called 'quelq20'
+ */
+int setPresenceChapel(int h) {
+ int retVal = 0;
+
if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
- per = chlm();
+ retVal = chlm();
else {
int min = 0, max = 0;
if ((h > 9) && (h < 12)) {
@@ -873,9 +919,11 @@ void quelq20(int h, int &per) {
min = 2;
max = 4;
}
- choix(min, max, per);
+ choix(min, max, retVal);
}
- affper(per);
+ affper(retVal);
+
+ return retVal;
}
@@ -1022,7 +1070,7 @@ void inzon() {
g_s._secretPassageObjectId = 0;
g_s._purpleRoomObjectId = 136;
g_s._cryptObjectId = 141;
- g_s._conf = getRandomNumber(4, 10);
+ g_s._faithScore = getRandomNumber(4, 10);
g_s._currPlace = MANOR_FRONT;
for (int cx = 2; cx <= 6; ++cx)
@@ -1072,7 +1120,7 @@ void pl1(int cf) {
if (rand > p)
person();
else
- quelq1(g_li);
+ setPresenceGreenRoom(g_li);
}
}
@@ -1085,7 +1133,7 @@ void pl2(int cf) {
if (rand > p)
person();
else
- quelq2();
+ setPresencePurpleRoom();
}
}
@@ -1098,7 +1146,7 @@ void pl5(int cf) {
if (rand > p)
person();
else
- quelq5();
+ setPresenceBlueRoom();
}
}
@@ -1111,7 +1159,7 @@ void pl6(int cf) {
if (rand > p)
person();
else
- quelq6(g_li);
+ setPresenceRedRoom(g_li);
}
}
@@ -1124,7 +1172,7 @@ void pl9(int cf) {
if (rand > p)
person();
else
- quelq2();
+ setPresencePurpleRoom();
}
}
@@ -1136,7 +1184,7 @@ void pl10(int cf) {
if (rand > p)
person();
else
- quelq10(h, p);
+ p = setPresenceDiningRoom(h);
}
void pl11(int cf) {
@@ -1147,7 +1195,7 @@ void pl11(int cf) {
if (rand > p)
person();
else
- quelq11(h, p);
+ p = setPresenceBureau(h);
}
void pl12(int cf) {
@@ -1158,7 +1206,7 @@ void pl12(int cf) {
if (rand > p)
person();
else
- quelq12(p);
+ p = setPresenceKitchen();
}
void pl13(int cf) {
@@ -1169,7 +1217,7 @@ void pl13(int cf) {
if (rand > p)
person();
else
- quelq12(p);
+ p = setPresenceKitchen();
}
void pl15(int cf) {
@@ -1180,7 +1228,7 @@ void pl15(int cf) {
if (rand > p)
person();
else
- quelq15(p);
+ p = setPresenceLanding();
}
void pl20(int cf) {
@@ -1191,13 +1239,13 @@ void pl20(int cf) {
if (rand > p)
person();
else
- quelq20(h, p);
+ p = setPresenceChapel(h);
}
void t11(int l11, int &a) {
int p, rand;
- ecfren(p, rand, g_s._conf, l11);
+ ecfren(p, rand, g_s._faithScore, l11);
g_li = l11;
if ((l11 > 0) && (l11 < 10)) {
if (p != -500) {
@@ -1229,22 +1277,22 @@ void t11(int l11, int &a) {
cpl15(p);
if (l11 == 20)
cpl20(p, h);
- p += g_s._conf;
+ p += g_s._faithScore;
rand = getRandomNumber(1, 100);
if (rand > p) {
person();
a = 0;
} else {
if (l11 == 10)
- quelq10(h, p);
+ p = setPresenceDiningRoom(h);
if (l11 == 11)
- quelq11(h, p);
+ p = setPresenceBureau(h);
if ((l11 == 12) || (l11 == 13) || (l11 == 14))
- quelq12(p);
+ p = setPresenceKitchen();
if ((l11 == 15) || (l11 == 26))
- quelq15(p);
+ p = setPresenceLanding();
if (l11 == 20)
- quelq20(h, p);
+ p = setPresenceChapel(h);
a = p;
}
}
@@ -1252,9 +1300,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._faithScore += 2;
+ if (g_s._faithScore > 69)
+ g_s._faithScore += (g_s._faithScore / 10);
clsf3();
ecrf2();
ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 87238c4217..14172c74b8 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -80,15 +80,15 @@ extern void cpl12(int &p);
extern void cpl13(int &p);
extern void cpl15(int &p);
extern void cpl20(int &p, int &h);
-extern void quelq1(int l);
-extern void quelq2();
-extern void quelq5();
-extern void quelq6(int l);
-extern void quelq10(int h, int &per);
-extern void quelq11(int h, int &per);
-extern void quelq12(int &per);
-extern void quelq15(int &per);
-extern void quelq20(int h, int &per);
+extern void setPresenceGreenRoom(int l);
+extern void setPresencePurpleRoom();
+extern void setPresenceBlueRoom();
+extern void setPresenceRedRoom(int l);
+extern int setPresenceDiningRoom(int h);
+extern int setPresenceBureau(int h);
+extern int setPresenceKitchen();
+extern int setPresenceLanding();
+extern int setPresenceChapel(int h);
extern void frap();
extern void nouvp(int l, int &p);
extern void tip(int ip, int &cx);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 28692eac83..a35a4e9860 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -101,7 +101,7 @@ void tinke() {
g_t = ti2;
else
g_t = ti1;
- cf = g_s._conf;
+ cf = g_s._faithScore;
if ((cf > 33) && (cf < 66))
g_t -= (g_t / 3);
@@ -313,10 +313,10 @@ void tperd() {
void tsort() {
if ((g_iouv > 0) && (g_s._currPlace != 0)) {
- if (g_s._conf < 50)
- g_s._conf += 2;
+ if (g_s._faithScore < 50)
+ g_s._faithScore += 2;
else
- g_s._conf += (g_s._conf / 10);
+ g_s._faithScore += (g_s._faithScore / 10);
}
for (int cx = 1; cx <= 7; ++cx)
@@ -573,11 +573,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._faithScore += 2;
+ else if (g_s._faithScore < 50)
+ g_s._faithScore += 4;
else
- g_s._conf += 3 * (g_s._conf / 10);
+ g_s._faithScore += 3 * (g_s._faithScore / 10);
tsort();
tmlieu(15);
int cx;
@@ -625,7 +625,7 @@ void tsuiv() {
g_caff = tbcl;
g_crep = g_caff + 400;
if (g_ipers != 0)
- g_s._conf += 2;
+ g_s._faithScore += 2;
} else {
affrep();
endSearch();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 46bde5ee53..078813b9a0 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -228,14 +228,14 @@ void tsitu() {
calch(j, h, m);
if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._currPlace != 10)) ||
((h > 0) && (h < 6) && (g_s._currPlace != 0)))
- ++g_s._conf;
+ ++g_s._faithScore;
if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
&& (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
- if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
+ if ((g_s._faithScore > 99) && (h > 8) && (h < 16)) {
g_crep = 1501;
tperd();
}
- if ((g_s._conf > 99) && (h > 0) && (h < 9)) {
+ if ((g_s._faithScore > 99) && (h > 0) && (h < 9)) {
g_crep = 1508;
tperd();
}
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 386fd95ef5..a53d218c86 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -49,7 +49,7 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
* Handle saving or loading savegame data
*/
void SavegameManager::sync_save(Common::Serializer &sz) {
- sz.syncAsSint16LE(g_s1._conf);
+ sz.syncAsSint16LE(g_s1._faithScore);
sz.syncBytes((byte *)&g_s1._pourc[0], 11);
sz.syncBytes((byte *)&g_s1._teauto[0], 43);
sz.syncBytes((byte *)&g_s1._sjer[0], 31);
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 8c661437a9..11bc4e0fe4 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -161,7 +161,7 @@ enum places {
};
struct sav_chaine {
- int _conf;
+ int _faithScore;
byte _pourc[11];
byte _teauto[43];
byte _sjer[31];