[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.98,2.99 script_v2.cpp,2.144,2.145
Max Horn
fingolfin at users.sourceforge.net
Sat Jul 12 15:02:01 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv13717
Modified Files:
intern.h script_v2.cpp
Log Message:
fixes for cutscenes in V2 games
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.98
retrieving revision 2.99
diff -u -d -r2.98 -r2.99
--- intern.h 1 Jul 2003 04:20:41 -0000 2.98
+++ intern.h 12 Jul 2003 22:00:59 -0000 2.99
@@ -215,6 +215,7 @@
virtual void clearStateCommon(byte type);
void resetSentence();
+ void setUserState(byte state);
/* Version 2 script opcodes */
void o2_actorFromPos();
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.144
retrieving revision 2.145
diff -u -d -r2.144 -r2.145
--- script_v2.cpp 9 Jul 2003 14:57:15 -0000 2.144
+++ script_v2.cpp 12 Jul 2003 22:00:59 -0000 2.145
@@ -1219,17 +1219,15 @@
void Scumm_v2::o2_cutscene() {
//warning("TODO o2_cutscene()");
- vm.cutSceneData[0] = _userState;
+ vm.cutSceneData[0] = _userState | (_userPut ? 16 : 0);
vm.cutSceneData[1] = (int16)VAR(VAR_CURSORSTATE);
vm.cutSceneData[2] = _currentRoom;
vm.cutSceneData[3] = camera._mode;
VAR(VAR_CURSORSTATE) = 200;
- // TODO: some cursor command stuff (hide mouse etc maybe?)
- freezeScripts(0);
- _userPut = 0;
- _cursor.state = 0;
+ // Hide inventory, freeze scripts, hide cursor
+ setUserState(15);
_sentenceNum = 0;
stopScript(SENTENCE_SCRIPT);
@@ -1249,10 +1247,8 @@
VAR(VAR_CURSORSTATE) = vm.cutSceneData[1];
- // TODO: some cursor command stuff (probably to reset it to the pre-cutscene state)
- unfreezeScripts();
- _userPut = 1;
- _cursor.state = 1;
+ // Reset user state to values before cutscene
+ setUserState(vm.cutSceneData[0] | 7);
if (_gameId == GID_MANIAC) {
camera._mode = (byte) vm.cutSceneData[3];
@@ -1357,27 +1353,31 @@
}
void Scumm_v2::o2_cursorCommand() { // TODO: Define the magic numbers
- int cmd = getVarOrDirectWord(0x80);
- int a2 = cmd >> 8;
+ uint16 cmd = getVarOrDirectWord(0x80);
+ byte state = cmd >> 8;
if (cmd & 0xFF) {
VAR(VAR_CURSORSTATE) = cmd & 0xFF;
}
+
+ setUserState(state);
+}
- if (a2 & 4) { // Userface
- _userState = a2 & (32 | 64 | 128);
+void Scumm_v2::setUserState(byte state) {
+ if (state & 4) { // Userface
+ _userState = state & (32 | 64 | 128);
runInventoryScript(0);
}
- if (a2 & 1) { // Freeze
- if (a2 & 8)
+ if (state & 1) { // Freeze
+ if (state & 8)
freezeScripts(0);
else
unfreezeScripts();
}
- if (a2 & 2) { // Cursor Show/Hide
- if (a2 & 16) {
+ if (state & 2) { // Cursor Show/Hide
+ if (state & 16) {
_userPut = 1;
_cursor.state = 1;
} else {
More information about the Scummvm-git-logs
mailing list