diff options
| author | Paul Gilbert | 2011-03-19 16:11:24 +1100 | 
|---|---|---|
| committer | Paul Gilbert | 2011-03-19 16:11:24 +1100 | 
| commit | 93b5873836a534e62dd4d7fdf4ae1f6cf4af068d (patch) | |
| tree | e7d92f0ee8d054ce3d9227609f53401bc9a7c0dd | |
| parent | 223ffde8ce9660bb2bcb02ccee6255130c6fec64 (diff) | |
| download | scummvm-rg350-93b5873836a534e62dd4d7fdf4ae1f6cf4af068d.tar.gz scummvm-rg350-93b5873836a534e62dd4d7fdf4ae1f6cf4af068d.tar.bz2 scummvm-rg350-93b5873836a534e62dd4d7fdf4ae1f6cf4af068d.zip | |
TSAGE: Added support to priority_regions to display a single specific priority region
| -rw-r--r-- | engines/tsage/debugger.cpp | 36 | 
1 files changed, 23 insertions, 13 deletions
| diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 84a04236da..2c6c533125 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -113,10 +113,11 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {   * This command draws the priority regions onto the screen   */  bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { -	if (argc != 1) { -		DebugPrintf("Usage: %s\n", argv[0]); -		return true; -	} +	int regionNum = 0; + +	// Check for an optional specific region to display +	if (argc == 2) +		regionNum = strToInt(argv[1]);  	// Colour index to use for the first priority region  	int colour = 16;	 @@ -126,18 +127,26 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {  	Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface();  	List<Region>::iterator i = _globals->_sceneManager._scene->_priorities.begin(); +	Common::String regionsDesc;  	for (; i != _globals->_sceneManager._scene->_priorities.end(); ++i, ++colour, ++count) { -		for (int y = 0; y < destSurface.h; ++y) { -			byte *destP = (byte *)destSurface.getBasePtr(0, y); - -			for (int x = 0; x < destSurface.w; ++x) { -				if ((*i).contains(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + x, -						_globals->_sceneManager._scene->_sceneBounds.top + y))) -					*destP = colour; -				++destP; +		Region &r = *i; + +		if ((regionNum == 0) || (regionNum == (count + 1))) { +			for (int y = 0; y < destSurface.h; ++y) { +				byte *destP = (byte *)destSurface.getBasePtr(0, y); + +				for (int x = 0; x < destSurface.w; ++x) { +					if (r.contains(Common::Point(_globals->_sceneManager._scene->_sceneBounds.left + x, +							_globals->_sceneManager._scene->_sceneBounds.top + y))) +						*destP = colour; +					++destP; +				}  			}  		} + +		regionsDesc += Common::String::format("Region Priority = %d bounds=%d,%d,%d,%d\n",  +			r._regionId, r._bounds.left, r._bounds.top, r._bounds.right, r._bounds.bottom);  	}  	// Release the surface @@ -147,8 +156,9 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) {  	_globals->_paneRefreshFlag[0] = 2;  	DebugPrintf("Total regions = %d\n", count); +	DebugPrintf("%s", regionsDesc.c_str()); -	return false; +	return true;  }  /** | 
