MORTEVIELLE: Rename some more variables and functions

This commit is contained in:
Strangerke 2012-02-21 00:33:48 +01:00
parent acd636dc2c
commit 3904af5306
9 changed files with 61 additions and 58 deletions

View File

@ -621,7 +621,6 @@ void fctOpen() {
* @remarks Originally called 'tmettre'
*/
void fctPlace() {
int quel;
bool entre;
char st[1410];
Common::String str_;
@ -669,8 +668,8 @@ void fctPlace() {
repon(2, 165);
maivid();
parole(6, -9, 1);
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
if (quel == 1) {
int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
if (answer== 1) {
deline(582, st, tay);
i = Alert::show(delig, 1);
tesok = false;
@ -682,7 +681,7 @@ void fctPlace() {
clsf3();
showMouse();
tinke();
pendule();
drawClock();
if (ipers != 0)
affper(ipers);
else
@ -745,8 +744,6 @@ void fctPlace() {
* @remarks Originally called 'ttourner'
*/
void fctTurn() {
int quel;
if (caff > 99) {
crep = 149;
return;
@ -762,8 +759,8 @@ void fctTurn() {
if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
repon(2, 167);
parole(7, 9, 1);
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
if (quel == 1)
int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
if (answer == 1)
g_vm->_endGame = true;
else
crep = 168;
@ -772,8 +769,8 @@ void fctTurn() {
repon(2, 175);
clsf3();
parole(6, -9, 1);
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
if (quel == 1) {
int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
if (answer == 1) {
s.mlieu = 16;
affrep();
} else
@ -1137,7 +1134,7 @@ void fctEnter() {
* @remarks Originally called 'tdormir'
*/
void fctSleep() {
int z, j, h, m, quel;
int z, j, h, m;
if ((s.mlieu > 15) && (s.mlieu < 26)) {
crep = 148;
@ -1156,6 +1153,8 @@ void fctSleep() {
ecrf2();
ecr2(g_vm->getString(S_WANT_TO_WAKE_UP));
calch(j, h, m);
int answer;
do {
if (h < 8) {
s.conf = s.conf - (s.conf / 20);
@ -1170,9 +1169,9 @@ void fctSleep() {
if (h > 23)
h = 0;
tinke();
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
answer = Alert::show(g_vm->getString(S_YES_NO), 1);
anyone = false;
} while (!(quel == 1));
} while (!(answer == 1));
crep = 998;
num = 0;
}
@ -1240,6 +1239,8 @@ void fctWait() {
mpers = 0;
clsf3();
int answer;
do {
++jh;
tinke();
@ -1257,8 +1258,8 @@ void fctWait() {
return;
}
repon(2, 102);
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
} while (!(quel == 2));
answer = Alert::show(g_vm->getString(S_YES_NO), 1);
} while (!(answer == 2));
crep = 998;
if (!anyone)
tinke();
@ -1472,7 +1473,7 @@ void fctDiscuss() {
showMouse();
affper(ipers);
tinke();
pendule();
drawClock();
affrep();
/* chech;*/
tmlieu(s.mlieu);
@ -1551,7 +1552,7 @@ void MortevielleEngine::endGame() {
* @remarks Originally called 'tencore'
*/
void MortevielleEngine::loseGame() {
int quel;
int answer;
clsf2();
musique(0);
@ -1562,12 +1563,12 @@ void MortevielleEngine::loseGame() {
vh = 10;
vm = 0;
vj = 0;
min = 0;
heu = 10;
jou = 0;
_minute = 0;
_hour = 10;
_day = 0;
repon(2, 180);
quel = Alert::show(g_vm->getString(S_YES_NO), 1);
_quitGame = (quel != 1);
answer = Alert::show(g_vm->getString(S_YES_NO), 1);
_quitGame = (answer != 1);
}
} // End of namespace Mortevielle

View File

@ -1098,7 +1098,7 @@ int ScreenSurface::getStringWidth(const Common::String &s) {
return s.size() * charWidth;
}
void ScreenSurface::droite(int x, int y, int xx, int yy, int coul) {
void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
int step, i;
float a, b;
float xr, yr, xro, yro;

View File

@ -92,7 +92,7 @@ public:
void putxy(int x, int y) { _textPos = Common::Point(x, y); }
void writeg(const Common::String &l, int c);
int getStringWidth(const Common::String &s);
void droite(int x, int y, int xx, int yy, int coul);
void drawLine(int x, int y, int xx, int yy, int coul);
// TODO: Refactor code to remove this method, for increased performance
void setPixel(const Common::Point &pt, int palIndex);

View File

@ -618,7 +618,7 @@ void chlm(int &per) {
if (per == 2) per = 128;
}
void pendule() {
void drawClock() {
const int cv[3][13] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 5, 8, 10, 8, 5, 0, -5, -8, -10, -8, -5, 0 },
@ -638,30 +638,30 @@ void pendule() {
co = 0;
else co = 1;
if (min == 0)
g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
if (_minute == 0)
g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
else
g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
h = heu;
h = _hour;
if (h > 12)
h -= 12;
if (h == 0)
h = 12;
g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
showMouse();
g_vm->_screenSurface.putxy(568, 154);
if (heu > 11)
if (_hour > 11)
g_vm->_screenSurface.writeg("PM ", 1);
else
g_vm->_screenSurface.writeg("AM ", 1);
g_vm->_screenSurface.putxy(550, 160);
if ((jou >= 0) && (jou <= 8)) {
if ((_day >= 0) && (_day <= 8)) {
Common::String tmp = g_vm->getString(S_DAY);
tmp.insertChar((char)(jou + 49), 0);
tmp.insertChar((char)(_day + 49), 0);
g_vm->_screenSurface.writeg(tmp, 1);
}
}

View File

@ -72,7 +72,7 @@ extern void cpl5(int &p);
extern void cpl6(int &p);
extern void person();
extern void chlm(int &per);
extern void pendule();
extern void drawClock();
/*************
* NIVEAU 11 *
*************/

View File

@ -58,8 +58,8 @@ void tinke() {
anyone = false;
calch(j, h, m);
if (j != jou) {
jou = j;
if (j != _day) {
_day = j;
cx = 0;
do {
++cx;
@ -68,10 +68,10 @@ void tinke() {
nbrep[cx] = 0;
} while (!(cx == 8));
}
if ((h > heu) || ((h == 0) && (heu == 23))) {
heu = h;
min = 0;
pendule();
if ((h > _hour) || ((h == 0) && (_hour == 23))) {
_hour = h;
_minute = 0;
drawClock();
cf = 0;
for (cx = 1; cx <= 10; cx ++) {
if (s.pourc[cx] == '*')
@ -96,9 +96,9 @@ void tinke() {
stpou += d6;
stpou += d4;
}
if (m > min) {
min = 30;
pendule();
if (m > _minute) {
_minute = 30;
drawClock();
}
if (y_s < 12)
return;
@ -110,16 +110,16 @@ void tinke() {
t = ti1;
cf = s.conf;
if ((cf > 33) && (cf < 66))
t = t - (t / 3);
t -= (t / 3);
if (cf > 65)
t = t - ((t / 3) * 2);
t -= ((t / 3) * 2);
nh = readclock();
if ((nh - mh) > t) {
am = g_vm->_menu._menuActive;
g_vm->_menu.eraseMenu();
jh = jh + ((nh - mh) / t);
jh += ((nh - mh) / t);
mh = nh;
switch (li) {
case 1:
@ -516,7 +516,7 @@ void t1sama() { //Entering manor
premtet();
sparl(0, 140);
dessine_rouleau();
pendule();
drawClock();
showMouse();
s.mlieu = 0;
affrep();

View File

@ -46,7 +46,7 @@ void change_gd(int ngd) {
showMouse();
dessine_rouleau();
tinke();
pendule();
drawClock();
if (ipers != 0) affper(ipers);
else person();
clsf2();
@ -122,7 +122,7 @@ void MortevielleEngine::gameLoaded() {
}
person();
tinke();
pendule();
drawClock();
afdes(0);
repon(2, crep);
clsf3();
@ -254,9 +254,11 @@ void theure() {
vj = vj / 48;
vm = vh % 2;
vh = vh / 2;
heu = vh;
if (vm == 1) min = 30;
else min = 0;
_hour = vh;
if (vm == 1)
_minute = 30;
else
_minute = 0;
}
} // End of namespace Mortevielle

View File

@ -127,10 +127,10 @@ int x,
gd, /* Gd = graph device */
hdb,
hfb,
heu,
jou,
_hour,
_day,
key,
min,
_minute,
num,
max,
res,

View File

@ -276,10 +276,10 @@ extern int x,
gd, /* Gd = graph device */
hdb,
hfb,
heu,
jou,
_hour,
_day,
key,
min,
_minute,
num,
max,
res,