diff options
| author | Eugene Sandulenko | 2005-09-29 15:57:41 +0000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2005-09-29 15:57:41 +0000 | 
| commit | 36f77ad3f96745f45980b86f2d68cec40689c4c9 (patch) | |
| tree | 567672d03a2c39d1841f010cc157e6a5a2888c3d | |
| parent | a7ec941d301f24b3515194886fbfeee9a3f8acbb (diff) | |
| download | scummvm-rg350-36f77ad3f96745f45980b86f2d68cec40689c4c9.tar.gz scummvm-rg350-36f77ad3f96745f45980b86f2d68cec40689c4c9.tar.bz2 scummvm-rg350-36f77ad3f96745f45980b86f2d68cec40689c4c9.zip | |
Fix fonts in intro. It is a very dirty code. Actually we should specify
font Ids in game settings. Also uhnm demo will definitely not work with current
code as it has lesser number of fonts.
svn-id: r18900
| -rw-r--r-- | saga/actor.cpp | 12 | ||||
| -rw-r--r-- | saga/game.cpp | 2 | ||||
| -rw-r--r-- | saga/interface.h | 6 | ||||
| -rw-r--r-- | saga/saga.h | 4 | ||||
| -rw-r--r-- | saga/sfuncs.cpp | 11 | 
5 files changed, 23 insertions, 12 deletions
| diff --git a/saga/actor.cpp b/saga/actor.cpp index 59257b5872..f057630172 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -1022,11 +1022,11 @@ void Actor::handleSpeech(int msec) {  			_activeSpeech.drawRect.bottom = _speechBoxScript.bottom;  		} else {  			width = _activeSpeech.speechBox.width(); -			height = _vm->_font->getHeight(kMediumFont, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1; +			height = _vm->_font->getHeight((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;  			if (height > 40 && width < _vm->getDisplayWidth() - 100) {  				width = _vm->getDisplayWidth() - 100; -				height = _vm->_font->getHeight(kMediumFont, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1; +				height = _vm->_font->getHeight((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;  			}  			_activeSpeech.speechBox.setWidth(width); @@ -1635,8 +1635,8 @@ void Actor::drawSpeech(void) {  	}  	if (_activeSpeech.actorsCount > 1) { -		height = _vm->_font->getHeight(kMediumFont); -		width = _vm->_font->getStringWidth(kMediumFont, _activeSpeech.strings[0], 0, kFontNormal); +		height = _vm->_font->getHeight((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont)); +		width = _vm->_font->getStringWidth((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), _activeSpeech.strings[0], 0, kFontNormal);  		for (i = 0; i < _activeSpeech.actorsCount; i++) {  			actor = getActor(_activeSpeech.actorIds[i]); @@ -1645,11 +1645,11 @@ void Actor::drawSpeech(void) {  			textPoint.x = clamp( 10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);  			textPoint.y = clamp( 10, actor->_screenPosition.y - 58, _vm->getSceneHeight() - 10 - height); -			_vm->_font->textDraw(kMediumFont, backBuffer, _activeSpeech.strings[0], textPoint, +			_vm->_font->textDraw((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), backBuffer, _activeSpeech.strings[0], textPoint,  				_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));  		}  	} else { -		_vm->_font->textDrawRect(kMediumFont, backBuffer, _activeSpeech.strings[0], _activeSpeech.drawRect, _activeSpeech.speechColor[0], +		_vm->_font->textDrawRect((_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont), backBuffer, _activeSpeech.strings[0], _activeSpeech.drawRect, _activeSpeech.speechColor[0],  			_activeSpeech.outlineColor[0], _activeSpeech.getFontFlags(0));  	}  } diff --git a/saga/game.cpp b/saga/game.cpp index 05c41c3c0c..9593f707d1 100644 --- a/saga/game.cpp +++ b/saga/game.cpp @@ -693,7 +693,7 @@ static GameFontDescription IHNMCD_GameFonts[] = {  	{5},  	{6},  	{7}, -	{8} +	{8}   // kIHNMMainFont  };  static GameSoundInfo IHNM_GameSound = { diff --git a/saga/interface.h b/saga/interface.h index 78fa69b780..21b19300d5 100644 --- a/saga/interface.h +++ b/saga/interface.h @@ -159,7 +159,7 @@ struct Converse {  	int replyBit;  }; -enum ITEColors { +enum GameColors {  	kITEColorBrightWhite = 0x01,  	kITEColorWhite = 0x02,  	kITEColorLightGrey = 0x04, @@ -174,7 +174,9 @@ enum ITEColors {  	kITEColorLightBlue92 = 0x92,  	kITEColorBlue = 0x93,  	kITEColorLightBlue94 = 0x94, -	kITEColorLightBlue96 = 0x96 +	kITEColorLightBlue96 = 0x96, + +	kIHNMColorBlack = 0xfa  };  enum StatusTextInputState { diff --git a/saga/saga.h b/saga/saga.h index 577c908a38..c21bcc9670 100644 --- a/saga/saga.h +++ b/saga/saga.h @@ -319,7 +319,9 @@ enum GameFeatures {  enum FontId {  	kSmallFont,  	kMediumFont, -	kBigFont +	kBigFont, + +	kIHNMMainFont = 6  };  enum FontEffectFlags { diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 8dadea2938..b0508cba08 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -1583,13 +1583,20 @@ void Script::sfScriptText(SCRIPTFUNC_PARAMS) {  	point.y = thread->pop();  	text = thread->_strings->getString(stringId); -	width = _vm->_font->getStringWidth(kMediumFont, text, 0, kFontOutline); + +	if (_vm->getGameType() == GType_ITE) +		width = _vm->_font->getStringWidth(kMediumFont, text, 0, kFontOutline); +	else +		width = _vm->_font->getStringWidth(kIHNMMainFont, text, 0, kFontOutline);  	rect.top = point.y - 6;  	rect.setHeight(12);  	rect.left = point.x - width / 2;  	rect.setWidth(width); -	_vm->_actor->setSpeechColor(color, kITEColorBlack); +	if (_vm->getGameType() == GType_ITE) +		_vm->_actor->setSpeechColor(color, kITEColorBlack); +	else +		_vm->_actor->setSpeechColor(color, kIHNMColorBlack);  	_vm->_actor->nonActorSpeech(rect, &text, 1, -1, flags);  } | 
