Skip to content

Commit

Permalink
MORTEVIELLE: Start renaming globals
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Apr 6, 2012
1 parent e81636f commit 7155d01
Show file tree
Hide file tree
Showing 18 changed files with 896 additions and 894 deletions.
594 changes: 298 additions & 296 deletions engines/mortevielle/actions.cpp

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions engines/mortevielle/dialogs.cpp
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -308,7 +308,7 @@ bool Ques::show() {
showMouse();
++indx;
int dialogHeight;
if (res == 1)
if (g_res == 1)
dialogHeight = 29;
else
dialogHeight = 23;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand All @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions engines/mortevielle/graphics.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/keyboard.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/level15.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 7155d01

Please sign in to comment.