diff options
-rw-r--r-- | engines/mortevielle/dialogs.cpp | 8 | ||||
-rw-r--r-- | engines/mortevielle/dialogs.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 26 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 20 | ||||
-rw-r--r-- | engines/mortevielle/mor2.h | 8 | ||||
-rw-r--r-- | engines/mortevielle/mortevielle.cpp | 2 | ||||
-rw-r--r-- | engines/mortevielle/ovd1.cpp | 6 | ||||
-rw-r--r-- | engines/mortevielle/sound.cpp | 4 | ||||
-rw-r--r-- | engines/mortevielle/sound.h | 2 |
10 files changed, 44 insertions, 38 deletions
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index 8d53da7526..7cf12cb1bd 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -38,8 +38,6 @@ namespace Mortevielle { -static const int nligne = 7; - /** * Alert function - Show * @remarks Originally called 'do_alert' @@ -57,7 +55,6 @@ int Alert::show(const Common::String &msg, int n) { // Make a copy of the current screen surface for later restore g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface); - /*debug('** do_alert **');*/ memset(&limit[0][0], 0, sizeof(int) * 3 * 3); int do_alert_result; hideMouse(); @@ -66,7 +63,7 @@ int Alert::show(const Common::String &msg, int n) { g_vm->setMouseClick(false); decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas); - sauvecr(50, (nligne + 1) << 4); + sauvecr(50, (NUM_LINES + 1) << 4); i = 0; if (chaine == "") { @@ -176,7 +173,7 @@ int Alert::show(const Common::String &msg, int n) { tmp4 += " "; g_vm->_screenSurface.writeg(tmp4, 1); } - charecr(50, (nligne + 1) << 4); + charecr(50, (NUM_LINES + 1) << 4); showMouse(); /* Restore the background area */ @@ -413,6 +410,7 @@ bool Ques::show() { if (indx == 10) { warning("Skipping protection check: testprot()"); protectionCheck = true; + // tesok is set to true in testprot() tesok = true; } } while (!(indx == 10)); diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h index a3f98f38d9..661c544b13 100644 --- a/engines/mortevielle/dialogs.h +++ b/engines/mortevielle/dialogs.h @@ -32,6 +32,8 @@ namespace Mortevielle { +static const int NUM_LINES = 7; + class Alert { private: static void decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr); diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index 1f8f3460e1..7cf6a316dd 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -471,7 +471,9 @@ void Menu::initMenu() { Common::File f; if (!f.open("menufr.mor")) - error("Missing file - menufr.mor"); + if (!f.open("menual.mor")) + if (!f.open("menu.mor")) + error("Missing file - menufr.mor or menual.mor or menu.mor"); f.read(lettres, 7 * 24); f.close(); diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index 6fe396f3cc..b740ad24dc 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -147,7 +147,7 @@ void text1(int x, int y, int nb, int m) { } void initouv() { - for (int cx = 1; cx <= 7; cx++) + for (int cx = 1; cx <= 7; ++cx) touv[cx] = chr(0); } @@ -444,7 +444,7 @@ void affper(int per) { int cx; /* debug('affper'); */ - for (cx = 1; cx <= 8; cx ++) + for (cx = 1; cx <= 8; ++cx) g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]); clsf10(); if ((per & 128) == 128) { @@ -595,7 +595,7 @@ void cpl6(int &p) { * Shows the you are alone message in the status area on the right hand side of the screen */ void person() { - for (int cf = 1; cf <= 8; cf ++) + for (int cf = 1; cf <= 8; ++cf) g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]); Common::String sYou = g_vm->getString(S_YOU); @@ -1058,30 +1058,30 @@ void inzon() { s.conf = hazard(4, 10); s.mlieu = 21; - for (cx = 2; cx <= 6; cx ++) + for (cx = 2; cx <= 6; ++cx) s.sjer[cx] = chr(0); s.sjer[1] = chr(113); s.heure = chr(20); - for (cx = 1; cx <= 10; cx ++) + for (cx = 1; cx <= 10; ++cx) s.pourc[cx] = ' '; - for (cx = 1; cx <= 6; cx ++) + for (cx = 1; cx <= 6; ++cx) s.teauto[cx] = '*'; - for (cx = 7; cx <= 9; cx ++) + for (cx = 7; cx <= 9; ++cx) s.teauto[cx] = ' '; - for (cx = 10; cx <= 28; cx ++) + for (cx = 10; cx <= 28; ++cx) s.teauto[cx] = '*'; - for (cx = 29; cx <= 42; cx ++) + for (cx = 29; cx <= 42; ++cx) s.teauto[cx] = ' '; s.teauto[33] = '*'; - for (cx = 1; cx <= 8; cx ++) + for (cx = 1; cx <= 8; ++cx) nbrep[cx] = 0; init_nbrepm(); @@ -1311,7 +1311,7 @@ void cavegre() { parole(2, haz, 1); // Useless? - for (haz = 0; haz <= 3000; haz++); + for (haz = 0; haz <= 3000; ++haz); clsf3(); person(); } @@ -1411,13 +1411,13 @@ void dessin(int ad) { dessine(ades, 60, 33); g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15); // Medium box } else if (caff > 69) { - dessine(ades, 112, 48); /* tˆtes */ //Translation: Heads + dessine(ades, 112, 48); // Heads g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15); } else { dessine(ades, 0, 12); ecrf1(); if ((caff < 30) || (caff > 32)) { - for (int cx = 1; cx <= 6; cx ++) { + for (int cx = 1; cx <= 6; ++cx) { if (ord(touv[cx]) != 0) aniof(1, ord(touv[cx])); } diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index 6ef32945c7..0a9637523d 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -39,12 +39,6 @@ namespace Mortevielle { -const int men[12] = { OPCODE_NONE, - OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, - OPCODE_ENTER, OPCODE_CLOSE, OPCODE_KNOCK, OPCODE_EAT, - OPCODE_PLACE, OPCODE_OPEN, OPCODE_LEAVE -}; - void tinke() { Common::String d1 = g_vm->getString(S_SHOULD_HAVE_NOTICED); Common::String d2 = g_vm->getString(S_NUMBER_OF_HINTS); @@ -73,7 +67,7 @@ void tinke() { _minute = 0; drawClock(); cf = 0; - for (cx = 1; cx <= 10; cx ++) { + for (cx = 1; cx <= 10; ++cx) { if (s.pourc[cx] == '*') ++cf; } @@ -263,7 +257,7 @@ void tmlieu(int mli) { ++i; } nomp = "* "; - for (cx = 7; cx >= i; cx--) + for (cx = 7; cx >= i; --cx) g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp); } @@ -289,7 +283,7 @@ void mfouen() { int cx; tmlieu(s.mlieu); - for (cx = 1; cx <= 11; cx ++) + for (cx = 1; cx <= 11; ++cx) g_vm->_menu.enableMenuItem(men[cx]); g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_PROBE)); @@ -328,7 +322,7 @@ void tsort() { s.conf += (s.conf / 10); } - for (int cx = 1; cx <= 7; cx ++) + for (int cx = 1; cx <= 7; ++cx) touv[cx] = chr(0); ment = 0; iouv = 0; @@ -370,7 +364,7 @@ void cherjer(int ob, bool &d) { int cx; d = false; - for (cx = 1; cx <= 6; cx++) + for (cx = 1; cx <= 6; ++cx) d = (d || (ord(s.sjer[cx]) == ob)); if (s.derobj == ob) @@ -434,10 +428,10 @@ void finfouil() { } void mfoudi() { - for (int cx = 1; cx <= 7; cx++) + for (int cx = 1; cx <= 7; ++cx) g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]); - for (int cx = 1; cx <= 11; cx++) + for (int cx = 1; cx <= 11; ++cx) g_vm->_menu.disableMenuItem(men[cx]); g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_SUITE)); diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h index 2c95f1e29d..dc23d04b63 100644 --- a/engines/mortevielle/mor2.h +++ b/engines/mortevielle/mor2.h @@ -28,8 +28,16 @@ #ifndef MORTEVIELLE_MOR2_H #define MORTEVIELLE_MOR2_H +#include "mortevielle/var_mor.h" + namespace Mortevielle { +static const int men[12] = { OPCODE_NONE, + OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, + OPCODE_ENTER, OPCODE_CLOSE, OPCODE_KNOCK, OPCODE_EAT, + OPCODE_PLACE, OPCODE_OPEN, OPCODE_LEAVE +}; + extern void tinke(); extern void fenat(char ans); /* NIVEAU 8 */ diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 7c7524235b..3a744fa2e2 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -490,7 +490,7 @@ void MortevielleEngine::mainGame() { if (rech_cfiec) charge_cfiec(); - for (crep = 1; crep <= c_zzz; crep ++) + for (crep = 1; crep <= c_zzz; ++crep) zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64); charge_bruit5(); diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp index fb893570ff..84f57402ea 100644 --- a/engines/mortevielle/ovd1.cpp +++ b/engines/mortevielle/ovd1.cpp @@ -105,7 +105,8 @@ void chartex() { /* debug('o3 chartex'); */ if (!f.open("TXX.INP")) - error("Missing file - TXX.INP"); + if (!f.open("TXX.MOR")) + error("Missing file - TXX.INP or .MOR"); assert(f.size() <= (maxti * 2)); for (int i = 0; i < f.size() / 2; ++i) @@ -114,7 +115,8 @@ void chartex() { f.close(); if (!f.open("TXX.NTP")) - error("Missing file - TXX.NTP"); + if (!f.open("TXX.IND")) + error("Missing file - TXX.NTP or .IND"); assert(f.size() <= (maxtd * 3)); int i; diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index 0a6e7e8d8d..5f634c595c 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -87,7 +87,7 @@ int PCSpeaker::readBuffer(int16 *buffer, const int numSamples) { int i; - for (i = 0; (_remainingSamples || !_pendingNotes.empty()) && (i < numSamples); i++) { + for (i = 0; (_remainingSamples || !_pendingNotes.empty()) && (i < numSamples); ++i) { if (!_remainingSamples) // Used up the current note, so queue the next one dequeueNote(); @@ -148,7 +148,7 @@ SoundManager::~SoundManager() { /** * Decode music data */ -void SoundManager::demus(const byte *PSrc, byte *PDest, int NbreSeg) { +void SoundManager::decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg) { int seed = 128; int v; diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h index f089974c6b..5c70bc8d0f 100644 --- a/engines/mortevielle/sound.h +++ b/engines/mortevielle/sound.h @@ -101,7 +101,7 @@ public: void playNote(int frequency, int32 length); - void demus(const byte *PSrc, byte *PDest, int NbreSeg); + void decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg); void litph(tablint &t, int typ, int tempo); void musyc(tablint &tb, int nbseg, int att); }; |