aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-03-05 23:59:21 +0100
committerStrangerke2012-04-06 08:22:48 +0200
commitb40b00b1c46a615ea346f6eea4c6f42f2d4e356d (patch)
tree45be0e77a064ed9a37571f55bb41612c11cf4798
parent203dcdaf4afdf42024fa013a1375a8865bf34875 (diff)
downloadscummvm-rg350-b40b00b1c46a615ea346f6eea4c6f42f2d4e356d.tar.gz
scummvm-rg350-b40b00b1c46a615ea346f6eea4c6f42f2d4e356d.tar.bz2
scummvm-rg350-b40b00b1c46a615ea346f6eea4c6f42f2d4e356d.zip
MORTEVIELLE: Some more renaming
-rw-r--r--engines/mortevielle/actions.cpp8
-rw-r--r--engines/mortevielle/mor.cpp441
-rw-r--r--engines/mortevielle/mor.h32
-rw-r--r--engines/mortevielle/mor2.cpp27
-rw-r--r--engines/mortevielle/prog.cpp33
-rw-r--r--engines/mortevielle/taffich.cpp2
6 files changed, 282 insertions, 261 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 01dd5b4665..0bcfd67046 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -711,7 +711,7 @@ void fctPlace() {
if (g_ipers != 0)
showPeoplePresent(g_ipers);
else
- person();
+ displayAloneText();
g_vm->_menu.displayMenu();
if (enterPassageFl) {
@@ -1063,7 +1063,7 @@ void fctListen() {
else {
becfren(l);
int j, h, m;
- calch(j, h, m);
+ updateHour(j, h, m);
rand = getRandomNumber(1, 100);
if ((h >= 0) && (h < 8)) {
if (rand > 30)
@@ -1096,7 +1096,7 @@ void fctEat() {
tmlieu(g_s._currPlace);
int j, h, m;
- calch(j, h, m);
+ updateHour(j, h, m);
if ((h == 12) || (h == 13) || (h == 19)) {
g_s._faithScore -= (g_s._faithScore / 7);
if (h == 12) {
@@ -1204,7 +1204,7 @@ void fctSleep() {
clsf2();
ecrf2();
ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
- calch(j, h, m);
+ updateHour(j, h, m);
int answer;
do {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e2a7facfcf..ef5800e993 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -269,17 +269,21 @@ void paint_rect(int x, int y, int dx, int dy) {
g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
}
-void calch(int &j, int &h, int &m) {
- int nh = readclock();
- 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;
+/**
+ * Engine function - Update hour
+ * @remarks Originally called 'calch'
+ */
+void updateHour(int &day, int &hour, int &minute) {
+ int newHour = readclock();
+ int th = g_jh + ((newHour - g_mh) / g_t);
+ minute = ((th % 2) + g_vm__) * 30;
+ hour = ((uint)th >> 1) + g_vh;
+ if (minute == 60) {
+ minute = 0;
+ ++hour;
}
- j = (h / 24) + g_vj;
- h = h - ((j - g_vj) * 24);
+ day = (hour / 24) + g_vj;
+ hour = hour - ((day - g_vj) * 24);
}
void conv(int x, int &y) {
@@ -486,90 +490,106 @@ void choix(int min, int max, int &per) {
per = 255 - per;
}
-void cpl1(int &p) {
- int j, h, m;
+int cpl1() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
+ updateHour(day, hour, minute);
// The original uses an || instead of an &&, resulting
// in an always true condition. Based on the other tests,
// and on other scenes, we use an && instead.
- // if ((h > 7) || (h < 11))
- if ((h > 7) && (h < 11))
- p = 25;
- else if ((h > 10) && (h < 14))
- p = 35;
- else if ((h > 13) && (h < 16))
- p = 50;
- else if ((h > 15) && (h < 18))
- p = 5;
- else if ((h > 17) && (h < 22))
- p = 35;
- else if ((h > 21) && (h < 24))
- p = 50;
- else if ((h >= 0) && (h < 8))
- p = 70;
+ if ((hour > 7) && (hour < 11))
+ retVal = 25;
+ else if ((hour > 10) && (hour < 14))
+ retVal = 35;
+ else if ((hour > 13) && (hour < 16))
+ retVal = 50;
+ else if ((hour > 15) && (hour < 18))
+ retVal = 5;
+ else if ((hour > 17) && (hour < 22))
+ retVal = 35;
+ else if ((hour > 21) && (hour < 24))
+ retVal = 50;
+ else if ((hour >= 0) && (hour < 8))
+ retVal = 70;
g_vm->_menu.mdn();
+
+ return retVal;
}
-void cpl2(int &p) {
- int j, h, m;
+int cpl2() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if ((h > 7) && (h < 11))
- p = -2;
- if (h == 11)
- p = 100;
- if ((h > 11) && (h < 23))
- p = 10;
- if (h == 23)
- p = 20;
- if ((h >= 0) && (h < 8))
- p = 50;
+ updateHour(day, hour, minute);
+ if ((hour > 7) && (hour < 11))
+ retVal = -2;
+ else if (hour == 11)
+ retVal = 100;
+ else if ((hour > 11) && (hour < 23))
+ retVal = 10;
+ else if (hour == 23)
+ retVal = 20;
+ else if ((hour >= 0) && (hour < 8))
+ retVal = 50;
+
+ return retVal;
}
-void cpl3(int &p) {
- int j, h, m;
+int cpl3() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))
- p = 34;
- if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))
- p = 0;
+ updateHour(day, hour, minute);
+ if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
+ retVal = 34;
+ else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
+ retVal = 0;
+
+ return retVal;
}
-void cpl5(int &p) {
- int j, h, m;
+int cpl5() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if ((h > 6) && (h < 10))
- p = 0;
- if (h == 10)
- p = 100;
- if ((h > 10) && (h < 24))
- p = 15;
- if ((h >= 0) && (h < 7))
- p = 50;
+ updateHour(day, hour, minute);
+ if ((hour > 6) && (hour < 10))
+ retVal = 0;
+ else if (hour == 10)
+ retVal = 100;
+ else if ((hour > 10) && (hour < 24))
+ retVal = 15;
+ else if ((hour >= 0) && (hour < 7))
+ retVal = 50;
+
+ return retVal;
}
-void cpl6(int &p) {
- int j, h, m;
+int cpl6() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))
- p = -2;
- if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))
- p = 35;
- if (h == 17)
- p = 100;
- if ((h >= 0) && (h < 8))
- p = 60;
+ updateHour(day, hour, minute);
+ if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
+ retVal = -2;
+ else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
+ retVal = 35;
+ else if (hour == 17)
+ retVal = 100;
+ else if ((hour >= 0) && (hour < 8))
+ retVal = 60;
+
+ return retVal;
}
/**
- * Shows the you are alone message in the status area on the right hand side of the screen
+ * Shows the "you are alone" message in the status area
+ * on the right hand side of the screen
+ * @remarks Originally called 'person'
*/
-void person() {
+void displayAloneText() {
for (int cf = 1; cf <= 8; ++cf)
g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cf]);
@@ -660,89 +680,95 @@ void debloc(int l) {
g_mpers = g_ipers;
}
-void cpl10(int &p, int &h) {
- int j, m;
+void cpl10(int &p, int &hour) {
+ int day, minute;
- calch(j, h, m);
- if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+ updateHour(day, hour, minute);
+ if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
p = 100;
- if ((h == 11) || ((h > 20) && (h < 24)))
+ else if ((hour == 11) || ((hour > 20) && (hour < 24)))
p = 45;
- if (((h > 13) && (h < 17)) || (h == 18))
+ else if (((hour > 13) && (hour < 17)) || (hour == 18))
p = 35;
- if (h == 17)
+ else if (hour == 17)
p = 60;
- if ((h >= 0) && (h < 8))
+ else if ((hour >= 0) && (hour < 8))
p = 5;
}
-void cpl11(int &p, int &h) {
- int j, m;
+void cpl11(int &p, int &hour) {
+ int day, minute;
- calch(j, h, m);
- if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))
+ updateHour(day, hour, minute);
+ if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
p = 25;
- if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+ else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
p = 5;
- if ((h > 13) && (h < 17))
+ else if ((hour > 13) && (hour < 17))
p = 55;
- if ((h > 16) && (h < 19))
+ else if ((hour > 16) && (hour < 19))
p = 45;
- if ((h >= 0) && (h < 9))
+ else if ((hour >= 0) && (hour < 9))
p = 0;
}
-void cpl12(int &p) {
- int j, h, m;
+int cpl12() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))
- p = 55;
- if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))
- p = 25;
- if ((h >= 0) && (h < 5))
- p = 0;
- if ((h > 4) && (h < 9))
- p = 15;
+ updateHour(day, hour, minute);
+ if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
+ retVal = 55;
+ else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
+ retVal = 25;
+ else if ((hour >= 0) && (hour < 5))
+ retVal = 0;
+ else if ((hour > 4) && (hour < 9))
+ retVal = 15;
+
+ return retVal;
}
-void cpl13(int &p) {
- p = 0;
+int cpl13() {
+ return 0;
}
-void cpl15(int &p) {
- int j, h, m;
+int cpl15() {
+ int day, hour, minute;
+ int retVal = 0;
- calch(j, h, m);
- if ((h > 7) && (h < 12))
- p = 25;
- else if ((h > 11) && (h < 14))
- p = 0;
- else if ((h > 13) && (h < 18))
- p = 10;
- else if ((h > 17) && (h < 20))
- p = 55;
- else if ((h > 19) && (h < 22))
- p = 5;
- else if ((h > 21) && (h < 24))
- p = 15;
- else if ((h >= 0) && (h < 8))
- p = -15;
+ updateHour(day, hour, minute);
+ if ((hour > 7) && (hour < 12))
+ retVal = 25;
+ else if ((hour > 11) && (hour < 14))
+ retVal = 0;
+ else if ((hour > 13) && (hour < 18))
+ retVal = 10;
+ else if ((hour > 17) && (hour < 20))
+ retVal = 55;
+ else if ((hour > 19) && (hour < 22))
+ retVal = 5;
+ else if ((hour > 21) && (hour < 24))
+ retVal = 15;
+ else if ((hour >= 0) && (hour < 8))
+ retVal = -15;
+
+ return retVal;
}
-void cpl20(int &p, int &h) {
- int j, m;
+void cpl20(int &p, int &hour) {
+ int day, minute;
- calch(j, h, m);
- if (h == 10)
+ updateHour(day, hour, minute);
+ if (hour == 10)
p = 65;
- else if ((h > 10) && (h < 21))
+ else if ((hour > 10) && (hour < 21))
p = 5;
- else if ((h > 20) && (h < 24))
+ else if ((hour > 20) && (hour < 24))
p = -15;
- else if ((h >= 0) && (h < 5))
+ else if ((hour >= 0) && (hour < 5))
p = -300;
- else if ((h > 4) && (h < 10))
+ else if ((hour > 4) && (hour < 10))
p = -5;
}
@@ -806,23 +832,23 @@ void setPresenceRedRoom(int l) {
* Engine function - Check who is in the Dining Room
* @remarks Originally called 'quelq10'
*/
-int setPresenceDiningRoom(int h) {
+int setPresenceDiningRoom(int hour) {
int retVal = 0;
- if ((h >= 0) && (h < 8))
+ if ((hour >= 0) && (hour < 8))
retVal = chlm();
else {
int min = 0, max = 0;
- if ((h > 7) && (h < 10)) {
+ if ((hour > 7) && (hour < 10)) {
min = 5;
max = 7;
- } else if ((h > 9) && (h < 12)) {
+ } else if ((hour > 9) && (hour < 12)) {
min = 1;
max = 4;
- } else if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
+ } else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
min = 6;
max = 8;
- } else if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
+ } else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
min = 1;
max = 5;
}
@@ -837,20 +863,20 @@ int setPresenceDiningRoom(int h) {
* Engine function - Check who is in the Bureau
* @remarks Originally called 'quelq11'
*/
-int setPresenceBureau(int h) {
+int setPresenceBureau(int hour) {
int retVal = 0;
- if ((h >= 0) && (h < 8))
+ if ((hour >= 0) && (hour < 8))
retVal = chlm();
else {
int min = 0, max = 0;
- if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
+ if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
min = 1;
max = 3;
- } else if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
+ } else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
min = 1;
max = 4;
- } else if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
+ } else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
min = 1;
max = 2;
}
@@ -902,20 +928,20 @@ int setPresenceLanding() {
* Engine function - Check who is in the chapel
* @remarks Originally called 'quelq20'
*/
-int setPresenceChapel(int h) {
+int setPresenceChapel(int hour) {
int retVal = 0;
- if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
+ if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
retVal = chlm();
else {
int min = 0, max = 0;
- if ((h > 9) && (h < 12)) {
+ if ((hour > 9) && (hour < 12)) {
min = 3;
max = 7;
- } else if ((h > 11) && (h < 18)) {
+ } else if ((hour > 11) && (hour < 18)) {
min = 1;
max = 2;
- } else if (h == 18) {
+ } else if (hour == 18) {
min = 2;
max = 4;
}
@@ -928,10 +954,10 @@ int setPresenceChapel(int h) {
void frap() {
- int j, h, m;
+ int day, hour, minute;
- calch(j, h, m);
- if ((h >= 0) && (h < 8))
+ updateHour(day, hour, minute);
+ if ((hour >= 0) && (hour < 8))
g_crep = 190;
else {
if (getRandomNumber(1, 100) > 70)
@@ -992,25 +1018,25 @@ void tip(int ip, int &cx) {
void ecfren(int &p, int &rand, int cf, int l) {
if (l == 0)
- person();
+ displayAloneText();
p = -500;
rand = 0;
if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
- cpl1(p);
+ p = cpl1();
if ((l == 2) && (!g_bh2) && (!g_bh9))
- cpl2(p);
+ p = cpl2();
if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
- cpl3(p);
+ p = cpl3();
if ((l == 5) && (!g_bh5))
- cpl5(p);
+ p = cpl5();
if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
- cpl6(p);
+ p = cpl6();
if ((l == 9) && (!g_bh9) && (!g_bh2))
p = 10;
if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
p = -400;
if (p != -500) {
- p = p + cf;
+ p += cf;
rand = getRandomNumber(1, 100);
}
}
@@ -1113,12 +1139,12 @@ void dprog() {
void pl1(int cf) {
if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
- int p, rand;
- cpl1(p);
+ int p = cpl1();
+ int rand;
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
setPresenceGreenRoom(g_li);
}
@@ -1126,12 +1152,12 @@ void pl1(int cf) {
void pl2(int cf) {
if (!g_bh2) {
- int p, rand;
- cpl2(p);
+ int p = cpl2();
+ int rand;
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
setPresencePurpleRoom();
}
@@ -1139,12 +1165,13 @@ void pl2(int cf) {
void pl5(int cf) {
if (!g_bh5) {
- int p, rand;
- cpl5(p);
+ int p = cpl5();
+ int rand;
+
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
setPresenceBlueRoom();
}
@@ -1152,12 +1179,13 @@ void pl5(int cf) {
void pl6(int cf) {
if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
- int p, rand;
- cpl6(p);
+ int p = cpl6();
+ int rand;
+
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
setPresenceRedRoom(g_li);
}
@@ -1170,7 +1198,7 @@ void pl9(int cf) {
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
setPresencePurpleRoom();
}
@@ -1182,9 +1210,9 @@ void pl10(int cf) {
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceDiningRoom(h);
+ setPresenceDiningRoom(h);
}
void pl11(int cf) {
@@ -1193,42 +1221,42 @@ void pl11(int cf) {
cpl11(p, h);
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceBureau(h);
+ setPresenceBureau(h);
}
void pl12(int cf) {
int p, rand;
- cpl12(p);
+ p = cpl12();
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceKitchen();
+ setPresenceKitchen();
}
void pl13(int cf) {
int p, rand;
- cpl13(p);
+ p = cpl13();
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceKitchen();
+ setPresenceKitchen();
}
void pl15(int cf) {
int p, rand;
- cpl15(p);
+ p = cpl15();
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceLanding();
+ setPresenceLanding();
}
void pl20(int cf) {
@@ -1237,9 +1265,9 @@ void pl20(int cf) {
cpl20(p, h);
phaz(rand, p, cf);
if (rand > p)
- person();
+ displayAloneText();
else
- p = setPresenceChapel(h);
+ setPresenceChapel(h);
}
void t11(int l11, int &a) {
@@ -1250,7 +1278,7 @@ void t11(int l11, int &a) {
if ((l11 > 0) && (l11 < 10)) {
if (p != -500) {
if (rand > p) {
- person();
+ displayAloneText();
a = 0;
} else {
becfren(g_li);
@@ -1262,36 +1290,36 @@ void t11(int l11, int &a) {
if (l11 > 9) {
if ((l11 > 15) && (l11 != 20) && (l11 != 26))
- person();
+ displayAloneText();
else {
int h = 0;
if (l11 == 10)
cpl10(p, h);
- if (l11 == 11)
+ else if (l11 == 11)
cpl11(p, h);
- if (l11 == 12)
- cpl12(p);
- if ((l11 == 13) || (l11 == 14))
- cpl13(p);
- if ((l11 == 15) || (l11 == 26))
- cpl15(p);
- if (l11 == 20)
+ else if (l11 == 12)
+ p = cpl12();
+ else if ((l11 == 13) || (l11 == 14))
+ p = cpl13();
+ else if ((l11 == 15) || (l11 == 26))
+ p = cpl15();
+ else if (l11 == 20)
cpl20(p, h);
p += g_s._faithScore;
rand = getRandomNumber(1, 100);
if (rand > p) {
- person();
+ displayAloneText();
a = 0;
} else {
if (l11 == 10)
p = setPresenceDiningRoom(h);
- if (l11 == 11)
+ else if (l11 == 11)
p = setPresenceBureau(h);
- if ((l11 == 12) || (l11 == 13) || (l11 == 14))
+ else if ((l11 == 12) || (l11 == 13) || (l11 == 14))
p = setPresenceKitchen();
- if ((l11 == 15) || (l11 == 26))
+ else if ((l11 == 15) || (l11 == 26))
p = setPresenceLanding();
- if (l11 == 20)
+ else if (l11 == 20)
p = setPresenceChapel(h);
a = p;
}
@@ -1313,7 +1341,7 @@ void cavegre() {
// It has been removed
clsf3();
- person();
+ displayAloneText();
}
void writetp(Common::String s, int t) {
@@ -1329,8 +1357,7 @@ void aniof(int ouf, int num) {
if ((g_caff == 10) && (num == 7))
num = 6;
-
- if (g_caff == 12) {
+ else if (g_caff == 12) {
if (num == 3)
num = 4;
else if (num == 4)
@@ -1362,24 +1389,23 @@ void musique(int so) {
i = true;
}
}
- if (g_s._currPlace == CHAPEL) {
+ else if (g_s._currPlace == CHAPEL) {
if (getRandomNumber(1, 2) == 1) {
parole(8, 1, 1);
i = true;
}
}
-
- if (g_s._currPlace == WELL) {
+ else if (g_s._currPlace == WELL) {
if (getRandomNumber(1, 2) == 2) {
parole(12, 1, 1);
i = true;
}
}
-
- if (g_s._currPlace == 23) {
+ else if (g_s._currPlace == 23) {
parole(13, 1, 1);
i = true;
}
+
if (!i)
parole(getRandomNumber(1, 17), 1, 2);
}
@@ -1412,14 +1438,11 @@ void dessin(int ad) {
if (g_s._atticRodHoleObjectId == 159)
aniof(1, 6);
- }
- if ((g_caff == 14) && (g_s._cellarObjectId == 151))
+ } else if ((g_caff == 14) && (g_s._cellarObjectId == 151))
aniof(1, 2);
-
- if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
+ else if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
aniof(1, 1);
-
- if ((g_caff == 24) && (g_s._wellObjectId != 0))
+ else if ((g_caff == 24) && (g_s._wellObjectId != 0))
aniof(1, 1);
}
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 514bd73d98..066392c879 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -54,7 +54,7 @@ extern void ecrf7();
extern void clsf10();
extern void stop();
extern void paint_rect(int x, int y, int dx, int dy);
-extern void calch(int &j, int &h, int &m);
+extern void updateHour(int &day, int &hour, int &minute);
extern void conv(int x, int &y);
/* NIVEAU 12 */
extern void modobj(int m);
@@ -62,33 +62,33 @@ extern void repon(int f, int m);
extern void t5(int cx);
extern void showPeoplePresent(int per);
extern void choix(int min, int max, int &per);
-extern void cpl1(int &p);
-extern void cpl2(int &p);
-extern void cpl3(int &p);
-extern void cpl5(int &p);
-extern void cpl6(int &p);
-extern void person();
+extern int cpl1();
+extern int cpl2();
+extern int cpl3();
+extern int cpl5();
+extern int cpl6();
+extern void displayAloneText();
extern int chlm();
extern void drawClock();
/*************
* NIVEAU 11 *
*************/
extern void debloc(int l);
-extern void cpl10(int &p, int &h);
-extern void cpl11(int &p, int &h);
-extern void cpl12(int &p);
-extern void cpl13(int &p);
-extern void cpl15(int &p);
-extern void cpl20(int &p, int &h);
+extern void cpl10(int &p, int &hour);
+extern void cpl11(int &p, int &hour);
+extern int cpl12();
+extern int cpl13();
+extern int cpl15();
+extern void cpl20(int &p, int &hour);
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 setPresenceDiningRoom(int hour);
+extern int setPresenceBureau(int hour);
extern int setPresenceKitchen();
extern int setPresenceLanding();
-extern int setPresenceChapel(int h);
+extern int setPresenceChapel(int hour);
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 c98b399114..8776336002 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -46,13 +46,13 @@ void tinke() {
const char d4 = ']';
const char d5 = '1';
Common::String d6 = g_vm->getEngineString(S_OK);
- int cx, cf, j, h, m;
+ int cx, cf, day, hour, minute;
Common::String stpo;
g_anyone = false;
- calch(j, h, m);
- if (j != g_day) {
- g_day = j;
+ updateHour(day, hour, minute);
+ if (day != g_day) {
+ g_day = day;
cx = 0;
do {
++cx;
@@ -61,8 +61,8 @@ void tinke() {
g_nbrep[cx] = 0;
} while (cx != 8);
}
- if ((h > g_hour) || ((h == 0) && (g_hour == 23))) {
- g_hour = h;
+ if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
+ g_hour = hour;
g_minute = 0;
drawClock();
cf = 0;
@@ -89,7 +89,7 @@ void tinke() {
g_hintPctMessage += d6;
g_hintPctMessage += d4;
}
- if (m > g_minute) {
+ if (minute > g_minute) {
g_minute = 30;
drawClock();
}
@@ -97,7 +97,7 @@ void tinke() {
return;
if (!g_blo) {
- if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
+ if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
g_t = ti2;
else
g_t = ti1;
@@ -484,10 +484,10 @@ void ajjer(int ob) {
}
void t1sama() { //Entering manor
- int j, h, m;
+ int day, hour, minute;
- calch(j, h, m);
- if ((h < 5) && (g_s._currPlace > 18)) {
+ updateHour(day, hour, minute);
+ if ((hour < 5) && (g_s._currPlace > 18)) {
bool d;
cherjer(137, d);
if (!d) { //You don't have the keys, and it's late
@@ -515,11 +515,10 @@ void t1sama() { //Entering manor
affrep();
t5(10);
if (!g_blo)
- t11(0, m);
+ t11(0, minute);
g_ipers = 0;
g_mpers = 0;
g_s._ipre = true;
- /*chech;*/
} else
st1sama();
}
@@ -605,7 +604,7 @@ L1:
int rand = (getRandomNumber(0, 4)) - 2;
parole(3, rand, 1);
clsf2();
- person();
+ displayAloneText();
debloc(21);
affrep();
}
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 606b417cef..f011cc891f 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -55,7 +55,7 @@ void changeGraphicalDevice(int newDevice) {
if (g_ipers != 0)
showPeoplePresent(g_ipers);
else
- person();
+ displayAloneText();
clsf2();
clsf3();
g_maff = 68;
@@ -115,7 +115,7 @@ void MortevielleEngine::gameLoaded() {
_loseGame = false;
g_heroSearching = false;
- person();
+ displayAloneText();
tinke();
drawClock();
afdes(0);
@@ -133,19 +133,17 @@ void MortevielleEngine::gameLoaded() {
/* NIVEAU 3 */
/* procedure PROGRAMME */
void tmaj3() {
- int j, h, m;
+ int day, hour, minute;
- calch(j, h, m);
- if (m == 30)
- m = 1;
- h += j * 24;
- m += h * 2;
- g_s._heure = chr(m);
+ updateHour(day, hour, minute);
+ if (minute == 30)
+ minute = 1;
+ hour += day * 24;
+ minute += hour * 2;
+ g_s._heure = chr(minute);
}
void tsitu() {
- int h, j, m;
-
if (!g_col)
clsf2();
g_syn = false;
@@ -225,21 +223,22 @@ void tsitu() {
return;
}
}
- calch(j, h, m);
- if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._currPlace != 10)) ||
- ((h > 0) && (h < 6) && (g_s._currPlace != 0)))
+ int hour, day, minute;
+ updateHour(day, hour, minute);
+ if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
+ ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
++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._faithScore > 99) && (h > 8) && (h < 16)) {
+ if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
g_crep = 1501;
tperd();
}
- if ((g_s._faithScore > 99) && (h > 0) && (h < 9)) {
+ if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
g_crep = 1508;
tperd();
}
- if ((j > 1) && (h > 8) && (!g_vm->_loseGame)) {
+ if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
g_crep = 1502;
tperd();
}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 00d9dca3ef..3e21a35742 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -250,7 +250,7 @@ void taffich() {
showMouse();
if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
if ((a == 13) || (a == 14))
- person();
+ displayAloneText();
else if (!g_blo)
t11(g_s._currPlace, cx);
g_mpers = 0;