Skip to content

Commit

Permalink
MORTEVIELLE: clean up while statements using separate 'not'
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Apr 6, 2012
1 parent 1cce075 commit d1420c9
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 55 deletions.
22 changes: 11 additions & 11 deletions engines/mortevielle/actions.cpp
Expand Up @@ -89,7 +89,7 @@ void fctMove() {
cx = 0;
do {
++cx;
} while (!(g_vm->_menu._depl[cx] == msg[4]));
} while (g_vm->_menu._depl[cx] != msg[4]);
if (s.mlieu == 19) {
if (cx == 1)
t1deva();
Expand Down Expand Up @@ -297,14 +297,14 @@ void tsprendre() {
cx = 0;
do {
++cx;
} while (!(g_vm->_menu._invt[cx] == msg[4]));
} while (g_vm->_menu._invt[cx] != msg[4]);
cz = 0;
cy = 0;
do {
++cy;
if (ord(s.sjer[cy]) != 0)
++cz;
} while (!(cz == cx));
} while (cz != cx);
cz = ord(s.sjer[cy]);
s.sjer[cy] = chr(0);
modinv();
Expand Down Expand Up @@ -491,7 +491,7 @@ void fctSearch() {
cx = 0;
do {
++cx;
} while (!((cx > 6) || (num == ord(touv[cx]))));
} while ((cx <= 6) && (num != ord(touv[cx])));
if (num != ord(touv[cx]))
crep = 187;
else {
Expand Down Expand Up @@ -848,7 +848,7 @@ void fctClose() {
cx = 0;
do {
++cx;
} while (!((cx > 6) || (num == ord(touv[cx]))));
} while ((cx <= 6) && (num != ord(touv[cx])));
if (num == ord(touv[cx])) {
aniof(2, num);
crep = 998;
Expand Down Expand Up @@ -941,7 +941,7 @@ void fctPut() {
cx = 0;
do {
++cx;
} while (!((cx > 6) || (num == ord(touv[cx]))));
} while ((cx <= 6) && (num != ord(touv[cx])));
if (num != ord(touv[cx]))
crep = 187;
else {
Expand Down Expand Up @@ -1174,7 +1174,7 @@ void fctSleep() {
tinke();
answer = Alert::show(g_vm->getString(S_YES_NO), 1);
anyone = false;
} while (!(answer == 1));
} while (answer != 1);
crep = 998;
num = 0;
}
Expand Down Expand Up @@ -1262,7 +1262,7 @@ void fctWait() {
}
repon(2, 102);
answer = Alert::show(g_vm->getString(S_YES_NO), 1);
} while (!(answer == 2));
} while (answer != 2);
crep = 998;
if (!anyone)
tinke();
Expand Down Expand Up @@ -1303,7 +1303,7 @@ void fctDiscuss() {
cx = 0;
do {
++cx;
} while (!(g_vm->_menu._disc[cx] == msg[4]));
} while (g_vm->_menu._disc[cx] != msg[4]);
caff = 69 + cx;
afdes(0);
repon(2, caff);
Expand Down Expand Up @@ -1345,7 +1345,7 @@ void fctDiscuss() {
co = 320;
} else
lig = lig + 8;
} while (!(icm == 42));
} while (icm != 42);
g_vm->_screenSurface.putxy(320, 176);
writetp(lib[46], 0);
tou = '\0';
Expand Down Expand Up @@ -1458,7 +1458,7 @@ void fctDiscuss() {
hirs();
showMouse();
}
} while (!((choi == 46) || (suj == 138)));
} while ((choi != 46) && (suj != 138));
if (col) {
s.conf = s.conf + (3 * (s.conf / 10));
hideMouse();
Expand Down
10 changes: 5 additions & 5 deletions engines/mortevielle/dialogs.cpp
Expand Up @@ -87,7 +87,7 @@ int Alert::show(const Common::String &msg, int n) {
g_vm->_screenSurface._textPos.y += 6;
g_vm->_screenSurface.writeg(st, 4);
++i;
} while (!(chaine[i] == ']'));
} while (chaine[i] != ']');
}
if (caseNumb == 1)
esp = nbcol - 40;
Expand Down Expand Up @@ -263,7 +263,7 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
++i;
ch = c[i];
str[l] += ch;
} while (!(c[i + 1] == ']'));
} while (c[i + 1] != ']');
i += 2;

while (str[l].size() < 3)
Expand Down Expand Up @@ -413,7 +413,7 @@ bool Ques::show() {
// tesok is set to true in testprot()
tesok = true;
}
} while (!(indx == 10));
} while (indx != 10);

return (correctCount == 10) && protectionCheck;
}
Expand Down Expand Up @@ -458,7 +458,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
hirs();
aff50(drawAni50Fl);
}
} while (!(key == 66)); // keycode for F8
} while (key != 66); // keycode for F8
}

/**
Expand All @@ -469,7 +469,7 @@ void f3f8::waitForF3F8(int &key) {
do {
key = testou();
CHECK_QUIT;
} while (!((key == 61) || (key == 66)));
} while ((key != 61) && (key != 66));
}

void f3f8::aff50(bool drawAni50Fl) {
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/graphics.cpp
Expand Up @@ -1117,7 +1117,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
do {
g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
i = i + step;
} while (!(i == yy));
} while (i != yy);
} else {
a = (float)((y - yy)) / (x - xx);
b = ((yro * xr) - (yr * xro)) / (x - xx);
Expand All @@ -1127,7 +1127,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
do {
g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
i = i + step;
} while (!(i == xx));
} while (i != xx);
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/level15.cpp
Expand Up @@ -41,7 +41,7 @@ void copcha() {
do {
tabdon[i] = tabdon[i + 390];
++i;
} while (!(i == acha + 390));
} while (i != acha + 390);
}

bool dans_rect(rectangle r) {
Expand Down
10 changes: 5 additions & 5 deletions engines/mortevielle/menu.cpp
Expand Up @@ -177,11 +177,11 @@ void Menu::menu_aff() {
}
++ind_tabl;
++k;
} while (!(k == 3));
} while (k != 3);
++y;
} while (!(y == 9));
} while (y != 9);
col += 48 * res;
} while (!(num_letr == 6));
} while (num_letr != 6);
showMouse();
}

Expand Down Expand Up @@ -347,7 +347,7 @@ void Menu::menuDown(int ii) {
break;
}
g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
} while (!(cx == nb_lig));
} while (cx != nb_lig);
test0 = true;
showMouse();
}
Expand Down Expand Up @@ -504,7 +504,7 @@ void Menu::initMenu() {
_dis[i] = delig + ' ';
}
++i;
} while (!(i == 22));
} while (i != 22);
for (i = 1; i <= 8; ++i) {
_disc[i] = 0x500 + i;
if (i < 8)
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mor.cpp
Expand Up @@ -874,7 +874,7 @@ void quelq15(int &per) {
((cx == 6) && bh1) ||
((cx == 7) && bf1) ||
((cx == 8) && bh5));
} while (!(! test));
} while (test);

conv(cx, per);
affper(per);
Expand Down
10 changes: 5 additions & 5 deletions engines/mortevielle/mor2.cpp
Expand Up @@ -60,7 +60,7 @@ void tinke() {
if (nbrepm[cx] != 0)
--nbrepm[cx];
nbrep[cx] = 0;
} while (!(cx == 8));
} while (cx != 8);
}
if ((h > _hour) || ((h == 0) && (_hour == 23))) {
_hour = h;
Expand Down Expand Up @@ -414,7 +414,7 @@ void sparl(float adr, float rep) {
parole(repint, haut[caff - 69], 0);
f3f8::waitForF3F8(key);
CHECK_QUIT;
} while (!(key == 66));
} while (key != 66);
hirs();
showMouse();
}
Expand Down Expand Up @@ -455,7 +455,7 @@ void ajchai() {
int cx = 0;
do {
++cx;
} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
} while ((cx <= 9) && (tabdon[cy + cx] != 0));

if (tabdon[cy + cx] == 0) {
int lderobj = s.derobj;
Expand All @@ -468,7 +468,7 @@ void ajjer(int ob) {
int cx = 0;
do {
++cx;
} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
} while ((cx <= 5) && (ord(s.sjer[cx]) != 0));

if (ord(s.sjer[cx]) == 0) {
s.sjer[(cx)] = chr(ob);
Expand Down Expand Up @@ -620,7 +620,7 @@ void tsuiv() {
cs = cs + 1;
cl = cy + cs;
tbcl = tabdon[cl];
} while (!((tbcl != 0) || (cs > 9)));
} while ((tbcl == 0) && (cs <= 9));

if ((tbcl != 0) && (cs < 11)) {
is = is + 1;
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mortevielle.cpp
Expand Up @@ -630,7 +630,7 @@ void MortevielleEngine::handleAction() {
if ((! syn) || (col))
repon(2, crep);
}
} while (!(! syn));
} while (syn);
if (ctrm != 0)
tctrm();
}
Expand Down
20 changes: 10 additions & 10 deletions engines/mortevielle/mouse.cpp
Expand Up @@ -100,7 +100,7 @@ void hideMouse() {
WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
j += 80;
++k;
} while (!(k >= 5));
} while (k < 5);
break;
case MODE_AMSTRAD1512:
for (i = 0; i <= 3; ++i) {
Expand All @@ -117,7 +117,7 @@ void hideMouse() {
}
imp = !imp;
++k;
} while (!(k >= 8));
} while (k < 8);
}
break;
case MODE_EGA:
Expand All @@ -136,9 +136,9 @@ void hideMouse() {
mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
j += 80;
++k;
} while (!(k >= 8));
} while (k < 8);
++i;
} while (!(i == 4));
} while (i != 4);
break;
case MODE_HERCULES:
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
Expand All @@ -158,7 +158,7 @@ void hideMouse() {
}
j += 160;
++k;
} while (!(k == 3));
} while (k != 3);
break;
default:
break;
Expand Down Expand Up @@ -191,7 +191,7 @@ void showMouse() {
s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
j += 80;
++k;
} while (!(k >= 5));
} while (k < 5);
break;
case MODE_AMSTRAD1512:
for (i = 0; i <= 3; ++i) {
Expand All @@ -209,7 +209,7 @@ void showMouse() {
}
imp = !imp;
++k;
} while (!(k >= 8));
} while (k < 8);
}
break;
case MODE_EGA:
Expand All @@ -223,9 +223,9 @@ void showMouse() {
s_s[l][k] = mem[0xa000 * 16 + j] + (mem[(0xa000 * 16) + j + 1] << 8);
j += 80;
++k;
} while (!(k >= 8));
} while (k < 8);
++l;
} while (!(l == 4));
} while (l != 4);
break;
case MODE_HERCULES:
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
Expand All @@ -245,7 +245,7 @@ void showMouse() {
}
j += 160;
++k;
} while (!(k == 3));
} while (k != 3);
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/outtext.cpp
Expand Up @@ -222,9 +222,9 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
g_vm->_screenSurface.putxy(j, i);
g_vm->_screenSurface.writeg(" ", 0);
j += 6;
} while (!(j > xf));
} while (j <= xf);
i += 6;
} while (!(i > yf));
} while (i <= yf);
yc = y;
}
g_vm->_screenSurface.putxy(xc, yc);
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/ovd1.cpp
Expand Up @@ -183,7 +183,7 @@ void music() {
fic.read(&mem[0x47a0 * 16 + 0], 123);
fic.close();

g_vm->_soundManager.demus(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
addfix = (float)((tempo_mus - addv[1])) / 256;
cctable(tbi);

Expand Down

0 comments on commit d1420c9

Please sign in to comment.