aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-18 12:52:27 +0000
committerMax Horn2003-05-18 12:52:27 +0000
commit657c8ca2e3960346a601aaf16e7d3b4068820bed (patch)
tree0b1c7db73b576169ec3df19c97abdf0b3425e757
parenta38c3599ce915424c3add0725546cc850dcd2684 (diff)
downloadscummvm-rg350-657c8ca2e3960346a601aaf16e7d3b4068820bed.tar.gz
scummvm-rg350-657c8ca2e3960346a601aaf16e7d3b4068820bed.tar.bz2
scummvm-rg350-657c8ca2e3960346a601aaf16e7d3b4068820bed.zip
more V2 sentence cleanup
svn-id: r7631
-rw-r--r--scumm/intern.h3
-rw-r--r--scumm/script_v2.cpp17
-rw-r--r--scumm/vars.cpp1
3 files changed, 18 insertions, 3 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index d00399fcfc..8dbdb1f8bf 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -210,6 +210,8 @@ protected:
virtual void ifNotStateCommon(byte type);
virtual void setStateCommon(byte type);
virtual void clearStateCommon(byte type);
+
+ void resetSentence();
/* Version 2 script opcodes */
void o2_actorFromPos();
@@ -278,6 +280,7 @@ protected:
byte VAR_SENTENCE_VERB;
byte VAR_SENTENCE_OBJECT1;
byte VAR_SENTENCE_OBJECT2;
+ byte VAR_BACKUP_VERB;
};
class Scumm_v4 : public Scumm_v3 {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 9a30c3fe51..81b5412311 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -829,11 +829,10 @@ void Scumm_v2::o2_doSentence() {
if (a == 0xFB) {
_sentenceNum = 0;
stopScriptNr(SENTENCE_SCRIPT);
- clearClickedStatus();
return;
}
if (a == 0xFC) {
- clearClickedStatus();
+ resetSentence();
return;
}
@@ -1065,6 +1064,8 @@ void Scumm_v2::o2_loadRoomWithEgo() {
_fullRedraw = 1;
+ resetSentence();
+
if (x != -1) {
a->startWalkActor(x, y, -1);
}
@@ -1134,7 +1135,7 @@ void Scumm_v2::o2_cutscene() {
warning("TODO o2_cutscene()");
_sentenceNum = 0;
stopScriptNr(SENTENCE_SCRIPT);
- clearClickedStatus();
+ resetSentence();
}
void Scumm_v2::o2_endCutscene() {
@@ -1213,6 +1214,10 @@ void Scumm_v2::o2_cursorCommand() {
int cmd = getVarOrDirectWord(0x80);
int a2 = cmd >> 8;
+ if (cmd & 0xFF) {
+ _scummVars[21] = cmd & 0xFF;
+ printf("Set cmd %d\n", cmd & 0xFF);
+ }
if (a2 & 4) {
_userPut = 1;
warning("TODO: o2_cursorCommand(userface)");
@@ -1249,3 +1254,9 @@ void Scumm_v2::o2_dummy() {
warning("o2_dummy invoked (opcode %d)", _opcode);
}
+void Scumm_v2::resetSentence() {
+ _scummVars[VAR_SENTENCE_VERB] = _scummVars[VAR_BACKUP_VERB];
+ _scummVars[VAR_SENTENCE_OBJECT1] = 0;
+ _scummVars[VAR_SENTENCE_OBJECT2] = 0;
+ _scummVars[29] = 0;
+}
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 68a2ab4677..6e67414a3b 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -127,6 +127,7 @@ void Scumm_v2::setupScummVars() {
VAR_CLICK_AREA = 32;
VAR_ROOM_RESOURCE = 36;
VAR_LAST_SOUND = 37;
+ VAR_BACKUP_VERB = 38;
VAR_KEYPRESS = 39;
VAR_CUTSCENEEXIT_KEY = 40;
VAR_TALK_ACTOR = 41;