[Scummvm-cvs-logs] SF.net SVN: scummvm:[45461] scummvm/trunk/engines/sci/engine/kgraphics.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Oct 28 14:43:09 CET 2009


Revision: 45461
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45461&view=rev
Author:   thebluegr
Date:     2009-10-28 13:43:09 +0000 (Wed, 28 Oct 2009)

Log Message:
-----------
Reimplemented isItSkip() using new graphics code

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

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-28 13:34:20 UTC (rev 45460)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-28 13:43:09 UTC (rev 45461)
@@ -38,6 +38,7 @@
 #include "sci/gui/gui_animate.h"
 #include "sci/gui/gui_cursor.h"
 #include "sci/gui/gui_screen.h"
+#include "sci/gui/gui_view.h"
 
 namespace Sci {
 
@@ -377,28 +378,15 @@
 	int y = argv[3].toUint16();
 	int x = argv[4].toUint16();
 
-#ifdef INCLUDE_OLDGFX
-	gfxr_view_t *res = NULL;
-	gfx_pixmap_t *pxm = NULL;
+	SciGuiView *tmpView = new SciGuiView(s->resMan, NULL, NULL, view);
+	sciViewCelInfo *celInfo = tmpView->getCelInfo(loop, cel);
+	x = CLIP<int>(x, 0, celInfo->width - 1);
+	y = CLIP<int>(y, 0, celInfo->height - 1);
+	byte *celData = tmpView->getBitmap(loop, cel);
+	int result = (celData[y * celInfo->width + x] == celInfo->clearKey);
+	delete tmpView;
 
-	res = s->gfx_state->gfxResMan->getView(view, &loop, &cel, 0);
-
-	if (!res) {
-		warning("[GFX] Attempt to get cel parameters for invalid view %d", view);
-		return SIGNAL_REG;
-	}
-
-	pxm = res->loops[loop].cels[cel];
-	if (x > pxm->index_width)
-		x = pxm->index_width - 1;
-	if (y > pxm->index_height)
-		y = pxm->index_height - 1;
-
-	return make_reg(0, pxm->index_data[y * pxm->index_width + x] == pxm->color_key);
-#else
-	// TODO
-	return NULL_REG;
-#endif
+	return make_reg(0, result);
 }
 
 reg_t kCelHigh(EngineState *s, int argc, reg_t *argv) {


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