[Scummvm-cvs-logs] scummvm master -> 398d0ffceffc2dc1241b3f667c180573c288ccbf

bluegr md5 at scummvm.org
Mon May 14 01:31:18 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:
398d0ffcef SCI: Check for object visibility, if an object defines it


Commit: 398d0ffceffc2dc1241b3f667c180573c288ccbf
    https://github.com/scummvm/scummvm/commit/398d0ffceffc2dc1241b3f667c180573c288ccbf
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-05-13T16:30:15-07:00

Commit Message:
SCI: Check for object visibility, if an object defines it

Fixes the inventory in GK1

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



diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index a8b1cf7..2f6b4d5 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -181,6 +181,7 @@ void Kernel::mapSelectors() {
 	FIND_SELECTOR(skip);
 	FIND_SELECTOR(fixPriority);
 	FIND_SELECTOR(mirrored);
+	FIND_SELECTOR(visible);
 	FIND_SELECTOR(useInsetRect);
 	FIND_SELECTOR(inTop);
 	FIND_SELECTOR(inLeft);
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index 4b913a8..2308a6c 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -149,6 +149,7 @@ struct SelectorCache {
 
 	Selector fixPriority;
 	Selector mirrored;
+	Selector visible;
 
 	Selector useInsetRect;
 	Selector inTop, inLeft, inBottom, inRight;
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index b12413a..42b51e4 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -237,6 +237,7 @@ void GfxFrameout::kernelAddScreenItem(reg_t object) {
 	memset(itemEntry, 0, sizeof(FrameoutEntry));
 	itemEntry->object = object;
 	itemEntry->givenOrderNr = _screenItems.size();
+	itemEntry->visible = true;
 	_screenItems.push_back(itemEntry);
 
 	kernelUpdateScreenItem(object);
@@ -266,6 +267,11 @@ void GfxFrameout::kernelUpdateScreenItem(reg_t object) {
 	itemEntry->signal = readSelectorValue(_segMan, object, SELECTOR(signal));
 	itemEntry->scaleX = readSelectorValue(_segMan, object, SELECTOR(scaleX));
 	itemEntry->scaleY = readSelectorValue(_segMan, object, SELECTOR(scaleY));
+	itemEntry->visible = true;
+
+	// Check if the entry can be hidden
+	if (lookupSelector(_segMan, object, SELECTOR(visible), NULL, NULL) != kSelectorNone)
+		itemEntry->visible = readSelectorValue(_segMan, object, SELECTOR(visible));
 }
 
 void GfxFrameout::kernelDeleteScreenItem(reg_t object) {
@@ -433,6 +439,7 @@ void GfxFrameout::createPlaneItemList(reg_t planeObject, FrameoutList &itemList)
 				picEntry->x = planePicture->getSci32celX(pictureCelNr);
 				picEntry->picStartX = pictureIt->startX;
 				picEntry->picStartY = pictureIt->startY;
+				picEntry->visible = true;
 
 				picEntry->priority = planePicture->getSci32celPriority(pictureCelNr);
 
@@ -541,6 +548,9 @@ void GfxFrameout::kernelFrameout() {
 		for (FrameoutList::iterator listIterator = itemList.begin(); listIterator != itemList.end(); listIterator++) {
 			FrameoutEntry *itemEntry = *listIterator;
 
+			if (!itemEntry->visible)
+				continue;
+			
 			if (itemEntry->object.isNull()) {
 				// Picture cel data
 				itemEntry->x = upscaleHorizontalCoordinate(itemEntry->x);
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 8c3cc26..a3d686c 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -60,6 +60,7 @@ struct FrameoutEntry {
 	GfxPicture *picture;
 	int16 picStartX;
 	int16 picStartY;
+	bool visible;
 };
 
 typedef Common::List<FrameoutEntry *> FrameoutList;






More information about the Scummvm-git-logs mailing list