aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/cursor.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2012-02-17 21:54:50 +0200
committerFilippos Karapetis2012-02-17 21:54:50 +0200
commitc87657f066ca9cbb0e07963c31cf57c96b1c5068 (patch)
treea7f3fe2fccc168f253b718a6a7e668d0ae6ebf2f /engines/sci/graphics/cursor.cpp
parentb21f956790075f11fff4b43cecb8afca368594b3 (diff)
downloadscummvm-rg350-c87657f066ca9cbb0e07963c31cf57c96b1c5068.tar.gz
scummvm-rg350-c87657f066ca9cbb0e07963c31cf57c96b1c5068.tar.bz2
scummvm-rg350-c87657f066ca9cbb0e07963c31cf57c96b1c5068.zip
SCI: Added some sanity checks by digitall
- Limit the LB1 cursor workaround to LB1 only (so that fanmade games aren't affected) - Error our when bad cursor hotspots are found
Diffstat (limited to 'engines/sci/graphics/cursor.cpp')
-rw-r--r--engines/sci/graphics/cursor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index b269e8ba51..daab532d0e 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -145,7 +145,7 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) {
// Special case for the magnifier cursor in LB1 (bug #3487092).
// No other SCI0 game has a cursor resource of 1, so this is handled
// specifically for LB1.
- if (resourceId == 1)
+ if (g_sci->getGameId() == GID_LAURABOW && resourceId == 1)
colorMapping[3] = _screen->getColorWhite();
// Seek to actual data
@@ -175,6 +175,11 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) {
rawBitmap = upscaledBitmap;
}
+ if (hotspot.x >= heightWidth || hotspot.y >= heightWidth) {
+ error("cursor %d's hotspot (%d, %d) is out of range of the cursor's dimensions (%dx%d)",
+ resourceId, hotspot.x, hotspot.y, heightWidth, heightWidth);
+ }
+
CursorMan.replaceCursor(rawBitmap, heightWidth, heightWidth, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR);
kernelShow();