[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.203,1.204 actor.h,1.99,1.100 font.cpp,1.39,1.40 font.h,1.19,1.20 interface.cpp,1.161,1.162 ite_introproc.cpp,1.71,1.72 itedata.cpp,1.12,1.13 itedata.h,1.10,1.11 objectmap.cpp,1.46,1.47 puzzle.cpp,1.18,1.19 puzzle.h,1.8,1.9 render.cpp,1.73,1.74 saga.h,1.137,1.138 scene.cpp,1.158,1.159 sfuncs.cpp,1.178,1.179

Andrew Kurushin h00ligan at users.sourceforge.net
Thu Nov 3 10:22:23 CET 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8078

Modified Files:
	actor.cpp actor.h font.cpp font.h interface.cpp 
	ite_introproc.cpp itedata.cpp itedata.h objectmap.cpp 
	puzzle.cpp puzzle.h render.cpp saga.h scene.cpp sfuncs.cpp 
Log Message:
-implement font substitution funcs
-move puzzle data to itedata

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- actor.cpp	21 Oct 2005 14:30:11 -0000	1.203
+++ actor.cpp	3 Nov 2005 18:20:10 -0000	1.204
@@ -1045,13 +1045,12 @@
 			_activeSpeech.drawRect.top = _speechBoxScript.top;
 			_activeSpeech.drawRect.bottom = _speechBoxScript.bottom;
 		} else {
-			FontId font = (_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont);
 			width = _activeSpeech.speechBox.width();
-			height = _vm->_font->getHeight(font, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
+			height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
 
 			if (height > 40 && width < _vm->getDisplayWidth() - 100) {
 				width = _vm->getDisplayWidth() - 100;
-				height = _vm->_font->getHeight(font, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
+				height = _vm->_font->getHeight(kKnownFontScript, _activeSpeech.strings[0], width - 2, _activeSpeech.getFontFlags(0)) + 1;
 			}
 
 			_activeSpeech.speechBox.setWidth(width);
@@ -1659,12 +1658,10 @@
 	} else {
 		outputString = _activeSpeech.strings[0];
 	}
-
-	FontId font = (_vm->getGameType() == GType_ITE ? kMediumFont : kIHNMMainFont);
-
+	
 	if (_activeSpeech.actorsCount > 1) {
-		height = _vm->_font->getHeight(font);
-		width = _vm->_font->getStringWidth(font, _activeSpeech.strings[0], 0, kFontNormal);
+		height = _vm->_font->getHeight(kKnownFontScript);
+		width = _vm->_font->getStringWidth(kKnownFontScript, _activeSpeech.strings[0], 0, kFontNormal);
 
 		for (i = 0; i < _activeSpeech.actorsCount; i++) {
 			actor = getActor(_activeSpeech.actorIds[i]);
@@ -1673,11 +1670,11 @@
 			textPoint.x = clamp(10, actor->_screenPosition.x - width / 2, _vm->getDisplayWidth() - 10 - width);
 			textPoint.y = clamp(10, actor->_screenPosition.y - 58, _vm->_scene->getHeight() - 10 - height);
 
-			_vm->_font->textDraw(font, backBuffer, _activeSpeech.strings[0], textPoint,
+			_vm->_font->textDraw(kKnownFontScript, backBuffer, _activeSpeech.strings[0], textPoint,
 				_activeSpeech.speechColor[i], _activeSpeech.outlineColor[i], _activeSpeech.getFontFlags(i));
 		}
 	} else {
-		_vm->_font->textDrawRect(font, backBuffer, _activeSpeech.strings[0], _activeSpeech.drawRect, _activeSpeech.speechColor[0],
+		_vm->_font->textDrawRect(kKnownFontScript, backBuffer, _activeSpeech.strings[0], _activeSpeech.drawRect, _activeSpeech.speechColor[0],
 			_activeSpeech.outlineColor[0], _activeSpeech.getFontFlags(0));
 	}
 }

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.h,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- actor.h	18 Oct 2005 01:30:19 -0000	1.99
+++ actor.h	3 Nov 2005 18:20:11 -0000	1.100
@@ -33,6 +33,7 @@
 #include "saga/itedata.h"
 #include "saga/list.h"
 #include "saga/saga.h"
+#include "saga/font.h"
 
 namespace Saga {
 

Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/font.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- font.cpp	18 Oct 2005 01:30:19 -0000	1.39
+++ font.cpp	3 Nov 2005 18:20:11 -0000	1.40
@@ -62,9 +62,6 @@
 	}
 }
 
-FontData *Font::getFont(FontId fontId) {
-	return _fonts[fontId];
-}
 
 void Font::loadFont(uint32 fontResourceId) {
 	FontData *font;
@@ -239,9 +236,9 @@
 }
 
 // Returns the horizontal length in pixels of the graphical representation
-// of at most 'test_str_ct' characters of the string 'test_str', taking
+// of at most 'count' characters of the string 'text', taking
 // into account any formatting options specified by 'flags'.
-// If 'test_str_ct' is 0, all characters of 'test_str' are counted.
+// If 'count' is 0, all characters of 'test' are counted.
 int Font::getStringWidth(FontId fontId, const char *text, size_t count, FontEffectFlags flags) {
 	FontData *font;
 	size_t ct;
@@ -249,8 +246,7 @@
 	int ch;
 	const byte *txt;
 
-	validate(fontId);
-
+	
 	font = getFont(fontId);
 
 	txt = (const byte *) text;
@@ -270,23 +266,12 @@
 	return width;
 }
 
-int Font::getHeight(FontId fontId) {
-	FontData *font;
-
-	validate(fontId);
-
-	font = getFont(fontId);
-
-	return font->normal.header.charHeight;
-}
 
 void Font::draw(FontId fontId, Surface *ds, const char *text, size_t count, const Common::Point &point,
 			   int color, int effectColor, FontEffectFlags flags) {
 	FontData *font;
 	Point offsetPoint(point);
 
-	validate(fontId);
-
 	font = getFont(fontId);
 
 	if (flags & kFontOutline) {
@@ -639,4 +624,57 @@
 	}
 }
 
+FontId Font::knownFont2FontIdx(KnownFont font) {
+	FontId fontId = kSmallFont;
+
+	if (_vm->getGameType() == GType_ITE) {
+		switch (font)
+		{
+		case (kKnownFontSmall):
+			fontId = kSmallFont;
+			break;
+		case (kKnownFontMedium):
+			fontId = kMediumFont;
+			break;
+		case (kKnownFontBig):
+			fontId = kBigFont;
+			break;
+
+		case (kKnownFontVerb):
+			fontId = kSmallFont;
+			break;
+		case (kKnownFontScript):
+			fontId = kMediumFont;
+			break;
+		case (kKnownFontPause):
+			fontId = _vm->_font->valid(kBigFont) ? kBigFont : kMediumFont;
+			break;
+		}
+	} else if (_vm->getGameType() == GType_IHNM) {
+		switch (font)
+		{
+		case (kKnownFontSmall):
+			fontId = kSmallFont;
+			break;
+		case (kKnownFontMedium):
+			fontId = kMediumFont;
+			break;
+		case (kKnownFontBig):
+			fontId = kBigFont;
+			break;
+
+		case (kKnownFontVerb):
+			fontId = kIHNMFont8;
+			break;
+		case (kKnownFontScript):
+			fontId = kIHNMMainFont;
+			break;
+		case (kKnownFontPause):
+			fontId = kMediumFont; // unchecked
+			break;
+		}
+	}
+	return fontId;
+}
+
 } // End of namespace Saga

Index: font.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/font.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- font.h	18 Oct 2005 01:30:19 -0000	1.19
+++ font.h	3 Nov 2005 18:20:12 -0000	1.20
@@ -53,6 +53,35 @@
 #define TEXT_MARGIN 10
 #define TEXT_LINESPACING 2
 
+enum FontId {
+	kSmallFont,
+	kMediumFont,
+	kBigFont,
+	kIHNMUnknown,
+	kIHNMFont8,
+	kIHNMUnknown2,
+	kIHNMMainFont
+};
+
+enum FontEffectFlags {
+	kFontNormal   = 0,
+	kFontOutline  = 1 << 0,
+	kFontShadow   = 1 << 1,
+	kFontBold     = 1 << 2,
+	kFontCentered = 1 << 3,
+	kFontDontmap  = 1 << 4
+};
+
+enum KnownFont {
+	kKnownFontSmall,
+	kKnownFontMedium,
+	kKnownFontBig,
+
+	kKnownFontPause,
+	kKnownFontScript,
+	kKnownFontVerb,
+};
+
 struct TextListEntry {
 	bool display;
 	bool useRect;
@@ -61,7 +90,7 @@
 	int color;
 	int effectColor;
 	FontEffectFlags flags;
-	FontId fontId;
+	KnownFont font;
 	const char *text;
 	TextListEntry() {
 		memset(this, 0, sizeof(*this));
@@ -105,38 +134,62 @@
  public:
 	Font(SagaEngine *vm);
 	~Font(void);
-	FontData *getFont(FontId fontId);
-	int getStringWidth(FontId fontId, const char *text, size_t count, FontEffectFlags flags);
-	int getHeight(FontId fontId);
-	int getHeight(FontId fontId, const char *text, int width, FontEffectFlags flags);
+	int getStringWidth(KnownFont font, const char *text, size_t count, FontEffectFlags flags) {
+		return getStringWidth(knownFont2FontIdx(font), text, count, flags);
+	}
+	int getHeight(KnownFont font) {
+		return getHeight(knownFont2FontIdx(font));
+	}
+	int getHeight(KnownFont font, const char *text, int width, FontEffectFlags flags) {
+		return getHeight(knownFont2FontIdx(font), text, width, flags);
+	}
+	void textDraw(KnownFont font, Surface *ds, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags) {
+		textDraw(knownFont2FontIdx(font), ds, string, point, color, effectColor, flags);
+	}
+	void textDrawRect(KnownFont font, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags) {
+		textDrawRect(knownFont2FontIdx(font), ds, text, rect, color, effectColor, flags);
+	}
+	
+ private:
+	 FontId knownFont2FontIdx(KnownFont font);
 
-	void textDraw(FontId fontId, Surface *ds, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
-	void textDrawRect(FontId fontId, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags);
+	 int getStringWidth(FontId fontId, const char *text, size_t count, FontEffectFlags flags);
+	 int getHeight(FontId fontId, const char *text, int width, FontEffectFlags flags);
+	 void textDrawRect(FontId fontId, Surface *ds, const char *text, const Common::Rect &rect, int color, int effectColor, FontEffectFlags flags);
+	 void textDraw(FontId fontId, Surface *ds, const char *string, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
 
-	void validate(FontId fontId) {
-		if ((fontId < 0) || (fontId >= _loadedFonts)) {
-			error("Font::validate: Invalid font id.");
-		}
-	}
+	 void loadFont(uint32 fontResourceId);
+	 void createOutline(FontData *font);
+	 void draw(FontId fontId, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
+	 void outFont(const FontStyle &drawFont, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags);
+	 
+	 FontData *getFont(FontId fontId) {
+		 validate(fontId);
+		 return _fonts[fontId];
+	 }
 
-	bool loaded(FontId fontId) {
-		return !((fontId < 0) || (fontId >= _loadedFonts));
-	}
+public:
+	int Font::getHeight(FontId fontId) {
+		 return getFont(fontId)->normal.header.charHeight;
+	 }
 
- private:
-	void loadFont(uint32 fontResourceId);
-	void createOutline(FontData *font);
-	void draw(FontId fontId, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, int effectColor, FontEffectFlags flags);
-	void outFont(const FontStyle &drawFont, Surface *ds, const char *text, size_t count, const Common::Point &point, int color, FontEffectFlags flags);
-	int getByteLen(int numBits) const {
-		int byteLength = numBits / 8;
+	 void validate(FontId fontId) {
+		 if (!valid(fontId)) {
+			 error("Font::validate: Invalid font id.");
+		 }
+	 }
+	 bool valid(FontId fontId) {
+		 return ((fontId >= 0) && (fontId < _loadedFonts));
+	 }
+	 int getByteLen(int numBits) const {
+		 int byteLength = numBits / 8;
 
-		if (numBits % 8) {
-			byteLength++;
-		}
+		 if (numBits % 8) {
+			 byteLength++;
+		 }
 
-		return byteLength;
-	}
+		 return byteLength;
+	 }
 
 	static const int _charMap[256];
 	SagaEngine *_vm;

Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- interface.cpp	18 Oct 2005 01:30:19 -0000	1.161
+++ interface.cpp	3 Nov 2005 18:20:12 -0000	1.162
@@ -728,14 +728,14 @@
 	text = _vm->getTextString(panelButton->id);
 	panel->calcPanelButtonRect(panelButton, rect);
 	if (panelButton->xOffset < 0) {
-		textWidth = _vm->_font->getStringWidth(kMediumFont, text, 0, kFontNormal);
+		textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
 		rect.left += 2 + (panel->imageWidth - 1 - textWidth) / 2;
 	}
 
 	textPoint.x = rect.left;
 	textPoint.y = rect.top + 1;
 
-	_vm->_font->textDraw(kMediumFont, ds, text, textPoint,
+	_vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint,
 		_vm->getDisplayInfo().verbTextColor, _vm->getDisplayInfo().verbTextShadowColor, kFontShadow);
 }
 
@@ -796,7 +796,7 @@
 			text = _vm->getSaveFile(idx)->name;
 			textPoint.x = rect.left + 1;
 			textPoint.y = rect2.top;
-			_vm->_font->textDraw(kSmallFont, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
+			_vm->_font->textDraw(kKnownFontSmall, backBuffer, text, textPoint, fgColor, 0, kFontNormal);
 		}
 	}
 
@@ -1003,8 +1003,8 @@
 			(ascii == ' ')) {
 			if (_textInputStringLength < SAVE_TITLE_SIZE - 1) {
 				ch[0] = ascii;
-				tempWidth = _vm->_font->getStringWidth(kSmallFont, ch, 0, kFontNormal);
-				tempWidth += _vm->_font->getStringWidth(kSmallFont, _textInputString, 0, kFontNormal);
+				tempWidth = _vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal);
+				tempWidth += _vm->_font->getStringWidth(kKnownFontSmall, _textInputString, 0, kFontNormal);
 				if (tempWidth > _textInputMaxWidth) {
 									break;
 				}
@@ -1045,7 +1045,7 @@
 
 	i = 0;
 	while ((ch[0] = _textInputString[i++]) != 0) {
-		rect.setWidth(_vm->_font->getStringWidth(kSmallFont, ch, 0, kFontNormal));
+		rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal));
 		if ((i == _textInputPos) && _textInput) {
 			fgColor = kITEColorBlack;
 			ds->fillRect(rect, kITEColorWhite);
@@ -1055,12 +1055,12 @@
 		textPoint.x = rect.left;
 		textPoint.y = rect.top + 1;
 
-		_vm->_font->textDraw(kSmallFont, ds, ch, textPoint, fgColor, 0, kFontNormal);
+		_vm->_font->textDraw(kKnownFontSmall, ds, ch, textPoint, fgColor, 0, kFontNormal);
 		rect.left += rect.width();
 	}
 	if (_textInput && (_textInputPos >= i)) {
 		ch[0] = ' ';
-		rect.setWidth(_vm->_font->getStringWidth(kSmallFont, ch, 0, kFontNormal));
+		rect.setWidth(_vm->_font->getStringWidth(kKnownFontSmall, ch, 0, kFontNormal));
 		ds->fillRect(rect, kITEColorWhite);
 	}
 }
@@ -1546,7 +1546,7 @@
 
 	backBuffer->drawRect(rect, _vm->getDisplayInfo().statusBGColor);
 
-	stringWidth = _vm->_font->getStringWidth(kSmallFont, _statusText, 0, kFontNormal);
+	stringWidth = _vm->_font->getStringWidth(kKnownFontSmall, _statusText, 0, kFontNormal);
 
 	if (_statusOnceColor == -1)
 		color = _vm->getDisplayInfo().statusTextColor;
@@ -1555,7 +1555,7 @@
 
 	textPoint.x = _vm->getDisplayInfo().statusXOffset + (_vm->getDisplayInfo().statusWidth - stringWidth) / 2;
 	textPoint.y = _vm->getDisplayInfo().statusYOffset + _vm->getDisplayInfo().statusTextY;
-	_vm->_font->textDraw(kSmallFont, backBuffer, _statusText, textPoint, color, 0, kFontNormal);
+	_vm->_font->textDraw(kKnownFontSmall, backBuffer, _statusText, textPoint, color, 0, kFontNormal);
 
 	if (_saveReminderState > 0) {
 		rect.left = _vm->getDisplayInfo().saveReminderXOffset;
@@ -1922,8 +1922,8 @@
 	}
 	text = _vm->getTextString(textId);
 
-	textWidth = _vm->_font->getStringWidth(kMediumFont, text, 0, kFontNormal);
-	textHeight = _vm->_font->getHeight(kMediumFont);
+	textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
+	textHeight = _vm->_font->getHeight(kKnownFontMedium);
 
 	point.x = panel->x + panelButton->xOffset + (panelButton->width / 2) - (textWidth / 2);
 	point.y = panel->y + panelButton->yOffset + (panelButton->height / 2) - (textHeight / 2);
@@ -1937,7 +1937,7 @@
 	panel->calcPanelButtonRect(panelButton, rect);
 	drawButtonBox(ds, rect, kButton, panelButton->state > 0);
 
-	_vm->_font->textDraw(kMediumFont, ds, text, point,
+	_vm->_font->textDraw(kKnownFontMedium, ds, text, point,
 		textColor, _vm->getDisplayInfo().verbTextShadowColor, kFontShadow);
 }
 
@@ -1966,20 +1966,17 @@
 	int textWidth;
 	Point point;
 	int textId;
-	FontId font;
 
 	if (_vm->getGameType() == GType_ITE) {
 		textId = verbTypeToTextStringsIdLUT[0][panelButton->id];
 		text = _vm->getTextString(textId);
-		font = kSmallFont;
 	} else {
 		textId = verbTypeToTextStringsIdLUT[1][panelButton->id];
 		text = _vm->_script->_mainStrings.getString(textId + 1);
-		font = kIHNMFont8;
 		textShadowColor = 0;
 	}
 
-	textWidth = _vm->_font->getStringWidth(font, text, 0, kFontNormal);
+	textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal);
 
 	if (_vm->getGameType() == GType_ITE) {
 		point.x = _mainPanel.x + panelButton->xOffset + 1 + (panelButton->width - 1 - textWidth) / 2;
@@ -1989,7 +1986,7 @@
 		point.y = _mainPanel.y + panelButton->yOffset + 12;
 	}
 
-	_vm->_font->textDraw(font, ds, text, point, textColor, textShadowColor, (textShadowColor != 0) ? kFontShadow : kFontNormal);
+	_vm->_font->textDraw(kKnownFontVerb, ds, text, point, textColor, textShadowColor, (textShadowColor != 0) ? kFontShadow : kFontNormal);
 }
 
 
@@ -2035,7 +2032,7 @@
 		for (i = len; i >= 0; i--) {
 			c = _converseWorkString[i];
 
-			if ((c == ' ' || c == '\0') && (_vm->_font->getStringWidth(kSmallFont, _converseWorkString, i, kFontNormal) <= _vm->getDisplayInfo().converseMaxTextWidth)) {
+			if ((c == ' ' || c == '\0') && (_vm->_font->getStringWidth(kKnownFontSmall, _converseWorkString, i, kFontNormal) <= _vm->getDisplayInfo().converseMaxTextWidth)) {
 				break;
 			}
 		}
@@ -2144,11 +2141,11 @@
 			textPoint.x = rect.left - 6;
 			textPoint.y = rect.top;
 
-			_vm->_font->textDraw(kSmallFont, ds, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
+			_vm->_font->textDraw(kKnownFontSmall, ds, bullet, textPoint, bulletForegnd, bulletBackgnd, (FontEffectFlags)(kFontShadow | kFontDontmap));
 		}
 		textPoint.x = rect.left + 1;
 		textPoint.y = rect.top;
-		_vm->_font->textDraw(kSmallFont, ds, str, textPoint, foregnd, kITEColorBlack, kFontShadow);
+		_vm->_font->textDraw(kKnownFontSmall, ds, str, textPoint, foregnd, kITEColorBlack, kFontShadow);
 	}
 
 	if (_converseStartPos != 0) {

Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- ite_introproc.cpp	18 Oct 2005 01:30:19 -0000	1.71
+++ ite_introproc.cpp	3 Nov 2005 18:20:12 -0000	1.72
@@ -101,7 +101,7 @@
 	textEntry.rect.right = _vm->getDisplayWidth();
 	textEntry.rect.top = (_vm->getLanguage() == Common::DE_DEU) ? INTRO_DE_CAPTION_Y : INTRO_CAPTION_Y;
 	textEntry.rect.bottom = _vm->getDisplayHeight();
-	textEntry.fontId = kMediumFont;
+	textEntry.font = kKnownFontMedium;
 	textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
 
 	for (i = 0; i < n_dialogues; i++) {
@@ -182,7 +182,7 @@
 
 	int line_spacing = 0;
 	int paragraph_spacing;
-	FontId font = kSmallFont;
+	KnownFont font = kKnownFontSmall;
 	int i;
 
 	int n_paragraphs = 0;
@@ -199,12 +199,12 @@
 
 		switch (credits[i].type) {
 		case kCHeader:
-			font = kSmallFont;
+			font = kKnownFontSmall;
 			line_spacing = 4;
 			n_paragraphs++;
 			break;
 		case kCText:
-			font = kMediumFont;
+			font = kKnownFontMedium;
 			line_spacing = 2;
 			break;
 		default:
@@ -240,12 +240,12 @@
 
 		switch (credits[i].type) {
 		case kCHeader:
-			font = kSmallFont;
+			font = kKnownFontSmall;
 			line_spacing = 4;
 			y += paragraph_spacing;
 			break;
 		case kCText:
-			font = kMediumFont;
+			font = kKnownFontMedium;
 			line_spacing = 2;
 			break;
 		default:
@@ -253,7 +253,7 @@
 		}
 
 		textEntry.text = credits[i].string;
-		textEntry.fontId = font;
+		textEntry.font = font;
 		textEntry.point.y = y;
 
 		entry = _vm->_scene->_textList.addEntry(textEntry);

Index: itedata.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/itedata.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- itedata.cpp	18 Oct 2005 01:30:19 -0000	1.12
+++ itedata.cpp	3 Nov 2005 18:20:12 -0000	1.13
@@ -376,5 +376,108 @@
 	}
 };
 
+Point pieceOrigins[PUZZLE_PIECES] = {
+	Point(268,  18),
+	Point(270,  51),
+	Point( 19,  51),
+	Point( 73,   0),
+	Point(  0,  34),
+	Point(215,   0),
+	Point(159,   0),
+	Point(  9,  69),
+	Point(288,  18),
+	Point(112,   0),
+	Point( 27,  88),
+	Point( 43,   0),
+	Point(  0,   0),
+	Point(262,   0),
+	Point(271, 103)
+};
+
+const char *pieceNames[][PUZZLE_PIECES] = {
+	{ "screwdriver", "pliers", "c-clamp", "wood clamp", "level",
+	"twine", "wood plane", "claw hammer", "tape measure", "hatchet",
+	"shears", "ruler", "saw", "mallet", "paint brush"
+	},
+	{ "Schraubendreher", "Zange", "Schraubzwinge", "Holzzwinge", "Wasserwaage",
+	"Bindfaden", "Hobel", "Schusterhammer", "Bandma$", "Beil",
+	"Schere", "Winkel", "S\204ge", "Hammer", "Pinsel"
+	}
+};
+
+const char *hintStr[][4] = {
+	{ "Check which pieces could fit in each corner first.",
+	"Check which corner has the least number of pieces that can fit and start from there.",
+	"Check each new corner and any new side for pieces that fit.",
+	"I don't see anything out of place."
+	},
+	{ "\232berpr\201fe zun\204chst, welche die Eckteile sein k\224nnten.",
+	"Schau, in welche Ecke die wenigsten Teile passen, und fang dort an.",
+	"Untersuche jede Ecke und jede Seite auf Teile, die dort passen k\224nnen.",
+	"Ich sehe nichts an der falschen Stelle."
+	}
+};
+
+const char *solicitStr[][NUM_SOLICIT_REPLIES] = {
+	{ "Hey, Fox! Would you like a hint?",
+	"Would you like some help?",
+	"Umm...Umm...",
+	"Psst! want a hint?",
+	"I would have done this differently, you know."
+	},
+	{ "Hey, Fuchs! Brauchst Du \047nen Tip?",
+	"M\224chtest Du etwas Hilfe?"
+	"\231hm...\216hm..."
+	"Psst! \047n Tip vielleicht?"
+	"Ja, wei$t Du... ich h\204tte das anders gemacht."
+	}
+};
+
+const char portraitList[] = {
+	RID_ITE_JFERRET_SERIOUS,
+	RID_ITE_JFERRET_GOOFY,
+	RID_ITE_JFERRET_SERIOUS,
+	RID_ITE_JFERRET_GOOFY,
+	RID_ITE_JFERRET_ALOOF
+};
+
+const char *sakkaStr[][NUM_SAKKA] = {
+	{ "Hey, you're not supposed to help the applicants!",
+	"Guys! This is supposed to be a test!",
+	"C'mon fellows, that's not in the rules!"
+	},
+	{ "Hey, Du darfst dem Pr\201fling nicht helfen!",
+	"Hallo?! Dies soll eine Pr\201fung sein!",
+	"Also, Jungs. Schummeln steht nicht in den Regeln!"
+	}
+};
+
+const char *whineStr[][NUM_WHINES] = {
+	{ "Aww, c'mon Sakka!",
+	"One hint won't hurt, will it?",
+	"Sigh...",
+	"I think that clipboard has gone to your head, Sakka!",
+	"Well, I don't recall any specific rule against hinting."
+	},
+	{ "Och, sei nicht so, Sakka!"
+	"EIN Tip wird schon nicht schaden, oder?",
+	"Seufz..."
+	"Ich glaube, Du hast ein Brett vor dem Kopf, Sakka!",
+	"Hm, ich kann mich an keine Regel erinnern, die Tips verbietet."
+	}
+};
+
+const char *optionsStr[][4] = {
+	{ "\"I'll do this puzzle later.\"",
+	"\"Yes, I'd like a hint please.\"",
+	"\"No, thank you, I'd like to try and solve it myself.\"",
+	"I think the %s is in the wrong place."
+	},
+	{ "\"Ich l\224se das Puzzle sp\204ter.\"",
+	"\"Ja, ich m\224chte einen Tip, bitte.\"",
+	"\"Nein danke, ich m\224chte das alleine l\224sen.\"",
+	"Pssst... %s... falsche Stelle..."
+	}
+};
 
 } // End of namespace Saga

Index: itedata.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/itedata.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- itedata.h	18 Oct 2005 01:30:19 -0000	1.10
+++ itedata.h	3 Nov 2005 18:20:12 -0000	1.11
@@ -89,6 +89,24 @@
 
 extern const char *ITEinterfaceTextStrings[][52];
 
+#define PUZZLE_PIECES 15
+
+extern Point pieceOrigins[PUZZLE_PIECES];
+extern const char *pieceNames[][PUZZLE_PIECES];
+
+#define NUM_SOLICIT_REPLIES 5
+extern const char *solicitStr[][NUM_SOLICIT_REPLIES];
+
+#define NUM_SAKKA 3
+extern const char *sakkaStr[][NUM_SAKKA];
+
+#define NUM_WHINES 5
+extern const char *whineStr[][NUM_WHINES];
+
+extern const char *hintStr[][4];
+extern const char portraitList[];
+extern const char *optionsStr[][4];
+
 } // End of namespace Saga
 
 #endif

Index: objectmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/objectmap.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- objectmap.cpp	18 Oct 2005 01:30:19 -0000	1.46
+++ objectmap.cpp	3 Nov 2005 18:20:12 -0000	1.47
@@ -242,7 +242,7 @@
 		snprintf(txtBuf, sizeof(txtBuf), "hitZone %d", hitZoneIndex);
 		textPoint.x = 2;
 		textPoint.y = 2;
-		_vm->_font->textDraw(kSmallFont, ds, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
+		_vm->_font->textDraw(kKnownFontSmall, ds, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
 }
 

Index: puzzle.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/puzzle.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- puzzle.cpp	18 Oct 2005 01:30:19 -0000	1.18
+++ puzzle.cpp	3 Nov 2005 18:20:12 -0000	1.19
@@ -41,99 +41,6 @@
 #define PUZZLE_MOVED		0x04   // 1 when somewhere in the box
 #define PUZZLE_ALL_SET		PUZZLE_FIT | PUZZLE_MOVED
 
-static Point pieceOrigins[PUZZLE_PIECES] = {
-	Point(268,  18),
-	Point(270,  51),
-	Point( 19,  51),
-	Point( 73,   0),
-	Point(  0,  34),
-	Point(215,   0),
-	Point(159,   0),
-	Point(  9,  69),
-	Point(288,  18),
-	Point(112,   0),
-	Point( 27,  88),
-	Point( 43,   0),
-	Point(  0,   0),
-	Point(262,   0),
-	Point(271, 103)
-};
-
-const char *pieceNames[][PUZZLE_PIECES] = {
-	{ "screwdriver", "pliers", "c-clamp", "wood clamp", "level",
-	  "twine", "wood plane", "claw hammer", "tape measure", "hatchet",
-	  "shears", "ruler", "saw", "mallet", "paint brush"
-	},
-	{ "Schraubendreher", "Zange", "Schraubzwinge", "Holzzwinge", "Wasserwaage",
-	  "Bindfaden", "Hobel", "Schusterhammer", "Bandma$", "Beil",
-	  "Schere", "Winkel", "S\204ge", "Hammer", "Pinsel"
-	}
-};
-
-const char *hintStr[][4] = {
-	{ "Check which pieces could fit in each corner first.",
-	  "Check which corner has the least number of pieces that can fit and start from there.",
-	  "Check each new corner and any new side for pieces that fit.",
-	  "I don't see anything out of place."
-	},
-	{ "\232berpr\201fe zun\204chst, welche die Eckteile sein k\224nnten.",
-	  "Schau, in welche Ecke die wenigsten Teile passen, und fang dort an.",
-	  "Untersuche jede Ecke und jede Seite auf Teile, die dort passen k\224nnen.",
-	  "Ich sehe nichts an der falschen Stelle."
-	}
-};
-
-#define NUM_SOLICIT_REPLIES 5
-const char *solicitStr[][NUM_SOLICIT_REPLIES] = {
-	{ "Hey, Fox! Would you like a hint?",
-	  "Would you like some help?",
-	  "Umm...Umm...",
-	  "Psst! want a hint?",
-	  "I would have done this differently, you know."
-	},
-	{ "Hey, Fuchs! Brauchst Du \047nen Tip?",
-	  "M\224chtest Du etwas Hilfe?"
-	  "\231hm...\216hm..."
-	  "Psst! \047n Tip vielleicht?"
-	  "Ja, wei$t Du... ich h\204tte das anders gemacht."
-	}
-};
-
-const char portraitList[] = {
-	RID_ITE_JFERRET_SERIOUS,
-	RID_ITE_JFERRET_GOOFY,
-	RID_ITE_JFERRET_SERIOUS,
-	RID_ITE_JFERRET_GOOFY,
-	RID_ITE_JFERRET_ALOOF
-};
-
-#define NUM_SAKKA 3
-const char *sakkaStr[][NUM_SAKKA] = {
-	{ "Hey, you're not supposed to help the applicants!",
-	  "Guys! This is supposed to be a test!",
-	  "C'mon fellows, that's not in the rules!"
-	},
-	{ "Hey, Du darfst dem Pr\201fling nicht helfen!",
-	  "Hallo?! Dies soll eine Pr\201fung sein!",
-	  "Also, Jungs. Schummeln steht nicht in den Regeln!"
-	}
-};
-
-#define NUM_WHINES 5
-const char *whineStr[][NUM_WHINES] = {
-	{ "Aww, c'mon Sakka!",
-	  "One hint won't hurt, will it?",
-	  "Sigh...",
-	  "I think that clipboard has gone to your head, Sakka!",
-	  "Well, I don't recall any specific rule against hinting."
-	},
-	{ "Och, sei nicht so, Sakka!"
-	  "EIN Tip wird schon nicht schaden, oder?",
-	  "Seufz..."
-	  "Ich glaube, Du hast ein Brett vor dem Kopf, Sakka!",
-	  "Hm, ich kann mich an keine Regel erinnern, die Tips verbietet."
-	}
-};
 
 enum rifOptions {
 	kROLater = 0,
@@ -142,19 +49,6 @@
 	kROHint = 3
 };
 
-const char *optionsStr[][4] = {
-	{ "\"I'll do this puzzle later.\"",
-	  "\"Yes, I'd like a hint please.\"",
-	  "\"No, thank you, I'd like to try and solve it myself.\"",
-	  "I think the %s is in the wrong place."
-	},
-	{ "\"Ich l\224se das Puzzle sp\204ter.\"",
-	  "\"Ja, ich m\224chte einen Tip, bitte.\"",
-	  "\"Nein danke, ich m\224chte das alleine l\224sen.\"",
-	  "Pssst... %s... falsche Stelle..."
-	}
-};
-
 Puzzle::Puzzle(SagaEngine *vm) : _vm(vm), _solved(false), _active(false) {
 	_lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 

Index: puzzle.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/puzzle.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- puzzle.h	18 Oct 2005 01:30:19 -0000	1.8
+++ puzzle.h	3 Nov 2005 18:20:12 -0000	1.9
@@ -24,7 +24,6 @@
 
 namespace Saga {
 
-#define PUZZLE_PIECES 15
 
 #define PUZZLE_SOUNDS         3622
 #define PUZZLE_TOOL_SOUNDS    (PUZZLE_SOUNDS + 0)

Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- render.cpp	18 Oct 2005 01:30:19 -0000	1.73
+++ render.cpp	3 Nov 2005 18:20:12 -0000	1.74
@@ -141,20 +141,18 @@
 	// Display rendering information
 	if (_flags & RF_SHOW_FPS) {
 		sprintf(txtBuffer, "%d", _fps);
-		textPoint.x = backBufferSurface->w - _vm->_font->getStringWidth(kSmallFont, txtBuffer, 0, kFontOutline);
+		textPoint.x = backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontSmall, txtBuffer, 0, kFontOutline);
 		textPoint.y = 2;
 
-		_vm->_font->textDraw(kSmallFont, backBufferSurface, txtBuffer, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
+		_vm->_font->textDraw(kKnownFontSmall, backBufferSurface, txtBuffer, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
 
 	// Display "paused game" message, if applicable
 	if (_flags & RF_RENDERPAUSE) {
-		FontId fontId = _vm->_font->loaded(kBigFont) ? kBigFont : kMediumFont;
-
-		textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(fontId, pauseString, 0, kFontOutline)) / 2;
+		textPoint.x = (backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontPause, pauseString, 0, kFontOutline)) / 2;
 		textPoint.y = 90;
 
-		_vm->_font->textDraw(fontId, backBufferSurface, pauseString, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
+		_vm->_font->textDraw(kKnownFontPause, backBufferSurface, pauseString, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
 
 	// Update user interface
@@ -163,7 +161,7 @@
 	// Display text formatting test, if applicable
 	if (_flags & RF_TEXT_TEST) {
 		Rect rect(mousePoint.x, mousePoint.y, mousePoint.x + 100, mousePoint.y + 50);
-		_vm->_font->textDrawRect(kMediumFont, backBufferSurface, test_txt, rect,
+		_vm->_font->textDrawRect(kKnownFontMedium, backBufferSurface, test_txt, rect,
 				kITEColorBrightWhite, kITEColorBlack, (FontEffectFlags)(kFontOutline | kFontCentered));
 	}
 

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- saga.h	18 Oct 2005 01:30:19 -0000	1.137
+++ saga.h	3 Nov 2005 18:20:12 -0000	1.138
@@ -321,24 +321,6 @@
 	GF_SCENE_SUBSTITUTES = 1 << 3
 };
 
-enum FontId {
-	kSmallFont,
-	kMediumFont,
-	kBigFont,
-
-	kIHNMFont8 = 4,
-	kIHNMMainFont = 6
-};
-
-enum FontEffectFlags {
-	kFontNormal   = 0,
-	kFontOutline  = 1 << 0,
-	kFontShadow   = 1 << 1,
-	kFontBold     = 1 << 2,
-	kFontCentered = 1 << 3,
-	kFontDontmap  = 1 << 4
-};
-
 struct GameSoundInfo {
 	GameSoundTypes resourceType;
 	long frequency;
@@ -685,8 +667,6 @@
 
 public:
 	bool initGame(void);
-//	RSCFILE_CONTEXT *getFileContext(uint16 type, int param);
-//	bool isBigEndianFile(const char *filename);
 public:
 	const GameDescription *getGameDescription() const { return _gameDescription; }
 	const bool isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- scene.cpp	22 Oct 2005 12:47:09 -0000	1.158
+++ scene.cpp	3 Nov 2005 18:20:12 -0000	1.159
@@ -240,9 +240,9 @@
 		if (entry->display) {
 
 			if (entry->useRect) {
-				_vm->_font->textDrawRect(entry->fontId, ds, entry->text, entry->rect, entry->color, entry->effectColor, entry->flags);
+				_vm->_font->textDrawRect(entry->font, ds, entry->text, entry->rect, entry->color, entry->effectColor, entry->flags);
 			} else {
-				_vm->_font->textDraw(entry->fontId, ds, entry->text, entry->point, entry->color, entry->effectColor, entry->flags);
+				_vm->_font->textDraw(entry->font, ds, entry->text, entry->point, entry->color, entry->effectColor, entry->flags);
 			}
 		}
 	}
@@ -452,9 +452,9 @@
 				}
 
 				_vm->_interface->setStatusText("Click or Press Return to continue. Press Q to quit.", 96);
-				_vm->_font->textDrawRect(kMediumFont, backBuffer, sceneSubstitutes[i].title,
+				_vm->_font->textDrawRect(kKnownFontMedium, backBuffer, sceneSubstitutes[i].title,
 					 Common::Rect(0, 7, _vm->getDisplayWidth(), 27), 1, 15, kFontOutline);
-				_vm->_font->textDrawRect(kMediumFont, backBuffer, sceneSubstitutes[i].message,
+				_vm->_font->textDrawRect(kKnownFontMedium, backBuffer, sceneSubstitutes[i].message,
 					 Common::Rect(24, getHeight() - 33, _vm->getDisplayWidth() - 11,
 								  getHeight()), 1, 15, kFontOutline);
 				return;

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- sfuncs.cpp	18 Oct 2005 01:30:19 -0000	1.178
+++ sfuncs.cpp	3 Nov 2005 18:20:12 -0000	1.179
@@ -1309,7 +1309,7 @@
 	textEntry.effectColor = kITEColorBlack;
 	textEntry.point.x = _vm->getDisplayWidth() / 2;
 	textEntry.point.y = (_vm->_scene->getHeight() - _vm->_font->getHeight(kMediumFont)) / 2;
-	textEntry.fontId = kMediumFont;
+	textEntry.font = kKnownFontMedium;
 	textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
 	textEntry.text = thread->_strings->getString(stringId);
 
@@ -1591,10 +1591,7 @@
 
 	text = thread->_strings->getString(stringId);
 
-	if (_vm->getGameType() == GType_ITE)
-		width = _vm->_font->getStringWidth(kMediumFont, text, 0, kFontOutline);
-	else
-		width = _vm->_font->getStringWidth(kIHNMMainFont, text, 0, kFontOutline);
+	width = _vm->_font->getStringWidth(kKnownFontScript, text, 0, kFontOutline);
 	rect.top = point.y - 6;
 	rect.setHeight(12);
 	rect.left = point.x - width / 2;





More information about the Scummvm-git-logs mailing list