[Scummvm-git-logs] scummvm master -> c73d612d8ef7593e91fd517b621ce7834aefc09a

dreammaster paulfgilbert at gmail.com
Sun Dec 6 23:04:57 UTC 2020


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:
c73d612d8e GLK: COMPREHEND: Workarounds to correctly draw title screens


Commit: c73d612d8ef7593e91fd517b621ce7834aefc09a
    https://github.com/scummvm/scummvm/commit/c73d612d8ef7593e91fd517b621ce7834aefc09a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-12-06T15:04:46-08:00

Commit Message:
GLK: COMPREHEND: Workarounds to correctly draw title screens

Well, more or less correctly. I haven't been able to figure
out what the screen renderer is doing incorrectly, and since
pretty mmuch all the in-game screens look okay, I've just gone
ahead and done a hack for the title screens.

Changed paths:
    engines/glk/comprehend/pics.cpp
    engines/glk/comprehend/pics.h


diff --git a/engines/glk/comprehend/pics.cpp b/engines/glk/comprehend/pics.cpp
index 4a3916e7f3..60457d4e30 100644
--- a/engines/glk/comprehend/pics.cpp
+++ b/engines/glk/comprehend/pics.cpp
@@ -61,6 +61,46 @@ enum SpecialOpcode {
 
 /*-------------------------------------------------------*/
 
+uint32 Pics::ImageContext::getFillColor() const {
+	uint color = _fillColor;
+
+	// FIXME: Properly display text color in Crimson Crown
+	if (g_vm->getGameID() == "crimsoncrown" && color == 0x000000ff)
+		color = G_COLOR_WHITE;
+
+	return color;
+}
+
+void Pics::ImageContext::lineFixes() {
+	// WORKAROUND: Fix lines on title screens so floodfill works correctly
+	if (g_vm->getGameID() == "transylvania" && _picIndex == 9999) {
+		_drawSurface->drawLine(191, 31, 192, 31, G_COLOR_BLACK); // v
+		_drawSurface->drawLine(196, 50, 197, 50, G_COLOR_BLACK); // a
+		_drawSurface->drawLine(203, 49, 204, 49, G_COLOR_BLACK);
+		_drawSurface->drawLine(197, 53, 202, 53, G_COLOR_BLACK);
+		_drawSurface->drawLine(215, 51, 220, 51, G_COLOR_BLACK); // n
+		_drawSurface->drawLine(221, 51, 222, 51, G_COLOR_BLACK);
+		_drawSurface->drawLine(228, 50, 229, 50, G_COLOR_BLACK);
+		_drawSurface->drawLine(217, 59, 220, 59, G_COLOR_BLACK);
+		_drawSurface->drawLine(212, 49, 212, 50, G_COLOR_BLACK);
+		_drawSurface->drawLine(213, 49, 213, 52, G_COLOR_WHITE);
+		_drawSurface->drawLine(235, 52, 236, 61, G_COLOR_BLACK); // i
+		_drawSurface->drawLine(237, 61, 238, 61, G_COLOR_BLACK);
+	}
+
+	if (g_vm->getGameID() == "crimsoncrown" && _picIndex == 9999 && _x == 67 && _y == 55) {
+		_drawSurface->drawLine(78, 28, 77, 29, G_COLOR_WHITE);
+		_drawSurface->drawLine(71, 43, 69, 47, G_COLOR_WHITE);
+		_drawSurface->drawLine(67, 57, 68, 56, G_COLOR_WHITE);
+		_drawSurface->drawLine(79, 101, 80, 101, G_COLOR_WHITE);
+		_drawSurface->drawLine(183, 101, 184, 100, G_COLOR_WHITE);
+		_drawSurface->drawLine(193, 47, 193, 48, G_COLOR_WHITE);
+		_drawSurface->drawLine(68, 48, 71, 48, G_COLOR_BLACK);
+	}
+}
+
+/*-------------------------------------------------------*/
+
 Pics::ImageFile::ImageFile(const Common::String &filename) {
 	Common::File f;
 	uint16 version;
@@ -141,7 +181,7 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
 		break;
 
 	case OPCODE_TEXT_CHAR:
-	case OPCODE_TEXT_OUTLINE: {
+	case OPCODE_TEXT_OUTLINE:
 		// Text outline mode draws a bunch of pixels that sort of looks like the char
 		// TODO: See if the outline mode is ever used
 		if (opcode == OPCODE_TEXT_OUTLINE)
@@ -153,16 +193,10 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
 			a = '?';
 		}
 
-		uint color = ctx->_fillColor;
-		// FIXME: Properly display text color in Crimson Crown
-		if (g_vm->getGameID() == "crimsoncrown" && color == 0x000000ff)
-			color = G_COLOR_WHITE;
-
 		debugC(kDebugGraphics, "draw_char(%c)", a);
-		ctx->_font->drawChar(ctx->_drawSurface, a, ctx->_textX, ctx->_textY, color);
+		ctx->_font->drawChar(ctx->_drawSurface, a, ctx->_textX, ctx->_textY, ctx->getFillColor());
 		ctx->_textX += ctx->_font->getCharWidth(a);
 		break;
-	}
 
 	case OPCODE_SET_SHAPE:
 		debugC(kDebugGraphics, "set_shape_type(%.2x)", param);
@@ -240,11 +274,11 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
 	case OPCODE_PAINT:
 		a = imageGetOperand(ctx) + (param & 1 ? 256 : 0);
 		b = imageGetOperand(ctx);
-
 		if (opcode & 0x1)
 			a += 255;
 
 		debugC(kDebugGraphics, "paint(%d, %d)", a, b);
+		ctx->lineFixes();
 		if (!(ctx->_drawFlags & IMAGEF_NO_FILL))
 			ctx->_drawSurface->floodFill(a, b, ctx->_fillColor);
 		break;
@@ -376,7 +410,7 @@ Common::SeekableReadStream *Pics::createReadStreamForMember(const Common::String
 }
 
 void Pics::drawPicture(int pictureNum) const {
-	ImageContext ctx(g_comprehend->_drawSurface, _font, g_comprehend->_drawFlags);
+	ImageContext ctx(g_comprehend->_drawSurface, _font, g_comprehend->_drawFlags, pictureNum);
 
 	if (pictureNum == DARK_ROOM) {
 		ctx._drawSurface->clearScreen(G_COLOR_BLACK);
diff --git a/engines/glk/comprehend/pics.h b/engines/glk/comprehend/pics.h
index 4f22b5659c..c38cef8c61 100644
--- a/engines/glk/comprehend/pics.h
+++ b/engines/glk/comprehend/pics.h
@@ -49,6 +49,7 @@ enum {
 class Pics : public Common::Archive {
 	struct ImageContext {
 		Common::File _file;
+		uint _picIndex;
 		DrawSurface *_drawSurface;
 		Graphics::Font *_font;
 		uint _drawFlags;
@@ -62,11 +63,14 @@ class Pics : public Common::Archive {
 		uint16 _textX;
 		uint16 _textY;
 
-		ImageContext(DrawSurface *drawSurface, Graphics::Font *font, uint flags) :
-			_drawSurface(drawSurface), _font(font), _drawFlags(flags),
+		ImageContext(DrawSurface *drawSurface, Graphics::Font *font, uint flags, uint picIndex) :
+			_drawSurface(drawSurface), _font(font), _drawFlags(flags), _picIndex(picIndex),
 			_x(0), _y(0), _penColor(G_COLOR_BLACK), _fillColor(G_COLOR_BLACK),
 			_shape(SHAPE_CIRCLE_LARGE), _textX(0), _textY(0) {
 		}
+
+		uint32 getFillColor() const;
+		void lineFixes();
 	};
 
 	struct ImageFile {




More information about the Scummvm-git-logs mailing list