[Scummvm-git-logs] scummvm master -> 06249350779cf610c87a4f06bed7598a89214920
dreammaster
paulfgilbert at gmail.com
Sun Nov 8 23:21:42 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:
0624935077 GLK: COMPREHEND: Fix white on black rendering when wearing goggles
Commit: 06249350779cf610c87a4f06bed7598a89214920
https://github.com/scummvm/scummvm/commit/06249350779cf610c87a4f06bed7598a89214920
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-11-08T15:01:20-08:00
Commit Message:
GLK: COMPREHEND: Fix white on black rendering when wearing goggles
Changed paths:
engines/glk/comprehend/debugger.cpp
engines/glk/comprehend/game_oo.cpp
engines/glk/comprehend/pics.cpp
engines/glk/comprehend/pics.h
diff --git a/engines/glk/comprehend/debugger.cpp b/engines/glk/comprehend/debugger.cpp
index dd0b98e0ca..ba8d31c668 100644
--- a/engines/glk/comprehend/debugger.cpp
+++ b/engines/glk/comprehend/debugger.cpp
@@ -66,10 +66,10 @@ bool Debugger::cmdDump(int argc, const char **argv) {
bool Debugger::cmdFloodfills(int argc, const char **argv) {
if (argc == 2 && !strcmp(argv[1], "off")) {
- g_comprehend->_drawFlags |= IMAGEF_NO_FLOODFILL;
+ g_comprehend->_drawFlags |= IMAGEF_NO_PAINTING;
debugPrintf("Floodfills are off\n");
} else {
- g_comprehend->_drawFlags &= ~IMAGEF_NO_FLOODFILL;
+ g_comprehend->_drawFlags &= ~IMAGEF_NO_PAINTING;
debugPrintf("Floodfills are on\n");
}
diff --git a/engines/glk/comprehend/game_oo.cpp b/engines/glk/comprehend/game_oo.cpp
index d58aaa7e83..df83b19615 100644
--- a/engines/glk/comprehend/game_oo.cpp
+++ b/engines/glk/comprehend/game_oo.cpp
@@ -158,9 +158,9 @@ void OOToposGame::beforeTurn() {
_updateFlags |= UPDATE_GRAPHICS | UPDATE_ROOM_DESC;
if (_noFloodfill == YES)
- g_comprehend->_drawFlags |= IMAGEF_NO_FLOODFILL;
+ g_comprehend->_drawFlags |= IMAGEF_REVERSE;
else
- g_comprehend->_drawFlags &= ~IMAGEF_NO_FLOODFILL;
+ g_comprehend->_drawFlags &= ~IMAGEF_REVERSE;
}
}
diff --git a/engines/glk/comprehend/pics.cpp b/engines/glk/comprehend/pics.cpp
index 894ea669c6..461237f41c 100644
--- a/engines/glk/comprehend/pics.cpp
+++ b/engines/glk/comprehend/pics.cpp
@@ -136,7 +136,7 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
case OPCODE_SET_PEN_COLOR:
debugC(kDebugGraphics, "set_pen_color(%.2x)", opcode);
- if (!(ctx->_drawFlags & IMAGEF_NO_FLOODFILL))
+ if (!(ctx->_drawFlags & IMAGEF_NO_FILL))
ctx->_penColor = ctx->_drawSurface->getPenColor(param);
break;
@@ -221,7 +221,7 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
debugC(kDebugGraphics, "draw_shape(%d, %d), style=%.2x, fill=%.2x",
a, b, ctx->_shape, ctx->_fillColor);
- if (!(ctx->_drawFlags & IMAGEF_NO_FLOODFILL))
+ if (!(ctx->_drawFlags & IMAGEF_NO_FILL))
ctx->_drawSurface->drawShape(a, b, ctx->_shape, ctx->_fillColor);
break;
@@ -239,7 +239,7 @@ bool Pics::ImageFile::doImageOp(Pics::ImageContext *ctx) const {
a += 255;
debugC(kDebugGraphics, "paint(%d, %d)", a, b);
- if (!(ctx->_drawFlags & IMAGEF_NO_FLOODFILL))
+ if (!(ctx->_drawFlags & IMAGEF_NO_FILL))
ctx->_drawSurface->floodFill(a, b, ctx->_fillColor);
break;
@@ -387,11 +387,13 @@ void Pics::drawPicture(int pictureNum) const {
pictureNum % IMAGES_PER_FILE, &ctx);
} else {
- if (pictureNum < LOCATIONS_NO_BG_OFFSET)
- ctx._drawSurface->clearScreen(G_COLOR_WHITE);
- else
+ if (pictureNum < LOCATIONS_NO_BG_OFFSET) {
+ ctx._drawSurface->clearScreen((ctx._drawFlags & IMAGEF_REVERSE) ? G_COLOR_BLACK : G_COLOR_WHITE);
+ if (ctx._drawFlags & IMAGEF_REVERSE)
+ ctx._penColor = RGB(255, 255, 255);
+ } else {
ctx._drawSurface->clear(0);
-
+ }
pictureNum %= 100;
_rooms[pictureNum / IMAGES_PER_FILE].draw(
pictureNum % IMAGES_PER_FILE, &ctx);
diff --git a/engines/glk/comprehend/pics.h b/engines/glk/comprehend/pics.h
index 90d3115d38..4f22b5659c 100644
--- a/engines/glk/comprehend/pics.h
+++ b/engines/glk/comprehend/pics.h
@@ -31,7 +31,11 @@
namespace Glk {
namespace Comprehend {
-#define IMAGEF_NO_FLOODFILL (1 << 1)
+enum ImageFlag {
+ IMAGEF_REVERSE = 1 << 0,
+ IMAGEF_NO_PAINTING = 1 << 1,
+ IMAGEF_NO_FILL = IMAGEF_REVERSE | IMAGEF_NO_PAINTING
+};
enum {
LOCATIONS_OFFSET = 0,
More information about the Scummvm-git-logs
mailing list