aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-18 03:10:19 +0300
committerFilippos Karapetis2011-10-18 03:10:19 +0300
commit7708a4ddbbcd7e7880890be252f5be1fa6a8eabb (patch)
tree9df1237d8b0677863a39f2bfd7d195ed58d1c4fd /engines/sci/graphics
parent021b09d35c9375750849fde8572c1ed28a1883e8 (diff)
downloadscummvm-rg350-7708a4ddbbcd7e7880890be252f5be1fa6a8eabb.tar.gz
scummvm-rg350-7708a4ddbbcd7e7880890be252f5be1fa6a8eabb.tar.bz2
scummvm-rg350-7708a4ddbbcd7e7880890be252f5be1fa6a8eabb.zip
SCI: Added some hacks related to new functionality in Phantasmagoria 2
The game will now start (but won't do anything exciting - it'll display its main menu, which doesn't work yet)
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/cursor.cpp12
-rw-r--r--engines/sci/graphics/frameout.cpp8
2 files changed, 19 insertions, 1 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index 57c65aa6e0..50da48aaf3 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -179,6 +179,18 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co
if (_useOriginalKQ6WinCursors)
viewNum += 2000; // Windows cursors
+ if (g_sci->getGameId() == GID_PHANTASMAGORIA2) {
+ // HACK: Ignore cursor views for Phantasmagoria 2. They've got
+ // differences from other SCI32 views, thus we skip them for
+ // now, otherwise our view decoding code will crash.
+ // The view code will crash with *any* view in P2, but this hack
+ // allows the game to start and show the menu.
+ // TODO: Remove once the view code is updated to handle
+ // Phantasmagoria 2 views.
+ warning("TODO: Cursor views for Phantasmagoria 2");
+ return;
+ }
+
if (!_cachedCursors.contains(viewNum))
_cachedCursors[viewNum] = new GfxView(_resMan, _screen, _palette, viewNum);
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 9a44f07a60..c771b5c7a4 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -492,7 +492,6 @@ void GfxFrameout::kernelFrameout() {
// warning("view %s %04x:%04x", _segMan->getObjectName(itemEntry->object), PRINT_REG(itemEntry->object));
-
if (view->isSci2Hires()) {
int16 dummyX = 0;
view->adjustToUpscaledCoordinates(itemEntry->y, itemEntry->x);
@@ -540,6 +539,13 @@ void GfxFrameout::kernelFrameout() {
nsRect.right = (nsRect.right * scriptsRunningWidth) / _screen->getWidth();
}
+ if (g_sci->getGameId() == GID_PHANTASMAGORIA2) {
+ // HACK: Some (?) objects in Phantasmagoria 2 have no NS rect. Skip them for now.
+ // TODO: Remove once we figure out how Phantasmagoria 2 draws objects on screen.
+ if (lookupSelector(_segMan, itemEntry->object, SELECTOR(nsLeft), NULL, NULL) != kSelectorVariable)
+ continue;
+ }
+
writeSelectorValue(_segMan, itemEntry->object, SELECTOR(nsLeft), nsRect.left);
writeSelectorValue(_segMan, itemEntry->object, SELECTOR(nsTop), nsRect.top);
writeSelectorValue(_segMan, itemEntry->object, SELECTOR(nsRight), nsRect.right);