[Scummvm-cvs-logs] scummvm master -> 90a11586e21d06c150f98842a62f2a5ae7857bb5

bluegr md5 at scummvm.org
Sun Oct 9 19:05:07 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
90a11586e2 SCI: CreateTextBitmap should return a pointer. Also, silenced a warning


Commit: 90a11586e21d06c150f98842a62f2a5ae7857bb5
    https://github.com/scummvm/scummvm/commit/90a11586e21d06c150f98842a62f2a5ae7857bb5
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-10-09T09:56:51-07:00

Commit Message:
SCI: CreateTextBitmap should return a pointer. Also, silenced a warning

Changed paths:
    engines/sci/engine/kgraphics.cpp
    engines/sci/graphics/text32.cpp
    engines/sci/graphics/text32.h



diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index e3a41fe..3d8a777 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1391,8 +1391,7 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
 		debugC(kDebugLevelStrings, "%s", text.c_str());
 		uint16 maxWidth = argv[1].toUint16();	// nsRight - nsLeft + 1
 		uint16 maxHeight = argv[2].toUint16();	// nsBottom - nsTop + 1
-		g_sci->_gfxText32->createTextBitmap(object, maxWidth, maxHeight);
-		break;
+		return g_sci->_gfxText32->createTextBitmap(object, maxWidth, maxHeight);
 	}
 	case 1: {
 		if (argc != 2) {
@@ -1403,14 +1402,12 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) {
 		Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text)));
 		debugC(kDebugLevelStrings, "kCreateTextBitmap case 1 (%04x:%04x)", PRINT_REG(argv[1]));
 		debugC(kDebugLevelStrings, "%s", text.c_str());
-		g_sci->_gfxText32->createTextBitmap(object);
-		break;
+		return g_sci->_gfxText32->createTextBitmap(object);
 	}
 	default:
 		warning("CreateTextBitmap(%d)", argv[0].toUint16());
+		return NULL_REG;
 	}
-
-	return NULL_REG;
 }
 
 reg_t kGetWindowsOption(EngineState *s, int argc, reg_t *argv) {
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp
index 6ec1261..7be3874 100644
--- a/engines/sci/graphics/text32.cpp
+++ b/engines/sci/graphics/text32.cpp
@@ -56,7 +56,7 @@ void GfxText32::purgeCache() {
 	_textCache.clear();
 }
 
-void GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxHeight) {
+reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxHeight) {
 	if (_textCache.size() >= MAX_CACHED_TEXTS)
 		purgeCache();
 
@@ -71,6 +71,9 @@ void GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxHe
 	}
 
 	_textCache[textId] = createTextEntry(textObject, maxWidth, maxHeight);
+
+	// TODO: Create a new hunk pointer with the created surface
+	return NULL_REG;
 }
 
 // TODO: Finish this!
@@ -176,7 +179,7 @@ TextEntry *GfxText32::createTextEntry(reg_t textObject, uint16 maxWidth, uint16
 	memset(newEntry->surface, 0, newEntry->width * newEntry->height);
 	newEntry->text = _segMan->getString(stringObject);
 
-	int16 maxTextWidth = 0, charCount = 0;
+	int16 /*maxTextWidth = 0,*/ charCount = 0;
 	uint16 curX = 0, curY = 0;
 
 	while (*text) {
diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h
index 620bcfc..113fbb4 100644
--- a/engines/sci/graphics/text32.h
+++ b/engines/sci/graphics/text32.h
@@ -51,7 +51,7 @@ class GfxText32 {
 public:
 	GfxText32(SegManager *segMan, GfxCache *fonts, GfxScreen *screen);
 	~GfxText32();
-	void createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0);
+	reg_t createTextBitmap(reg_t textObject, uint16 maxWidth = 0, uint16 maxHeight = 0);
 	void drawTextBitmap(reg_t textObject, uint16 textX, uint16 textY, uint16 planeWidth);
 	int16 GetLongest(const char *text, int16 maxWidth, GfxFont *font);
 	TextEntry *getTextEntry(reg_t textObject);






More information about the Scummvm-git-logs mailing list