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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Oct 28 20:19:36 CET 2009


Revision: 45480
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45480&view=rev
Author:   m_kiewitz
Date:     2009-10-28 19:19:35 +0000 (Wed, 28 Oct 2009)

Log Message:
-----------
SCI/newgui: BaseSetter moved to SciGui

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

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-28 19:10:39 UTC (rev 45479)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-28 19:19:35 UTC (rev 45480)
@@ -482,35 +482,10 @@
 reg_t kBaseSetter(EngineState *s, int argc, reg_t *argv) {
 	reg_t object = argv[0];
 
-	if (lookup_selector(s->_segMan, object, s->_kernel->_selectorCache.brLeft, NULL, NULL) == kSelectorVariable) {
-		int x = (int16)GET_SEL32V(s->_segMan, object, x);
-		int y = (int16)GET_SEL32V(s->_segMan, object, y);
-		int z = (s->_kernel->_selectorCache.z > -1) ? (int16)GET_SEL32V(s->_segMan, object, z) : 0;
-		int ystep = (int16)GET_SEL32V(s->_segMan, object, yStep);
-		int view = GET_SEL32V(s->_segMan, object, view);
-		int loop = GET_SEL32V(s->_segMan, object, loop);
-		int cel = GET_SEL32V(s->_segMan, object, cel);
+	s->_gui->baseSetter(object);
 
-		SciGuiView *tmpView = new SciGuiView(s->resMan, NULL, NULL, view);
-		sciViewCelInfo *celInfo = tmpView->getCelInfo(loop, cel);
-		int left = x + celInfo->displaceX - (celInfo->width >> 1);
-		int right = left + celInfo->width;
-		int bottom = y + celInfo->displaceY - z + 1;
-		int top = bottom - ystep;
-
-		debugC(2, kDebugLevelBaseSetter, "(%d,%d)+/-(%d,%d), (%d x %d) -> (%d, %d) to (%d, %d)\n",
-				  x, y, celInfo->displaceX, celInfo->displaceY, celInfo->width, celInfo->height, left, top, bottom, right);
-
-		delete tmpView;
-
-		PUT_SEL32V(s->_segMan, object, brLeft, left);
-		PUT_SEL32V(s->_segMan, object, brRight, right);
-		PUT_SEL32V(s->_segMan, object, brTop, top);
-		PUT_SEL32V(s->_segMan, object, brBottom, bottom);
-	}
-
 	return s->r_acc;
-} // kBaseSetter
+}
 
 reg_t kSetNowSeen(EngineState *s, int argc, reg_t *argv) {
 	s->_gui->setNowSeen(argv[0]);

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-28 19:10:39 UTC (rev 45479)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-28 19:19:35 UTC (rev 45480)
@@ -637,6 +637,35 @@
 	return result;
 }
 
+void SciGui::baseSetter(reg_t object) {
+	if (lookup_selector(_s->_segMan, object, _s->_kernel->_selectorCache.brLeft, NULL, NULL) == kSelectorVariable) {
+		int16 x = GET_SEL32V(_s->_segMan, object, x);
+		int16 y = GET_SEL32V(_s->_segMan, object, y);
+		int16 z = (_s->_kernel->_selectorCache.z > -1) ? GET_SEL32V(_s->_segMan, object, z) : 0;
+		int16 yStep = GET_SEL32V(_s->_segMan, object, yStep);
+		GuiResourceId viewId = GET_SEL32V(_s->_segMan, object, view);
+		int16 loopNo = GET_SEL32V(_s->_segMan, object, loop);
+		int16 celNo = GET_SEL32V(_s->_segMan, object, cel);
+
+		SciGuiView *tmpView = new SciGuiView(_s->resMan, NULL, NULL, viewId);
+		sciViewCelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
+		int16 left = x + celInfo->displaceX - (celInfo->width >> 1);
+		int16 right = left + celInfo->width;
+		int16 bottom = y + celInfo->displaceY - z + 1;
+		int16 top = bottom - yStep;
+
+		debugC(2, kDebugLevelBaseSetter, "(%d,%d)+/-(%d,%d), (%d x %d) -> (%d, %d) to (%d, %d)\n",
+				x, y, celInfo->displaceX, celInfo->displaceY, celInfo->width, celInfo->height, left, top, bottom, right);
+
+		delete tmpView;
+
+		PUT_SEL32V(_s->_segMan, object, brLeft, left);
+		PUT_SEL32V(_s->_segMan, object, brRight, right);
+		PUT_SEL32V(_s->_segMan, object, brTop, top);
+		PUT_SEL32V(_s->_segMan, object, brBottom, bottom);
+	}
+}
+
 void SciGui::hideCursor() {
 	_cursor->hide();
 }

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-28 19:10:39 UTC (rev 45479)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-28 19:19:35 UTC (rev 45480)
@@ -117,6 +117,7 @@
 	virtual void setNowSeen(reg_t objectReference);
 	virtual bool canBeHere(reg_t curObject, reg_t listReference);
 	virtual bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
+	virtual void baseSetter(reg_t object);
 
 	virtual void hideCursor();
 	virtual void showCursor();


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