[Scummvm-cvs-logs] SF.net SVN: scummvm:[44893] scummvm/trunk/engines/sci/gui

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Oct 11 09:54:20 CEST 2009


Revision: 44893
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44893&view=rev
Author:   m_kiewitz
Date:     2009-10-11 07:54:20 +0000 (Sun, 11 Oct 2009)

Log Message:
-----------
SCI/newgui: Implemented kCanBeHere list processing

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.h

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-11 07:21:59 UTC (rev 44892)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-11 07:54:20 UTC (rev 44893)
@@ -54,7 +54,7 @@
 
 	_gfx = new SciGuiGfx(_s, _screen, _palette);
 	_windowMgr = new SciGuiWindowMgr(_s, _screen, _gfx);
-	// _gui32 = new SciGui32(_s, _screen, _palette, _cursor); // for debug purposes
+// 	_gui32 = new SciGui32(_s, _screen, _palette, _cursor); // for debug purposes
 }
 
 SciGui::SciGui() {
@@ -429,10 +429,8 @@
 	_gfx->AnimateDisposeLastCast();
 
 	_gfx->AnimateMakeSortedList(list);
-
 	_gfx->AnimateFill(old_picNotValid);
 
-	// _gfx->AnimateSort();
 	if (old_picNotValid) {
 		_windowMgr->BeginUpdate(_windowMgr->_picWind);
 		_gfx->AnimateUpdate();
@@ -492,7 +490,11 @@
 	controlMask = GET_SEL32V(curObject, illegalBits);
 	result = (_gfx->onControl(SCI_SCREEN_MASK_CONTROL, checkRect) & controlMask) ? false : true;
 	if ((!result) && (signal & (SCI_ANIMATE_SIGNAL_IGNOREACTOR | SCI_ANIMATE_SIGNAL_REMOVEVIEW))) {
-		result = true;
+		List *list = _s->_segMan->lookupList(listReference);
+		if (!list)
+			error("kCanBeHere called with non-list as parameter");
+
+		result = _gfx->CanBeHereCheckRectList(curObject, checkRect, list);
 	}
 	_gfx->SetPort(oldPort);
 	return result;

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-11 07:21:59 UTC (rev 44892)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-11 07:54:20 UTC (rev 44893)
@@ -113,7 +113,7 @@
 	SciGuiresources *_resources;
 	SciGuiWindowMgr *_windowMgr;
 
-	// SciGui32 *_gui32; // for debug purposes
+// 	SciGui32 *_gui32; // for debug purposes
 };
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-11 07:21:59 UTC (rev 44892)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-11 07:54:20 UTC (rev 44893)
@@ -1200,6 +1200,35 @@
 	drawCel(viewId, loopNo, celNo, celRect.left, celRect.top, priority, 0);
 }
 
+bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
+	SegManager *segMan = _s->_segMan;
+	reg_t curAddress = list->first;
+	Node *curNode = _s->_segMan->lookupNode(curAddress);
+	reg_t curObject;
+	uint16 signal;
+	Common::Rect curRect;
+
+	while (curNode) {
+		curObject = curNode->value;
+		if (curObject != checkObject) {
+			signal = GET_SEL32V(curObject, signal);
+			if ((signal & (SCI_ANIMATE_SIGNAL_IGNOREACTOR | SCI_ANIMATE_SIGNAL_REMOVEVIEW | SCI_ANIMATE_SIGNAL_NOUPDATE)) == 0) {
+				curRect.left = GET_SEL32V(curObject, brLeft);
+				curRect.top = GET_SEL32V(curObject, brTop);
+				curRect.right = GET_SEL32V(curObject, brRight);
+				curRect.bottom = GET_SEL32V(curObject, brBottom);
+				// Check if curRect is within checkRect
+				if (curRect.right > checkRect.left && curRect.left < checkRect.right && curRect.bottom > checkRect.top && curRect.top < checkRect.bottom) {
+					return false;
+				}
+			}
+		}
+		curAddress = curNode->succ;
+		curNode = _s->_segMan->lookupNode(curAddress);
+	}
+	return true;
+}
+
 void SciGuiGfx::SetNowSeen(reg_t objectReference) {
 	SegManager *segMan = _s->_segMan;
 	SciGuiView *view = NULL;

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-11 07:21:59 UTC (rev 44892)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-11 07:54:20 UTC (rev 44893)
@@ -123,6 +123,7 @@
 	void AnimateRestoreAndDelete(int argc, reg_t *argv);
 	void AddToPicDrawCels(List *list);
 	void AddToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+	bool CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list);
 
 	void SetNowSeen(reg_t objectReference);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list