[Scummvm-cvs-logs] scummvm master -> 6c036549806491012a1921bbe4aa3b5a3252702d

dreammaster dreammaster at scummvm.org
Mon Jul 13 04:31:38 CEST 2015


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

Summary:
6c03654980 SHERLOCK: Split up Debugger class for both games


Commit: 6c036549806491012a1921bbe4aa3b5a3252702d
    https://github.com/scummvm/scummvm/commit/6c036549806491012a1921bbe4aa3b5a3252702d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-12T22:30:32-04:00

Commit Message:
SHERLOCK: Split up Debugger class for both games

Changed paths:
  A engines/sherlock/scalpel/scalpel_debugger.cpp
  A engines/sherlock/scalpel/scalpel_debugger.h
  A engines/sherlock/tattoo/tattoo_debugger.cpp
  A engines/sherlock/tattoo/tattoo_debugger.h
    engines/sherlock/debugger.cpp
    engines/sherlock/debugger.h
    engines/sherlock/module.mk
    engines/sherlock/sherlock.cpp
    engines/sherlock/tattoo/tattoo_map.cpp



diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index 8b7bdaa..7806cc8 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -23,21 +23,25 @@
 #include "sherlock/debugger.h"
 #include "sherlock/sherlock.h"
 #include "sherlock/music.h"
-
 #include "sherlock/scalpel/3do/movie_decoder.h"
-
+#include "sherlock/scalpel/scalpel_debugger.h"
+#include "sherlock/tattoo/tattoo_debugger.h"
 #include "audio/mixer.h"
 #include "audio/decoders/aiff.h"
 #include "audio/decoders/wave.h"
-#include "audio/decoders/3do.h"
 
 namespace Sherlock {
 
+Debugger *Debugger::init(SherlockEngine *vm) {
+	if (vm->getGameID() == GType_RoseTattoo)
+		return new Tattoo::TattooDebugger(vm);
+	else
+		return new Scalpel::ScalpelDebugger(vm);
+}
+
 Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("continue",	     WRAP_METHOD(Debugger, cmdExit));
 	registerCmd("scene",         WRAP_METHOD(Debugger, cmdScene));
-	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));
 }
@@ -78,56 +82,6 @@ bool Debugger::cmdScene(int argc, const char **argv) {
 	}
 }
 
-bool Debugger::cmd3DO_PlayMovie(int argc, const char **argv) {
-	if (argc != 2) {
-		debugPrintf("Format: 3do_playmovie <3do-movie-file>\n");
-		return true;
-	}
-
-	// play gets postboned until debugger is closed
-	Common::String filename = argv[1];
-	_3doPlayMovieFile = filename;
-
-	return cmdExit(0, 0);
-}
-
-bool Debugger::cmd3DO_PlayAudio(int argc, const char **argv) {
-	if (argc != 2) {
-		debugPrintf("Format: 3do_playaudio <3do-audio-file>\n");
-		return true;
-	}
-
-	Common::File *file = new Common::File();
-	if (!file->open(argv[1])) {
-		debugPrintf("can not open specified audio file\n");
-		return true;
-	}
-
-	Audio::AudioStream *testStream;
-	Audio::SoundHandle testHandle;
-
-	// Try to load the given file as AIFF/AIFC
-	testStream = Audio::makeAIFFStream(file, DisposeAfterUse::YES);
-
-	if (testStream) {
-		g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &testHandle, testStream);
-		_vm->_events->clearEvents();
-
-		while ((!_vm->shouldQuit()) && g_system->getMixer()->isSoundHandleActive(testHandle)) {
-			_vm->_events->pollEvents();
-			g_system->delayMillis(10);
-			if (_vm->_events->kbHit()) {
-				break;
-			}
-		}
-
-		debugPrintf("playing completed\n");
-		g_system->getMixer()->stopHandle(testHandle);
-	}
-
-	return true;
-}
-
 bool Debugger::cmdSong(int argc, const char **argv) {
 	if (argc != 2) {
 		debugPrintf("Format: song <room>\n");
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index 2252f6d..eec2579 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -31,15 +31,7 @@ namespace Sherlock {
 class SherlockEngine;
 
 class Debugger : public GUI::Debugger {
-public:
-	Debugger(SherlockEngine *vm);
-	virtual ~Debugger() {}
-
-	void postEnter();
-
 private:
-	SherlockEngine *_vm;
-
 	/**
 	 * Converts a decimal or hexadecimal string into a number
 	 */
@@ -51,16 +43,6 @@ private:
 	bool cmdScene(int argc, const char **argv);
 
 	/**
-	 * Plays a 3DO movie
-	 */
-	bool cmd3DO_PlayMovie(int argc, const char **argv);
-
-	/**
-	 * Plays a 3DO audio
-	 */
-	bool cmd3DO_PlayAudio(int argc, const char **argv);
-
-	/**
 	 * Plays a song
 	 */
 	bool cmdSong(int argc, const char **argv);
@@ -69,9 +51,15 @@ private:
 	 * Dumps a file to disk
 	 */
 	bool cmdDumpFile(int argc, const char **argv);
-
-private:
+protected:
+	SherlockEngine *_vm;
 	Common::String _3doPlayMovieFile;
+public:
+	Debugger(SherlockEngine *vm);
+	virtual ~Debugger() {}
+	static Debugger *init(SherlockEngine *vm);
+
+	void postEnter();
 };
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/module.mk b/engines/sherlock/module.mk
index c1591b6..73067fd 100644
--- a/engines/sherlock/module.mk
+++ b/engines/sherlock/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS = \
 	scalpel/drivers/mt32.o \
 	scalpel/tsage/logo.o \
 	scalpel/tsage/resources.o \
+	scalpel/scalpel_debugger.o \
 	scalpel/scalpel_fixed_text.o \
 	scalpel/scalpel_inventory.o \
 	scalpel/scalpel_journal.o \
@@ -21,6 +22,7 @@ MODULE_OBJS = \
 	scalpel/settings.o \
 	tattoo/tattoo.o \
 	tattoo/tattoo_darts.o \
+	tattoo/tattoo_debugger.o \
 	tattoo/tattoo_fixed_text.o \
 	tattoo/tattoo_inventory.o \
 	tattoo/tattoo_journal.o \
diff --git a/engines/sherlock/scalpel/scalpel_debugger.cpp b/engines/sherlock/scalpel/scalpel_debugger.cpp
new file mode 100644
index 0000000..7f5e1ef
--- /dev/null
+++ b/engines/sherlock/scalpel/scalpel_debugger.cpp
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "sherlock/scalpel/scalpel_debugger.h"
+#include "sherlock/sherlock.h"
+#include "audio/mixer.h"
+#include "audio/decoders/3do.h"
+#include "audio/decoders/aiff.h"
+#include "audio/decoders/wave.h"
+
+namespace Sherlock {
+
+namespace Scalpel {
+
+ScalpelDebugger::ScalpelDebugger(SherlockEngine *vm) : Debugger(vm) {
+	registerCmd("3do_playmovie", WRAP_METHOD(ScalpelDebugger, cmd3DO_PlayMovie));
+	registerCmd("3do_playaudio", WRAP_METHOD(ScalpelDebugger, cmd3DO_PlayAudio));
+}
+
+bool ScalpelDebugger::cmd3DO_PlayMovie(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Format: 3do_playmovie <3do-movie-file>\n");
+		return true;
+	}
+
+	// play gets postboned until debugger is closed
+	Common::String filename = argv[1];
+	_3doPlayMovieFile = filename;
+
+	return cmdExit(0, 0);
+}
+
+bool ScalpelDebugger::cmd3DO_PlayAudio(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Format: 3do_playaudio <3do-audio-file>\n");
+		return true;
+	}
+
+	Common::File *file = new Common::File();
+	if (!file->open(argv[1])) {
+		debugPrintf("can not open specified audio file\n");
+		return true;
+	}
+
+	Audio::AudioStream *testStream;
+	Audio::SoundHandle testHandle;
+
+	// Try to load the given file as AIFF/AIFC
+	testStream = Audio::makeAIFFStream(file, DisposeAfterUse::YES);
+
+	if (testStream) {
+		g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &testHandle, testStream);
+		_vm->_events->clearEvents();
+
+		while ((!_vm->shouldQuit()) && g_system->getMixer()->isSoundHandleActive(testHandle)) {
+			_vm->_events->pollEvents();
+			g_system->delayMillis(10);
+			if (_vm->_events->kbHit()) {
+				break;
+			}
+		}
+
+		debugPrintf("playing completed\n");
+		g_system->getMixer()->stopHandle(testHandle);
+	}
+
+	return true;
+}
+
+} // End of namespace Scalpel
+
+} // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_debugger.h b/engines/sherlock/scalpel/scalpel_debugger.h
new file mode 100644
index 0000000..17a8477
--- /dev/null
+++ b/engines/sherlock/scalpel/scalpel_debugger.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SHERLOCK_SCALPEL_DEBUGGER_H
+#define SHERLOCK_SCALPEL_DEBUGGER_H
+
+#include "sherlock/debugger.h"
+
+namespace Sherlock {
+
+class SherlockEngine;
+
+namespace Scalpel {
+
+class ScalpelDebugger : public Debugger {
+private:
+	/**
+	 * Plays a 3DO movie
+	 */
+	bool cmd3DO_PlayMovie(int argc, const char **argv);
+
+	/**
+	 * Plays a 3DO audio
+	 */
+	bool cmd3DO_PlayAudio(int argc, const char **argv);
+public:
+	ScalpelDebugger(SherlockEngine *vm);
+	virtual ~ScalpelDebugger() {}
+};
+
+} // End of namespace Scalpel
+
+} // End of namespace Sherlock
+
+#endif	/* SHERLOCK_DEBUGGER_H */
diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp
index 7653dc0..d3a82d0 100644
--- a/engines/sherlock/sherlock.cpp
+++ b/engines/sherlock/sherlock.cpp
@@ -93,7 +93,7 @@ void SherlockEngine::initialize() {
 
 	_res = new Resources(this);
 	_animation = new Animation(this);
-	_debugger = new Debugger(this);
+	_debugger = Debugger::init(this);
 	_events = new Events(this);
 	_fixedText = FixedText::init(this);
 	_inventory = Inventory::init(this);
diff --git a/engines/sherlock/tattoo/tattoo_debugger.cpp b/engines/sherlock/tattoo/tattoo_debugger.cpp
new file mode 100644
index 0000000..8d59b4c
--- /dev/null
+++ b/engines/sherlock/tattoo/tattoo_debugger.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "sherlock/tattoo/tattoo_debugger.h"
+#include "sherlock/sherlock.h"
+
+namespace Sherlock {
+
+namespace Tattoo {
+
+TattooDebugger::TattooDebugger(SherlockEngine *vm) : Debugger(vm) {
+}
+
+} // End of namespace Tattoo
+
+} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_debugger.h b/engines/sherlock/tattoo/tattoo_debugger.h
new file mode 100644
index 0000000..e729262
--- /dev/null
+++ b/engines/sherlock/tattoo/tattoo_debugger.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SHERLOCK_TATTOO_DEBUGGER_H
+#define SHERLOCK_TATTOO_DEBUGGER_H
+
+#include "sherlock/debugger.h"
+
+namespace Sherlock {
+
+class SherlockEngine;
+
+namespace Tattoo {
+
+class TattooDebugger : public Debugger {
+public:
+	TattooDebugger(SherlockEngine *vm);
+	virtual ~TattooDebugger() {}
+};
+
+} // End of namespace Tattoo
+
+} // End of namespace Sherlock
+
+#endif	/* SHERLOCK_TATTOO_DEBUGGER_H */
diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp
index 3bd22cd..f7af0f4 100644
--- a/engines/sherlock/tattoo/tattoo_map.cpp
+++ b/engines/sherlock/tattoo/tattoo_map.cpp
@@ -293,7 +293,8 @@ void TattooMap::drawMapIcons() {
 	Screen &screen = *_vm->_screen;
 	
 	for (uint idx = 0; idx < _data.size(); ++idx) {
-		_vm->setFlagsDirect(idx + 1); //***DEBUG***
+		_vm->setFlagsDirect(idx + 1);
+
 		if (_data[idx]._iconNum != -1 && _vm->readFlags(idx + 1)) {
 			MapEntry &mapEntry = _data[idx];
 			ImageFrame &img = (*_iconImages)[mapEntry._iconNum];






More information about the Scummvm-git-logs mailing list