diff options
author | Strangerke | 2012-02-26 18:08:53 +0100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:22:04 +0200 |
commit | 510cae8af11ec66d849d6d6912eacef048de8012 (patch) | |
tree | d4c0e74743c848667cb3337acacbb9c469dd0cba /engines/mortevielle | |
parent | ce56512c99b522e3942a84993360203d5f9e8fbc (diff) | |
download | scummvm-rg350-510cae8af11ec66d849d6d6912eacef048de8012.tar.gz scummvm-rg350-510cae8af11ec66d849d6d6912eacef048de8012.tar.bz2 scummvm-rg350-510cae8af11ec66d849d6d6912eacef048de8012.zip |
MORTEVIELLE: Start removing deline() and delig
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/actions.cpp | 25 | ||||
-rw-r--r-- | engines/mortevielle/dialogs.cpp | 44 | ||||
-rw-r--r-- | engines/mortevielle/graphics.cpp | 14 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 15 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 91 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 30 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 15 | ||||
-rw-r--r-- | engines/mortevielle/outtext.cpp | 30 | ||||
-rw-r--r-- | engines/mortevielle/outtext.h | 3 | ||||
-rw-r--r-- | engines/mortevielle/ovd1.cpp | 1 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 2 |
11 files changed, 113 insertions, 157 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 68d6e82c43..a22dd3bbf2 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -47,7 +47,6 @@ namespace Mortevielle { * @remarks Originally called 'taller' */ void fctMove() { - //int mx, cx, cy; int cx; if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._depl[6])) { @@ -180,7 +179,6 @@ L2: * @remarks Originally called 'tprendre' */ void fctTake() { - //int cx, cy, cz; int cx; if (caff > 99) { @@ -354,8 +352,6 @@ void fctLift() { * @remarks Originally called 'tlire' */ void fctRead() { -// int iaff; - if (caff > 99) st4(caff); else { @@ -622,9 +618,8 @@ void fctOpen() { */ void fctPlace() { bool enterPassageFl; - char st[1410]; Common::String str_; - int i, tay; + int i; if (s.derobj == 0) { crep = 186; @@ -673,8 +668,9 @@ void fctPlace() { // Do you want to enter the hidden passage? int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); if (answer== 1) { - deline(582, st, tay); - i = Alert::show(delig, 1); + Common::String alertTxt = delin2(582); + i = Alert::show(alertTxt, 1); + tesok = false; enterPassageFl = Ques::show(); hideMouse(); @@ -700,8 +696,8 @@ void fctPlace() { dessin(0); aniof(1, 2); aniof(1, 1); - deline(577, st, tay); - i = Alert::show(delig, 1); + alertTxt = delin2(577); + i = Alert::show(alertTxt, 1); aniof(2, 1); crep = 166; } @@ -1289,11 +1285,9 @@ void fctSound() { */ void fctDiscuss() { bool te[47]; - int cy, cx, max, haz, suj, co, lig, icm, - i, tay, choi, x, y, c; + int cy, cx, max, haz, suj, co, lig, icm, i, choi, x, y, c; char tou; Common::String lib[47]; - char st[1410]; bool f; finfouil(); @@ -1319,9 +1313,8 @@ void fctDiscuss() { for (int ix = 1; ix <= 46; ++ix) te[ix] = false; for (int ix = 1; ix <= 45; ++ix) { - deline(ix + c_tparler, st, tay); - lib[ix] = delig; - for (i = tay; i <= 40; ++i) + lib[ix] = delin2(ix + c_tparler); + for (i = lib[ix].size(); i <= 40; ++i) lib[ix] = lib[ix] + ' '; } lib[46] = lib[45]; diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index b91fd30ee3..f8c5ceb3f6 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -290,13 +290,12 @@ bool Ques::show() { const int correctAnswerArr[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }; int optionPosY; - int curLength, maxLength; + int maxLength; int rep; int firstOption, lastOption; char key; rectangle coor[max_rect]; Common::String choiceArray[15]; - char st[1410]; int currChoice, prevChoice; int indx = 0; @@ -308,14 +307,15 @@ bool Ques::show() { hirs(); showMouse(); ++indx; - deline(textIndexArr[indx], st, curLength); int dialogHeight; if (res == 1) dialogHeight = 29; else dialogHeight = 23; g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight)); - afftex(st, 20, 15, 100, 2, 0); + Common::String tmpStr = delin2(textIndexArr[indx]); + afftex(tmpStr, 20, 15, 100, 2, 0); + if (indx != 10) { firstOption = textIndexArr[indx] + 1; lastOption = textIndexArr[indx + 1] - 1; @@ -327,11 +327,11 @@ bool Ques::show() { maxLength = 0; for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) { - deline(j, st, curLength); - if (curLength > maxLength) - maxLength = curLength; - afftex(st, 100, optionPosY, 100, 1, 0); - choiceArray[prevChoice] = delig; + tmpStr = delin2(j); + if ((int) tmpStr.size() > maxLength) + maxLength = tmpStr.size(); + afftex(tmpStr, 100, optionPosY, 100, 1, 0); + choiceArray[prevChoice] = tmpStr; optionPosY += 8; } for (int j = 1; j <= lastOption - firstOption + 1; ++j) { @@ -356,6 +356,7 @@ bool Ques::show() { rep = 0; prevChoice = 0; + warning("Expected answer: %d", correctAnswerArr[indx]); do { g_vm->setMouseClick(false); tesok = false; @@ -368,34 +369,21 @@ bool Ques::show() { ++currChoice; if (coor[currChoice].enabled) { if ((prevChoice != 0) && (prevChoice != currChoice)) { - st[0] = ' '; -// for (j = 0; j <= maxLength; ++j) -// st[j + 1] = choiceArray[prevChoice][j]; - strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength); - st[1 + maxLength] = '$'; - afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0); + Common::String tmpStr = choiceArray[prevChoice] + '$'; + afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0); } if (prevChoice != currChoice) { - st[0] = ' '; -// for (j = 0; j <= maxLength; ++j) -// st[j + 1] = choiceArray[currChoice][j]; - strncpy(st + 1, choiceArray[currChoice].c_str(), maxLength); - st[1 + maxLength] = '$'; - afftex(st, 100, 27 + (currChoice * 8), 100, 1, 1); + Common::String tmpStr = choiceArray[currChoice] + '$'; + afftex(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1); prevChoice = currChoice; } } else if (prevChoice != 0) { - st[0] = ' '; -// for (j = 0; j <= maxLength; ++j) -// st[j + 1] = choiceArray[prevChoice][j]; - strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength); - st[1 + maxLength] = '$'; - afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0); + Common::String tmpStr = choiceArray[prevChoice] + '$'; + afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0); prevChoice = 0; } } while (!((prevChoice != 0) && g_vm->getMouseClick())); - warning("Expected answer: %d, answer: %d", prevChoice, correctAnswerArr[indx]); if (prevChoice == correctAnswerArr[indx]) // Answer is correct ++correctCount; diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index 7511b21ce2..bec7ef4073 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -1112,18 +1112,22 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) { a = (float)((x - xx)) / (y - yy); b = (yr * xro - yro * xr) / (y - yy); i = y; - if (y > yy) step = -1; - else step = 1; + if (y > yy) + step = -1; + else + step = 1; do { g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul); - i = i + step; + i += step; } while (i != yy); } else { a = (float)((y - yy)) / (x - xx); b = ((yro * xr) - (yr * xro)) / (x - xx); i = x; - if (x > xx) step = -1; - else step = 1; + if (x > xx) + step = -1; + else + step = 1; do { g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul); i = i + step; diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index f81a454ab9..d176d7cd70 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -389,11 +389,9 @@ void Menu::eraseMenu() { * Handle updates to the menu */ void Menu::mdn() { - //int x, y, c, a, ix; int x, y, ix; bool tes; - /* debug('mdn'); */ if (!_menuActive) return; @@ -466,8 +464,7 @@ void Menu::mdn() { } void Menu::initMenu() { - int i, tai; - char st[1410]; + int i; Common::File f; if (!f.open("menufr.mor")) @@ -488,20 +485,18 @@ void Menu::initMenu() { _dep[i] = "* "; i = 1; do { - deline(i + c_action, st, tai); - _act[i] = delig; + _act[i] = delin2(i + c_action); + while (_act[i].size() < 10) _act[i] += ' '; if (i < 9) { if (i < 6) { - deline(i + c_saction, st, tai); - _self[i] = delig; + _self[i] = delin2(i + c_saction); while (_self[i].size() < 10) _self[i] += ' '; } - deline(i + c_dis, st, tai); - _dis[i] = delig + ' '; + _dis[i] = delin2(i + c_dis) + ' '; } ++i; } while (i != 22); diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index f36ae2dff5..cac723a4f5 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -130,20 +130,16 @@ void text_color(int c) { void text1(int x, int y, int nb, int m) { - char st[1410]; - int tay; int co; - - /* debug('text'); */ if (res == 1) co = 10; else co = 6; - deline(m, st, tay); - if ((y == 182) && (tay * co > nb * 6)) + Common::String tmpStr = delin2(m); + if ((y == 182) && ((int) tmpStr.size() * co > nb * 6)) y = 176; - afftex(st, x, y, nb, 20, color_txt); + afftex(tmpStr, x, y, nb, 20, color_txt); } void initouv() { @@ -313,31 +309,26 @@ void okpas() { } void modobj(int m) { - char str_[1410]; - int tay; - Common::String strp = Common::String(' '); - if (m != 500) { - deline(m - 501 + c_st41, str_, tay); - strp = delig; - } + + if (m != 500) + strp = delin2(m - 501 + c_st41); + g_vm->_menu.menut(g_vm->_menu._invt[8], strp); g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]); } void modobj2(int m, bool t1, bool t2) { - char str_[1410]; - int tay; - Common::String strp = Common::String(' '); + if (t1 || t2) okpas(); else tesok = false;; - if (m != 500) { - deline(m - 501 + c_st41, str_, tay); - strp = delig; - } + + if (m != 500) + strp = delin2(m - 501 + c_st41); + g_vm->_menu.menut(g_vm->_menu._invt[8], strp); g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]); } @@ -346,17 +337,19 @@ void modobj2(int m, bool t1, bool t2) { void repon(int f, int m) { Common::String str_; Common::String str1; - char st[1410]; - int i, xco, dx, caspe, tay; + Common::String tmpStr; + int i, xco, dx, caspe; if ((m > 499) && (m < 563)) { - deline(m - 501 + c_st41, st, tay); - if (tay > ((58 + (res - 1) * 37) << 1)) + tmpStr = delin2(m - 501 + c_st41); + + if ((int) tmpStr.size() > ((58 + (res - 1) * 37) << 1)) f2_all = true; else f2_all = false; + clsf2(); - afftex(st, 8, 176, 85, 3, 5); + afftex(tmpStr, 8, 176, 85, 3, 5); } else { modif(m); if (f == 8) @@ -378,33 +371,37 @@ void repon(int f, int m) { } } if ((f >= 6) && (f <= 9)) { - deline(m, st, tay); if (f == 6) i = 4; else i = 5; - afftex(st, 80, 40, 60, 25, i); + + tmpStr = delin2(m); + afftex(tmpStr, 80, 40, 60, 25, i); + if (m == 180) s.pourc[6] = '*'; + if (m == 179) s.pourc[10] = '*'; } if (f == 7) { /* messint */ ecrf7(); - deline(m, st, tay); + tmpStr = delin2(m); if (res == 1) { - xco = 252 - tay * 5; + xco = 252 - tmpStr.size() * 5; caspe = 100; dx = 80; } else { - xco = 252 - tay * 3; + xco = 252 - tmpStr.size() * 3; caspe = 144; dx = 50; } - if (tay < 40) - afftex(st, xco, 86, dx, 3, 5); + + if (tmpStr.size() < 40) + afftex(tmpStr, xco, 86, dx, 3, 5); else - afftex(st, caspe, 86, dx, 3, 5); + afftex(tmpStr, caspe, 86, dx, 3, 5); } } } @@ -443,7 +440,6 @@ void t5(int cx) { void affper(int per) { int cx; - /* debug('affper'); */ for (cx = 1; cx <= 8; ++cx) g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]); clsf10(); @@ -905,7 +901,6 @@ void quelq20(int h, int &per) { void frap() { int j, h, m, haz; - /* debug('o1 frap'); */ calch(j, h, m); if ((h >= 0) && (h < 8)) crep = 190; @@ -968,7 +963,6 @@ void tip(int ip, int &cx) { void ecfren(int &p, int &haz, int cf, int l) { - /* debug('o1 ecfren'); */ if (l == 0) person(); p = -500; @@ -996,7 +990,6 @@ void ecfren(int &p, int &haz, int cf, int l) { void becfren(int l) { int haz; - /* debug('o1 becfren'); */ if ((l == 1) || (l == 4)) { haz = hazard(1, 2); if (l == 1) @@ -1029,13 +1022,11 @@ void becfren(int l) { void init_nbrepm() { const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 }; - /* debug('init_nbrepm'); */ for (int idx = 0; idx < 9; ++idx) nbrepm[idx] = ipm[idx]; } void phaz(int &haz, int &p, int cf) { - /* debug('phaz'); */ p += cf; haz = hazard(1, 100); } @@ -1043,7 +1034,6 @@ void phaz(int &haz, int &p, int cf) { void inzon() { int cx; - /* debug('o2 inzon'); */ copcha(); s.ipre = false; @@ -1088,9 +1078,7 @@ void inzon() { } void dprog() { - /* debug('o2 dprog'); */ li = 21; - /* jh:= t_settime(0);*/ jh = 0; if (! s.ipre) blo = true; @@ -1101,7 +1089,6 @@ void dprog() { void pl1(int cf) { int p, haz; - /* debug('o2 pl1'); */ if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) { cpl1(p); phaz(haz, p, cf); @@ -1115,7 +1102,6 @@ void pl1(int cf) { void pl2(int cf) { int p, haz; - /* debug('o2 pl2'); */ if (! bh2) { cpl2(p); phaz(haz, p, cf); @@ -1129,7 +1115,6 @@ void pl2(int cf) { void pl5(int cf) { int p, haz; - /* debug('o2 pl5'); */ if (! bh5) { cpl5(p); phaz(haz, p, cf); @@ -1143,7 +1128,6 @@ void pl5(int cf) { void pl6(int cf) { int p, haz; - /* debug('o2 pl6'); */ if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) { cpl6(p); phaz(haz, p, cf); @@ -1157,7 +1141,6 @@ void pl6(int cf) { void pl9(int cf) { int p, haz; - /* debug('o2 pl9'); */ if (! bh9) { cf = -10; phaz(haz, p, cf); @@ -1171,7 +1154,6 @@ void pl9(int cf) { void pl10(int cf) { int p, h, haz; - /* debug('o2 pl10'); */ cpl10(p, h); phaz(haz, p, cf); if (haz > p) @@ -1183,7 +1165,6 @@ void pl10(int cf) { void pl11(int cf) { int p, h, haz; - /* debug('o2 pl11'); */ cpl11(p, h); phaz(haz, p, cf); if (haz > p) @@ -1195,7 +1176,6 @@ void pl11(int cf) { void pl12(int cf) { int p, haz; - /* debug('o2 pl12'); */ cpl12(p); phaz(haz, p, cf); if (haz > p) @@ -1207,7 +1187,6 @@ void pl12(int cf) { void pl13(int cf) { int p, haz; - /* debug('o2 pl13'); */ cpl13(p); phaz(haz, p, cf); if (haz > p) @@ -1219,7 +1198,6 @@ void pl13(int cf) { void pl15(int cf) { int p, haz; - /* debug('o2 pl15'); */ cpl15(p); phaz(haz, p, cf); if (haz > p) @@ -1231,7 +1209,6 @@ void pl15(int cf) { void pl20(int cf) { int p, h, haz; - /* debug('o2 pl20'); */ cpl20(p, h); phaz(haz, p, cf); if (haz > p) @@ -1243,7 +1220,6 @@ void pl20(int cf) { void t11(int l11, int &a) { int p, haz, h = 0; - /* debug('o2 t11'); */ ecfren(p, haz, s.conf, l11); li = l11; if ((l11 > 0) && (l11 < 10)) { @@ -1300,7 +1276,6 @@ void t11(int l11, int &a) { void cavegre() { int haz; - /* debug('cavegre'); */ s.conf = s.conf + 2; if (s.conf > 69) s.conf += (s.conf / 10); @@ -1362,8 +1337,8 @@ void musique(int so) { bool i; int haz; - /* debug('musique'); */ - if (so == 0) { /*musik(0)*/ + if (so == 0) { + /* musik(0) */ ; } else if ((prebru == 0) && (! s.ipre)) { parole(10, 1, 1); diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index fb1ccafa31..f51275784e 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -238,26 +238,21 @@ void tkey1(bool d) { } void tmlieu(int mli) { - int cx, i, tail; Common::String nomp; - char st[1410]; - if (mli == 26) mli = 15; - i = 1; + int i = 1; while ((i < 8) && (v_lieu[i][mli] != 0)) { - cx = v_lieu[i][mli]; - deline(cx + c_tmlieu, st, tail); - nomp = delig; + nomp = delin2(v_lieu[i][mli] + c_tmlieu); while (nomp.size() < 20) nomp += ' '; g_vm->_menu.menut(g_vm->_menu._depl[i], nomp); ++i; } nomp = "* "; - for (cx = 7; cx >= i; --cx) + for (int cx = 7; cx >= i; --cx) g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp); } @@ -377,8 +372,7 @@ void st1sama() { } void modinv() { - int tay, r; - char nom[1410]; + int r; Common::String nomp; int cy = 0; @@ -386,8 +380,7 @@ void modinv() { if (s.sjer[cx] != chr(0)) { ++cy; r = (ord(s.sjer[cx]) + 400); - deline(r - 501 + c_st41, nom, tay); - nomp = delig; + nomp = delin2(r - 501 + c_st41); g_vm->_menu.menut(g_vm->_menu._invt[cy], nomp); g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]); } @@ -400,13 +393,12 @@ void modinv() { void sparl(float adr, float rep) { const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 }; - int key, tay, repint; - char st[1410]; + int key, repint; repint = abs((int)rep); hideMouse(); - deline(repint + c_paroles, st, tay); - afftex(st, 230, 4, 65, 24, 5); + Common::String tmpStr = delin2(repint + c_paroles); + afftex(tmpStr, 230, 4, 65, 24, 5); f3f8::draw(); key = 0; @@ -449,8 +441,6 @@ void premtet() { /* NIVEAU 5 */ void ajchai() { - - int cy = acha + ((mchai - 1) * 10) - 1; int cx = 0; do { @@ -484,12 +474,12 @@ void t1sama() { //Entering manor calch(j, h, m); if ((h < 5) && (s.mlieu > 18)) { cherjer(137, d); - if (!d) { /* On n'a pas les cl‚s et il est tard */ //Translation: You don't have the keys, and it's late + if (!d) { //You don't have the keys, and it's late crep = 1511; tperd(); } else st1sama(); - } else if (!s.ipre) { /* c'est votre premiŠre fois ? */ //Translation: Is it your first time? + } else if (!s.ipre) { //Is it your first time? ipers = 255; affper(ipers); caff = 77; diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 9ca4839e76..262cc3446e 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -134,17 +134,10 @@ Common::ErrorCode MortevielleEngine::initialise() { return result; // Load some error messages (was previously in chartex()) - int length = 0; - char str[1410]; - - deline(578, str, length); - al_mess = delig; - deline(579, str, length); - err_mess = delig; - deline(580, str, length); - ind_mess = delig; - deline(581, str, length); - al_mess2 = delig; + al_mess = delin2(578); // Insert floppy #1 + err_mess = delin2(579); // Floppy error + ind_mess = delin2(580); // You should have noticed %d hints + al_mess2 = delin2(581); // Insert floppy #2 // Set default EGA palette _paletteManager.setDefaultPalette(); diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp index 99c2cac92c..c2da1166b5 100644 --- a/engines/mortevielle/outtext.cpp +++ b/engines/mortevielle/outtext.cpp @@ -134,8 +134,13 @@ void deline(int num, char *line , int &length) { if (!g_vm->_txxFileFl) { delig = g_vm->getGameString(num); +/* if (delig.size() < 255) + // Remove trailing '$' + delig.deleteLastChar(); +*/ if (line) { - strcpy(line, delig.c_str()); + line[0] = ' '; + strcpy(line + 1, delig.c_str()); length = delig.size(); } @@ -169,11 +174,21 @@ void deline(int num, char *line , int &length) { warning("deline: delig %s - line %s", delig.c_str(), line); } +Common::String delin2(int num) { + char tmpStr[1410]; + int length; + + deline(num, tmpStr, length); + + Common::String resStr = delig; + delig = ""; + return resStr; +} -void afftex(char *ch, int x, int y, int dx, int dy, int typ); +void afftex(const char *ch, int x, int y, int dx, int dy, int typ); -static int l_motsuiv(int p, char *ch, int &tab) { +static int l_motsuiv(int p, const char *ch, int &tab) { int c = p; while ((ch[p] != ' ') && (ch[p] != '$') && (ch[p] != '@')) @@ -182,12 +197,14 @@ static int l_motsuiv(int p, char *ch, int &tab) { return tab * (p - c); } -void afftex(char *ch, int x, int y, int dx, int dy, int typ) { +void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) { bool the_end; int tab; Common::String s; int i, j; + // Safeguard: add $ just in case + ch += '$'; /* debug(' .. Afftex');*/ g_vm->_screenSurface.putxy(x, y); @@ -201,7 +218,8 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) { int yc = y; int xf = x + dx; int yf = y + dy; - int p = 1; +// int p = 1; + int p = 0; the_end = (ch[p] == '$'); s = ""; while (!the_end) { @@ -218,7 +236,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) { s += ' '; xc += tab; ++p; - if (l_motsuiv(p, ch, tab) + xc > xf) { + if (l_motsuiv(p, ch.c_str(), tab) + xc > xf) { g_vm->_screenSurface.writeg(s, typ); s = ""; xc = x; diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h index 32d3c4c7ec..742b832612 100644 --- a/engines/mortevielle/outtext.h +++ b/engines/mortevielle/outtext.h @@ -35,7 +35,8 @@ namespace Mortevielle { extern Common::String delig; extern void deline(int num , char *line , int &length); -extern void afftex(char *ch, int x, int y, int dx, int dy, int typ); +extern Common::String delin2(int num); +extern void afftex(Common::String ch, int x, int y, int dx, int dy, int typ); } // End of namespace Mortevielle #endif diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp index 17966b88c6..64bb6cb463 100644 --- a/engines/mortevielle/ovd1.cpp +++ b/engines/mortevielle/ovd1.cpp @@ -102,7 +102,6 @@ void charpal() { void chartex() { Common::File inpFile; Common::File ntpFile; - char s[1410]; g_vm->_txxFileFl = false; if (g_vm->getLanguage() == Common::EN_ANY) { diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 7aef569618..daac97704d 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -174,7 +174,7 @@ int x, int t_cph[6401]; byte tabdon[4001]; -Common::String stpou; /* donne le % d'indices */ //Translation: "Provides the % of hints" +Common::String stpou; // Provides the % of hints byte is; byte mode; Common::String al_mess, |