[Scummvm-cvs-logs] CVS: residual driver.h,1.14,1.15 driver_gl.cpp,1.57,1.58 driver_gl.h,1.27,1.28 driver_tinygl.cpp,1.29,1.30 driver_tinygl.h,1.15,1.16 engine.cpp,1.89,1.90 lua.cpp,1.153,1.154

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Aug 13 13:15:15 CEST 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16659

Modified Files:
	driver.h driver_gl.cpp driver_gl.h driver_tinygl.cpp 
	driver_tinygl.h engine.cpp lua.cpp 
Log Message:
added store/restore display buffer

Index: driver.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- driver.h	13 Aug 2005 11:33:12 -0000	1.14
+++ driver.h	13 Aug 2005 20:14:46 -0000	1.15
@@ -84,7 +84,7 @@
 
 	virtual Bitmap *getScreenshot(int w, int h) = 0;
 	virtual void storeDisplay() = 0;
-	virtual void flushStoredDisplay() = 0;
+	virtual void copyStoredToDisplay() = 0;
 	virtual void enableDim(int x, int y, int w, int h) = 0;
 	virtual void disableDim(int x, int y, int w, int h) = 0;
 
@@ -104,7 +104,6 @@
 	int _screenWidth, _screenHeight, _screenBPP;
 	bool _isFullscreen;
 	bool _dim;
-	byte *_storedDisplay;
 
 	virtual void drawDim() = 0;
 };

Index: driver_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- driver_gl.cpp	13 Aug 2005 11:33:12 -0000	1.57
+++ driver_gl.cpp	13 Aug 2005 20:14:46 -0000	1.58
@@ -47,7 +47,6 @@
 	loadEmergFont();
 
 	_smushNumTex = 0;
-	_storedDisplay = NULL;
 }
 
 void DriverGL::toggleFullscreenMode() {

Index: driver_gl.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- driver_gl.h	13 Aug 2005 11:33:12 -0000	1.27
+++ driver_gl.h	13 Aug 2005 20:14:46 -0000	1.28
@@ -67,7 +67,7 @@
 
 	Bitmap *getScreenshot(int w, int h);
 	void storeDisplay() {}
-	void flushStoredDisplay() {}
+	void copyStoredToDisplay() {}
 	void enableDim(int /*x*/, int /*y*/, int /*w*/, int /*h*/) { _dim = true; }
 	void disableDim(int /*x*/, int /*y*/, int /*w*/, int /*h*/) { _dim = false; }
 

Index: driver_tinygl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_tinygl.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- driver_tinygl.cpp	13 Aug 2005 16:25:51 -0000	1.29
+++ driver_tinygl.cpp	13 Aug 2005 20:14:46 -0000	1.30
@@ -108,10 +108,12 @@
 	_zb = ZB_open(screenW, screenH, ZB_MODE_5R6G5B, 0, NULL, NULL, _screen->pixels);
 	tglInit(_zb);
 
-	_storedDisplay = NULL;
+	_storedDisplay = new byte[640 * 480 * 2];
+	memset(_storedDisplay, 0, 640 * 480 * 2);
 }
 
 DriverTinyGL::~DriverTinyGL() {
+	delete []_storedDisplay;
 	tglClose();
 	ZB_close(_zb);
 }
@@ -490,14 +492,11 @@
 }
 
 void DriverTinyGL::storeDisplay() {
-	_storedDisplay = new byte[640 * 480 * 2];
-	assert(_storedDisplay);
 	memcpy(_storedDisplay, _zb->pbuf, 640 * 480 * 2);
 }
 
-void DriverTinyGL::flushStoredDisplay() {
-	delete []_storedDisplay;
-	_storedDisplay = NULL;
+void DriverTinyGL::copyStoredToDisplay() {
+	memcpy(_zb->pbuf, _storedDisplay, 640 * 480 * 2);
 }
 
 void DriverTinyGL::drawDim() {

Index: driver_tinygl.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_tinygl.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- driver_tinygl.h	13 Aug 2005 11:33:12 -0000	1.15
+++ driver_tinygl.h	13 Aug 2005 20:14:46 -0000	1.16
@@ -69,7 +69,7 @@
 
 	Bitmap *getScreenshot(int w, int h);
 	void storeDisplay();
-	void flushStoredDisplay();
+	void copyStoredToDisplay();
 	void enableDim(int /*x*/, int /*y*/, int /*w*/, int /*h*/) { _dim = true; }
 	void disableDim(int /*x*/, int /*y*/, int /*w*/, int /*h*/) { _dim = false; }
 
@@ -94,6 +94,7 @@
 	byte *_smushBitmap;
 	int _smushWidth;
 	int _smushHeight;
+	byte *_storedDisplay;
 };
 
 #endif

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- engine.cpp	13 Aug 2005 16:25:51 -0000	1.89
+++ engine.cpp	13 Aug 2005 20:14:46 -0000	1.90
@@ -270,6 +270,8 @@
 		// The overlay objects should be drawn on top of everything else,
 		// including 3D objects such as Manny and the message tube
 		_currScene->drawBitmaps(ObjectState::OBJSTATE_OVERLAY);
+
+		g_driver->storeDisplay();
 	} else if (_mode == ENGINE_MODE_DRAW) {
 		if (_refreshDrawNeeded) {
 			lua_beginblock();

Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- lua.cpp	13 Aug 2005 16:25:51 -0000	1.153
+++ lua.cpp	13 Aug 2005 20:14:46 -0000	1.154
@@ -2261,10 +2261,6 @@
 	}
 }
 
-/* Clean the buffer of text objects and primitives
- * this is known to be used when changing between menus
- * and when loading some cutscenes
- */
 static void CleanBuffer() {
 	DEBUG_FUNCTION();
 	g_engine->killPrimitiveObjects();
@@ -2272,36 +2268,9 @@
 	// Cleanup references to deleted text objects
 	for (Engine::ActorListType::const_iterator i = g_engine->actorsBegin(); i != g_engine->actorsEnd(); i++)
 		(*i)->lineCleanup();
+	//g_driver->copyStoredToDisplay();
 }
  
-/* Check to see if the menu item at a specific index has
- * the "disabled" flag set
- */
-bool itemDisabled(lua_Object itemTable, int menuItem) {
-	lua_Object table = getTableValue(itemTable, "items");
-	lua_Object item = getIndexedTableValue(table, menuItem);
-	lua_Object itemdata = getTableValue(item, "props");
-	lua_Object disabled = getTableValue(itemdata, "disabled");
-
-	if (!lua_isnil(disabled) && atoi(lua_getstring(disabled)) == 1)
-		return true;
-	else
-		return false;
-}
-
-/* Find the text representing an item in the menu
- */
-char *itemText(lua_Object itemTable, int menuItem) {
-	lua_Object table = getTableValue(itemTable, "items");
-	lua_Object item = getIndexedTableValue(table, menuItem);
-	lua_Object itemtext = getTableValue(item, "text");
-
-	if (!lua_isnil(itemtext) && lua_isstring(itemtext))
-		return lua_getstring(itemtext);
-	else
-		return NULL;
-}
-
 /* This function sends the SDL signal to
  * go ahead and exit the game
  */
@@ -2958,6 +2927,7 @@
 		g_smush->pause(false);
 		g_engine->refreshDrawMode();
 		g_engine->setMode(g_engine->getPreviousMode());
+		CleanBuffer();
 	} else {
 		error("RenderModeUser() Unknown type of param");
 	}





More information about the Scummvm-git-logs mailing list