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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Oct 28 20:10:40 CET 2009


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

Log Message:
-----------
SCI/newgui: IsItSkip moved into 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 18:59:11 UTC (rev 45478)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-28 19:10:39 UTC (rev 45479)
@@ -371,22 +371,13 @@
 	return make_reg(0, !canBeHere);
 }
 
-// TODO: This should go into SciGui
 reg_t kIsItSkip(EngineState *s, int argc, reg_t *argv) {
 	GuiResourceId viewId = argv[0].toSint16();
 	int16 loopNo = argv[1].toSint16();
 	int16 celNo = argv[2].toSint16();
-	int16 y = argv[3].toUint16();
-	int16 x = argv[4].toUint16();
+	Common::Point position(argv[4].toUint16(), argv[3].toUint16());
 
-	SciGuiView *tmpView = new SciGuiView(s->resMan, NULL, NULL, viewId);
-	sciViewCelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
-	x = CLIP<int>(x, 0, celInfo->width - 1);
-	y = CLIP<int>(y, 0, celInfo->height - 1);
-	byte *celData = tmpView->getBitmap(loopNo, celNo);
-	int result = (celData[y * celInfo->width + x] == celInfo->clearKey);
-	delete tmpView;
-
+	bool result = s->_gui->isItSkip(viewId, loopNo, celNo, position);
 	return make_reg(0, result);
 }
 

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-28 18:59:11 UTC (rev 45478)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-28 19:10:39 UTC (rev 45479)
@@ -626,6 +626,17 @@
 	return result;
 }
 
+bool SciGui::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
+	SciGuiView *tmpView = new SciGuiView(_s->resMan, NULL, NULL, viewId);
+	sciViewCelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
+	position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
+	position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
+	byte *celData = tmpView->getBitmap(loopNo, celNo);
+	bool result = (celData[position.y * celInfo->width + position.x] == celInfo->clearKey);
+	delete tmpView;
+	return result;
+}
+
 void SciGui::hideCursor() {
 	_cursor->hide();
 }

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-28 18:59:11 UTC (rev 45478)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-28 19:10:39 UTC (rev 45479)
@@ -116,6 +116,7 @@
 	virtual void addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 	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 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