aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-08-24 06:36:12 +0000
committerTorbjörn Andersson2004-08-24 06:36:12 +0000
commit103cbac40a22189d01e06ed0e0a26ceca1344959 (patch)
tree271566c1f763652f49fdd2f75cd5e38d2eda8740
parentbb0b18515b9fe88bb537a366e5a18c6e57d78d6a (diff)
downloadscummvm-rg350-103cbac40a22189d01e06ed0e0a26ceca1344959.tar.gz
scummvm-rg350-103cbac40a22189d01e06ed0e0a26ceca1344959.tar.bz2
scummvm-rg350-103cbac40a22189d01e06ed0e0a26ceca1344959.zip
Fixed bug #1014296, the Loom cursor hotspot regression.
svn-id: r14726
-rw-r--r--scumm/cursor.cpp19
-rw-r--r--scumm/script_v5.cpp2
-rw-r--r--scumm/scumm.h1
3 files changed, 19 insertions, 3 deletions
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp
index a37486f899..07f39d9dd5 100644
--- a/scumm/cursor.cpp
+++ b/scumm/cursor.cpp
@@ -64,7 +64,7 @@ static uint16 default_cursor_images[5][16] = {
0x1004, 0x2002, 0x0000, 0x0080, 0x01c0, 0x02a0, 0x0080, 0x0000 },
};
-static const byte default_cursor_hotspots[10] = {
+static byte default_cursor_hotspots[10] = {
8, 7, 8, 7, 1, 1, 5, 0,
8, 7, //zak256
};
@@ -255,12 +255,13 @@ void ScummEngine_v6::useBompCursor(const byte *im, int width, int height) {
void ScummEngine::redefineBuiltinCursorFromChar(int index, int chr) {
// Cursor image in both Looms are based on images from charset.
- // For now we don't handle them.
if (_gameId != GID_LOOM && _gameId != GID_LOOM256) {
// FIXME: Actually: is this opcode ever called by a non-Loom game?
// Which V3-V5 game besides Loom makes use of custom cursors, ever?
warning("V3--V5 SO_CURSOR_IMAGE(%d,%d) called - tell Fingolfin where you saw this!", index, chr);
}
+
+ assert(index >= 0 && index < 5);
// const int oldID = _charset->getCurID();
@@ -295,6 +296,20 @@ void ScummEngine::redefineBuiltinCursorFromChar(int index, int chr) {
// _charset->setCurID(oldID);
}
+void ScummEngine::redefineBuiltinCursorHotspot(int index, int x, int y) {
+ // Cursor image in both Looms are based on images from charset.
+ if (_gameId != GID_LOOM && _gameId != GID_LOOM256) {
+ // FIXME: Actually: is this opcode ever called by a non-Loom game?
+ // Which V3-V5 game besides Loom makes use of custom cursors, ever?
+ warning("V3--V5 SO_CURSOR_HOTSPOT(%d,%d,%d) called - tell Fingolfin where you saw this!", index, x, y);
+ }
+
+ assert(index >= 0 && index < 5);
+
+ default_cursor_hotspots[index * 2] = x;
+ default_cursor_hotspots[index * 2 + 1] = y;
+}
+
void ScummEngine::setBuiltinCursor(int idx) {
int i, j;
byte color;
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index f16df1a04c..96625e2e09 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -683,7 +683,7 @@ void ScummEngine_v5::o5_cursorCommand() {
i = getVarOrDirectByte(PARAM_1);
j = getVarOrDirectByte(PARAM_2);
k = getVarOrDirectByte(PARAM_3);
- setCursorHotspot(j, k);
+ redefineBuiltinCursorHotspot(i, j, k);
break;
case 12: // SO_CURSOR_SET
i = getVarOrDirectByte(PARAM_1);
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 8e10da2ddd..edb0b9ba2c 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -943,6 +943,7 @@ protected:
void setBuiltinCursor(int index);
void redefineBuiltinCursorFromChar(int index, int chr);
+ void redefineBuiltinCursorHotspot(int index, int x, int y);
void grabCursor(int x, int y, int w, int h);
void setCursorFromBuffer(byte *ptr, int width, int height, int pitch);