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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Oct 13 18:22:09 CEST 2009


Revision: 45028
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45028&view=rev
Author:   thebluegr
Date:     2009-10-13 16:22:07 +0000 (Tue, 13 Oct 2009)

Log Message:
-----------
Merged the cursor manipulation code - cursor views are still not done

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

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/console.cpp	2009-10-13 16:22:07 UTC (rev 45028)
@@ -42,6 +42,7 @@
 #include "sci/sfx/sci_midi.h"
 #include "sci/vocabulary.h"
 #include "sci/gui/gui.h"
+#include "sci/gui/gui_cursor.h"
 
 #include "common/savefile.h"
 
@@ -1196,7 +1197,7 @@
 }
 
 bool Console::cmdFlushPorts(int argc, const char **argv) {
-	gfxop_set_pointer_cursor(_vm->_gamestate->gfx_state, GFXOP_NO_POINTER);
+	_vm->_gamestate->_cursor->setShape(GFXOP_NO_POINTER);
 	DebugPrintf("Flushing dynamically allocated ports (for memory profiling)...\n");
 	delete _vm->_gamestate->visual;
 	_vm->_gamestate->gfx_state->gfxResMan->freeAllResources();

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-13 16:22:07 UTC (rev 45028)
@@ -967,23 +967,6 @@
 	}
 }
 
-void gfxop_set_pointer_cursor(GfxState *state, int nr) {
-	if (nr == GFXOP_NO_POINTER) {
-		state->driver->setPointer(NULL, NULL);
-		return;
-	}
-
-	gfx_pixmap_t *new_pointer = state->gfxResMan->getCursor(nr);
-
-	if (!new_pointer) {
-		warning("[GFX] Attempt to set invalid pointer #%d\n", nr);
-		return;
-	}
-
-	Common::Point p = Common::Point(new_pointer->xoffset, new_pointer->yoffset);
-	state->driver->setPointer(new_pointer, &p);
-}
-
 void gfxop_set_pointer_view(GfxState *state, int nr, int loop, int cel, Common::Point *hotspot) {
 	// FIXME: For now, don't palettize pointers
 	gfx_pixmap_t *new_pointer = state->gfxResMan->getView(nr, &loop, &cel, 0)->loops[loop].cels[cel];

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-10-13 16:22:07 UTC (rev 45028)
@@ -364,14 +364,6 @@
 void gfxop_sleep(GfxState *state, uint32 msecs);
 
 /**
- * Sets the mouse pointer to a cursor resource.
- *
- * @param[in] state	The affected state
- * @param[in] nr	Number of the cursor resource to use
- */
-void gfxop_set_pointer_cursor(GfxState *state, int nr);
-
-/**
  * Sets the mouse pointer to a view resource.
  *
  * Use gfxop_set_pointer_cursor(state, GFXOP_NO_POINTER) to disable the pointer.

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-13 16:22:07 UTC (rev 45028)
@@ -114,13 +114,15 @@
 	// FIXME: Don't store EngineState
 	virtual void resetEngineState(EngineState *s);
 
+protected:
+	SciGuiCursor *_cursor;
+
 private:
 	virtual void initPriorityBands();
 
 	EngineState *_s;
 	SciGuiScreen *_screen;
 	SciGuiPalette *_palette;
-	SciGuiCursor *_cursor;
 	SciGuiGfx *_gfx;
 	SciGuiresources *_resources;
 	SciGuiWindowMgr *_windowMgr;

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-13 16:22:07 UTC (rev 45028)
@@ -37,6 +37,7 @@
 #include "sci/gfx/gfx_widgets.h"
 #include "sci/gfx/gfx_state_internal.h"	// required for GfxContainer, GfxPort, GfxVisual
 #include "sci/gui32/gui32.h"
+#include "sci/gui/gui_cursor.h"
 
 // This is the real width of a text with a specified width of 0
 #define MAX_TEXT_WIDTH_MAGIC_VALUE 192
@@ -67,6 +68,7 @@
 
 SciGui32::SciGui32( EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor)
 	: s(state) {
+	_cursor = cursor;
 }
 
 SciGui32::~SciGui32() {
@@ -2444,18 +2446,15 @@
 }
 
 void SciGui32::hideCursor() {
-	CursorMan.showMouse(false);
+	_cursor->hide();
 }
 
 void SciGui32::showCursor() {
-	CursorMan.showMouse(true);
+	_cursor->show();
 }
 
 void SciGui32::setCursorShape(GuiResourceId cursorId) {
-	if (cursorId == -1)
-		gfxop_set_pointer_cursor(s->gfx_state, GFXOP_NO_POINTER);
-	else
-		gfxop_set_pointer_cursor(s->gfx_state, cursorId);
+	_cursor->setShape(cursorId);
 }
 
 void SciGui32::setCursorPos(Common::Point pos) {

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-10-13 16:18:17 UTC (rev 45027)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-10-13 16:22:07 UTC (rev 45028)
@@ -197,6 +197,7 @@
 	script_free_engine(_gamestate); // Uninitialize game state
 	script_free_breakpoints(_gamestate);
 
+	delete cursor;
 	delete palette;
 	delete screen;
 	delete _gamestate;


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