[Scummvm-cvs-logs] SF.net SVN: scummvm:[35238] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Dec 4 19:38:05 CET 2008


Revision: 35238
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35238&view=rev
Author:   thebluegr
Date:     2008-12-04 18:38:02 +0000 (Thu, 04 Dec 2008)

Log Message:
-----------
Disabled all the test functions in SAGA. They can be enabled again by defining SAGA_DEBUG to 1 in saga.h. This cuts down on the engine size a bit, for devices with little memory (e.g. the DS)

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.h
    scummvm/trunk/engines/saga/actor_path.cpp
    scummvm/trunk/engines/saga/input.cpp
    scummvm/trunk/engines/saga/objectmap.cpp
    scummvm/trunk/engines/saga/objectmap.h
    scummvm/trunk/engines/saga/render.cpp
    scummvm/trunk/engines/saga/render.h
    scummvm/trunk/engines/saga/saga.h

Modified: scummvm/trunk/engines/saga/actor.h
===================================================================
--- scummvm/trunk/engines/saga/actor.h	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/actor.h	2008-12-04 18:38:02 UTC (rev 35238)
@@ -604,7 +604,9 @@
 
 	void drawSpeech();
 
+#ifdef ACTOR_DEBUG
 	void drawPathTest();
+#endif
 
 	uint16 hitTest(const Point &testPoint, bool skipProtagonist);
 	void takeExit(uint16 actorId, const HitZone *hitZone);

Modified: scummvm/trunk/engines/saga/actor_path.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor_path.cpp	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/actor_path.cpp	2008-12-04 18:38:02 UTC (rev 35238)
@@ -589,8 +589,8 @@
 	_pathNodeListIndex = j - 1;
 }
 
+#ifdef ACTOR_DEBUG
 void Actor::drawPathTest() {
-#ifdef ACTOR_DEBUG
 	int i;
 	Surface *surface;
 	surface = _vm->_gfx->getBackBuffer();
@@ -601,7 +601,7 @@
 	for (i = 0; i < _debugPointsCount; i++) {
 		*((byte *)surface->pixels + (_debugPoints[i].point.y * surface->pitch) + _debugPoints[i].point.x) = _debugPoints[i].color;
 	}
+}
 #endif
-}
 
 } // End of namespace Saga

Modified: scummvm/trunk/engines/saga/input.cpp
===================================================================
--- scummvm/trunk/engines/saga/input.cpp	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/input.cpp	2008-12-04 18:38:02 UTC (rev 35238)
@@ -77,6 +77,8 @@
 				}
 				break;
 #endif
+
+#ifdef SAGA_DEBUG
 			case Common::KEYCODE_F1:
 				_render->toggleFlag(RF_SHOW_FPS);
 				_actor->_handleActionDiv = (_actor->_handleActionDiv == 15) ? 50 : 15;
@@ -90,10 +92,13 @@
 			case Common::KEYCODE_F4:
 				_render->toggleFlag(RF_OBJECTMAP_TEST);
 				break;
+#endif
 			case Common::KEYCODE_F5:
 				if (_interface->getSaveReminderState() > 0)
 					_interface->setMode(kPanelOption);
 				break;
+
+#ifdef SAGA_DEBUG
 			case Common::KEYCODE_F6:
 				_render->toggleFlag(RF_ACTOR_PATH_TEST);
 				break;
@@ -102,6 +107,8 @@
 				break;
 			case Common::KEYCODE_F8:
 				break;
+#endif
+
 			case Common::KEYCODE_F9:
 				_interface->keyBoss();
 				break;

Modified: scummvm/trunk/engines/saga/objectmap.cpp
===================================================================
--- scummvm/trunk/engines/saga/objectmap.cpp	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/objectmap.cpp	2008-12-04 18:38:02 UTC (rev 35238)
@@ -141,6 +141,7 @@
 	return false;
 }
 
+#ifdef SAGA_DEBUG
 void HitZone::draw(SagaEngine *vm, Surface *ds, int color) {
 	int i, pointsCount, j;
 	Location location;
@@ -186,8 +187,8 @@
 		ds->drawFrame(specialPoint1, specialPoint2, color);
 	}
 }
+#endif
 
-
 // Loads an object map resource ( objects ( clickareas ( points ) ) )
 void ObjectMap::load(const byte *resourcePointer, size_t resourceLength) {
 	int i;
@@ -235,7 +236,7 @@
 }
 
 
-
+#ifdef SAGA_DEBUG
 void ObjectMap::draw(Surface *ds, const Point& testPoint, int color, int color2) {
 	int i;
 	int hitZoneIndex;
@@ -264,6 +265,7 @@
 		_vm->_font->textDraw(kKnownFontSmall, ds, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
 }
+#endif
 
 int ObjectMap::hitTest(const Point& testPoint) {
 	int i;

Modified: scummvm/trunk/engines/saga/objectmap.h
===================================================================
--- scummvm/trunk/engines/saga/objectmap.h	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/objectmap.h	2008-12-04 18:38:02 UTC (rev 35238)
@@ -76,7 +76,9 @@
 		return objectIndexToId(kGameObjectStepZone, _index);
 	}
 	bool getSpecialPoint(Point &specialPoint) const;
+#ifdef SAGA_DEBUG
 	void draw(SagaEngine *vm, Surface *ds, int color);
+#endif
 	bool hitTest(const Point &testPoint);
 
 private:
@@ -104,7 +106,9 @@
 	void load(const byte *resourcePointer, size_t resourceLength);
 	void freeMem(void);
 
+#ifdef SAGA_DEBUG
 	void draw(Surface *drawSurface, const Point& testPoint, int color, int color2);
+#endif
 	int hitTest(const Point& testPoint);
 	HitZone *getHitZone(int16 index) {
 		if ((index < 0) || (index >= _hitZoneListCount)) {

Modified: scummvm/trunk/engines/saga/render.cpp
===================================================================
--- scummvm/trunk/engines/saga/render.cpp	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/render.cpp	2008-12-04 18:38:02 UTC (rev 35238)
@@ -73,7 +73,6 @@
 
 void Render::drawScene() {
 	Surface *backBufferSurface;
-	char txtBuffer[20];
 	Point mousePoint;
 	Point textPoint;
 
@@ -101,15 +100,21 @@
 					_vm->_actor->drawActors();
 			}
 
+#ifdef SAGA_DEBUG
 			if (getFlags() & RF_OBJECTMAP_TEST) {
 				if (_vm->_scene->_objectMap)
 					_vm->_scene->_objectMap->draw(backBufferSurface, mousePoint, kITEColorBrightWhite, kITEColorBlack);
 				if (_vm->_scene->_actionMap)
 					_vm->_scene->_actionMap->draw(backBufferSurface, mousePoint, kITEColorRed, kITEColorBlack);
 			}
+#endif
+
+#ifdef ACTOR_DEBUG
 			if (getFlags() & RF_ACTOR_PATH_TEST) {
 				_vm->_actor->drawPathTest();
 			}
+#endif
+
 		}
 	}
 
@@ -143,14 +148,17 @@
 	// Handle user input
 	_vm->processInput();
 
+#ifdef SAGA_DEBUG
 	// Display rendering information
 	if (_flags & RF_SHOW_FPS) {
+		char txtBuffer[20];
 		sprintf(txtBuffer, "%d", _fps);
 		textPoint.x = backBufferSurface->w - _vm->_font->getStringWidth(kKnownFontSmall, txtBuffer, 0, kFontOutline);
 		textPoint.y = 2;
 
 		_vm->_font->textDraw(kKnownFontSmall, backBufferSurface, txtBuffer, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline);
 	}
+#endif
 
 	// Display "paused game" message, if applicable
 	if (_flags & RF_RENDERPAUSE) {
@@ -170,6 +178,7 @@
 	// Update user interface
 	_vm->_interface->update(mousePoint, UPDATE_MOUSEMOVE);
 
+#ifdef SAGA_DEBUG
 	// Display text formatting test, if applicable
 	if (_flags & RF_TEXT_TEST) {
 		Rect rect(mousePoint.x, mousePoint.y, mousePoint.x + 100, mousePoint.y + 50);
@@ -181,6 +190,7 @@
 	if (_flags & RF_PALETTE_TEST) {
 		backBufferSurface->drawPalette();
 	}
+#endif
 
 	_system->copyRectToScreen((byte *)backBufferSurface->pixels, backBufferSurface->w, 0, 0,
 							  backBufferSurface->w, backBufferSurface->h);

Modified: scummvm/trunk/engines/saga/render.h
===================================================================
--- scummvm/trunk/engines/saga/render.h	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/render.h	2008-12-04 18:38:02 UTC (rev 35238)
@@ -33,13 +33,17 @@
 namespace Saga {
 
 enum RENDER_FLAGS {
+#ifdef SAGA_DEBUG
 	RF_SHOW_FPS = (1 << 0),
 	RF_PALETTE_TEST = (1 << 1),
 	RF_TEXT_TEST = (1 << 2),
 	RF_OBJECTMAP_TEST = (1 << 3),
+#endif
 	RF_RENDERPAUSE = (1 << 4),
 	RF_GAMEPAUSE = (1 << 5),
+#ifdef SAGA_DEBUG
 	RF_ACTOR_PATH_TEST = (1 << 6),
+#endif
 	RF_MAP = (1 << 7),
 	RF_DISABLE_ACTORS = (1 << 8),
 	RF_DEMO_SUBST = (1 << 9)

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2008-12-04 18:14:36 UTC (rev 35237)
+++ scummvm/trunk/engines/saga/saga.h	2008-12-04 18:38:02 UTC (rev 35238)
@@ -65,6 +65,7 @@
 using Common::MemoryReadStream;
 using Common::MemoryReadStreamEndian;
 
+//#define SAGA_DEBUG 1		// define for test functions
 #define SAGA_IMAGE_DATA_OFFSET 776
 #define SAGA_IMAGE_HEADER_LEN  8
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list