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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Nov 4 13:19:06 CET 2009


Revision: 45660
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45660&view=rev
Author:   thebluegr
Date:     2009-11-04 12:19:05 +0000 (Wed, 04 Nov 2009)

Log Message:
-----------
Removed the reference to SciGuiCursor from EngineState

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui32/gui32.cpp
    scummvm/trunk/engines/sci/gui32/gui32.h
    scummvm/trunk/engines/sci/sci.cpp

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -43,7 +43,7 @@
 	int oldx, oldy;
 	int modifier_mask = getSciVersion() <= SCI_VERSION_01 ? SCI_EVM_ALL : SCI_EVM_NO_FOOLOCK;
 	SegManager *segMan = s->_segMan;
-	const Common::Point mousePos = s->_cursor->getPosition();
+	const Common::Point mousePos = s->_gui->getCursorPos();
 
 	// If there's a simkey pending, and the game wants a keyboard event, use the
 	// simkey instead of a normal event

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -128,7 +128,7 @@
 
 		if ((right >= left) && (bottom >= top)) {
 			Common::Rect rect = Common::Rect(left, top, right, bottom);
-			s->_cursor->setMoveZone(rect);
+			s->_gui->setCursorZone(rect);
 		} else {
 			warning("kSetCursor: Ignoring invalid mouse zone (%i, %i)-(%i, %i)", left, top, right, bottom);
 		}

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -737,7 +737,7 @@
 	}
 
 	// FIXME: Do in-place loading at some point, instead of creating a new EngineState instance from scratch.
-	retval = new EngineState(s->resMan, s->_kernel, s->_voc, s->_gui, s->_cursor, s->_audio);
+	retval = new EngineState(s->resMan, s->_kernel, s->_voc, s->_gui, s->_audio);
 
 	// Copy some old data
 	retval->gfx_state = s->gfx_state;

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -32,8 +32,8 @@
 
 namespace Sci {
 
-EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SciGui *gui, SciGuiCursor *cursor, AudioPlayer *audio)
-: resMan(res), _kernel(kernel), _voc(voc), _gui(gui), _cursor(cursor), _audio(audio), _dirseeker(this) {
+EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SciGui *gui, AudioPlayer *audio)
+: resMan(res), _kernel(kernel), _voc(voc), _gui(gui), _audio(audio), _dirseeker(this) {
 
 	gfx_state = 0;
 

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/engine/state.h	2009-11-04 12:19:05 UTC (rev 45660)
@@ -116,7 +116,7 @@
 
 struct EngineState : public Common::Serializable {
 public:
-	EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SciGui *gui, SciGuiCursor *cursor, AudioPlayer *audio);
+	EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SciGui *gui, AudioPlayer *audio);
 	virtual ~EngineState();
 
 	virtual void saveLoadWithSerializer(Common::Serializer &ser);
@@ -132,7 +132,6 @@
 	/* Non-VM information */
 
 	SciGui *_gui; /* Currently active Gui */
-	SciGuiCursor *_cursor;	/* Cursor functions */
 
 	GfxState *gfx_state; /**< Graphics state and driver */
 

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -737,6 +737,10 @@
 	moveCursor(pos);
 }
 
+Common::Point SciGui::getCursorPos() {
+	return _cursor->getPosition();
+}
+
 void SciGui::moveCursor(Common::Point pos) {
 	pos.y += _windowMgr->_picWind->rect.top;
 	pos.x += _windowMgr->_picWind->rect.left;
@@ -756,6 +760,10 @@
 	// FIXME!
 }
 
+void SciGui::setCursorZone(Common::Rect zone) {
+	_cursor->setMoveZone(zone);
+}
+
 int16 SciGui::getCelWidth(GuiResourceId viewId, int16 loopNo, int16 celNo) {
 	return _gfx->getView(viewId)->getCelInfo(loopNo, celNo)->width;
 }

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-11-04 12:19:05 UTC (rev 45660)
@@ -126,12 +126,14 @@
 	virtual bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
 	virtual void baseSetter(reg_t object);
 
-	virtual void hideCursor();
-	virtual void showCursor();
-	virtual void setCursorShape(GuiResourceId cursorId);
-	virtual void setCursorView(GuiResourceId viewNum, int loopNum, int cellNum, Common::Point *hotspot);
+	void hideCursor();
+	void showCursor();
+	void setCursorShape(GuiResourceId cursorId);
+	void setCursorView(GuiResourceId viewNum, int loopNum, int cellNum, Common::Point *hotspot);
 	virtual void setCursorPos(Common::Point pos);
+	Common::Point getCursorPos();
 	virtual void moveCursor(Common::Point pos);
+	void setCursorZone(Common::Rect zone);
 
 	virtual int16 getCelWidth(GuiResourceId viewId, int16 loopNo, int16 celNo);
 	virtual int16 getCelHeight(GuiResourceId viewId, int16 loopNo, int16 celNo);

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -934,7 +934,7 @@
 		}
 	}
 
-	Common::Point cursorPos = _s->_cursor->getPosition();
+	Common::Point cursorPos = _cursor->getPosition();
 
 	if ((type == SCI_EVT_MOUSE_PRESS) && (cursorPos.y < 10)) {
 		menu_mode = 1;
@@ -1027,7 +1027,7 @@
 
 			case SCI_EVT_MOUSE_RELEASE:
 				{
-				Common::Point curMousePos = _s->_cursor->getPosition();
+				Common::Point curMousePos = _cursor->getPosition();
 				menu_mode = (curMousePos.y < 10);
 				claimed = !menu_mode && !_s->_menubar->mapPointer(curMousePos, menu_nr, item_nr, portBounds);
 				mouse_down = 0;
@@ -1044,7 +1044,7 @@
 			}
 
 			if (mouse_down)
-				_s->_menubar->mapPointer(_s->_cursor->getPosition(), menu_nr, item_nr, portBounds);
+				_s->_menubar->mapPointer(_cursor->getPosition(), menu_nr, item_nr, portBounds);
 
 			if ((item_nr > -1 && old_item == -1) || (menu_nr != old_menu)) { /* Update menu */
 
@@ -2962,22 +2962,6 @@
 	return retval;
 }
 
-void SciGui32::hideCursor() {
-	_cursor->hide();
-}
-
-void SciGui32::showCursor() {
-	_cursor->show();
-}
-
-void SciGui32::setCursorShape(GuiResourceId cursorId) {
-	_cursor->setShape(cursorId);
-}
-
-void SciGui32::setCursorView(GuiResourceId viewNum, int loopNum, int cellNum, Common::Point *hotspot) {
-	_cursor->setView(viewNum, loopNum, cellNum, hotspot);
-}
-
 void SciGui32::setCursorPos(Common::Point pos) {
 	pos.y += _s->port->_bounds.y;
 	pos.x += _s->port->_bounds.x;

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-11-04 12:19:05 UTC (rev 45660)
@@ -102,10 +102,6 @@
 	void setNowSeen(reg_t objectReference);
 	bool canBeHere(reg_t curObject, reg_t listReference);
 
-	void hideCursor();
-	void showCursor();
-	void setCursorShape(GuiResourceId cursorId);
-	void setCursorView(GuiResourceId viewNum, int loopNum, int cellNum, Common::Point *hotspot);
 	void setCursorPos(Common::Point pos);
 	void moveCursor(Common::Point pos);
 

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-11-04 12:16:08 UTC (rev 45659)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-11-04 12:19:05 UTC (rev 45660)
@@ -134,7 +134,7 @@
 	_audio = new AudioPlayer(_resMan);
 
 	// We'll set the GUI below
-	_gamestate = new EngineState(_resMan, _kernel, _vocabulary, NULL, cursor, _audio);
+	_gamestate = new EngineState(_resMan, _kernel, _vocabulary, NULL, _audio);
 
 	if (script_init_engine(_gamestate))
 		return Common::kUnknownError;


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