aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/cursor.cpp5
-rw-r--r--scumm/intern.h5
-rw-r--r--scumm/script_v72he.cpp2
-rw-r--r--scumm/script_v7he.cpp64
4 files changed, 10 insertions, 66 deletions
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp
index 88bc532c63..36af18967b 100644
--- a/scumm/cursor.cpp
+++ b/scumm/cursor.cpp
@@ -24,6 +24,7 @@
#include "scumm/charset.h"
#include "scumm/intern.h"
#include "scumm/object.h"
+#include "scumm/resource_v7he.h"
#include "scumm/scumm.h"
@@ -146,6 +147,10 @@ void ScummEngine::setCursorFromBuffer(byte *ptr, int width, int height, int pitc
updateCursor();
}
+void ScummEngine_v7he::setCursorFromImg(uint img, uint room, uint imgindex) {
+ _Win32ResExtractor->setCursor(img);
+}
+
void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
int w, h;
const byte *dataptr, *bomp;
diff --git a/scumm/intern.h b/scumm/intern.h
index 223770ace7..3c4891c47c 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -364,7 +364,7 @@ protected:
void setCursorTransparency(int a);
void setCursorHotspot(int x, int y);
- void setCursorFromImg(uint img, uint room, uint imgindex);
+ virtual void setCursorFromImg(uint img, uint room, uint imgindex);
void useIm01Cursor(const byte *im, int w, int h);
void useBompCursor(const byte *im, int w, int h);
void grabCursor(int x, int y, int w, int h);
@@ -635,8 +635,9 @@ protected:
bool polygonDefined(int id);
int polygonHit(int id, int x, int y);
+ virtual void setCursorFromImg(uint img, uint room, uint imgindex);
+
/* HE version 70 script opcodes */
- void o70he_cursorCommand();
void o70he_startSound();
void o70he_pickupObject();
void o70he_getActorRoom();
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 9b01ad9194..d5a12743ea 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -178,7 +178,7 @@ void ScummEngine_v72he::setupOpcodes() {
OPCODE(o6_cutscene),
OPCODE(o6_stopMusic),
OPCODE(o6_freezeUnfreeze),
- OPCODE(o70he_cursorCommand),
+ OPCODE(o6_cursorCommand),
/* 6C */
OPCODE(o6_breakHere),
OPCODE(o6_ifClassOfIs),
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index bc2807527c..7b30c77ea5 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -179,7 +179,7 @@ void ScummEngine_v7he::setupOpcodes() {
OPCODE(o6_cutscene),
OPCODE(o6_stopMusic),
OPCODE(o6_freezeUnfreeze),
- OPCODE(o70he_cursorCommand),
+ OPCODE(o6_cursorCommand),
/* 6C */
OPCODE(o6_breakHere),
OPCODE(o6_ifClassOfIs),
@@ -404,68 +404,6 @@ void ScummEngine_v7he::arrrays_unk2(int dst, int src, int len2, int len) {
writeArray(0, 0, edi + i, 0);
}
-void ScummEngine_v7he::o70he_cursorCommand() {
- int a, i;
- int args[16];
- int subOp = fetchScriptByte();
-
- switch (subOp) {
- case 0x90: // SO_CURSOR_ON Turn cursor on
- _cursor.state = 1;
- verbMouseOver(0);
- break;
- case 0x91: // SO_CURSOR_OFF Turn cursor off
- _cursor.state = 0;
- verbMouseOver(0);
- break;
- case 0x92: // SO_USERPUT_ON
- _userPut = 1;
- break;
- case 0x93: // SO_USERPUT_OFF
- _userPut = 0;
- break;
- case 0x94: // SO_CURSOR_SOFT_ON Turn soft cursor on
- _cursor.state++;
- if (_cursor.state > 1)
- error("Cursor state greater than 1 in script");
- verbMouseOver(0);
- break;
- case 0x95: // SO_CURSOR_SOFT_OFF Turn soft cursor off
- _cursor.state--;
- verbMouseOver(0);
- break;
- case 0x96: // SO_USERPUT_SOFT_ON
- _userPut++;
- break;
- case 0x97: // SO_USERPUT_SOFT_OFF
- _userPut--;
- break;
- case 0x99: // SO_CURSOR_IMAGE Set cursor image
- _Win32ResExtractor->setCursor(pop()); /* Difference */
- break;
- case 0x9A: // SO_CURSOR_HOTSPOT Set cursor hotspot
- a = pop();
- setCursorHotspot(pop(), a);
- break;
- case 0x9C: // SO_CHARSET_SET
- initCharset(pop());
- break;
- case 0x9D: // SO_CHARSET_COLOR
- getStackList(args, ARRAYSIZE(args));
- for (i = 0; i < 16; i++)
- _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i];
- break;
- case 0xD6: // SO_CURSOR_TRANSPARENT Set cursor transparent color
- setCursorTransparency(pop());
- break;
- default:
- error("o70he_cursorCommand: default case %x", subOp);
- }
-
- VAR(VAR_CURSORSTATE) = _cursor.state;
- VAR(VAR_USERPUT) = _userPut;
-}
-
void ScummEngine_v7he::o70he_startSound() {
byte op;
op = fetchScriptByte();