aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKawa2018-12-02 21:56:19 +0100
committerFilippos Karapetis2018-12-02 22:56:19 +0200
commitca2209cb5fd3c9548946d69cc7444431d3cce863 (patch)
treef481787dc05e169213fce48d13ce28e02d9709fb
parentbbbd40477d1afe62df63b222193e016d1e9fdd7d (diff)
downloadscummvm-rg350-ca2209cb5fd3c9548946d69cc7444431d3cce863.tar.gz
scummvm-rg350-ca2209cb5fd3c9548946d69cc7444431d3cce863.tar.bz2
scummvm-rg350-ca2209cb5fd3c9548946d69cc7444431d3cce863.zip
SCI: Add support for The Dating Pool (#1403)
-rw-r--r--engines/sci/detection.cpp4
-rw-r--r--engines/sci/detection_tables.h51
-rw-r--r--engines/sci/engine/kernel.cpp3
-rw-r--r--engines/sci/engine/kernel.h2
-rw-r--r--engines/sci/engine/kernel_tables.h7
-rw-r--r--engines/sci/engine/kgraphics.cpp29
-rw-r--r--engines/sci/engine/kmisc.cpp23
-rw-r--r--engines/sci/graphics/paint16.cpp40
-rw-r--r--engines/sci/graphics/paint16.h6
-rw-r--r--engines/sci/graphics/view.cpp10
-rw-r--r--engines/sci/graphics/view.h4
-rw-r--r--engines/sci/sci.cpp2
-rw-r--r--engines/sci/sci.h2
13 files changed, 164 insertions, 19 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 98b9891ca2..2befe36e29 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -103,6 +103,8 @@ static const PlainGameDescriptor s_sciGameTitles[] = {
{"gk1demo", "Gabriel Knight: Sins of the Fathers"},
{"qfg4demo", "Quest for Glory IV: Shadows of Darkness"},
{"pq4demo", "Police Quest IV: Open Season"},
+ // === SCI1.1+ games ======================================================
+ {"catdate", "The Dating Pool"},
// === SCI2 games =========================================================
{"gk1", "Gabriel Knight: Sins of the Fathers"},
{"pq4", "Police Quest IV: Open Season"}, // floppy is SCI2, CD SCI2.1
@@ -207,6 +209,7 @@ static const GameIdStrToEnum s_gameIdStrToEnum[] = {
{ "qfg4", GID_QFG4 },
{ "qfg4demo", GID_QFG4DEMO },
{ "rama", GID_RAMA },
+ { "catdate", GID_CATDATE },
{ "sci-fanmade", GID_FANMADE }, // FIXME: Do we really need/want this?
{ "shivers", GID_SHIVERS },
//{ "shivers2", GID_SHIVERS2 }, // Not SCI
@@ -319,6 +322,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R
sierraId == "mg" || sierraId == "pq" ||
sierraId == "jones" ||
sierraId == "cardgames" || sierraId == "solitare" ||
+ sierraId == "catdate" ||
sierraId == "hoyle4")
demoThreshold = 40;
if (sierraId == "hoyle3")
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 2dd81479ba..c530a85696 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2883,7 +2883,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::FR_FRA, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_LIGHTHOUSE },
- // Lighthouse - German DOS (from bug #10359)
+ // Lighthouse - German DOS (from bug #10359)
{"lighthouse", "", {
{"resmap.001", 0, "d2dc13bb936d6528a19feac92fc7df1c", 7852},
{"ressci.001", 0, "dbb615146ec943e4ff7764a485c90511", 122330257},
@@ -5061,6 +5061,55 @@ static const struct ADGameDescription SciGameDescriptions[] = {
#endif // ENABLE_SCI32
+ // The Dating Pool - English DOSBox
+ // Work in progress - uncomment this with proper hashes and such when it's done.
+ //{ "catdate", "", {
+ // {"resource.aud", 0, "586a461c5f0560a03807d1929e23ba51", 11567},
+ // {"resource.000", 0, "094b9d3c841fe60076f06cdef3fb1383", 1467949},
+ // {"resource.map", 0, "a62d355ea262b39c36228fbd84b874b4", 1538},
+ // AD_LISTEND},
+ // Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // The Dating Pool - English DOSBox Interactive Demo
+ // Kafuka release, catdate-onedaydemo-2015.zip: old branding, old title, old music, zipper, hand.
+ { "catdate", "Demo", {
+ {"resource.000", 0, "af28393cf5ae59e98203067f5eb87e2b", 1038935},
+ {"resource.map", 0, "6f788e0ec2b4a6110e9bbb639ca7ee74", 1378},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // The Dating Pool - English DOSBox Interactive Demo
+ // Kafuka release, catdate-onedaydemo-2016.zip: new branding, old title, zipper, hand.
+ { "catdate", "Demo", {
+ {"resource.000", 0, "4d6f521253ec67d0f1bd38c29c91c806", 915197},
+ {"resource.map", 0, "9f44b144d8986a3676fb5114b819ec02", 1303},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // The Dating Pool - English DOSBox Interactive Demo
+ // Release status unknown: new title, cocktail, paw, remapped shadow
+ { "catdate", "Demo", {
+ {"resource.000", 0, "755e12d325420acc7a06474d75002ba8", 1153508},
+ {"resource.map", 0, "80ae0fc1bc60b815c65eda86a23157bc", 1318},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // The Dating Pool - English DOSBox Interactive Demo
+ // Itch.IO release: bug fixes
+ { "catdate", "Demo", {
+ {"resource.000", 0, "755e12d325420acc7a06474d75002ba8", 1044647},
+ {"resource.map", 0, "1442c3599b5f41755e4318db8d68da51", 1318},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // The Dating Pool - English DOSBox Interactive Demo
+ // Itch.IO 2018 release: bug fixes, polish, new content at end
+ { "catdate", "Demo", {
+ {"resource.000", 0, "094b9d3c841fe60076f06cdef3fb1383", 1467849},
+ {"resource.map", 0, "750e0f01ca54ac0ea49cff2753e1ae65", 1263},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
// SCI Fanmade Games
FANMADE("120 Degrees Below Zero", "57f6135bd073802215c9b97f32d6aea3", 504, "03adf530a34557dfc20f848c9572f4d0", 320749),
FANMADE("Al Pond: Island Quest 2", "4cba6a5a4c8f66f21935ed78b0511a92", 870, "876587dc9a5ec569287a3dc4b29139d8", 613769),
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index e828db6f40..29d16ab753 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -781,6 +781,9 @@ void Kernel::loadKernelNames(GameFeatures *features) {
_kernelNames[0x84] = "ShowMovie";
} else if (g_sci->getGameId() == GID_QFG4DEMO) {
_kernelNames[0x7b] = "RemapColors"; // QFG4 Demo has this SCI2 function instead of StrSplit
+ } else if (g_sci->getGameId() == GID_CATDATE) {
+ _kernelNames[0x7b] = "RemapColorsKawa";
+ _kernelNames[0x89] = "KawaHacks";
}
_kernelNames[0x71] = "PalVary";
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 404aa5af67..bac0e9e375 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -406,10 +406,12 @@ reg_t kTextColors(EngineState *s, int argc, reg_t *argv);
reg_t kTextFonts(EngineState *s, int argc, reg_t *argv);
reg_t kShow(EngineState *s, int argc, reg_t *argv);
reg_t kRemapColors(EngineState *s, int argc, reg_t *argv);
+reg_t kRemapColorsKawa(EngineState *s, int argc, reg_t *argv);
reg_t kDummy(EngineState *s, int argc, reg_t *argv);
reg_t kEmpty(EngineState *s, int argc, reg_t *argv);
reg_t kStub(EngineState *s, int argc, reg_t *argv);
reg_t kStubNull(EngineState *s, int argc, reg_t *argv);
+reg_t kKawaHacks(EngineState *s, int argc, reg_t *argv);
#ifdef ENABLE_SCI32
// SCI2 Kernel Functions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 547c5c3683..47786e5ada 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -780,6 +780,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(Random), SIG_EVERYWHERE, "(i)(i)", NULL, kRandom_workarounds },
{ MAP_CALL(ReadNumber), SIG_EVERYWHERE, "r", NULL, kReadNumber_workarounds },
{ MAP_CALL(RemapColors), SIG_SCI11, SIGFOR_ALL, "i(i)(i)(i)(i)", NULL, NULL },
+ { MAP_CALL(RemapColorsKawa), SIG_SCI11, SIGFOR_ALL, "i(i)(i)(i)(i)(i)", NULL, NULL },
#ifdef ENABLE_SCI32
{ "RemapColors", kRemapColors32, SIG_SCI32, SIGFOR_ALL, "i(i)(i)(i)(i)(i)", kRemapColors_subops, NULL },
#endif
@@ -863,6 +864,8 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_DUMMY(Record), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(PlayBack), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(DbugStr), SIG_EVERYWHERE, "(.*)", NULL, NULL },
+ // Used in Kawa's SCI11+
+ { MAP_CALL(KawaHacks), SIG_SCI11, SIGFOR_ALL, "(.*)", NULL, NULL },
// =======================================================================================================
@@ -1181,7 +1184,9 @@ static const char *const s_defaultKernelNames[] = {
/*0x85*/ "ShowMovie",
/*0x86*/ "SetVideoMode",
/*0x87*/ "SetQuitStr",
- /*0x88*/ "DbugStr" // for debugging
+ /*0x88*/ "DbugStr", // for debugging
+ /*0x89*/ "Empty",
+ /*0x8a*/ "Empty"
};
#ifdef ENABLE_SCI32
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 3c23cd515f..ee9212bd47 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1278,4 +1278,33 @@ reg_t kRemapColors(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}
+// Later SCI32-style kRemapColors, but in SCI11+.
+reg_t kRemapColorsKawa(EngineState *s, int argc, reg_t *argv) {
+ uint16 operation = argv[0].toUint16();
+
+ switch (operation) {
+ case 0: // off
+ break;
+ case 1: { // remap by percent
+ uint16 from = argv[1].toUint16();
+ uint16 percent = argv[2].toUint16();
+ g_sci->_gfxRemap16->resetRemapping();
+ g_sci->_gfxRemap16->setRemappingPercent(from, percent);
+ }
+ break;
+ case 2: { // remap by range
+ uint16 from = argv[1].toUint16();
+ uint16 to = argv[2].toUint16();
+ uint16 base = argv[3].toUint16();
+ g_sci->_gfxRemap16->resetRemapping();
+ g_sci->_gfxRemap16->setRemappingRange(254, from, to, base);
+ }
+ break;
+ default:
+ error("Unsupported SCI32-style kRemapColors(%d) has been called", operation);
+ break;
+ }
+ return s->r_acc;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 92a9cfaf8b..f8b41a2b71 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -629,6 +629,8 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
+extern void showScummVMDialog(const Common::String &message);
+
#ifdef ENABLE_SCI32
reg_t kPlatform32(EngineState *s, int argc, reg_t *argv) {
enum Operation {
@@ -693,8 +695,6 @@ reg_t kWinExec(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
}
-extern void showScummVMDialog(const Common::String &message);
-
reg_t kWinDLL(EngineState *s, int argc, reg_t *argv) {
uint16 operation = argv[0].toUint16();
Common::String dllName = s->_segMan->getString(argv[1]);
@@ -726,6 +726,25 @@ reg_t kWinDLL(EngineState *s, int argc, reg_t *argv) {
#endif
+reg_t kKawaHacks(EngineState *s, int argc, reg_t *argv) {
+ switch (argv[0].toUint16()) {
+ case 0: { // DoAlert
+ showScummVMDialog(s->_segMan->getString(argv[1]));
+ return NULL_REG;
+ }
+ case 1: // ZaWarudo
+ // Unused, would invert the color palette for the specified range.
+ return NULL_REG;
+ case 2: // SetTitleColors
+ // Unused, would change the colors for plain windows' title bars.
+ return NULL_REG;
+ case 3: // IsDebug
+ // Should return 1 if running with an internal debugger, 2 if we have AddMenu support, 3 if both.
+ return TRUE_REG;
+ }
+ return NULL_REG;
+}
+
reg_t kEmpty(EngineState *s, int argc, reg_t *argv) {
// Placeholder for empty kernel functions which are still called from the
// engine scripts (like the empty kSetSynonyms function in SCI1.1). This
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index aac922d278..80349f119a 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -80,7 +80,7 @@ void GfxPaint16::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mi
}
// This one is the only one that updates screen!
-void GfxPaint16::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
+void GfxPaint16::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, uint16 scaleSignal) {
GfxView *view = _cache->getView(viewId);
Common::Rect celRect;
@@ -90,7 +90,7 @@ void GfxPaint16::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo,
celRect.right = celRect.left + view->getWidth(loopNo, celNo);
celRect.bottom = celRect.top + view->getHeight(loopNo, celNo);
- drawCel(view, loopNo, celNo, celRect, priority, paletteNo, scaleX, scaleY);
+ drawCel(view, loopNo, celNo, celRect, priority, paletteNo, scaleX, scaleY, scaleSignal);
if (getSciVersion() >= SCI_VERSION_1_1) {
if (!_screen->_picNotValidSci11) {
@@ -104,12 +104,12 @@ void GfxPaint16::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo,
}
// This version of drawCel is not supposed to call BitsShow()!
-void GfxPaint16::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
- drawCel(_cache->getView(viewId), loopNo, celNo, celRect, priority, paletteNo, scaleX, scaleY);
+void GfxPaint16::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, uint16 scaleSignal) {
+ drawCel(_cache->getView(viewId), loopNo, celNo, celRect, priority, paletteNo, scaleX, scaleY, scaleSignal);
}
// This version of drawCel is not supposed to call BitsShow()!
-void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) {
+void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, uint16 scaleSignal) {
Common::Rect clipRect = celRect;
clipRect.clip(_ports->_curPort->rect);
if (clipRect.isEmpty()) // nothing to draw
@@ -118,9 +118,9 @@ void GfxPaint16::drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common:
Common::Rect clipRectTranslated = clipRect;
_ports->offsetRect(clipRectTranslated);
if (scaleX == 128 && scaleY == 128)
- view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, false);
+ view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, false, scaleSignal);
else
- view->drawScaled(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, scaleX, scaleY);
+ view->drawScaled(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, scaleX, scaleY, scaleSignal);
}
// This is used as replacement for drawCelAndShow() when hires-cels are drawn to
@@ -472,6 +472,7 @@ void GfxPaint16::kernelGraphRedrawBox(Common::Rect rect) {
#define SCI_DISPLAY_SAVEUNDER 107
#define SCI_DISPLAY_RESTOREUNDER 108
#define SCI_DISPLAY_DONTSHOWBITS 121
+#define SCI_DISPLAY_SETSTROKE 122
reg_t GfxPaint16::kernelDisplay(const char *text, uint16 languageSplitter, int argc, reg_t *argv) {
reg_t displayArg;
@@ -480,6 +481,7 @@ reg_t GfxPaint16::kernelDisplay(const char *text, uint16 languageSplitter, int a
bool doSaveUnder = false;
Common::Rect rect;
reg_t result = NULL_REG;
+ int16 stroke = 0; // Kawa's SCI11+
// Make a "backup" of the port settings (required for some SCI0LATE and
// SCI01+ only)
@@ -539,6 +541,10 @@ reg_t GfxPaint16::kernelDisplay(const char *text, uint16 languageSplitter, int a
case SCI_DISPLAY_DONTSHOWBITS:
bRedraw = 0;
break;
+ case SCI_DISPLAY_SETSTROKE: // From Kawa's SCI11+
+ stroke = argv[0].toUint16();
+ argc--; argv++;
+ break;
default:
SciCallOrigin originReply;
@@ -563,10 +569,30 @@ reg_t GfxPaint16::kernelDisplay(const char *text, uint16 languageSplitter, int a
rect.moveTo(_ports->getPort()->curLeft, _ports->getPort()->curTop);
}
+ // Kawa's SCI11+
+ if (stroke)
+ rect.grow(1);
+
if (doSaveUnder)
result = bitsSave(rect, GFX_SCREEN_MASK_VISUAL);
if (colorBack != -1)
fillRect(rect, GFX_SCREEN_MASK_VISUAL, colorBack, 0, 0);
+
+ // Kawa's SCI11+
+ if (stroke) {
+ _ports->penColor(0);
+ rect.translate(1, 0); if (stroke & 1) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // right
+ rect.translate(0, 1); if (stroke & 2) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // bottom right
+ rect.translate(-1, 0); if (stroke & 4) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // bottom
+ rect.translate(-1, 0); if (stroke & 8) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // bottom left
+ rect.translate(0, -1); if (stroke & 16) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // left
+ rect.translate(0, -1); if (stroke & 32) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // top left
+ rect.translate(1, 0); if (stroke & 64) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // top
+ rect.translate(1, 0); if (stroke & 128) _text16->Box(text, languageSplitter, false, rect, alignment, -1); // top right
+ rect.translate(-1, 1); // and back to center
+ _ports->penColor(colorPen);
+ }
+
_text16->Box(text, languageSplitter, false, rect, alignment, -1);
if (_screen->_picNotValid == 0 && bRedraw)
bitsShow(rect);
diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index 6fc9cbbdfc..db19efa261 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -44,9 +44,9 @@ public:
void debugSetEGAdrawingVisualize(bool state);
void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
- void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
- void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
- void drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
+ void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
+ void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
+ void drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
void drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t upscaledHiresHandle, uint16 scaleX = 128, uint16 scaleY = 128);
void clearScreen(byte color = 255);
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 319e3ac4fb..9ed08cee1b 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -776,7 +776,7 @@ void GfxView::unditherBitmap(SciSpan<byte> &bitmapPtr, int16 width, int16 height
}
void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated,
- int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires) {
+ int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires, uint16 scaleSignal) {
const Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
const CelInfo *celInfo = getCelInfo(loopNo, celNo);
const SciSpan<const byte> &bitmap = getBitmap(loopNo, celNo);
@@ -832,6 +832,9 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
// SCI16 remapping (QFG4 demo)
if (g_sci->_gfxRemap16 && g_sci->_gfxRemap16->isRemapped(outputColor))
outputColor = g_sci->_gfxRemap16->remapColor(outputColor, _screen->getVisual(x2, y2));
+ // SCI16+ remapping (Catdate)
+ if ((scaleSignal & 0x200) && g_sci->_gfxRemap16 && !g_sci->_gfxRemap16->isRemapped(outputColor))
+ outputColor = g_sci->_gfxRemap16->remapColor(253, outputColor);
_screen->putPixel(x2, y2, drawMask, outputColor, priority, 0);
}
}
@@ -846,7 +849,7 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
* matter because the scaled cel rect is definitely the same as in sierra sci.
*/
void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated,
- int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY) {
+ int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY, uint16 scaleSignal) {
const Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
const CelInfo *celInfo = getCelInfo(loopNo, celNo);
const SciSpan<const byte> &bitmap = getBitmap(loopNo, celNo);
@@ -923,6 +926,9 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect,
// SCI16 remapping (QFG4 demo)
if (g_sci->_gfxRemap16 && g_sci->_gfxRemap16->isRemapped(outputColor))
outputColor = g_sci->_gfxRemap16->remapColor(outputColor, _screen->getVisual(x2, y2));
+ // SCI16+ remapping (Catdate)
+ if ((scaleSignal & 0x200) && g_sci->_gfxRemap16 && !g_sci->_gfxRemap16->isRemapped(outputColor))
+ outputColor = g_sci->_gfxRemap16->remapColor(253, outputColor);
_screen->putPixel(x2, y2, drawMask, outputColor, priority, 0);
}
}
diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h
index 5ecf7e6fa3..1876567013 100644
--- a/engines/sci/graphics/view.h
+++ b/engines/sci/graphics/view.h
@@ -70,8 +70,8 @@ public:
void getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const;
void getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const;
const SciSpan<const byte> &getBitmap(int16 loopNo, int16 celNo);
- void draw(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires);
- void drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY);
+ void draw(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires, uint16 scaleSignal = 0);
+ void drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY, uint16 scaleSignal = 0);
uint16 getLoopCount() const { return _loop.size(); }
uint16 getCelCount(int16 loopNo) const;
Palette *getPalette();
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index c6d8b8b4d1..c920403dcc 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -614,7 +614,7 @@ void SciEngine::initGraphics() {
} else {
#endif
_gfxPalette16 = new GfxPalette(_resMan, _gfxScreen);
- if (getGameId() == GID_QFG4DEMO)
+ if (getGameId() == GID_QFG4DEMO || getGameId() == GID_CATDATE)
_gfxRemap16 = new GfxRemap(_gfxPalette16);
#ifdef ENABLE_SCI32
}
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index c17eba5955..b7495498b6 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -211,6 +211,8 @@ enum SciGameId {
GID_SQ6,
GID_TORIN,
+ GID_CATDATE,
+
GID_FANMADE // FIXME: Do we really need/want this?
};