aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2007-09-30 10:51:33 +0000
committerPaul Gilbert2007-09-30 10:51:33 +0000
commitb7c7623930eb430bfc330e4a3827ba46446574c5 (patch)
treebd4a133548b7784f16d5330b954375bd36770cdf /engines
parent182eef40daa4c0eb6794efa7a0c46e6b803e3721 (diff)
downloadscummvm-rg350-b7c7623930eb430bfc330e4a3827ba46446574c5.tar.gz
scummvm-rg350-b7c7623930eb430bfc330e4a3827ba46446574c5.tar.bz2
scummvm-rg350-b7c7623930eb430bfc330e4a3827ba46446574c5.zip
Added cross-language handling for the top menu
svn-id: r29136
Diffstat (limited to 'engines')
-rw-r--r--engines/lure/menu.cpp29
-rw-r--r--engines/lure/menu.h13
2 files changed, 33 insertions, 9 deletions
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 5856056e5c..1a03118476 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -32,11 +32,11 @@
#include "lure/strings.h"
#include "lure/room.h"
#include "lure/events.h"
+#include "lure/lure.h"
namespace Lure {
-MenuRecord::MenuRecord(uint16 hsxstartVal, uint16 hsxendVal, uint16 xstartVal,
- uint16 widthVal, int numParams, ...) {
+MenuRecord::MenuRecord(const MenuRecordBounds *bounds, int numParams, ...) {
// Store list of pointers to strings
va_list params;
@@ -48,8 +48,9 @@ MenuRecord::MenuRecord(uint16 hsxstartVal, uint16 hsxendVal, uint16 xstartVal,
_entries[index] = va_arg(params, const char *);
// Store position data
- _xstart = xstartVal; _width = widthVal;
- _hsxstart = hsxstartVal; _hsxend = hsxendVal;
+ _hsxstart = bounds->left; _hsxend = bounds->right;
+ _xstart = bounds->contentsX << 3;
+ _width = (bounds->contentsWidth + 3) << 3;
}
const char *MenuRecord::getEntry(uint8 index) {
@@ -61,19 +62,33 @@ const char *MenuRecord::getEntry(uint8 index) {
static Menu *int_menu = NULL;
+const MenuRecordLanguage menuList[] = {
+// {EN_ANY, {{40, 87, 20, 80}, {127, 179, 100, 120}, {224, 281, 210, 105}}},
+ {EN_ANY, {{40, 87, 3, 7}, {127, 179, 13, 12}, {224, 281, 27, 10}}},
+ {IT_ITA, {{40, 98, 4, 6}, {120, 195, 14, 11}, {208, 281, 24, 13}}},
+ {UNK_LANG, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}
+};
+
Menu::Menu() {
int_menu = this;
StringList &sl = Resources::getReference().stringList();
+ Common::Language language = LureEngine::getReference().getLanguage();
MemoryBlock *data = Disk::getReference().getEntry(MENU_RESOURCE_ID);
PictureDecoder decoder;
_menu = decoder.decode(data, SCREEN_SIZE);
delete data;
- _menus[0] = new MenuRecord(40, 87, 20, 80, 1, sl.getString(S_CREDITS));
- _menus[1] = new MenuRecord(127, 179, 100, 120, 3,
+ const MenuRecordLanguage *rec = &menuList[0];
+ while ((rec->language != UNK_LANG) && (rec->language != language))
+ ++rec;
+ if (rec->language == UNK_LANG)
+ error("Unknown language encountered in top line handler");
+
+ _menus[0] = new MenuRecord(&rec->menus[0], 1, sl.getString(S_CREDITS));
+ _menus[1] = new MenuRecord(&rec->menus[1], 3,
sl.getString(S_RESTART_GAME), sl.getString(S_SAVE_GAME), sl.getString(S_RESTORE_GAME));
- _menus[2] = new MenuRecord(224, 281, 210, 105, 3,
+ _menus[2] = new MenuRecord(&rec->menus[2], 3,
sl.getString(S_QUIT), sl.getString(S_SLOW_TEXT), sl.getString(S_SOUND_ON));
_selectedMenu = NULL;
diff --git a/engines/lure/menu.h b/engines/lure/menu.h
index 4f0b3297ed..41a0356890 100644
--- a/engines/lure/menu.h
+++ b/engines/lure/menu.h
@@ -38,6 +38,16 @@
namespace Lure {
+struct MenuRecordBounds {
+ uint16 left, right;
+ uint16 contentsX, contentsWidth;
+};
+
+struct MenuRecordLanguage {
+ Common::Language language;
+ MenuRecordBounds menus[3];
+};
+
class MenuRecord {
private:
uint16 _xstart, _width;
@@ -45,8 +55,7 @@ private:
const char **_entries;
uint8 _numEntries;
public:
- MenuRecord(uint16 hsxstartVal, uint16 hsxendVal, uint16 xstartVal, uint16 widthVal,
- int numParams, ...);
+ MenuRecord(const MenuRecordBounds *bounds, int numParams, ...);
uint16 xstart() { return _xstart; }
uint16 width() { return _width; }