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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Oct 22 07:41:50 CEST 2009


Revision: 45322
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45322&view=rev
Author:   thebluegr
Date:     2009-10-22 05:41:50 +0000 (Thu, 22 Oct 2009)

Log Message:
-----------
Moved the view loop counting code in the new GUI

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

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/console.cpp	2009-10-22 05:41:50 UTC (rev 45322)
@@ -1069,7 +1069,7 @@
 
 	DebugPrintf("Resource view.%d ", view);
 
-	loops = gfxop_lookup_view_get_loops(_vm->_gamestate->gfx_state, view);
+	loops = _vm->_gamestate->_gui->getLoopCount(view);
 
 	if (loops < 0)
 		DebugPrintf("does not exist.\n");

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-22 05:41:50 UTC (rev 45322)
@@ -33,8 +33,7 @@
 #include "sci/seq_decoder.h"
 #include "sci/engine/state.h"
 #include "sci/engine/kernel.h"
-#include "sci/gfx/gfx_widgets.h"
-//#include "sci/gfx/gfx_state_internal.h"	// required for GfxContainer, GfxPort, GfxVisual
+#include "sci/gfx/operations.h"
 #include "sci/gui/gui.h"
 #include "sci/gui/gui_animate.h"
 #include "sci/gui/gui_cursor.h"
@@ -95,7 +94,7 @@
 		else loop = 0xffff;
 	}
 
-	maxloops = gfxop_lookup_view_get_loops(s->gfx_state, view);
+	maxloops = s->_gui->getLoopCount(view);
 
 	if ((loop > 1) && (maxloops < 4))
 		return;
@@ -414,7 +413,7 @@
 	SegManager *segMan = s->_segMan;
 	reg_t obj = argv[0];
 	int view = GET_SEL32V(segMan, obj, view);
-	int loops_nr = gfxop_lookup_view_get_loops(s->gfx_state, view);
+	int loops_nr = s->_gui->getLoopCount(view);
 
 	if (loops_nr < 0) {
 		error("view.%d (0x%x) not found", view, view);

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-22 05:41:50 UTC (rev 45322)
@@ -1300,19 +1300,6 @@
 
 // View operations
 
-int gfxop_lookup_view_get_loops(GfxState *state, int nr) {
-	int loop = 0, cel = 0;
-	gfxr_view_t *view = NULL;
-
-	view = state->gfxResMan->getView(nr, &loop, &cel, 0);
-
-	if (!view) {
-		error("[GFX] Attempt to retrieve number of loops from invalid view %d", nr);
-	}
-
-	return view->loops_nr;
-}
-
 int gfxop_lookup_view_get_cels(GfxState *state, int nr, int loop) {
 	int real_loop = loop, cel = 0;
 	gfxr_view_t *view = NULL;

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-10-22 05:41:50 UTC (rev 45322)
@@ -359,15 +359,6 @@
 /** @{ */
 
 /**
- * Determines the number of loops associated with a view.
- *
- * @param[in] state	The state to use
- * @param[in] nr	Number of the view to investigate
- * @return			The number of loops, or GFX_ERROR if the view didn't exist
- */
-int gfxop_lookup_view_get_loops(GfxState *state, int nr);
-
-/**
  * Determines the number of cels associated stored in a loop.
  *
  * @param[in] state	The state to look up in

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-22 05:41:50 UTC (rev 45322)
@@ -668,6 +668,17 @@
 	return height;
 }
 
+int16 SciGui::getLoopCount(int view) {
+	SciGuiView *tmpView = new SciGuiView(_s->resMan, _screen, _palette, view);
+	if (!tmpView)
+		return -1;
+
+	uint16 loopCount = tmpView->getLoopCount();
+	delete tmpView;
+
+	return loopCount;
+}
+
 bool SciGui::debugUndither(bool flag) {
 	_screen->unditherSetState(flag);
 	return false;

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-22 02:05:24 UTC (rev 45321)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-22 05:41:50 UTC (rev 45322)
@@ -126,6 +126,8 @@
 	int16 getCelWidth(int view, int loop, int cel);
 	int16 getCelHeight(int view, int loop, int cel);
 
+	int16 getLoopCount(int view);
+
 	virtual bool debugUndither(bool flag);
 	virtual bool debugShowMap(int mapNo);
 


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