aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2012-07-16 11:49:50 +0300
committerFilippos Karapetis2012-07-16 11:49:50 +0300
commit1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa (patch)
tree9b7ee9d92c89305d8f54fda8627564c2a38e77bd /engines/sci
parentb17667cbcf64f68d94b9228f09c6c2fd6b9f1ed5 (diff)
downloadscummvm-rg350-1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa.tar.gz
scummvm-rg350-1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa.tar.bz2
scummvm-rg350-1a90ca5ecd9eeaaca3b6de79dd940e9b29e472aa.zip
SCI: Handle all negative priority values. Fixes graphics in the SQ6 demo
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/frameout.cpp17
-rw-r--r--engines/sci/graphics/frameout.h4
2 files changed, 8 insertions, 13 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index cb56e24de9..fedae2eb6f 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 ecaf450d89..5fd2824224 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;