Skip to content

Commit

Permalink
MORTEVIELLE: some more renaming, match menu item size in setText()
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Apr 6, 2012
1 parent a2bfb13 commit c539a3b
Show file tree
Hide file tree
Showing 20 changed files with 143 additions and 151 deletions.
35 changes: 17 additions & 18 deletions engines/mortevielle/actions.cpp
Expand Up @@ -47,8 +47,6 @@ namespace Mortevielle {
* @remarks Originally called 'taller'
*/
void fctMove() {
int cx;

if ((g_s._currPlace == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
g_s._currPlace = LANDING;
g_caff = g_s._currPlace;
Expand Down Expand Up @@ -85,7 +83,7 @@ void fctMove() {
return;
}
tsort();
cx = 0;
int cx = 0;
do {
++cx;
} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
Expand All @@ -95,15 +93,17 @@ void fctMove() {
t1deva();
if (cx == 2)
t1neig();
goto L2;
tmlieu(g_s._currPlace);
return;
}

if (g_s._currPlace == 23) {
if (cx == 1)
t1deau();
if (cx == 2)
t1derr();
goto L2;
tmlieu(g_s._currPlace);
return;
}

if ((g_s._currPlace == BUREAU) && (cx == 1))
Expand Down Expand Up @@ -175,7 +175,6 @@ void fctMove() {
if ((cx < 5) || (cx == 13) || (cx == 14))
affrep();
debloc(g_s._currPlace);
L2:
tmlieu(g_s._currPlace);
}

Expand Down Expand Up @@ -315,7 +314,7 @@ void fctInventoryTake() {
modinv();
avpoing(cz);
g_crep = 998;
clsf2();
clearScreenType2();
}

/**
Expand Down Expand Up @@ -623,7 +622,7 @@ void fctOpen() {
|| ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
|| (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
if (getRandomNumber(1, 4) == 3)
parole(7, 9, 1);
startSpeech(7, 9, 1);
}
g_touv[tmpPlace] = chr(g_num);
aniof(1, g_num);
Expand Down Expand Up @@ -691,7 +690,7 @@ void fctPlace() {
aniof(1, 1);
repon(2, 165);
maivid();
parole(6, -9, 1);
startSpeech(6, -9, 1);

// Do you want to enter the hidden passage?
int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
Expand All @@ -703,7 +702,7 @@ void fctPlace() {
hideMouse();
hirs();
dessine_rouleau();
clsf2();
clearScreenType2();
clsf3();
showMouse();
tinke();
Expand Down Expand Up @@ -792,7 +791,7 @@ void fctTurn() {
g_crep = 997;
if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
repon(2, 167);
parole(7, 9, 1);
startSpeech(7, 9, 1);
int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
if (answer == 1)
g_vm->_endGame = true;
Expand All @@ -802,7 +801,7 @@ void fctTurn() {
if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
repon(2, 175);
clsf3();
parole(6, -9, 1);
startSpeech(6, -9, 1);
int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
if (answer == 1) {
g_s._currPlace = CRYPT;
Expand Down Expand Up @@ -928,7 +927,7 @@ void fctKnock() {

if (g_s._currPlace == 26) {
int rand = (getRandomNumber(0, 8)) - 4;
parole(11, rand, 1);
startSpeech(11, rand, 1);
int p;
ecfren(p, rand, g_s._faithScore, g_ment);
int l = g_ment;
Expand Down Expand Up @@ -1146,7 +1145,7 @@ void fctEnter() {
g_crep = 179;
else {
g_x = (getRandomNumber(0, 10)) - 5;
parole(7, g_x, 1);
startSpeech(7, g_x, 1);
aniof(1, 1);

g_x = convertBitIndexToCharacterIndex(z);
Expand All @@ -1167,7 +1166,7 @@ void fctEnter() {
}
} else {
g_x = (getRandomNumber(0, 10)) - 5;
parole(7, g_x, 1);
startSpeech(7, g_x, 1);
aniof(1, 1);

g_s._currPlace = g_ment;
Expand Down Expand Up @@ -1201,7 +1200,7 @@ void fctSleep() {
tmlieu(g_s._currPlace);
}
clsf3();
clsf2();
clearScreenType2();
ecrf2();
ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
updateHour(j, h, m);
Expand Down Expand Up @@ -1573,7 +1572,7 @@ void MortevielleEngine::endGame() {
tlu(13, 152);
maivid();
clsf1();
clsf2();
clearScreenType2();
clsf3();
repon(9, 1509);
tkey1(false);
Expand Down Expand Up @@ -1607,7 +1606,7 @@ void MortevielleEngine::endGame() {
* @remarks Originally called 'tencore'
*/
void MortevielleEngine::loseGame() {
clsf2();
clearScreenType2();
musique(0);
tkey1(false);
maivid();
Expand Down
20 changes: 10 additions & 10 deletions engines/mortevielle/dialogs.cpp
Expand Up @@ -85,7 +85,7 @@ int Alert::show(const Common::String &msg, int n) {
}
g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
g_vm->_screenSurface._textPos.y += 6;
g_vm->_screenSurface.writeg(st, 4);
g_vm->_screenSurface.drawString(st, 4);
++i;
} while (chaine[i] != ']');
}
Expand Down Expand Up @@ -134,14 +134,14 @@ int Alert::show(const Common::String &msg, int n) {
Common::String tmp(" ");
tmp += s[quoi];
tmp += " ";
g_vm->_screenSurface.writeg(tmp, 0);
g_vm->_screenSurface.drawString(tmp, 0);
}
setPosition(ix, coldep, esp);

Common::String tmp2 = " ";
tmp2 += s[ix];
tmp2 += " ";
g_vm->_screenSurface.writeg(tmp2, 1);
g_vm->_screenSurface.drawString(tmp2, 1);

quoi = ix;
showMouse();
Expand All @@ -155,7 +155,7 @@ int Alert::show(const Common::String &msg, int n) {
Common::String tmp3(" ");
tmp3 += s[quoi];
tmp3 += " ";
g_vm->_screenSurface.writeg(tmp3, 0);
g_vm->_screenSurface.drawString(tmp3, 0);

quoi = 0;
showMouse();
Expand All @@ -171,7 +171,7 @@ int Alert::show(const Common::String &msg, int n) {
Common::String tmp4(" ");
tmp4 += s[n];
tmp4 += " ";
g_vm->_screenSurface.writeg(tmp4, 1);
g_vm->_screenSurface.drawString(tmp4, 1);
}
charecr(50, (NUM_LINES + 1) << 4);
showMouse();
Expand Down Expand Up @@ -275,7 +275,7 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
tmp += str[l];
tmp += " ";

g_vm->_screenSurface.writeg(tmp, 0);
g_vm->_screenSurface.drawString(tmp, 0);
x += esp + 40;
}
}
Expand Down Expand Up @@ -406,9 +406,9 @@ void f3f8::draw() {

// Write the F3 and F8 text strings
g_vm->_screenSurface.putxy(3, 44);
g_vm->_screenSurface.writeg(f3, 5);
g_vm->_screenSurface.drawString(f3, 5);
g_vm->_screenSurface._textPos.y = 51;
g_vm->_screenSurface.writeg(f8, 5);
g_vm->_screenSurface.drawString(f8, 5);

// Get the width of the written text strings
int f3Width = g_vm->_screenSurface.getStringWidth(f3);
Expand All @@ -426,7 +426,7 @@ void f3f8::draw() {
void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
teskbd();
do {
parole(SpeechNum, 0, 0);
startSpeech(SpeechNum, 0, 0);
waitForF3F8(g_key);
CHECK_QUIT;

Expand Down Expand Up @@ -468,7 +468,7 @@ void f3f8::ani50() {
pictout(adani, g_crep, 63, 12);
g_crep = animof(2, 1);
pictout(adani, g_crep, 63, 12);
g_f2_all = (g_res == 1);
g_largestClearScreen = (g_res == 1);
repon(2, kDialogStringIndex + 143);
}

Expand Down
8 changes: 4 additions & 4 deletions engines/mortevielle/graphics.cpp
Expand Up @@ -1046,16 +1046,16 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {

/**
* Write out a string
* @remarks Originally called 'writeg'
*/
void ScreenSurface::writeg(const Common::String &l, int c) {
void ScreenSurface::drawString(const Common::String &l, int command) {
int i, x;
Common::Point pt;
int cecr = 0;

/* debug('writeg : '+l);*/

if (l == "")
return;

hideMouse();
pt = _textPos;

Expand All @@ -1065,7 +1065,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
i = 10;
x = pt.x + i * l.size();

switch (c) {
switch (command) {
case 1:
case 3: {
cecr = 0;
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/graphics.h
Expand Up @@ -92,7 +92,7 @@ class ScreenSurface: public Graphics::Surface {
void fillRect(int colour, const Common::Rect &bounds);
void clearScreen();
void putxy(int x, int y) { _textPos = Common::Point(x, y); }
void writeg(const Common::String &l, int c);
void drawString(const Common::String &l, int command);
int getStringWidth(const Common::String &s);
void drawLine(int x, int y, int xx, int yy, int coul);

Expand Down

0 comments on commit c539a3b

Please sign in to comment.