[Scummvm-cvs-logs] CVS: residual engine.cpp,1.35,1.36

Pawel Kolodziejski aquadran at users.sourceforge.net
Sun Oct 31 01:32:28 CEST 2004


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

Modified Files:
	engine.cpp 
Log Message:
- moved updating lua tasks to end of loop.
- update actors only when scene exist

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- engine.cpp	20 Apr 2004 18:54:04 -0000	1.35
+++ engine.cpp	31 Oct 2004 09:31:34 -0000	1.36
@@ -86,9 +86,6 @@
 			}
 		}
 
-		// Run asynchronous tasks
-		lua_runtasks();
-
 		if (_mode == ENGINE_MODE_SMUSH) {
 			if (g_smush->isPlaying()) {
 				movieTime_ = g_smush->getMovieTime();
@@ -106,13 +103,14 @@
 			if (SCREENBLOCKS_GLOBAL)
 				screenBlocksReset();
 
-			// Update actor costumes
-			for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
-				Actor *a = *i;
-				assert(currScene_);
-				if (a->inSet(currScene_->name()) && a->visible())
-					a->update();
-			} 
+			if (currScene_ != NULL) {
+				// Update actor costumes
+				for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
+					Actor *a = *i;
+					if (currScene_ != NULL && a->inSet(currScene_->name()) && a->visible())
+						a->update();
+				} 
+			}
 
 			g_driver->clearScreen();
 
@@ -144,16 +142,17 @@
 
 			g_driver->set3DMode();
 
-			if (currScene_ != NULL)
+			if (currScene_ != NULL) {
 				currScene_->setupCamera();
 
-			// Draw actors
-			for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
-				Actor *a = *i;
-				if (a->inSet(currScene_->name()) && a->visible())
-					a->draw();
+				// Draw actors
+				for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
+					Actor *a = *i;
+					if (currScene_ != NULL && a->inSet(currScene_->name()) && a->visible())
+						a->draw();
+				}
+				//screenBlocksDrawDebug();
 			}
-			//screenBlocksDrawDebug();
 
 			// Draw text
 			for (text_list_type::iterator i = textObjects_.begin(); i != textObjects_.end(); i++) {
@@ -189,6 +188,9 @@
 				timeAccum = 0;
 			}
 		}
+
+		// Run asynchronous tasks
+		lua_runtasks();
 	}
 }
 





More information about the Scummvm-git-logs mailing list