[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.187,1.188 game.cpp,1.101,1.102 interface.h,1.72,1.73 saga.h,1.125,1.126 sfuncs.cpp,1.165,1.166
Eugene Sandulenko
sev at users.sourceforge.net
Thu Sep 29 08:59:51 CEST 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4206
Modified Files:
actor.cpp game.cpp interface.h saga.h sfuncs.cpp
Log Message:
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.
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -d -r1.187 -r1.188
--- actor.cpp 28 Sep 2005 14:27:15 -0000 1.187
+++ actor.cpp 29 Sep 2005 15:57:41 -0000 1.188
@@ -1022,11 +1022,11 @@
_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 @@
}
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 @@
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));
}
}
Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- game.cpp 23 Sep 2005 13:20:10 -0000 1.101
+++ game.cpp 29 Sep 2005 15:57:41 -0000 1.102
@@ -693,7 +693,7 @@
{5},
{6},
{7},
- {8}
+ {8} // kIHNMMainFont
};
static GameSoundInfo IHNM_GameSound = {
Index: interface.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- interface.h 11 Aug 2005 16:13:10 -0000 1.72
+++ interface.h 29 Sep 2005 15:57:41 -0000 1.73
@@ -159,7 +159,7 @@
int replyBit;
};
-enum ITEColors {
+enum GameColors {
kITEColorBrightWhite = 0x01,
kITEColorWhite = 0x02,
kITEColorLightGrey = 0x04,
@@ -174,7 +174,9 @@
kITEColorLightBlue92 = 0x92,
kITEColorBlue = 0x93,
kITEColorLightBlue94 = 0x94,
- kITEColorLightBlue96 = 0x96
+ kITEColorLightBlue96 = 0x96,
+
+ kIHNMColorBlack = 0xfa
};
enum StatusTextInputState {
Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- saga.h 28 Sep 2005 15:49:20 -0000 1.125
+++ saga.h 29 Sep 2005 15:57:41 -0000 1.126
@@ -319,7 +319,9 @@
enum FontId {
kSmallFont,
kMediumFont,
- kBigFont
+ kBigFont,
+
+ kIHNMMainFont = 6
};
enum FontEffectFlags {
Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -d -r1.165 -r1.166
--- sfuncs.cpp 29 Sep 2005 15:35:30 -0000 1.165
+++ sfuncs.cpp 29 Sep 2005 15:57:41 -0000 1.166
@@ -1583,13 +1583,20 @@
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);
}
More information about the Scummvm-git-logs
mailing list