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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Wed Oct 7 14:47:53 CEST 2009


Revision: 44730
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44730&view=rev
Author:   m_kiewitz
Date:     2009-10-07 12:47:53 +0000 (Wed, 07 Oct 2009)

Log Message:
-----------
SCI: SciGuiCursor class added, cleanup, OSystem removed from SciGui constructor

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

Added Paths:
-----------
    scummvm/trunk/engines/sci/gui/gui_cursor.cpp
    scummvm/trunk/engines/sci/gui/gui_cursor.h

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -279,7 +279,8 @@
 	s->titlebar_port->_bgcolor.priority = 11; // Standard priority for the titlebar port
 #endif
 
-	s->gui->moveCursor(160, 150);
+	Common::Point mousePos(160, 150);
+	s->gui->moveCursor(mousePos);
 
 	return 0;
 }

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -268,7 +268,7 @@
 }
 
 static reg_t kSetCursorSci0(EngineState *s, int argc, reg_t *argv) {
-	
+	Common::Point pos;
 
 	int16 cursor = argv[0].toSint16();
 
@@ -278,13 +278,16 @@
 	gfxop_set_pointer_cursor(s->gfx_state, cursor);
 
 	// Set pointer position, if requested
-	if (argc >= 4)
-		s->gui->moveCursor(argv[2].toSint16() + s->port->_bounds.x, argv[3].toSint16() + s->port->_bounds.y);
-
+	if (argc >= 4) {
+		pos.y = argv[3].toSint16();
+		pos.x = argv[2].toSint16();
+		s->gui->setCursorPos(pos);
+	}
 	return s->r_acc;
 }
 
 static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
+	Common::Point pos;
 	Common::Point *hotspot = NULL;
 
 	switch (argc) {
@@ -292,7 +295,9 @@
 		CursorMan.showMouse(argv[0].toSint16() != 0);
 		break;
 	case 2:
-		s->gui->moveCursor(argv[0].toUint16() + s->port->_bounds.x, argv[1].toUint16() + s->port->_bounds.y);
+		pos.y = argv[1].toSint16();
+		pos.x = argv[0].toSint16();
+		s->gui->setCursorPos(pos);
 		break;
 	case 4: {
 		int16 top = argv[0].toSint16();
@@ -337,8 +342,12 @@
 }
 
 reg_t kMoveCursor(EngineState *s, int argc, reg_t *argv) {
-	if (argc == 2)
-		s->gui->moveCursor(argv[0].toSint16(), argv[1].toSint16());
+	Common::Point pos;
+	if (argc == 2) {
+		pos.y = argv[1].toSint16();
+		pos.x = argv[0].toSint16();
+		s->gui->moveCursor(pos);
+	}
 	return s->r_acc;
 }
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -798,7 +798,6 @@
 	retval->_msgState = s->_msgState;
 
 	retval->gui = s->gui;
-	retval->gui->resetEngineState(retval);
 
 	return retval;
 }

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -33,6 +33,7 @@
 #include "sci/gui/gui.h"
 #include "sci/gui/gui_screen.h"
 #include "sci/gui/gui_palette.h"
+#include "sci/gui/gui_cursor.h"
 #include "sci/gui/gui_gfx.h"
 #include "sci/gui/gui_windowmgr.h"
 #include "sci/gui/gui_view.h"
@@ -41,8 +42,8 @@
 
 namespace Sci {
 
-SciGui::SciGui(OSystem *system, EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette)
-	: _system(system), _s(state), _screen(screen), _palette(palette) {
+SciGui::SciGui(EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor)
+	: _s(state), _screen(screen), _palette(palette), _cursor(cursor) {
 
 	_gfx = new SciGuiGfx(_s, _screen, _palette);
 	_windowMgr = new SciGuiWindowMgr(_s, _gfx);
@@ -460,24 +461,28 @@
 	_gfx->SetNowSeen(objectReference);
 }
 
-void SciGui::moveCursor(int16 x, int16 y, int16 scaleFactor) {
-	Common::Point newPos;
+void SciGui::setCursorPos(Common::Point pos) {
+	// FIXME: try to find out if we need to adjust position somehow, currently just forwarding to moveCursor()
+	moveCursor(pos);
+}
+
+void SciGui::moveCursor(Common::Point pos) {
+	pos.y += _windowMgr->_picWind->rect.top;
+	pos.x += _windowMgr->_picWind->rect.left;
 	
-	x += _windowMgr->_picWind->rect.left;
-	y += _windowMgr->_picWind->rect.top;
-	newPos.x = CLIP<int16>(x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
-	newPos.y = CLIP<int16>(y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
+	pos.y = CLIP<int16>(pos.y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1);
+	pos.x = CLIP<int16>(pos.x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1);
 
-	if (x > _screen->_width || y > _screen->_height) {
-		debug("[GFX] Attempt to place pointer at invalid coordinates (%d, %d)\n", x, y);
+	if (pos.x > _screen->_width || pos.y > _screen->_height) {
+		warning("attempt to place cursor at invalid coordinates (%d, %d)", pos.y, pos.x);
 		return; // Not fatal
 	}
 
-	g_system->warpMouse(x * scaleFactor, y * scaleFactor);
-
+	_cursor->setPosition(pos);
 	// Trigger event reading to make sure the mouse coordinates will
 	// actually have changed the next time we read them.
-	gfxop_get_event(_s->gfx_state, SCI_EVT_PEEK);
+	//gfxop_get_event(_s->gfx_state, SCI_EVT_PEEK);
+	// FIXME!
 }
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-07 12:47:53 UTC (rev 44730)
@@ -32,18 +32,16 @@
 
 class SciGuiScreen;
 class SciGuiPalette;
+class SciGuiCursor;
 class SciGuiGfx;
 class SciGuiresources;
 class SciGuiWindowMgr;
 class SciGui {
 public:
-	SciGui(OSystem *system, EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette);
+	SciGui(EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor);
 	SciGui();
 	virtual ~SciGui();
 
-	// FIXME: Don't store EngineState
-	virtual void resetEngineState(EngineState *s) { _s = s; }
-
 	virtual void init(bool usesOldGfxFunctions);
 
 	virtual void wait(int16 ticks);
@@ -86,16 +84,14 @@
 	virtual void addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 	virtual void setNowSeen(reg_t objectReference);
 
-	virtual void moveCursor(int16 x, int16 y, int16 scaleFactor = 1);
-	void moveCursor(Common::Point p, int16 scaleFactor = 1) { moveCursor(p.x, p.y, scaleFactor); }
+	virtual void setCursorPos(Common::Point pos);
+	virtual void moveCursor(Common::Point pos);
 
-	SciGuiPalette *getPalette() { return _palette; }
-
 private:
-	OSystem *_system;
 	EngineState *_s;
 	SciGuiScreen *_screen;
 	SciGuiPalette *_palette;
+	SciGuiCursor *_cursor;
 	SciGuiGfx *_gfx;
 	SciGuiresources *_resources;
 	SciGuiWindowMgr *_windowMgr;

Copied: scummvm/trunk/engines/sci/gui/gui_cursor.cpp (from rev 44723, scummvm/trunk/engines/sci/gui/gui_palette.cpp)
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_cursor.cpp	                        (rev 0)
+++ scummvm/trunk/engines/sci/gui/gui_cursor.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/timer.h"
+#include "common/util.h"
+
+#include "sci/sci.h"
+#include "sci/engine/state.h"
+#include "sci/tools.h"
+#include "sci/gui/gui_palette.h"
+#include "sci/gui/gui_view.h"
+#include "sci/gui/gui_cursor.h"
+
+namespace Sci {
+
+SciGuiCursor::SciGuiCursor(EngineState *state, SciGuiPalette *palette)
+	: _s(state), _palette(palette) {
+	init();
+}
+
+SciGuiCursor::~SciGuiCursor() {
+}
+
+void SciGuiCursor::init() {
+}
+
+void SciGuiCursor::setPosition(Common::Point pos) {
+	g_system->warpMouse(pos.x, pos.y);
+}
+
+} // End of namespace Sci

Copied: scummvm/trunk/engines/sci/gui/gui_cursor.h (from rev 44723, scummvm/trunk/engines/sci/gui/gui_palette.h)
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_cursor.h	                        (rev 0)
+++ scummvm/trunk/engines/sci/gui/gui_cursor.h	2009-10-07 12:47:53 UTC (rev 44730)
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_GUI_CURSOR_H
+#define SCI_GUI_CURSOR_H
+
+#include "sci/gui/gui.h"
+
+namespace Sci {
+
+class SciGuiView;
+class SciGuiPalette;
+class SciGuiCursor {
+public:
+	SciGuiCursor(EngineState *state, SciGuiPalette *palette);
+	~SciGuiCursor();
+
+	void setPosition(Common::Point pos);
+
+private:
+	void init();
+
+	EngineState *_s;
+	SciGuiScreen *_screen;
+	SciGuiPalette *_palette;
+};
+
+} // End of namespace Sci
+
+#endif

Modified: scummvm/trunk/engines/sci/gui/gui_picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_picture.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/gui/gui_picture.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -556,4 +556,192 @@
 	}
 }
 
+#if 0
+void SciGuiGfx::Pic_Fill(int16 x, int16 y, byte color, byte prio, byte control) {
+
+void SciGuiPicture::vectorFloodFillRecursive(byte *data, int &curPos, int16 &x, int16 &y) {
+
+void FILL_FUNCTION_RECURSIVE(gfxr_pic_t *pic, int old_xl, int old_xr, int y, int dy, byte *bounds,
+	int legalcolor, int legalmask, int color, int priority, int drawenable, int sci_titlebar_size) {
+	int linewidth = pic->mode->scaleFactor * 320;
+	int miny = pic->mode->scaleFactor * sci_titlebar_size;
+	int maxy = pic->mode->scaleFactor * 200;
+	int xl, xr;
+	int oldytotal = y * linewidth;
+
+	do {
+		int ytotal = oldytotal + (linewidth * dy);
+		int xcont;
+		int state;
+
+		y += dy;
+
+		if (y < miny || y >= maxy) {
+			error("ABRT on failed initial assertion!");
+			return;
+		}
+#  define proj_xl_bound 0
+#  define proj_xr_bound 319
+
+		// Now we have the projected limits, get the real ones:
+
+		xl = (old_xl > proj_xl_bound) ? old_xl : proj_xl_bound;
+		if (!IS_BOUNDARY(xl, y + 1, bounds[ytotal + xl])) { // go left as far as possible
+			while (xl > proj_xl_bound && (!IS_BOUNDARY(xl - 1, y + 1, bounds[ytotal + xl - 1])))
+				--xl;
+		} else // go right until the fillable area starts
+			while (xl < proj_xr_bound && (IS_BOUNDARY(xl, y + 1, bounds[ytotal + xl])))
+				++xl;
+
+
+		if ((xl > proj_xr_bound)
+		        || (xl > old_xr)) {
+			error("ABRT because xl > xr_bound");
+			return;
+		}
+
+		xr = (xl > old_xl) ? xl : old_xl;
+		while (xr < proj_xr_bound && (!IS_BOUNDARY(xr + 1, y + 1, bounds[ytotal + xr + 1])))
+			++xr;
+
+		PRINT_DEBUG1("%d> -> ", xr);
+
+		if (IS_BOUNDARY(xl, y + 1,  bounds[ytotal + xl])) {
+			error("ABRT because xl illegal");
+			return;
+		}
+
+		if (drawenable & GFX_MASK_VISUAL)
+			memset(pic->visual_map->index_data + ytotal + xl, color, xr - xl + 1);
+
+		if (drawenable & GFX_MASK_PRIORITY)
+			memset(pic->priority_map->index_data + ytotal + xl, priority, xr - xl + 1);
+
+
+		// Check whether we need to recurse on branches in the same direction
+		state = 0;
+		xcont = xr + 1;
+		while (xcont <= old_xr) {
+			if (IS_BOUNDARY(xcont, y + 1, bounds[ytotal + xcont]))
+				state = xcont;
+			else if (state) { // recurse
+				vectorFloodFillRecursive(pic, state, xcont, y - dy, dy, bounds, legalcolor,
+				                        legalmask, color, priority, drawenable, sci_titlebar_size);
+				state = 0;
+			}
+			++xcont;
+		}
+
+		// Check whether we need to recurse on backward branches:
+		// left
+		if (xl < old_xl - 1) {
+			state = 0;
+			for (xcont = old_xl - 1; xcont >= xl; xcont--) {
+				if (IS_BOUNDARY(xcont, y, bounds[oldytotal + xcont]))
+					state = xcont;
+				else if (state) { // recurse
+					vectorFloodFillRecursive(pic, xcont, state, y, -dy, bounds,
+					                        legalcolor, legalmask, color, priority, drawenable,
+					                        sci_titlebar_size);
+					state = 0;
+				}
+			}
+		}
+
+		// right
+		if (xr > old_xr + 1) {
+			state = 0;
+			for (xcont = old_xr + 1; xcont <= xr; xcont++) {
+				if (IS_BOUNDARY(xcont, y, bounds[oldytotal + xcont]))
+					state = xcont;
+				else if (state) { // recurse
+					vectorFloodFillRecursive(pic, state, xcont, y, -dy, bounds,
+					                        legalcolor, legalmask, color, priority, drawenable,
+					                        sci_titlebar_size);
+					state = 0;
+				}
+			}
+		}
+
+		oldytotal = ytotal;
+		old_xl = xl;
+		old_xr = xr;
+
+	} while (1);
+}
+
+void SciGuiPicture::vectorFloodFillRecursive(gfxr_pic_t *pic, int x_320, int y_200, int color, int priority, int control, int drawenable,
+	int sci_titlebar_size) {
+	int linewidth = pic->mode->scaleFactor * 320;
+	int x, y;
+	int xl, xr;
+	int ytotal;
+	int bitmask;
+	byte *bounds = NULL;
+	int legalcolor, legalmask;
+	int original_drawenable = drawenable; // Backup, since we need the unmodified value
+					      // for filling the aux and control map
+
+	// Restrict drawenable not to restrict itself to zero
+	if (pic->control_map->index_data[y_200 * 320 + x_320] != 0)
+		drawenable &= ~GFX_MASK_CONTROL;
+
+	if (color == 0xff)
+		drawenable &= ~GFX_MASK_VISUAL;
+
+	if (priority == 0) {
+		drawenable &= ~GFX_MASK_PRIORITY;
+		original_drawenable &= ~GFX_MASK_PRIORITY;
+	}
+
+	AUXBUF_FILL(pic, x_320, y_200, original_drawenable, (drawenable & GFX_MASK_CONTROL) ? control : 0,
+	            sci_titlebar_size);
+
+	x = x_320;
+	y = y_200;
+
+	ytotal = y * linewidth;
+
+	if (!drawenable)
+		return;
+
+	if (drawenable & GFX_MASK_VISUAL) {
+		bounds = pic->visual_map->index_data;
+		legalmask = 0x0ff0;
+		legalcolor = 0xff;
+	} else if (drawenable & GFX_MASK_PRIORITY) {
+		bounds = pic->priority_map->index_data;
+		legalcolor = 0;
+		legalmask = 0x0f0f;
+	} else {
+		legalcolor = 0;
+		legalmask = 0x0f0f;
+	}
+
+	if (!bounds || IS_BOUNDARY(x, y, bounds[ytotal + x]))
+		return;
+
+	if (bounds) {
+		xl = x;
+		while (xl > proj_xl_bound && (!IS_BOUNDARY(xl - 1, y, bounds[ytotal + xl -1])))
+			--xl;
+
+		while (x < proj_xr_bound && (!IS_BOUNDARY(x + 1, y, bounds[ytotal + x + 1])))
+			++x;
+		xr = x;
+
+		if (drawenable & GFX_MASK_VISUAL)
+			memset(pic->visual_map->index_data + ytotal + xl, color, xr - xl + 1);
+
+		if (drawenable & GFX_MASK_PRIORITY)
+			memset(pic->priority_map->index_data + ytotal + xl, priority, xr - xl + 1);
+
+		vectorFloodFillRecursive(pic, xl, xr, y, -1, bounds, legalcolor, legalmask, color, priority, drawenable,
+		                        sci_titlebar_size);
+		vectorFloodFillRecursive(pic, xl, xr, y, + 1, bounds, legalcolor, legalmask, color, priority, drawenable,
+		                        sci_titlebar_size);
+	}
+}
+#endif
+
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -64,8 +64,8 @@
 
 namespace Sci {
 
-SciGui32::SciGui32(OSystem *system, EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette)
-	: _system(system), s(state) {
+SciGui32::SciGui32( EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor)
+	: s(state) {
 }
 
 SciGui32::~SciGui32() {
@@ -2002,31 +2002,30 @@
 	_k_set_now_seen(objectReference);
 }
 
+void SciGui32::setCursorPos(Common::Point pos) {
+	pos.y += s->port->_bounds.y;
+	pos.x += s->port->_bounds.x;
+	moveCursor(pos);
+}
 
-void SciGui32::moveCursor(int16 x, int16 y, int16 scaleFactor) {
-	Common::Point newPos;
+void SciGui32::moveCursor(Common::Point pos) {
+	pos.y += s->port->zone.y;
+	pos.x += s->port->zone.x;
 
-	// newPos = s->gfx_state->pointer_pos;
+	if (pos.x > s->port->zone.x + s->port->zone.width)
+		pos.x = s->port->zone.x + s->port->zone.width;
+	if (pos.y > s->port->zone.y + s->port->zone.height)
+		pos.y = s->port->zone.y + s->port->zone.height;
 
-	newPos.x = x + s->port->zone.x;
-	newPos.y = y + s->port->zone.y;
+	if (pos.x < 0) pos.x = 0;
+	if (pos.y < 0) pos.y = 0;
 
-	if (newPos.x > s->port->zone.x + s->port->zone.width)
-		newPos.x = s->port->zone.x + s->port->zone.width;
-	if (newPos.y > s->port->zone.y + s->port->zone.height)
-		newPos.y = s->port->zone.y + s->port->zone.height;
-
-	if (newPos.x < 0)
-		newPos.x = 0;
-	if (newPos.y < 0)
-		newPos.y = 0;
-
-	if (x > 320 || y > 200) {
-		debug("[GFX] Attempt to place pointer at invalid coordinates (%d, %d)\n", x, y);
+	if (pos.x > 320 || pos.y > 200) {
+		debug("[GFX] Attempt to place pointer at invalid coordinates (%d, %d)\n", pos.x, pos.y);
 		return; // Not fatal
 	}
 
-	g_system->warpMouse(x * scaleFactor, y * scaleFactor);
+	g_system->warpMouse(pos.x, pos.y);
 
 	// Trigger event reading to make sure the mouse coordinates will
 	// actually have changed the next time we read them.

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-07 12:47:53 UTC (rev 44730)
@@ -32,12 +32,9 @@
 
 class SciGui32 : public SciGui {
 public:
-	SciGui32(OSystem *system, EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette);
+	SciGui32(EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor);
 	~SciGui32();
 
-	// FIXME: Don't store EngineState
-	virtual void resetEngineState(EngineState *newState) { s = newState; }
-
 	void init(bool oldGfxFunctions);
 
 	void wait(int16 ticks);
@@ -80,10 +77,10 @@
 	void addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 	void setNowSeen(reg_t objectReference);
 
-	void moveCursor(int16 x, int16 y, int16 scaleFactor = 1);
+	void setCursorPos(Common::Point pos);
+	void moveCursor(Common::Point pos);
 
 private:
-	OSystem *_system;
 	EngineState *s;
 	bool _usesOldGfxFunctions;
 

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-10-07 12:34:43 UTC (rev 44729)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-10-07 12:47:53 UTC (rev 44730)
@@ -38,6 +38,7 @@
 #include "sci/gfx/gfx_state_internal.h"	// required for GfxContainer, GfxPort, GfxVisual
 #include "sci/gui32/gui32.h"
 #include "sci/gui/gui_palette.h"
+#include "sci/gui/gui_cursor.h"
 
 #include "sci/gfx/gfx_resource.h"
 #include "sci/gfx/gfx_tools.h"
@@ -158,10 +159,11 @@
 
 	SciGuiScreen *screen = new SciGuiScreen(_system);
 	SciGuiPalette *palette = new SciGuiPalette(_gamestate, screen);
+	SciGuiCursor *cursor = new SciGuiCursor(_gamestate, palette);
 
 	// Gui change
-	//_gamestate->gui = new SciGui(_system, _gamestate, screen, palette);    // new
-	_gamestate->gui = new SciGui32(_system, _gamestate, screen, palette);  // old
+	//_gamestate->gui = new SciGui(_gamestate, screen, palette, cursor);    // new
+	_gamestate->gui = new SciGui32(_gamestate, screen, palette, cursor);  // old
 
 	// Assign default values to the config manager, in case settings are missing
 	ConfMan.registerDefault("dither_mode", "0");


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