diff options
| author | Filippos Karapetis | 2007-06-13 22:23:12 +0000 | 
|---|---|---|
| committer | Filippos Karapetis | 2007-06-13 22:23:12 +0000 | 
| commit | 99c65ce24d42d72d7182c9c35a92e669a77e8868 (patch) | |
| tree | 123f25093cd6ea1acb11d41aec8920c546d4dbb1 | |
| parent | 810390393538842286205974568c287b5ffcbdc3 (diff) | |
| download | scummvm-rg350-99c65ce24d42d72d7182c9c35a92e669a77e8868.tar.gz scummvm-rg350-99c65ce24d42d72d7182c9c35a92e669a77e8868.tar.bz2 scummvm-rg350-99c65ce24d42d72d7182c9c35a92e669a77e8868.zip  | |
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
svn-id: r27396
| -rw-r--r-- | engines/saga/interface.cpp | 116 | ||||
| -rw-r--r-- | engines/saga/itedata.cpp | 10 | ||||
| -rw-r--r-- | engines/saga/itedata.h | 2 | ||||
| -rw-r--r-- | engines/saga/saga.h | 5 | 
4 files changed, 108 insertions, 25 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index ddd00a23e6..d969fe6c3f 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -80,6 +80,69 @@ static int verbTypeToTextStringsIdLUT[2][kVerbTypeIdsMax] = {  	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 @@ void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *p  	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 @@ void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *p  	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 @@ void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *p  	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 @@ void Interface::drawButtonBox(Surface *ds, const Rect& rect, ButtonKind kind, bo  	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 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut  	KnownColor textColor;  	Rect rect;  	int litButton = 0; +	KnownColor textShadowKnownColor = kKnownColorVerbTextShadow; +	KnownFont textFont = kKnownFontMedium;  	textId = panelButton->id;  	switch (panelButton->id) { @@ -1973,12 +2053,24 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut  			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 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut  		}  	} -	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) { diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp index 5e3d85c928..60082561e2 100644 --- a/engines/saga/itedata.cpp +++ b/engines/saga/itedata.cpp @@ -336,7 +336,7 @@ FxTable ITE_SfxTable[ITE_SFXCOUNT] = {  	{ 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 @@ const char *ITEinterfaceTextStrings[][56] = {  		"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 @@ const char *ITEinterfaceTextStrings[][56] = {  		"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?"  	}  }; diff --git a/engines/saga/itedata.h b/engines/saga/itedata.h index e9b5bda5bc..d9bd59adc4 100644 --- a/engines/saga/itedata.h +++ b/engines/saga/itedata.h @@ -91,7 +91,7 @@ struct FxTable {  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 diff --git a/engines/saga/saga.h b/engines/saga/saga.h index e406b487c7..9532d2fd56 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -281,12 +281,11 @@ enum TextStringIds {  	kTextShowDialog,  	kTextEnterProtectAnswer,  	kTextVoices, -	kTextBoth,  	kTextText, -	kTextAudio +	kTextAudio, +	kTextBoth  }; -  struct GameResourceDescription {  	uint32 sceneLUTResourceId;  	uint32 moduleLUTResourceId;  | 
