[Scummvm-cvs-logs] scummvm master -> 1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa

bluegr md5 at scummvm.org
Mon Jul 16 10:51:14 CEST 2012


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:
1a90ca5ecd SCI: Handle all negative priority values. Fixes graphics in the SQ6 demo


Commit: 1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa
    https://github.com/scummvm/scummvm/commit/1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-07-16T01:49:50-07:00

Commit Message:
SCI: Handle all negative priority values. Fixes graphics in the SQ6 demo

Changed paths:
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index cb56e24..fedae2e 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -159,7 +159,7 @@ void GfxFrameout::kernelAddPlane(reg_t object) {
 
 	newPlane.object = object;
 	newPlane.priority = readSelectorValue(_segMan, object, SELECTOR(priority));
-	newPlane.lastPriority = 0xFFFF; // hidden
+	newPlane.lastPriority = -1; // hidden
 	newPlane.planeOffsetX = 0;
 	newPlane.planeOffsetY = 0;
 	newPlane.pictureId = kPlanePlainColored;
@@ -465,15 +465,10 @@ bool sortHelper(const FrameoutEntry* entry1, const FrameoutEntry* entry2) {
 }
 
 bool planeSortHelper(const PlaneEntry &entry1, const PlaneEntry &entry2) {
-//	SegManager *segMan = g_sci->getEngineState()->_segMan;
-
-//	uint16 plane1Priority = readSelectorValue(segMan, entry1, SELECTOR(priority));
-//	uint16 plane2Priority = readSelectorValue(segMan, entry2, SELECTOR(priority));
-
-	if (entry1.priority == 0xffff)
+	if (entry1.priority < 0)
 		return true;
 
-	if (entry2.priority == 0xffff)
+	if (entry2.priority < 0)
 		return false;
 
 	return entry1.priority < entry2.priority;
@@ -639,13 +634,13 @@ void GfxFrameout::kernelFrameout() {
 			_screen->drawLine(startPoint, endPoint, it2->color, it2->priority, it2->control);
 		}
 
-		uint16 planeLastPriority = it->lastPriority;
+		int16 planeLastPriority = it->lastPriority;
 
 		// Update priority here, sq6 sets it w/o UpdatePlane
-		uint16 planePriority = it->priority = readSelectorValue(_segMan, planeObject, SELECTOR(priority));
+		int16 planePriority = it->priority = readSelectorValue(_segMan, planeObject, SELECTOR(priority));
 
 		it->lastPriority = planePriority;
-		if (planePriority == 0xffff) { // Plane currently not meant to be shown
+		if (planePriority < 0) { // Plane currently not meant to be shown
 			// If plane was shown before, delete plane rect
 			if (planePriority != planeLastPriority)
 				_paint32->fillRect(it->planeRect, 0);
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index ecaf450..5fd2824 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -40,8 +40,8 @@ typedef Common::List<PlaneLineEntry> PlaneLineList;
 
 struct PlaneEntry {
 	reg_t object;
-	uint16 priority;
-	uint16 lastPriority;
+	int16 priority;
+	int16 lastPriority;
 	int16 planeOffsetX;
 	int16 planeOffsetY;
 	GuiResourceId pictureId;






More information about the Scummvm-git-logs mailing list