[Scummvm-cvs-logs] SF.net SVN: scummvm: [33035] residual/trunk/engine

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sun Jul 13 16:01:23 CEST 2008


Revision: 33035
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33035&view=rev
Author:   aquadran
Date:     2008-07-13 07:01:22 -0700 (Sun, 13 Jul 2008)

Log Message:
-----------
updating shadow mask only when needed works now

Modified Paths:
--------------
    residual/trunk/engine/actor.cpp
    residual/trunk/engine/backend/sdl/driver_tinygl.cpp
    residual/trunk/engine/engine.cpp
    residual/trunk/engine/lua.cpp

Modified: residual/trunk/engine/actor.cpp
===================================================================
--- residual/trunk/engine/actor.cpp	2008-07-13 13:06:33 UTC (rev 33034)
+++ residual/trunk/engine/actor.cpp	2008-07-13 14:01:22 UTC (rev 33035)
@@ -601,7 +601,7 @@
 	for (std::list<Costume *>::iterator i = _costumeStack.begin(); i != _costumeStack.end(); i++)
 		(*i)->setupTextures();
 
-	if (!g_driver->isHardwareAccelerated()/* && g_engine->getFlagRefreshShadowMask()*/) {
+	if (!g_driver->isHardwareAccelerated() && g_engine->getFlagRefreshShadowMask()) {
 		for (int l = 0; l < 5; l++) {
 			if (!_shadowArray[l].active)
 				continue;
@@ -657,6 +657,7 @@
 		Sector *sector = g_engine->currScene()->getSectorBase(i);
 		if (strmatch(sector->name(), name)) {
 			_shadowArray[_activeShadowSlot].planeList.push_back(sector);
+			g_engine->flagRefreshShadowMask(true);
 			return;
 		}
 	}
@@ -697,6 +698,7 @@
 		delete[] shadow->shadowMask;
 		shadow->shadowMask = NULL;
 		shadow->active = false;
+		shadow->dontNegate = false;
 	}
 }
 

Modified: residual/trunk/engine/backend/sdl/driver_tinygl.cpp
===================================================================
--- residual/trunk/engine/backend/sdl/driver_tinygl.cpp	2008-07-13 13:06:33 UTC (rev 33034)
+++ residual/trunk/engine/backend/sdl/driver_tinygl.cpp	2008-07-13 14:01:22 UTC (rev 33035)
@@ -264,10 +264,10 @@
 
 void DriverTinyGL::drawShadowPlanes() {
 	tglEnable(TGL_SHADOW_MASK_MODE);
-	if (_currentShadowArray->shadowMask)
+	if (!_currentShadowArray->shadowMask) {
+		_currentShadowArray->shadowMask = new byte[_screenWidth * _screenHeight];
 		memset(_currentShadowArray->shadowMask, 0, _screenWidth * _screenHeight);
-	else
-		_currentShadowArray->shadowMask = new byte[_screenWidth * _screenHeight];
+	}
 
 	tglSetShadowMaskBuf(_currentShadowArray->shadowMask);
 	_currentShadowArray->planeList.begin();

Modified: residual/trunk/engine/engine.cpp
===================================================================
--- residual/trunk/engine/engine.cpp	2008-07-13 13:06:33 UTC (rev 33034)
+++ residual/trunk/engine/engine.cpp	2008-07-13 14:01:22 UTC (rev 33035)
@@ -646,7 +646,6 @@
 	if (b == NULL)
 		warning("Could not find scene file %s\n", name);
 	_currScene = new Scene(name, b->data(), b->len());
-	flagRefreshShadowMask(true);
 	registerScene(_currScene);
 	_currScene->setSoundParameters(20, 127);
 	// should delete the old scene after creating the new one

Modified: residual/trunk/engine/lua.cpp
===================================================================
--- residual/trunk/engine/lua.cpp	2008-07-13 13:06:33 UTC (rev 33034)
+++ residual/trunk/engine/lua.cpp	2008-07-13 14:01:22 UTC (rev 33035)
@@ -1489,6 +1489,7 @@
 	bool state = getbool(3);
 
 	act->setActivateShadow(shadowId, state);
+	g_engine->flagRefreshShadowMask(true);
 }
 
 static void SetActorShadowValid() {


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