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

dreammaster dreammaster at scummvm.org
Fri Dec 9 00:13: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:
a2da8e6b39 TSAGE: Got rid of goto in TsAGE engine.


Commit: a2da8e6b397a76e2efef41b4d07b1baef78a6abc
    https://github.com/scummvm/scummvm/commit/a2da8e6b397a76e2efef41b4d07b1baef78a6abc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-12-08T15:13:06-08:00

Commit Message:
TSAGE: Got rid of goto in TsAGE engine.

Changed paths:
    engines/tsage/core.cpp



diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index eb7c734..88121c4 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2661,43 +2661,48 @@ void SceneObjectList::draw() {
 		}
 
 		g_globals->_paneRegions[paneNum].setRect(0, 0, 0, 0);
-redraw:
-		// Main draw loop
-		for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) {
-			SceneObject *obj = objList[objIndex];
-
-			if ((obj->_flags & flagMask) && !(obj->_flags & OBJFLAG_HIDE)) {
-				obj->_paneRects[paneNum] = obj->_bounds;
-				obj->draw();
+
+		// FIXME: Currently, removing objects causes screen flickers when the removed object intersects
+		// another drawn object, since the background is briefly redrawn over the object. For now, I'm
+		// using a forced jump back to redraw objects. In the long term, I should figure out how the
+		// original game does this properly
+		bool redrawFlag = true;
+		while (redrawFlag) {
+			redrawFlag = false;
+
+			// Main draw loop
+			for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) {
+				SceneObject *obj = objList[objIndex];
+
+				if ((obj->_flags & flagMask) && !(obj->_flags & OBJFLAG_HIDE)) {
+					obj->_paneRects[paneNum] = obj->_bounds;
+					obj->draw();
+				}
 			}
-		}
 
-		// Update the palette
-		g_globals->_sceneManager.fadeInIfNecessary();
-		g_globals->_sceneManager._loadMode = 0;
-		g_globals->_paneRefreshFlag[paneNum] = 0;
-
-		// Loop through the object list, removing any objects and refreshing the screen as necessary
-		for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) {
-			SceneObject *obj = objList[objIndex];
-
-			if (obj->_flags & OBJFLAG_HIDE)
-				obj->_flags |= OBJFLAG_HIDING;
-			obj->_flags &= ~flagMask;
-			if (obj->_flags & OBJFLAG_REMOVE) {
-				obj->_flags |= OBJFLAG_PANES;
-
-				checkIntersection(objList, objIndex, CURRENT_PANENUM);
-
-				obj->updateScreen();
-				obj->removeObject();
-
-				// FIXME: Currently, removing objects causes screen flickers when the removed object intersects
-				// another drawn object, since the background is briefly redrawn over the object. For now, I'm
-				// using a forced jump back to redraw objects. In the long term, I should figure out how the
-				// original game does this properly
-				objList.remove_at(objIndex);
-				goto redraw;
+			// Update the palette
+			g_globals->_sceneManager.fadeInIfNecessary();
+			g_globals->_sceneManager._loadMode = 0;
+			g_globals->_paneRefreshFlag[paneNum] = 0;
+
+			// Loop through the object list, removing any objects and refreshing the screen as necessary
+			for (uint objIndex = 0; objIndex < objList.size() && !redrawFlag; ++objIndex) {
+				SceneObject *obj = objList[objIndex];
+
+				if (obj->_flags & OBJFLAG_HIDE)
+					obj->_flags |= OBJFLAG_HIDING;
+				obj->_flags &= ~flagMask;
+				if (obj->_flags & OBJFLAG_REMOVE) {
+					obj->_flags |= OBJFLAG_PANES;
+
+					checkIntersection(objList, objIndex, CURRENT_PANENUM);
+
+					obj->updateScreen();
+					obj->removeObject();
+
+					objList.remove_at(objIndex);
+					redrawFlag = true;
+				}
 			}
 		}
 	}






More information about the Scummvm-git-logs mailing list