[Scummvm-cvs-logs] scummvm master -> dc43979a9c73e7f93733d050716b8afd02a1741c

bluegr bluegr at gmail.com
Sun Jun 7 19:54:50 CEST 2015


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

Summary:
0f8f40c111 SHERLOCK: Implement the "dumpfile" debugger command
dc43979a9c SHERLOCK: Split cmdGotoScene and add the Rose Tattoo implementation


Commit: 0f8f40c11185edd361bedf443f79b64328be6088
    https://github.com/scummvm/scummvm/commit/0f8f40c11185edd361bedf443f79b64328be6088
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-07T20:51:44+03:00

Commit Message:
SHERLOCK: Implement the "dumpfile" debugger command

This can help us debug resources bundled within LIB files

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



diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index 4d8ea6c..7a727e8 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -39,6 +39,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("3do_playmovie", WRAP_METHOD(Debugger, cmd3DO_PlayMovie));
 	registerCmd("3do_playaudio", WRAP_METHOD(Debugger, cmd3DO_PlayAudio));
 	registerCmd("song",          WRAP_METHOD(Debugger, cmdSong));
+	registerCmd("dumpfile",      WRAP_METHOD(Debugger, cmdDumpFile));
 }
 
 void Debugger::postEnter() {
@@ -140,4 +141,33 @@ bool Debugger::cmdSong(int argc, const char **argv) {
 	return false;
 }
 
+bool Debugger::cmdDumpFile(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Format: dumpfile <resource name>\n");
+		return true;
+	}
+
+	Common::SeekableReadStream *s = _vm->_res->load(argv[1]);
+	if (!s) {
+		debugPrintf("Invalid resource.\n");
+		return true;
+	}
+
+	byte *buffer = new byte[s->size()];
+	s->read(buffer, s->size());
+
+	Common::DumpFile dumpFile;
+	dumpFile.open(argv[1]);
+
+	dumpFile.write(buffer, s->size());
+	dumpFile.flush();
+	dumpFile.close();
+
+	delete[] buffer;
+
+	debugPrintf("Resource %s has been dumped to disk.\n", argv[1]);
+
+	return true;
+}
+
 } // End of namespace Sherlock
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index 9b12668..2252f6d 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -65,6 +65,11 @@ private:
 	 */
 	bool cmdSong(int argc, const char **argv);
 
+	/**
+	 * Dumps a file to disk
+	 */
+	bool cmdDumpFile(int argc, const char **argv);
+
 private:
 	Common::String _3doPlayMovieFile;
 };


Commit: dc43979a9c73e7f93733d050716b8afd02a1741c
    https://github.com/scummvm/scummvm/commit/dc43979a9c73e7f93733d050716b8afd02a1741c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-07T20:51:45+03:00

Commit Message:
SHERLOCK: Split cmdGotoScene and add the Rose Tattoo implementation

This also adds some code missing from the Serrated Scalpel implementation

Changed paths:
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_talk.h
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_talk.h



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index b3ac27c..2d9db77 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -287,6 +287,40 @@ OpcodeReturn ScalpelTalk::cmdSwitchSpeaker(const byte *&str) {
 	return RET_SUCCESS;
 }
 
+OpcodeReturn ScalpelTalk::cmdGotoScene(const byte *&str) {
+	Map &map = *_vm->_map;
+	People &people = *_vm->_people;
+	Scene &scene = *_vm->_scene;
+	scene._goToScene = str[1] - 1;
+
+	if (scene._goToScene != 100) {
+		// Not going to the map overview
+		map._oldCharPoint = scene._goToScene;
+		map._overPos.x = map[scene._goToScene].x * 100 - 600;
+		map._overPos.y = map[scene._goToScene].y * 100 + 900;
+
+		// Run a canimation?
+		if (str[2] > 100) {
+			people._hSavedFacing = str[2];
+			people._hSavedPos = Point32(160, 100);
+		} else {
+			people._hSavedFacing = str[2] - 1;
+			int32 posX = (str[3] - 1) * 256 + str[4] - 1;
+			int32 posY = str[5] - 1;
+			people._hSavedPos = Point32(posX, posY);
+		}
+	}	// if (scene._goToScene != 100)
+
+	str += 6;
+
+	_scriptMoreFlag = (scene._goToScene == 100) ? 2 : 1;
+	_scriptSaveIndex = str - _scriptStart;
+	_endStr = true;
+	_wait = 0;
+
+	return RET_SUCCESS;
+}
+
 OpcodeReturn ScalpelTalk::cmdAssignPortraitLocation(const byte *&str) {
 	People &people = *_vm->_people;
 
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index eb97b57..6a11824 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -39,6 +39,7 @@ class ScalpelTalk : public Talk {
 private:
 	OpcodeReturn cmdSwitchSpeaker(const byte *&str);
 	OpcodeReturn cmdAssignPortraitLocation(const byte *&str);
+	OpcodeReturn cmdGotoScene(const byte *&str);
 	OpcodeReturn cmdClearInfoLine(const byte *&str);
 	OpcodeReturn cmdClearWindow(const byte *&str);
 	OpcodeReturn cmdDisplayInfoLine(const byte *&str);
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index fe1ff70..e11fc66 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -1336,34 +1336,6 @@ OpcodeReturn Talk::cmdEnableEndKey(const byte *&str) {
 	return RET_SUCCESS;
 }
 
-OpcodeReturn Talk::cmdGotoScene(const byte *&str) {
-	Map &map = *_vm->_map;
-	People &people = *_vm->_people;
-	Scene &scene = *_vm->_scene;
-	scene._goToScene = str[1] - 1;
-
-	if (scene._goToScene != 100) {
-		// Not going to the map overview
-		map._oldCharPoint = scene._goToScene;
-		map._overPos.x = map[scene._goToScene].x * 100 - 600;
-		map._overPos.y = map[scene._goToScene].y * 100 + 900;
-
-		// Run a canimation?
-		if (str[2] > 100) {
-			people._hSavedFacing = str[2];
-			people._hSavedPos = Common::Point(160, 100);
-		}
-	}
-	str += 6;
-
-	_scriptMoreFlag = (scene._goToScene == 100) ? 2 : 1;
-	_scriptSaveIndex = str - _scriptStart;
-	_endStr = true;
-	_wait = 0;
-
-	return RET_SUCCESS;
-}
-
 OpcodeReturn Talk::cmdHolmesOff(const byte *&str) {
 	People &people = *_vm->_people;
 	people[PLAYER]._type = REMOVE;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index ec8f526..fbcc9e7 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -238,7 +238,6 @@ protected:
 	OpcodeReturn cmdCallTalkFile(const byte *&str);
 	OpcodeReturn cmdDisableEndKey(const byte *&str);
 	OpcodeReturn cmdEnableEndKey(const byte *&str);
-	OpcodeReturn cmdGotoScene(const byte *&str);
 	OpcodeReturn cmdHolmesOff(const byte *&str);
 	OpcodeReturn cmdHolmesOn(const byte *&str);
 	OpcodeReturn cmdPause(const byte *&str);
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 9e20ad4..92e64a8 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -230,6 +230,42 @@ OpcodeReturn TattooTalk::cmdMouseOnOff(const byte *&str) {
 	return RET_SUCCESS;
 }
 
+OpcodeReturn TattooTalk::cmdGotoScene(const byte *&str) {
+	Map &map = *_vm->_map;
+	People &people = *_vm->_people;
+	Scene &scene = *_vm->_scene;
+	scene._goToScene = str[1] - 1;
+
+	if (scene._goToScene != 100) {
+		// Not going to the map overview
+		map._oldCharPoint = scene._goToScene;
+
+		// Run a canimation?
+		if (str[2] > 100) {
+			people._hSavedFacing = str[2];
+			people._hSavedPos = Point32(160, 100);
+		} else {
+			people._hSavedFacing = str[2] - 1;
+			int32 posX = (str[3] - 1) * 256 + str[4] - 1;
+			if (posX > 16384)
+				posX = -1 * (posX - 16384);
+			int32 posY = (str[5] - 1) * 256 + str[6] - 1;
+			people._hSavedPos = Point32(posX, posY);
+		}
+
+		_scriptMoreFlag = 1;
+	}	// if (scene._goToScene != 100)
+
+	str += 7;
+	if (scene._goToScene != 100)
+		_scriptSaveIndex = str - _scriptStart;
+
+	_endStr = true;
+	_wait = 0;
+
+	return RET_SUCCESS;
+}
+
 OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) {
 	Sound &sound = *_vm->_sound;
 
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index 0b5e7e4..ab032a7 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -39,6 +39,7 @@ class TattooTalk : public Talk {
 private:
 	OpcodeReturn cmdSwitchSpeaker(const byte *&str);
 	OpcodeReturn cmdMouseOnOff(const byte *&str);
+	OpcodeReturn cmdGotoScene(const byte *&str);
 	OpcodeReturn cmdNextSong(const byte *&str);
 	OpcodeReturn cmdPassword(const byte *&str);
 	OpcodeReturn cmdPlaySong(const byte *&str);






More information about the Scummvm-git-logs mailing list