aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-08-22 23:55:29 +0000
committerFilippos Karapetis2010-08-22 23:55:29 +0000
commit542711cea7211a283800cff8e2392ff7eb3e714b (patch)
treecb5898cd93bb405f6cc361a007932e5f05dd0218
parent704ee45b989e56f4425f04240aa8b3a8a8b95d35 (diff)
downloadscummvm-rg350-542711cea7211a283800cff8e2392ff7eb3e714b.tar.gz
scummvm-rg350-542711cea7211a283800cff8e2392ff7eb3e714b.tar.bz2
scummvm-rg350-542711cea7211a283800cff8e2392ff7eb3e714b.zip
SCI: Fixed bug #3048908 - "PQ3EGA: Wrong speech bubble background colors" and added a FIXME inside kGraphDrawLine
svn-id: r52291
-rw-r--r--engines/sci/engine/kgraphics.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 25d8b6ef27..4e0306106b 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -269,7 +269,9 @@ reg_t kGraphDrawLine(EngineState *s, int argc, reg_t *argv) {
int16 priority = (argc > 5) ? argv[5].toSint16() : -1;
int16 control = (argc > 6) ? argv[6].toSint16() : -1;
- // TODO: Find out why we get >15 for color in EGA
+ // TODO: Find out why we get > 15 for color in EGA
+ // FIXME: EGA? Which EGA? SCI0 or SCI1? Check the
+ // workarounds inside kGraphFillBoxAny and kNewWindow
if (!g_sci->getResMan()->isVGA() && !g_sci->getResMan()->isAmiga32color())
color &= 0x0F;
@@ -308,6 +310,13 @@ reg_t kGraphFillBoxAny(EngineState *s, int argc, reg_t *argv) {
int16 priority = argv[6].toSint16(); // yes, we may read from stack sometimes here
int16 control = argv[7].toSint16(); // sierra did the same
+ // WORKAROUND: PQ3 EGA is setting invalid colors (above 0 - 15).
+ // Colors above 15 are all white in SCI1 EGA games, which is why this was never
+ // observed. We clip them all to (0, 15) instead, as colors above 15 are used
+ // for the undithering algorithm in EGA games - bug #3048908.
+ if (g_sci->getResMan()->getViewType() == kViewEga && getSciVersion() >= SCI_VERSION_1_EARLY)
+ color &= 0x0F;
+
g_sci->_gfxPaint16->kernelGraphFillBox(rect, colorMask, color, priority, control);
return s->r_acc;
}
@@ -1081,6 +1090,15 @@ reg_t kNewWindow(EngineState *s, int argc, reg_t *argv) {
int colorPen = (argc > 7 + argextra) ? argv[7 + argextra].toSint16() : 0;
int colorBack = (argc > 8 + argextra) ? argv[8 + argextra].toSint16() : 255;
+ // WORKAROUND: PQ3 EGA is setting invalid colors (above 0 - 15).
+ // Colors above 15 are all white in SCI1 EGA games, which is why this was never
+ // observed. We clip them all to (0, 15) instead, as colors above 15 are used
+ // for the undithering algorithm in EGA games - bug #3048908.
+ if (g_sci->getResMan()->getViewType() == kViewEga && getSciVersion() >= SCI_VERSION_1_EARLY) {
+ colorPen &= 0x0F;
+ colorBack &= 0x0F;
+ }
+
// const char *title = argv[4 + argextra].segment ? kernel_dereference_char_pointer(s, argv[4 + argextra], 0) : NULL;
if (argc>=13) {
rect2 = Common::Rect (argv[5].toSint16(), argv[4].toSint16(), argv[7].toSint16(), argv[6].toSint16());