aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/actions.cpp2
-rw-r--r--engines/mortevielle/menu.cpp48
-rw-r--r--engines/mortevielle/menu.h2
-rw-r--r--engines/mortevielle/prog.cpp2
-rw-r--r--engines/mortevielle/var_mor.cpp19
-rw-r--r--engines/mortevielle/var_mor.h2
6 files changed, 38 insertions, 37 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index d9a1022548..80a460e0c2 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -686,7 +686,7 @@ void fctPlace() {
else
person();
- g_vm->_menu.menu_aff();
+ g_vm->_menu.displayMenu();
if (enterPassageFl) {
s.mlieu = 17;
tmlieu(17);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 3edaaaaf21..6bbfa62df5 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -145,7 +145,7 @@ void Menu::enableMenuItem(int no) {
}
}
-void Menu::menu_aff() {
+void Menu::displayMenu() {
int ind_tabl, k, col;
int pt, x, y, color, msk, num_letr;
@@ -191,7 +191,7 @@ void Menu::menu_aff() {
* Show the menu
*/
void Menu::drawMenu() {
- menu_aff();
+ displayMenu();
_menuActive = true;
msg4 = OPCODE_NONE;
msg3 = OPCODE_NONE;
@@ -206,38 +206,40 @@ void Menu::invers(int ix) {
if (msg4 == OPCODE_NONE)
return;
- g_vm->_screenSurface.putxy(don[msg3][1] << 3, (lo(msg4) + 1) << 3);
+ int menuIndex = lo(msg4);
+
+ g_vm->_screenSurface.putxy(_menuConstants[msg3 - 1][0] << 3, (menuIndex + 1) << 3);
switch (msg3) {
case 1:
- s = _inventoryStringArray[lo(msg4)];
+ s = _inventoryStringArray[menuIndex];
break;
case 2:
- s = _moveStringArray[lo(msg4)];
+ s = _moveStringArray[menuIndex];
break;
case 3:
- s = _actionStringArray[lo(msg4)];
+ s = _actionStringArray[menuIndex];
break;
case 4:
- s = _selfStringArray[lo(msg4)];
+ s = _selfStringArray[menuIndex];
break;
case 5:
- s = _discussStringArray[lo(msg4)];
+ s = _discussStringArray[menuIndex];
break;
case 6:
- s = g_vm->getEngineString(S_SAVE_LOAD + lo(msg4));
+ s = g_vm->getEngineString(S_SAVE_LOAD + menuIndex);
break;
case 7:
s = g_vm->getEngineString(S_SAVE_LOAD + 1);
s += ' ';
- s += (char)(48 + lo(msg4));
+ s += (char)(48 + menuIndex);
break;
case 8:
- if (lo(msg4) == 1) {
+ if (menuIndex == 1) {
s = g_vm->getEngineString(S_RESTART);
} else {
s = g_vm->getEngineString(S_SAVE_LOAD + 2);
s += ' ';
- s += (char)(47 + lo(msg4));
+ s += (char)(47 + menuIndex);
}
break;
default:
@@ -251,9 +253,9 @@ void Menu::invers(int ix) {
void Menu::util(int x, int y) {
- int ymx = (don[msg3][4] << 3) + 16;
- int dxcar = don[msg3][3];
- int xmn = (don[msg3][1] << 2) * res;
+ int ymx = (_menuConstants[msg3 - 1][3] << 3) + 16;
+ int dxcar = _menuConstants[msg3 - 1][2];
+ int xmn = (_menuConstants[msg3 - 1][0] << 2) * res;
int ix;
if (res == 1)
@@ -287,19 +289,19 @@ void Menu::menuDown(int ii) {
g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
// Draw the menu
- xco = don[ii][1];
- nb_lig = don[ii][4];
+ xco = _menuConstants[ii - 1][0];
+ nb_lig = _menuConstants[ii - 1][3];
hideMouse();
- sauvecr(10, (don[ii][2] + 1) << 1);
+ sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
xco = xco << 3;
if (res == 1)
cx = 10;
else
cx = 6;
- xcc = xco + (don[ii][3] * cx) + 6;
- g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
- g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
- g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1)));
+ xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
+ g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
+ g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
+ g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
g_vm->_screenSurface.putxy(xco, 16);
cx = 0;
do {
@@ -360,7 +362,7 @@ void Menu::menuDown(int ii) {
void Menu::menuUp(int xx) {
/* debug('menuUp'); */
if (test0) {
- charecr(10, (don[xx][2] + 1) << 1);
+ charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
/* Restore the background area */
assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index f6e3ea5a9c..923c5aa3b6 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -51,7 +51,7 @@ public:
void menut(int no, Common::String name);
void disableMenuItem(int no);
void enableMenuItem(int no);
- void menu_aff();
+ void displayMenu();
void drawMenu();
void menuUp(int xx);
void eraseMenu();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index a41b652b06..cd7bb2a050 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -61,7 +61,7 @@ void changeGraphicalDevice(int newDevice) {
_maff = 68;
afdes(0);
repon(2, crep);
- g_vm->_menu.menu_aff();
+ g_vm->_menu.displayMenu();
}
/**
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index d3a44c46e6..ef9dbcf23a 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -59,16 +59,15 @@ const byte tnocon[364] = {
};
-const byte don[9][5] = {
- { 0, 0, 0, 0, 0},
- { 0, 7, 37, 22, 8},
- {0, 19, 33, 23, 7},
- {0, 31, 89, 10, 21},
- {0, 43, 25, 11, 5},
- {0, 55, 37, 5, 8},
- {0, 64, 13, 11, 2},
- {0, 62, 22, 13, 4},
- {0, 62, 25, 13, 5}
+const byte _menuConstants[8][4] = {
+ { 7, 37, 22, 8},
+ {19, 33, 23, 7},
+ {31, 89, 10, 21},
+ {43, 25, 11, 5},
+ {55, 37, 5, 8},
+ {64, 13, 11, 2},
+ {62, 22, 13, 4},
+ {62, 25, 13, 5}
};
const byte addv[2] = {8, 8};
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 0956b23e2f..d6024ece24 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -149,7 +149,7 @@ extern const byte typcon[26];
extern const byte intcon[26];
extern const byte tnocon[364];
-extern const byte don[9][5];
+extern const byte _menuConstants[8][4];
extern const byte addv[2];