[Scummvm-cvs-logs] scummvm master -> 87ef0819d366d753515b79af85e33f0801d801ed

athrxx athrxx at scummvm.org
Sat Apr 27 21:47:21 CEST 2013


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
be7486ffef KYRA: (EOB) - minor fix in NPC sequence code
c3a7e01807 KYRA: (EOB) - fix original savefile import/export
87ef0819d3 KYRA: (EOB) - add debugger functions


Commit: be7486ffef6406131fb316d46aeefcd93beec7ac
    https://github.com/scummvm/scummvm/commit/be7486ffef6406131fb316d46aeefcd93beec7ac
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-27T12:28:26-07:00

Commit Message:
KYRA: (EOB) - minor fix in NPC sequence code

Changed paths:
    engines/kyra/eob.cpp



diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp
index 05b1e03..405ea21 100644
--- a/engines/kyra/eob.cpp
+++ b/engines/kyra/eob.cpp
@@ -178,13 +178,14 @@ void EoBEngine::runNpcDialogue(int npcIndex) {
 	case 1:
 		if (!checkScriptFlags(0x10000)) {
 			if (checkScriptFlags(0x8000)) {
-				a = 1;
+				a = 13;
 			} else {
 				setScriptFlags(0x8000);
 				r = DLG2(3, 3);
+				a = 4;
 			}
 			if (!r)
-				r = DLG2(a ? 13 : 4, 4);
+				r = DLG2(a, 4);
 
 			if (!r) {
 				for (a = 0; a < 6; a++)
@@ -214,8 +215,8 @@ void EoBEngine::runNpcDialogue(int npcIndex) {
 
 		if (!checkScriptFlags(0x100000)) {
 			if (deletePartyItems(6, -1)) {
-				//_npcSequenceSub = 0;
-				//drawNpcScene(npcIndex);
+				_npcSequenceSub = 0;
+				drawNpcScene(npcIndex);
 				TXT(28);
 				createItemOnCurrentBlock(32);
 				setScriptFlags(0x100000);


Commit: c3a7e01807677e637a123188ba0081173c25380c
    https://github.com/scummvm/scummvm/commit/c3a7e01807677e637a123188ba0081173c25380c
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-27T12:28:28-07:00

Commit Message:
KYRA: (EOB) - fix original savefile import/export

(flag settings were not imported/exported in EOB 1 saves)

Changed paths:
    engines/kyra/script_eob.cpp



diff --git a/engines/kyra/script_eob.cpp b/engines/kyra/script_eob.cpp
index de4d01b..4a6a498 100644
--- a/engines/kyra/script_eob.cpp
+++ b/engines/kyra/script_eob.cpp
@@ -216,21 +216,25 @@ bool EoBInfProcessor::preventRest() const {
 
 void EoBInfProcessor::loadState(Common::SeekableSubReadStreamEndian &in, bool origFile) {
 	_preventRest = (_vm->game() == GI_EOB1 && origFile) ? 0 : in.readByte();
-	int numFlags = (_vm->game() == GI_EOB1 && origFile) ? 13 : 18;
+	int numFlags = (_vm->game() == GI_EOB1 && origFile) ? 12 : 18;
 	for (int i = 0; i < numFlags; i++)
 		_flagTable[i] = in.readUint32();
+	if (_vm->game() == GI_EOB1 && origFile)
+		setFlags(in.readUint32());
 }
 
 void EoBInfProcessor::saveState(Common::OutSaveFile *out, bool origFile) {
 	if (_vm->game() == GI_EOB2 || !origFile)
 		out->writeByte(_preventRest);
-	int numFlags = (_vm->game() == GI_EOB1 && origFile) ? 13 : 18;
+	int numFlags = (_vm->game() == GI_EOB1 && origFile) ? 12 : 18;
 	for (int i = 0; i < numFlags; i++) {
 		if (origFile)
 			out->writeUint32LE(_flagTable[i]);
 		else
 			out->writeUint32BE(_flagTable[i]);
 	}
+	if (_vm->game() == GI_EOB1 && origFile)
+		out->writeUint32LE(_flagTable[17]);
 }
 
 void EoBInfProcessor::reset() {


Commit: 87ef0819d366d753515b79af85e33f0801d801ed
    https://github.com/scummvm/scummvm/commit/87ef0819d366d753515b79af85e33f0801d801ed
Author: athrxx (athrxx at scummvm.org)
Date: 2013-04-27T12:43:47-07:00

Commit Message:
KYRA: (EOB) - add debugger functions

(list_flags, set_flag, clear_flag)

Changed paths:
    engines/kyra/debugger.cpp
    engines/kyra/debugger.h



diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 84f956f..0457422 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -489,6 +489,9 @@ void Debugger_EoB::initialize() {
 	DCmd_Register("set_position", WRAP_METHOD(Debugger_EoB, cmd_setPosition));
 	DCmd_Register("open_door", WRAP_METHOD(Debugger_EoB, cmd_openDoor));
 	DCmd_Register("close_door", WRAP_METHOD(Debugger_EoB, cmd_closeDoor));
+	DCmd_Register("list_flags", WRAP_METHOD(Debugger_EoB, cmd_listFlags));
+	DCmd_Register("set_flag", WRAP_METHOD(Debugger_EoB, cmd_setFlag));
+	DCmd_Register("clear_flag", WRAP_METHOD(Debugger_EoB, cmd_clearFlag));
 }
 
 bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
@@ -640,7 +643,7 @@ bool Debugger_EoB::cmd_closeDoor(int, const char **) {
 	int c = (_vm->_wllWallFlags[_vm->_levelBlockProperties[block].walls[0]] & 8) ? 0 : 1;
 	int v = _vm->_levelBlockProperties[block].walls[c];
 	if ((_vm->_flags.gameID == GI_EOB1 && !(_vm->_wllWallFlags[v] & 1)) || (_vm->_flags.gameID == GI_EOB2 && (_vm->_wllWallFlags[v] & 0x20))) {
-		DebugPrintf("Couldn't close any door. Make sure you're facing the door you wish to open and standing right in front of it.\n\n");
+		DebugPrintf("Couldn't close any door. Make sure you're facing the door you wish to close and standing right in front of it.\n\n");
 	} else {
 		_vm->closeDoor(block);
 		DebugPrintf("Trying to close door at block %d.\n\n", block);
@@ -648,6 +651,54 @@ bool Debugger_EoB::cmd_closeDoor(int, const char **) {
 	return true;
 }
 
+bool Debugger_EoB::cmd_listFlags(int, const char **) {
+	DebugPrintf("Flag           Status\n----------------------\n\n");
+	for (int i = 0; i < 32; i++) {
+		uint32 flag = 1 << i;
+		DebugPrintf("%.2d             %s\n", i, _vm->checkScriptFlags(flag) ? "TRUE" : "FALSE");
+	}
+	DebugPrintf("\n");
+	return true;
+}
+
+bool Debugger_EoB::cmd_setFlag(int argc, const char **argv) {
+	if (argc != 2) {
+		DebugPrintf("Syntax:   set_flag <flag>\n\n");
+		return true;
+	}
+
+	int flag = atoi(argv[1]);
+	if (flag < 0 || flag > 31) {
+		DebugPrintf("<flag> must be a value from 0 to 31.\n\n");
+	} else {
+		_vm->setScriptFlags(1 << flag);
+		DebugPrintf("Flag '%.2d' has been set.\n\n", flag);
+	}
+
+	return true;
+}
+
+bool Debugger_EoB::cmd_clearFlag(int argc, const char **argv) {
+	if (argc != 2) {
+		DebugPrintf("Syntax:   clear_flag <flag>\n\n");
+		return true;
+	}
+
+	int flag = atoi(argv[1]);
+	if (flag < 0 || flag > 31) {
+		DebugPrintf("<flag> must be a value from 0 to 31.\n\n");
+	} else {
+		_vm->clearScriptFlags(1 << flag);
+		DebugPrintf("Flag '%.2d' has been cleared.\n\n", flag);
+	}
+
+	return true;
+}
+
+bool cmd_listFlags(int argc, const char **argv);
+	bool cmd_setFlags(int argc, const char **argv);
+	bool cmd_clearFlags(int argc, const char **argv);
+
 #endif // ENABLE_EOB
 
 } // End of namespace Kyra
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index 76264ec..c1056a6 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -126,6 +126,9 @@ protected:
 	bool cmd_setPosition(int argc, const char **argv);
 	bool cmd_openDoor(int argc, const char **argv);
 	bool cmd_closeDoor(int argc, const char **argv);
+	bool cmd_listFlags(int argc, const char **argv);
+	bool cmd_setFlag(int argc, const char **argv);
+	bool cmd_clearFlag(int argc, const char **argv);
 };
 #endif // ENABLE_EOB
 






More information about the Scummvm-git-logs mailing list