aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorEugene Sandulenko2004-06-28 11:38:26 +0000
committerEugene Sandulenko2004-06-28 11:38:26 +0000
commit6980923df89d24299969c03f3dc548e84dca668e (patch)
tree030b94ef2741a33d94251d7be2d8ef0eed65a793 /scumm
parentba23b9f96e1a99d8271c4be9c445ebce986f8c6a (diff)
downloadscummvm-rg350-6980923df89d24299969c03f3dc548e84dca668e.tar.gz
scummvm-rg350-6980923df89d24299969c03f3dc548e84dca668e.tar.bz2
scummvm-rg350-6980923df89d24299969c03f3dc548e84dca668e.zip
Move Win32ResExtractor to ScummEngine_v7he. Now it doesn't look alien.
svn-id: r14104
Diffstat (limited to 'scumm')
-rw-r--r--scumm/intern.h10
-rw-r--r--scumm/script_v6.cpp5
-rw-r--r--scumm/script_v7he.cpp66
-rw-r--r--scumm/scumm.cpp12
4 files changed, 75 insertions, 18 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 3b502e6fa2..fdccfba2f9 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -326,10 +326,6 @@ protected:
const OpcodeEntryV6 *_opcodesV6;
- // HE v7.0+ games
- Win32ResExtractor *_Win32ResExtractor;
-
-
int _smushFrameRate;
public:
@@ -606,10 +602,12 @@ protected:
const char *desc;
};
+ Win32ResExtractor *_Win32ResExtractor;
+
const OpcodeEntryV7he *_opcodesV7he;
public:
- ScummEngine_v7he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6he(detector, syst, gs) {}
+ ScummEngine_v7he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs);
protected:
virtual void setupScummVars();
@@ -633,6 +631,8 @@ protected:
void o7_getActorRoom();
void o7_pickupObject();
void o7_startSound();
+ void o7_actorOps();
+ void o7_cursorCommand();
};
class ScummEngine_v7 : public ScummEngine_v6 {
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index afc21cd86d..08cbb0b534 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -33,7 +33,6 @@
#include "scumm/intern.h"
#include "scumm/object.h"
#include "scumm/resource.h"
-#include "scumm/resource_v7he.h"
#include "scumm/scumm.h"
#include "scumm/sound.h"
#include "scumm/verbs.h"
@@ -934,10 +933,6 @@ void ScummEngine_v6::o6_cursorCommand() {
break;
case 0x99: // SO_CURSOR_IMAGE Set cursor image
{
- if (_heversion >= 70) { // Windows titles
- _Win32ResExtractor->setCursor(pop());
- break;
- }
int room, obj = popRoomAndObj(&room);
setCursorImg(obj, room, 1);
break;
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index af72a58fea..cfcc05d166 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -30,6 +30,7 @@
#include "scumm/intern.h"
#include "scumm/object.h"
#include "scumm/resource.h"
+#include "scumm/resource_v7he.h"
#include "scumm/scumm.h"
#include "scumm/sound.h"
#include "scumm/verbs.h"
@@ -184,7 +185,7 @@ void ScummEngine_v7he::setupOpcodes() {
OPCODE(o6_cutscene),
OPCODE(o6_stopMusic),
OPCODE(o6_freezeUnfreeze),
- OPCODE(o6_cursorCommand),
+ OPCODE(o7_cursorCommand),
/* 6C */
OPCODE(o6_breakHere),
OPCODE(o6_ifClassOfIs),
@@ -699,4 +700,67 @@ void ScummEngine_v7he::o7_startSound() {
}
+void ScummEngine_v7he::o7_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
+ makeCursorColorTransparent(pop());
+ break;
+ default:
+ error("o6_cursorCommand: default case %x", subOp);
+ }
+
+ VAR(VAR_CURSORSTATE) = _cursor.state;
+ VAR(VAR_USERPUT) = _userPut;
+}
+
+
} // End of namespace Scumm
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 2225dda0fa..76bf631411 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -954,16 +954,14 @@ ScummEngine_v6::ScummEngine_v6(GameDetector *detector, OSystem *syst, const Scum
VAR_TIMEDATE_MINUTE = 0xFF;
VAR_TIMEDATE_SECOND = 0xFF;
- // HE v7.0+
- if (_heversion >= 70) {
- _Win32ResExtractor = new Win32ResExtractor(this);
- } else {
- _Win32ResExtractor = 0;
- }
-
_smushFrameRate = 0;
}
+ScummEngine_v7he::ScummEngine_v7he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs)
+ : ScummEngine_v6he(detector, syst, gs) {
+ _Win32ResExtractor = new Win32ResExtractor(this);
+}
+
void ScummEngine::go() {
launch();
mainRun();