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

Strangerke Strangerke at scummvm.org
Mon Nov 28 18:54:40 CET 2011


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:
b3c9b51e46 CGE: Add to the console a function to display boundaries


Commit: b3c9b51e4638afa3fb2afd32d2a9b3e16153d0e3
    https://github.com/scummvm/scummvm/commit/b3c9b51e4638afa3fb2afd32d2a9b3e16153d0e3
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-11-28T09:54:01-08:00

Commit Message:
CGE: Add to the console a function to display boundaries

Changed paths:
    engines/cge/cge.cpp
    engines/cge/cge.h
    engines/cge/console.cpp
    engines/cge/console.h
    engines/cge/vga13h.cpp
    engines/cge/vga13h.h
    engines/cge/walk.h



diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 87654c5..34e7d3f 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -54,6 +54,7 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
 	_pocPtr      = 0;
 	_bitmapPalette = NULL;
 	_quitFlag = false;
+	_showBoundariesFl = false;
 }
 
 void CGEEngine::initSceneValues() {
@@ -89,7 +90,7 @@ void CGEEngine::init() {
 	_font = new Font(this, "CGE");
 	_text = new Text(this, "CGE");
 	_talk = NULL;
-	_vga = new Vga();
+	_vga = new Vga(this);
 	_sys = new System(this);
 	_pocLight = new PocLight(this);
 	for (int i = 0; i < kPocketNX; i++)
diff --git a/engines/cge/cge.h b/engines/cge/cge.h
index 2aada42..d494af0 100644
--- a/engines/cge/cge.h
+++ b/engines/cge/cge.h
@@ -73,8 +73,9 @@ class Talk;
 #define kPathMax    128
 #define kCryptSeed  0xA5
 #define kMaxFile    128
-#define kMapXCnt       40
-#define kMapZCnt       20
+#define kMapXCnt    40
+#define kMapZCnt    20
+#define kMapTop     80
 
 // our engine debug channels
 enum {
@@ -141,6 +142,7 @@ public:
 
 	static const int _maxSceneArr[5];
 	bool _quitFlag;
+	bool _showBoundariesFl;
 
 	const   ADGameDescription *_gameDescription;
 	int    _startupMode;
diff --git a/engines/cge/console.cpp b/engines/cge/console.cpp
index 71eedf3..105f241 100644
--- a/engines/cge/console.cpp
+++ b/engines/cge/console.cpp
@@ -26,9 +26,23 @@
 namespace CGE {
 
 CGEConsole::CGEConsole(CGEEngine *vm) : GUI::Debugger(), _vm(vm) {
+	DCmd_Register("Boundaries",    WRAP_METHOD(CGEConsole, Cmd_boundaries));
 }
 
 CGEConsole::~CGEConsole() {
 }
 
+/**
+ * This command shows and hides boundaries
+ */
+bool CGEConsole::Cmd_boundaries(int argc, const char **argv) {
+	if (argc != 1) {
+		DebugPrintf("Usage: %s\n", argv[0]);
+		return true;
+	}
+
+	_vm->_showBoundariesFl = !_vm->_showBoundariesFl;
+	return false;
+}
+
 } // End of namespace CGE
diff --git a/engines/cge/console.h b/engines/cge/console.h
index 25a1a4f..ea36dfb 100644
--- a/engines/cge/console.h
+++ b/engines/cge/console.h
@@ -36,6 +36,7 @@ public:
 
 private:
 	CGEEngine *_vm;
+	bool Cmd_boundaries(int argc, const char **argv);
 };
 
 } // End of namespace CGE
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index e271895..fb81925 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -625,7 +625,7 @@ Sprite *Queue::locate(int ref) {
 	return NULL;
 }
 
-Vga::Vga() : _frmCnt(0), _msg(NULL), _name(NULL), _setPal(false), _mono(0) {
+Vga::Vga(CGEEngine *vm) : _frmCnt(0), _msg(NULL), _name(NULL), _setPal(false), _mono(0), _vm(vm) {
 	_oldColors = NULL;
 	_newColors = NULL;
 	_showQ = new Queue(true);
@@ -822,6 +822,19 @@ void Vga::update() {
 		updateColors();
 		_setPal = false;
 	}
+	if (_vm->_showBoundariesFl) {
+		Vga::_page[0]->hLine(0, 200 - kPanHeight, 320, 0xee);
+		if (_vm->_barriers[_vm->_now]._horz != 255) {
+			warning("hBar %d", _vm->_barriers[_vm->_now]._horz);
+			for (int i = 0; i < 8; i++)
+				Vga::_page[0]->vLine((_vm->_barriers[_vm->_now]._horz * 8) + i, 0, 200, 0xff);
+		}
+		if (_vm->_barriers[_vm->_now]._vert != 255) {
+			warning("vBar %d", _vm->_barriers[_vm->_now]._vert);
+			for (int i = 0; i < 4; i++)
+				Vga::_page[0]->hLine(0, 80 + (_vm->_barriers[_vm->_now]._vert * 4) + i, 320, 0xff);
+		}
+	}
 
 	g_system->copyRectToScreen((const byte *)Vga::_page[0]->getBasePtr(0, 0), kScrWidth, 0, 0, kScrWidth, kScrHeight);
 	g_system->updateScreen();
diff --git a/engines/cge/vga13h.h b/engines/cge/vga13h.h
index 50cf5de..beca19f 100644
--- a/engines/cge/vga13h.h
+++ b/engines/cge/vga13h.h
@@ -177,6 +177,7 @@ public:
 };
 
 class Vga {
+	CGEEngine *_vm;
 	bool _setPal;
 	Dac *_oldColors;
 	Dac *_newColors;
@@ -196,7 +197,7 @@ public:
 	Graphics::Surface *_page[4];
 	Dac *_sysPal;
 
-	Vga();
+	Vga(CGEEngine *vm);
 	~Vga();
 
 	uint8 *glass(Dac *pal, const uint8 colR, const uint8 colG, const uint8 colB);
diff --git a/engines/cge/walk.h b/engines/cge/walk.h
index 99dc362..00ec080 100644
--- a/engines/cge/walk.h
+++ b/engines/cge/walk.h
@@ -35,7 +35,6 @@
 namespace CGE {
 
 #define kMapArrSize    (kMapZCnt * kMapXCnt)
-#define kMapTop        80
 #define kMapHig        80
 #define kMapGridX      (kScrWidth / kMapXCnt)
 #define kMapGridZ      (kMapHig / kMapZCnt)






More information about the Scummvm-git-logs mailing list