[Scummvm-cvs-logs] SF.net SVN: scummvm: [29136] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Sep 30 12:51:34 CEST 2007


Revision: 29136
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29136&view=rev
Author:   dreammaster
Date:     2007-09-30 03:51:33 -0700 (Sun, 30 Sep 2007)

Log Message:
-----------
Added cross-language handling for the top menu

Modified Paths:
--------------
    scummvm/trunk/engines/lure/menu.cpp
    scummvm/trunk/engines/lure/menu.h

Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp	2007-09-30 10:36:27 UTC (rev 29135)
+++ scummvm/trunk/engines/lure/menu.cpp	2007-09-30 10:51:33 UTC (rev 29136)
@@ -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 @@
 		_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 @@
 
 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;

Modified: scummvm/trunk/engines/lure/menu.h
===================================================================
--- scummvm/trunk/engines/lure/menu.h	2007-09-30 10:36:27 UTC (rev 29135)
+++ scummvm/trunk/engines/lure/menu.h	2007-09-30 10:51:33 UTC (rev 29136)
@@ -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 @@
 	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; }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list