diff options
author | Strangerke | 2012-02-27 21:31:58 +0100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:22:06 +0200 |
commit | d3bbf213e9396820b845ecd44c56ff5a695e8562 (patch) | |
tree | 214641544003747bda3d1a8798056ca37298bba9 /engines | |
parent | 510cae8af11ec66d849d6d6912eacef048de8012 (diff) | |
download | scummvm-rg350-d3bbf213e9396820b845ecd44c56ff5a695e8562.tar.gz scummvm-rg350-d3bbf213e9396820b845ecd44c56ff5a695e8562.tar.bz2 scummvm-rg350-d3bbf213e9396820b845ecd44c56ff5a695e8562.zip |
MORTEVIELLE: Rename arrays used by menu
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mortevielle/actions.cpp | 12 | ||||
-rw-r--r-- | engines/mortevielle/menu.cpp | 104 | ||||
-rw-r--r-- | engines/mortevielle/menu.h | 18 | ||||
-rw-r--r-- | engines/mortevielle/mor.cpp | 28 | ||||
-rw-r--r-- | engines/mortevielle/mor2.cpp | 20 | ||||
-rw-r--r-- | engines/mortevielle/mor2.h | 2 |
6 files changed, 93 insertions, 91 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index a22dd3bbf2..80aba8df0d 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -49,13 +49,13 @@ namespace Mortevielle { void fctMove() { int cx; - if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._depl[6])) { + if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._moveMenu[6])) { s.mlieu = 15; caff = s.mlieu; afdes(0); repon(2, s.mlieu); } - if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._depl[6])) { + if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._moveMenu[6])) { if (!syn) ecr3(g_vm->getEngineString(S_GO_TO)); tfleche(); @@ -88,7 +88,7 @@ void fctMove() { cx = 0; do { ++cx; - } while (g_vm->_menu._depl[cx] != msg[4]); + } while (g_vm->_menu._moveMenu[cx] != msg[4]); if (s.mlieu == 19) { if (cx == 1) t1deva(); @@ -295,7 +295,7 @@ void tsprendre() { cx = 0; do { ++cx; - } while (g_vm->_menu._invt[cx] != msg[4]); + } while (g_vm->_menu._inventoryMenu[cx] != msg[4]); cz = 0; cy = 0; do { @@ -1100,7 +1100,7 @@ void fctEnter() { ++s.conf; s.mlieu = 15; msg[3] = MENU_DISCUSS; - msg[4] = g_vm->_menu._disc[x]; + msg[4] = g_vm->_menu._discussMenu[x]; syn = true; if (ment == 9) { col = true; @@ -1297,7 +1297,7 @@ void fctDiscuss() { cx = 0; do { ++cx; - } while (g_vm->_menu._disc[cx] != msg[4]); + } while (g_vm->_menu._discussMenu[cx] != msg[4]); caff = 69 + cx; afdes(0); repon(2, caff); diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp index d176d7cd70..250fd12d6e 100644 --- a/engines/mortevielle/menu.cpp +++ b/engines/mortevielle/menu.cpp @@ -43,10 +43,10 @@ namespace Mortevielle { /** * Setup a menu's contents */ -void Menu::menut(int no, Common::String nom) { +void Menu::menut(int no, Common::String name) { byte h = hi(no); byte l = lo(no); - Common::String s = nom; + Common::String s = name; if (! tesok) g_vm->quitGame(); @@ -58,21 +58,21 @@ void Menu::menut(int no, Common::String nom) { switch (h) { case MENU_INVENTORY: if (l != 7) { - _inv[l] = s; - _inv[l].insertChar(' ', 0); + _inventoryStringArray[l] = s; + _inventoryStringArray[l].insertChar(' ', 0); } break; case MENU_MOVE: - _dep[l] = s; + _moveStringArray[l] = s; break; case MENU_ACTION: - _act[l] = s; + _actionStringArray[l] = s; break; case MENU_SUB_ACTION: - _self[l] = s; + _selfStringArray[l] = s; break; case MENU_DISCUSS: - _dis[l] = s; + _discussStringArray[l] = s; break; default: break; @@ -90,22 +90,22 @@ void Menu::disableMenuItem(int no) { switch (h) { case MENU_INVENTORY: if (l > 6) { - _inv[l].setChar('<', 0); - _inv[l].setChar('>', 21); + _inventoryStringArray[l].setChar('<', 0); + _inventoryStringArray[l].setChar('>', 21); } else - _inv[l].setChar('*', 0); + _inventoryStringArray[l].setChar('*', 0); break; case MENU_MOVE: - _dep[l].setChar('*', 0); + _moveStringArray[l].setChar('*', 0); break; case MENU_ACTION: - _act[l].setChar('*', 0); + _actionStringArray[l].setChar('*', 0); break; case MENU_SUB_ACTION: - _self[l].setChar('*', 0); + _selfStringArray[l].setChar('*', 0); break; case MENU_DISCUSS: - _dis[l].setChar('*', 0); + _discussStringArray[l].setChar('*', 0); break; default: break; @@ -115,6 +115,7 @@ void Menu::disableMenuItem(int no) { /** * Enable a menu item * @param no Hi byte represents menu number, lo byte reprsents item index + * @remarks Originally called menu_enable */ void Menu::enableMenuItem(int no) { byte h = hi(no); @@ -122,21 +123,22 @@ void Menu::enableMenuItem(int no) { switch (h) { case MENU_INVENTORY: - _inv[l].setChar(' ', 0); - _inv[l].setChar(' ', 21); + _inventoryStringArray[l].setChar(' ', 0); + _inventoryStringArray[l].setChar(' ', 21); break; case MENU_MOVE: - _dep[l].setChar(' ', 0); + _moveStringArray[l].setChar(' ', 0); break; case MENU_ACTION: - _act[l].setChar(' ', 0); + _actionStringArray[l].setChar(' ', 0); break; case MENU_SUB_ACTION: - _self[l].setChar(' ', 0); - _self[l].setChar(' ', 0); + _selfStringArray[l].setChar(' ', 0); + // The original sets two times the same value. Skipped + // _selfStringArray[l].setChar(' ', 0); break; case MENU_DISCUSS: - _dis[l].setChar(' ', 0); + _discussStringArray[l].setChar(' ', 0); break; default: break; @@ -207,19 +209,19 @@ void Menu::invers(int ix) { g_vm->_screenSurface.putxy(don[msg3][1] << 3, (lo(msg4) + 1) << 3); switch (msg3) { case 1: - s = _inv[lo(msg4)]; + s = _inventoryStringArray[lo(msg4)]; break; case 2: - s = _dep[lo(msg4)]; + s = _moveStringArray[lo(msg4)]; break; case 3: - s = _act[lo(msg4)]; + s = _actionStringArray[lo(msg4)]; break; case 4: - s = _self[lo(msg4)]; + s = _selfStringArray[lo(msg4)]; break; case 5: - s = _dis[lo(msg4)]; + s = _discussStringArray[lo(msg4)]; break; case 6: s = g_vm->getEngineString(S_SAVE_LOAD + lo(msg4)); @@ -304,24 +306,24 @@ void Menu::menuDown(int ii) { ++cx; switch (ii) { case 1: - if (_inv[cx][0] != '*') - g_vm->_screenSurface.writeg(_inv[cx], 4); + if (_inventoryStringArray[cx][0] != '*') + g_vm->_screenSurface.writeg(_inventoryStringArray[cx], 4); break; case 2: - if (_dep[cx][0] != '*') - g_vm->_screenSurface.writeg(_dep[cx], 4); + if (_moveStringArray[cx][0] != '*') + g_vm->_screenSurface.writeg(_moveStringArray[cx], 4); break; case 3: - if (_act[cx][0] != '*') - g_vm->_screenSurface.writeg(_act[cx], 4); + if (_actionStringArray[cx][0] != '*') + g_vm->_screenSurface.writeg(_actionStringArray[cx], 4); break; case 4: - if (_self[cx][0] != '*') - g_vm->_screenSurface.writeg(_self[cx], 4); + if (_selfStringArray[cx][0] != '*') + g_vm->_screenSurface.writeg(_selfStringArray[cx], 4); break; case 5: - if (_dis[cx][0] != '*') - g_vm->_screenSurface.writeg(_dis[cx], 4); + if (_discussStringArray[cx][0] != '*') + g_vm->_screenSurface.writeg(_discussStringArray[cx], 4); break; case 6: g_vm->_screenSurface.writeg(g_vm->getEngineString(S_SAVE_LOAD + cx), 4); @@ -479,34 +481,34 @@ void Menu::initMenu() { dem2(); for (i = 1; i <= 8; ++i) - _inv[i] = "* "; - _inv[7] = "< -*-*-*-*-*-*-*-*-*- "; + _inventoryStringArray[i] = "* "; + _inventoryStringArray[7] = "< -*-*-*-*-*-*-*-*-*- "; for (i = 1; i <= 7; ++i) - _dep[i] = "* "; + _moveStringArray[i] = "* "; i = 1; do { - _act[i] = delin2(i + c_action); + _actionStringArray[i] = delin2(i + c_action); - while (_act[i].size() < 10) - _act[i] += ' '; + while (_actionStringArray[i].size() < 10) + _actionStringArray[i] += ' '; if (i < 9) { if (i < 6) { - _self[i] = delin2(i + c_saction); - while (_self[i].size() < 10) - _self[i] += ' '; + _selfStringArray[i] = delin2(i + c_saction); + while (_selfStringArray[i].size() < 10) + _selfStringArray[i] += ' '; } - _dis[i] = delin2(i + c_dis) + ' '; + _discussStringArray[i] = delin2(i + c_dis) + ' '; } ++i; } while (i != 22); for (i = 1; i <= 8; ++i) { - _disc[i] = 0x500 + i; + _discussMenu[i] = 0x500 + i; if (i < 8) - _depl[i] = 0x200 + i; - _invt[i] = 0x100 + i; + _moveMenu[i] = 0x200 + i; + _inventoryMenu[i] = 0x100 + i; if (i > 6) - g_vm->_menu.disableMenuItem(_invt[i]); + g_vm->_menu.disableMenuItem(_inventoryMenu[i]); } msg3 = OPCODE_NONE; msg4 = OPCODE_NONE; diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h index 84169241c3..67fc8bbf64 100644 --- a/engines/mortevielle/menu.h +++ b/engines/mortevielle/menu.h @@ -39,16 +39,16 @@ private: void menuDown(int ii); public: bool _menuActive; - Common::String _inv[9]; - Common::String _dep[8]; - Common::String _act[22]; - Common::String _self[7]; - Common::String _dis[9]; - int _disc[9]; - int _invt[9]; - int _depl[8]; + Common::String _inventoryStringArray[9]; + Common::String _moveStringArray[8]; + Common::String _actionStringArray[22]; + Common::String _selfStringArray[7]; + Common::String _discussStringArray[9]; + int _discussMenu[9]; + int _inventoryMenu[9]; + int _moveMenu[8]; public: - void menut(int no, Common::String nom); + void menut(int no, Common::String name); void disableMenuItem(int no); void enableMenuItem(int no); void menu_aff(); diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp index cac723a4f5..25a0cf7b1c 100644 --- a/engines/mortevielle/mor.cpp +++ b/engines/mortevielle/mor.cpp @@ -314,8 +314,8 @@ void modobj(int m) { 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]); + g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp); + g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]); } void modobj2(int m, bool t1, bool t2) { @@ -329,8 +329,8 @@ void modobj2(int m, bool t1, bool t2) { 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]); + g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp); + g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]); } @@ -441,47 +441,47 @@ void affper(int per) { int cx; for (cx = 1; cx <= 8; ++cx) - g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]); + g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cx]); clsf10(); if ((per & 128) == 128) { g_vm->_screenSurface.putxy(560, 24); g_vm->_screenSurface.writeg("LEO", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[1]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[1]); } if ((per & 64) == 64) { g_vm->_screenSurface.putxy(560, 32); g_vm->_screenSurface.writeg("PAT", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[2]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[2]); } if ((per & 32) == 32) { g_vm->_screenSurface.putxy(560, 40); g_vm->_screenSurface.writeg("GUY", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[3]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[3]); } if ((per & 16) == 16) { g_vm->_screenSurface.putxy(560, 48); g_vm->_screenSurface.writeg("EVA", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[4]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[4]); } if ((per & 8) == 8) { g_vm->_screenSurface.putxy(560, 56); g_vm->_screenSurface.writeg("BOB", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[5]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[5]); } if ((per & 4) == 4) { g_vm->_screenSurface.putxy(560, 64); g_vm->_screenSurface.writeg("LUC", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[6]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[6]); } if ((per & 2) == 2) { g_vm->_screenSurface.putxy(560, 72); g_vm->_screenSurface.writeg("IDA", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[7]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[7]); } if ((per & 1) == 1) { g_vm->_screenSurface.putxy(560, 80); g_vm->_screenSurface.writeg("MAX", 4); - g_vm->_menu.enableMenuItem(g_vm->_menu._disc[8]); + g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]); } ipers = per; } @@ -592,7 +592,7 @@ void cpl6(int &p) { */ void person() { for (int cf = 1; cf <= 8; ++cf) - g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]); + g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cf]); Common::String sYou = g_vm->getEngineString(S_YOU); Common::String sAre = g_vm->getEngineString(S_ARE); diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp index f51275784e..5495854c32 100644 --- a/engines/mortevielle/mor2.cpp +++ b/engines/mortevielle/mor2.cpp @@ -248,12 +248,12 @@ void tmlieu(int mli) { nomp = delin2(v_lieu[i][mli] + c_tmlieu); while (nomp.size() < 20) nomp += ' '; - g_vm->_menu.menut(g_vm->_menu._depl[i], nomp); + g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp); ++i; } nomp = "* "; for (int cx = 7; cx >= i; --cx) - g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp); + g_vm->_menu.menut(g_vm->_menu._moveMenu[cx], nomp); } @@ -279,7 +279,7 @@ void mfouen() { tmlieu(s.mlieu); for (cx = 1; cx <= 11; ++cx) - g_vm->_menu.enableMenuItem(men[cx]); + g_vm->_menu.enableMenuItem(_actionMenu[cx]); g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE)); g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_RAISE)); @@ -381,13 +381,13 @@ void modinv() { ++cy; r = (ord(s.sjer[cx]) + 400); 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]); + g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp); + g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]); } if (cy < 6) for (int cx = cy + 1; cx <= 6; ++cx) { - g_vm->_menu.menut(g_vm->_menu._invt[cx], " "); - g_vm->_menu.disableMenuItem(g_vm->_menu._invt[cx]); + g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cx], " "); + g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]); } } @@ -421,10 +421,10 @@ void finfouil() { void mfoudi() { for (int cx = 1; cx <= 7; ++cx) - g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]); + g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]); for (int cx = 1; cx <= 11; ++cx) - g_vm->_menu.disableMenuItem(men[cx]); + g_vm->_menu.disableMenuItem(_actionMenu[cx]); g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_SUITE)); g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_STOP)); @@ -576,7 +576,7 @@ L1: caff = 69 + cx; crep = caff; msg[3] = MENU_DISCUSS; - msg[4] = g_vm->_menu._disc[cx]; + msg[4] = g_vm->_menu._discussMenu[cx]; syn = true; col = true; } else { diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h index dc23d04b63..2df20b7804 100644 --- a/engines/mortevielle/mor2.h +++ b/engines/mortevielle/mor2.h @@ -32,7 +32,7 @@ namespace Mortevielle { -static const int men[12] = { OPCODE_NONE, +static const int _actionMenu[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 |