[Scummvm-cvs-logs] scummvm master -> 10c96babbcba734ab6bd8273d1a6ebff58018dd3

dreammaster dreammaster at scummvm.org
Tue Jul 14 02:18:04 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:
10c96babbc SHERLOCK: Debugger locations command to show all locations on the map


Commit: 10c96babbcba734ab6bd8273d1a6ebff58018dd3
    https://github.com/scummvm/scummvm/commit/10c96babbcba734ab6bd8273d1a6ebff58018dd3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-13T20:17:02-04:00

Commit Message:
SHERLOCK: Debugger locations command to show all locations on the map

Changed paths:
    engines/sherlock/debugger.cpp
    engines/sherlock/debugger.h
    engines/sherlock/scalpel/scalpel_map.cpp
    engines/sherlock/tattoo/tattoo_map.cpp



diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index 7806cc8..2813a7e 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -40,10 +40,13 @@ Debugger *Debugger::init(SherlockEngine *vm) {
 }
 
 Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
+	_showAllLocations = LOC_DISABLED;
+
 	registerCmd("continue",	     WRAP_METHOD(Debugger, cmdExit));
 	registerCmd("scene",         WRAP_METHOD(Debugger, cmdScene));
 	registerCmd("song",          WRAP_METHOD(Debugger, cmdSong));
 	registerCmd("dumpfile",      WRAP_METHOD(Debugger, cmdDumpFile));
+	registerCmd("locations",	 WRAP_METHOD(Debugger, cmdLocations));
 }
 
 void Debugger::postEnter() {
@@ -124,4 +127,12 @@ bool Debugger::cmdDumpFile(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger::cmdLocations(int argc, const char **argv) {
+	_showAllLocations = LOC_REFRESH;
+
+	debugPrintf("Now showing all map locations\n");
+	return false;
+}
+
+
 } // End of namespace Sherlock
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index eec2579..abc8ef0 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -30,6 +30,8 @@ namespace Sherlock {
 
 class SherlockEngine;
 
+enum AllLocations { LOC_REFRESH = -1, LOC_DISABLED = 0, LOC_ALL = 1 };
+
 class Debugger : public GUI::Debugger {
 private:
 	/**
@@ -51,10 +53,17 @@ private:
 	 * Dumps a file to disk
 	 */
 	bool cmdDumpFile(int argc, const char **argv);
+
+	/**
+	 * Show all locations on the map
+	 */
+	bool cmdLocations(int argc, const char **argv);
 protected:
 	SherlockEngine *_vm;
 	Common::String _3doPlayMovieFile;
 public:
+	AllLocations _showAllLocations;
+public:
 	Debugger(SherlockEngine *vm);
 	virtual ~Debugger() {}
 	static Debugger *init(SherlockEngine *vm);
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp
index 6da52e6..369822b 100644
--- a/engines/sherlock/scalpel/scalpel_map.cpp
+++ b/engines/sherlock/scalpel/scalpel_map.cpp
@@ -122,6 +122,7 @@ void ScalpelMap::loadData() {
 }
 
 int ScalpelMap::show() {
+	Debugger &debugger = *_vm->_debugger;
 	Events &events = *_vm->_events;
 	People &people = *_vm->_people;
 	Screen &screen = *_vm->_screen;
@@ -175,6 +176,11 @@ int ScalpelMap::show() {
 		events.pollEventsAndWait();
 		events.setButtonState();
 
+		if (debugger._showAllLocations == LOC_REFRESH) {
+			showPlaces();
+			screen.slamArea(screen._currentScroll.x, screen._currentScroll.y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_WIDTH);
+		}
+
 		// Keyboard handling
 		if (events.kbHit()) {
 			Common::KeyState keyState = events.getKey();
@@ -342,12 +348,16 @@ void ScalpelMap::freeSprites() {
 }
 
 void ScalpelMap::showPlaces() {
+	Debugger &debugger = *_vm->_debugger;
 	Screen &screen = *_vm->_screen;
 
 	for (uint idx = 0; idx < _points.size(); ++idx) {
 		const MapEntry &pt = _points[idx];
 
 		if (pt.x != 0 && pt.y != 0) {
+			if (debugger._showAllLocations != LOC_DISABLED)
+				_vm->setFlagsDirect(idx);
+
 			if (pt.x >= _bigPos.x && (pt.x - _bigPos.x) < SHERLOCK_SCREEN_WIDTH
 					&& pt.y >= _bigPos.y && (pt.y - _bigPos.y) < SHERLOCK_SCREEN_HEIGHT) {
 				if (_vm->readFlags(idx)) {
@@ -357,6 +367,9 @@ void ScalpelMap::showPlaces() {
 			}
 		}
 	}
+
+	if (debugger._showAllLocations == LOC_REFRESH)
+		debugger._showAllLocations = LOC_ALL;
 }
 
 void ScalpelMap::saveTopLine() {
diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp
index f7af0f4..b60ac3a 100644
--- a/engines/sherlock/tattoo/tattoo_map.cpp
+++ b/engines/sherlock/tattoo/tattoo_map.cpp
@@ -49,6 +49,7 @@ TattooMap::TattooMap(SherlockEngine *vm) : Map(vm), _mapTooltip(vm) {
 }
 
 int TattooMap::show() {
+	Debugger &debugger = *_vm->_debugger;
 	Events &events = *_vm->_events;
 	Music &music = *_vm->_music;
 	Resources &res = *_vm->_res;
@@ -129,6 +130,11 @@ int TattooMap::show() {
 		events.setButtonState();
 		Common::Point mousePos = events.screenMousePos();
 
+		if (debugger._showAllLocations == LOC_REFRESH) {
+			drawMapIcons();
+			screen.slamArea(screen._currentScroll.x, screen._currentScroll.y, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_WIDTH);
+		}
+
 		checkMapNames(true);
 
 		if (mousePos.x < (SHERLOCK_SCREEN_WIDTH / 6))
@@ -290,10 +296,12 @@ void TattooMap::loadData() {
 }
 
 void TattooMap::drawMapIcons() {
+	Debugger &debugger = *_vm->_debugger;
 	Screen &screen = *_vm->_screen;
 	
 	for (uint idx = 0; idx < _data.size(); ++idx) {
-		_vm->setFlagsDirect(idx + 1);
+		if (debugger._showAllLocations != LOC_DISABLED)
+			_vm->setFlagsDirect(idx + 1);
 
 		if (_data[idx]._iconNum != -1 && _vm->readFlags(idx + 1)) {
 			MapEntry &mapEntry = _data[idx];
@@ -302,6 +310,9 @@ void TattooMap::drawMapIcons() {
 				mapEntry.y - img._height / 2));
 		}
 	}
+
+	if (debugger._showAllLocations == LOC_REFRESH)
+		debugger._showAllLocations = LOC_ALL;
 }
 
 void TattooMap::checkMapNames(bool slamIt) {






More information about the Scummvm-git-logs mailing list