[Scummvm-cvs-logs] scummvm master -> 8be1ff109f21e061259af397480624b251ed7fab

wjp wjp at usecode.org
Mon Mar 7 23:41:36 CET 2016


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:
8be1ff109f SCI32: Fix adding too many items to drawlist


Commit: 8be1ff109f21e061259af397480624b251ed7fab
    https://github.com/scummvm/scummvm/commit/8be1ff109f21e061259af397480624b251ed7fab
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-03-07T23:41:06+01:00

Commit Message:
SCI32: Fix adding too many items to drawlist

Changed paths:
    engines/sci/graphics/plane32.cpp



diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp
index 6961a9a..09d8dc0 100644
--- a/engines/sci/graphics/plane32.cpp
+++ b/engines/sci/graphics/plane32.cpp
@@ -382,6 +382,10 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 	breakEraseListByPlanes(eraseList, planeList);
 	breakDrawListByPlanes(drawList, planeList);
 
+	// We store the current size of the drawlist, as we want to loop
+	// over the currently inserted entries later.
+	DrawList::size_type drawListSizePrimary = drawList.size();
+
 	// NOTE: Setting this to true fixes the menu bars in GK1
 	if (/* TODO: dword_C6288 */ false) {  // "high resolution pictures"????
 		_screenItemList.sort();
@@ -437,8 +441,12 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 	}
 	if (/* TODO: g_Remap_numActiveRemaps == 0 */ true) { // no remaps active?
 		// Add all items that overlap with items in the drawlist and have higher
-		// priority
-		for (DrawList::size_type i = 0; i < drawList.size(); ++i) {
+		// priority.
+
+		// We only loop over "primary" items in the draw list, skipping
+		// those that were added because of the erase list in the previous loop,
+		// or those to be added in this loop.
+		for (DrawList::size_type i = 0; i < drawListSizePrimary; ++i) {
 			DrawItem *dli = drawList[i];
 
 			for (PlaneList::size_type j = 0; j < planeItemCount; ++j) {






More information about the Scummvm-git-logs mailing list