[Scummvm-cvs-logs] SF.net SVN: scummvm: [27396] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Jun 14 00:23:13 CEST 2007


Revision: 27396
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27396&view=rev
Author:   thebluegr
Date:     2007-06-13 15:23:12 -0700 (Wed, 13 Jun 2007)

Log Message:
-----------
IHNM: Button texts are read from the game data files, instead of the hardcoded ITE strings. The IHNM-specific strings have been removed from the ITE hardcoded strings. Also did some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/itedata.cpp
    scummvm/trunk/engines/saga/itedata.h
    scummvm/trunk/engines/saga/saga.h

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2007-06-13 21:07:15 UTC (rev 27395)
+++ scummvm/trunk/engines/saga/interface.cpp	2007-06-13 22:23:12 UTC (rev 27396)
@@ -80,6 +80,69 @@
 	kVerbIHNMPush}
 };
 
+// This maps the internally used string ITE IDs to the LUT strings loaded in IHNM
+// i.e. id 12 (quit game button) maps to string 14 (Quit game)
+// The comments are what the actual IHNM string is
+// For the text string IDs, refer to saga.h, enum TextStringIds
+static int IHNMTextStringIdsLUT[56] = {
+	-1,	// (Empty)
+	-1,	// (Empty)
+	4,	// Take
+	6,	// Talk to
+	-1,
+	-1,
+	5,	// Use
+	8,	// Give
+	10,	// Options
+	11,	// Test
+	12,	// 
+	13,	// Help
+	14,	// Quit Game
+	16,	// Fast
+	18,	// Slow
+	20,	// On
+	21,	// Off
+	15,	// Continue Playing
+	22,	// Load
+	23,	// Save
+	24,	// Game Options
+	25,	// Reading Speed
+	26,	// Music
+	27,	// Sound
+	32,	// Cancel
+	33,	// Quit
+	34,	// OK
+	17,	// Mid
+	19,	// Click
+	36,	// 10%
+	37,	// 20%
+	38,	// 30%
+	39,	// 40%
+	40,	// 50%
+	41,	// 60%
+	42,	// 70%
+	43,	// 80%
+	44,	// 90%
+	45,	// Max
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	-1,
+	28,	// Voices
+	29,	// Text
+	30,	// Audio
+	31	// Both
+};
+
 Interface::Interface(SagaEngine *vm) : _vm(vm) {
 	byte *resource;
 	size_t resourceLength;
@@ -718,6 +781,8 @@
 	int textWidth;
 	Rect rect;
 	Point textPoint;
+	KnownColor textShadowKnownColor = kKnownColorVerbTextShadow;
+	KnownFont textFont = kKnownFontMedium;
 
 	// Button differs for CD version
 	if (panelButton->id == kTextReadingSpeed && _vm->getFeatures() & GF_CD_FX)
@@ -725,7 +790,23 @@
 	if (panelButton->id == kTextShowDialog && !(_vm->getFeatures() & GF_CD_FX))
 		return;
 
-	text = _vm->getTextString(panelButton->id);
+	if (_vm->getGameType() == GType_ITE) {
+		text = _vm->getTextString(panelButton->id);
+		textFont = kKnownFontMedium;
+		textShadowKnownColor = kKnownColorVerbTextShadow;
+	} else {
+		if (panelButton->id < 39 || panelButton->id > 50) {
+			// Read non-hardcoded strings from the LUT string table, loaded from the game
+			// data files
+			text = _vm->_script->_mainStrings.getString(IHNMTextStringIdsLUT[panelButton->id]);
+		} else {
+			// Hardcoded strings in IHNM are read from the ITE hardcoded strings
+			text = _vm->getTextString(panelButton->id);
+		}
+		textFont = kKnownFontVerb;
+		textShadowKnownColor = kKnownColorTransparent;
+	}
+
 	panel->calcPanelButtonRect(panelButton, rect);
 	if (panelButton->xOffset < 0) {
 		if (_vm->getGameType() == GType_ITE)
@@ -738,10 +819,7 @@
 	textPoint.x = rect.left;
 	textPoint.y = rect.top + 1;
 
-	if (_vm->getGameType() == GType_ITE)
-		_vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
-	else
-		_vm->_font->textDraw(kKnownFontVerb, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
+	_vm->_font->textDraw(textFont, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(textShadowKnownColor), kFontShadow);
 }
 
 void Interface::drawOption() {
@@ -1843,7 +1921,7 @@
 	switch (kind ) {
 		case kSlider:
 			cornerColor = 0x8b;
-			frameColor = (_vm->getGameType() == GType_ITE) ? kITEColorBlack : kIHNMColorBlack;
+			frameColor = _vm->KnownColor2ColorId(kKnownColorBlack);
 			fillColor = kITEColorLightBlue96;
 			odl = kITEColorDarkBlue8a;
 			our = kITEColorLightBlue92;
@@ -1939,6 +2017,8 @@
 	KnownColor textColor;
 	Rect rect;
 	int litButton = 0;
+	KnownColor textShadowKnownColor = kKnownColorVerbTextShadow;
+	KnownFont textFont = kKnownFontMedium;
 
 	textId = panelButton->id;
 	switch (panelButton->id) {
@@ -1973,12 +2053,24 @@
 			textId = kTextAudio;
 		break;
 	}
-	text = _vm->getTextString(textId);
-
 	if (_vm->getGameType() == GType_ITE) {
+		text = _vm->getTextString(textId);
+		textFont = kKnownFontMedium;
+		textShadowKnownColor = kKnownColorVerbTextShadow;
 		textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
 		textHeight = _vm->_font->getHeight(kKnownFontMedium);
 	} else {
+		if (textId < 39 || textId > 50) {
+			// Read non-hardcoded strings from the LUT string table, loaded from the game
+			// data files
+			text = _vm->_script->_mainStrings.getString(IHNMTextStringIdsLUT[textId]);
+		} else {
+			// Hardcoded strings in IHNM are read from the ITE hardcoded strings
+			text = _vm->getTextString(textId);
+		}
+
+		textFont = kKnownFontVerb;
+		textShadowKnownColor = kKnownColorTransparent;
 		textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal);
 		textHeight = _vm->_font->getHeight(kKnownFontVerb);
 	}
@@ -2012,12 +2104,8 @@
 		}
 	}
 
-	if (_vm->getGameType() == GType_ITE)
-		_vm->_font->textDraw(kKnownFontMedium, ds, text, point,
-			_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
-	else
-		_vm->_font->textDraw(kKnownFontVerb, ds, text, point,
-			_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
+	_vm->_font->textDraw(textFont, ds, text, point,
+		_vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(textShadowKnownColor), kFontShadow);
 }
 
 void Interface::drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {

Modified: scummvm/trunk/engines/saga/itedata.cpp
===================================================================
--- scummvm/trunk/engines/saga/itedata.cpp	2007-06-13 21:07:15 UTC (rev 27395)
+++ scummvm/trunk/engines/saga/itedata.cpp	2007-06-13 22:23:12 UTC (rev 27396)
@@ -336,7 +336,7 @@
 	{ FX_CROWD_17,      64 }
 };
 
-const char *ITEinterfaceTextStrings[][56] = {
+const char *ITEinterfaceTextStrings[][52] = {
 	{
 		"Walk to", "Look At", "Pick Up", "Talk to", "Open",
 		"Close", "Use", "Give", "Options", "Test",
@@ -354,9 +354,7 @@
 		"There's no opening to close.",
 		"I don't know how to do that.",
 		"Show Dialog",
-		"What is Rif's reply?",
-		"Voices",				// IHNM
-		"Both", "Text", "Audio"	// IHNM
+		"What is Rif's reply?"
 	},
 	// German
 	{
@@ -376,9 +374,7 @@
 		"Hier ist keine \231ffnung zum Schlie$en.",
 		"Ich wei$ nicht, wie ich das machen soll.",
 		"Text zeigen",
-		"Wie lautet die Antwort?",
-		"Sprache",					// IHNM
-		"Beides", "Text", "Stimmen"	// IHNM
+		"Wie lautet die Antwort?"
 	}
 };
 

Modified: scummvm/trunk/engines/saga/itedata.h
===================================================================
--- scummvm/trunk/engines/saga/itedata.h	2007-06-13 21:07:15 UTC (rev 27395)
+++ scummvm/trunk/engines/saga/itedata.h	2007-06-13 22:23:12 UTC (rev 27396)
@@ -91,7 +91,7 @@
 extern ObjectTableData ITE_ObjectTable[ITE_OBJECTCOUNT];
 extern FxTable ITE_SfxTable[ITE_SFXCOUNT];
 
-extern const char *ITEinterfaceTextStrings[][56];
+extern const char *ITEinterfaceTextStrings[][52];
 
 #define PUZZLE_PIECES 15
 

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2007-06-13 21:07:15 UTC (rev 27395)
+++ scummvm/trunk/engines/saga/saga.h	2007-06-13 22:23:12 UTC (rev 27396)
@@ -281,12 +281,11 @@
 	kTextShowDialog,
 	kTextEnterProtectAnswer,
 	kTextVoices,
-	kTextBoth,
 	kTextText,
-	kTextAudio
+	kTextAudio,
+	kTextBoth
 };
 
-
 struct GameResourceDescription {
 	uint32 sceneLUTResourceId;
 	uint32 moduleLUTResourceId;


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