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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jun 5 20:05:45 CEST 2009


Revision: 41197
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41197&view=rev
Author:   thebluegr
Date:     2009-06-05 18:05:45 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
Removed some unused code and performed some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/gfx_driver.h
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/operations.h

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-05 12:20:42 UTC (rev 41196)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-05 18:05:45 UTC (rev 41197)
@@ -306,9 +306,6 @@
 
 gfx_driver_t gfx_driver_scummvm = {
 	NULL,
-	0, 0,
-	0,
-	NULL,
 	scummvm_init,
 	scummvm_exit,
 	scummvm_draw_line,

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.h	2009-06-05 12:20:42 UTC (rev 41196)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.h	2009-06-05 18:05:45 UTC (rev 41197)
@@ -38,10 +38,6 @@
 };
 
 
-/* graphics driver hints */
-#define GFX_CAPABILITY_SHADING (1<<0)
-#define GFX_CAPABILITY_STIPPLED_LINES (1<<6)
-
 /* Principial graphics driver architecture
 ** ---------------------------------------
 **
@@ -71,38 +67,8 @@
 
 	gfx_mode_t *mode; /* Currently active mode, NULL if no mode is active */
 
-	int pointer_x, pointer_y; /* Mouse pointer position */
-
-	int capabilities; /* The driver's capabilities: A list of flags that may
-	                  ** be pre-defined or set after a successful initialization.
-	                  */
-	/* Capability flags:
-	**
-	** The words MUST, SHOULD and MAY are to be interpreted as described in
-	** the IETF RFC 1123.
-	**
-	** GFX_CAPABILITY_SHADING: draw_filled_rect() supports drawing shaded
-	**    rectangles.
-	** GFX_CAPABILITY_STIPPLED_LINES: The driver is able to draw stippled lines
-	**    horizontally and vertically (xl = 0 or yl = 0).
-	*/
-
 	/*** Initialization ***/
 
-	int (*set_parameter)(gfx_driver_t *drv, char *attribute, char *value);
-	/* Sets a driver-specific parameter
-	** Parameters: (gfx_driver_t *) drv: Pointer to the affected driver
-	**             (char *) attribute: Name of the attribute/parameter to set
-	**             (char *) value: The value to set, or NULL to query the value
-	** Returns   : (int) GFX_OK or GFX_FATAL, which signals a fatal error
-	**                   condition.
-	** This function should make extensive use of sciprintf() to signal invalid
-	** values or unapplicable attributes.
-	** Note that it may be called either before initialization (to interpret
-	** config file or command line parameters) or afterwars (from the command
-	** console).
-	*/
-
 	int (*init)(gfx_driver_t *drv, int xres, int yres,
 	                     int bytespp);
 	/* Attempts to initialize a specific graphics mode

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-05 12:20:42 UTC (rev 41196)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-06-05 18:05:45 UTC (rev 41197)
@@ -265,8 +265,9 @@
 }
 
 static void _gfxop_full_pointer_refresh(GfxState *state) {
-	state->pointer_pos.x = state->driver->pointer_x / state->driver->mode->xfact;
-	state->pointer_pos.y = state->driver->pointer_y / state->driver->mode->yfact;
+	Common::Point mousePoint = g_system->getEventManager()->getMousePos();
+	state->pointer_pos.x = mousePoint.x / state->driver->mode->xfact;
+	state->pointer_pos.y = mousePoint.y / state->driver->mode->yfact;
 }
 
 static int _gfxop_buffer_propagate_box(GfxState *state, rect_t box, gfx_buffer_t buffer);
@@ -450,12 +451,6 @@
 	return GFX_OK;
 }
 
-int gfxop_set_parameter(GfxState *state, char *attribute, char *value) {
-	BASIC_CHECKS(GFX_FATAL);
-
-	return state->driver->set_parameter(state->driver, attribute, value);
-}
-
 int gfxop_exit(GfxState *state) {
 	BASIC_CHECKS(GFX_ERROR);
 
@@ -822,8 +817,7 @@
 			GFXWARN("Attempt to draw stippled line which is neither an hbar nor a vbar: (%d,%d) -- (%d,%d)\n", start.x, start.y, end.x, end.y);
 			return GFX_ERROR;
 		}
-		if (!(state->driver->capabilities & GFX_CAPABILITY_STIPPLED_LINES))
-			return simulate_stippled_line_draw(state->driver, skipone, start, end, color, line_mode);
+		return simulate_stippled_line_draw(state->driver, skipone, start, end, color, line_mode);
 	}
 
 	if ((retval = state->driver->draw_line(state->driver, start, end, color, line_mode, line_style))) {
@@ -923,8 +917,7 @@
 	BASIC_CHECKS(GFX_FATAL);
 	_gfxop_full_pointer_refresh(state);
 
-	if (PALETTE_MODE || !(state->driver->capabilities & GFX_CAPABILITY_SHADING))
-		shade_type = GFX_BOX_SHADE_FLAT;
+	shade_type = GFX_BOX_SHADE_FLAT;
 
 
 	_gfxop_add_dirty(state, box);
@@ -1244,9 +1237,7 @@
 		return 0; // Not fatal
 	}
 
-	state->driver->pointer_x = pos.x * state->driver->mode->xfact;
-	state->driver->pointer_y = pos.y * state->driver->mode->yfact;
-	g_system->warpMouse(state->driver->pointer_x, state->driver->pointer_y);
+	g_system->warpMouse(pos.x * state->driver->mode->xfact, pos.y * state->driver->mode->yfact);
 
 	_gfxop_full_pointer_refresh(state);
 	return 0;
@@ -1373,8 +1364,6 @@
 
 	// Don't generate events for mouse movement
 	while (found && ev.type == Common::EVENT_MOUSEMOVE) {
-		drv->pointer_x = ev.mouse.x;
-		drv->pointer_y = ev.mouse.y;
 		found = em->pollEvent(ev);
 	}
 
@@ -1538,26 +1527,18 @@
 		case Common::EVENT_LBUTTONDOWN:
 			input.type = SCI_EVT_MOUSE_PRESS;
 			input.data = 1;
-			drv->pointer_x = p.x;
-			drv->pointer_y = p.y;
 			break;
 		case Common::EVENT_RBUTTONDOWN:
 			input.type = SCI_EVT_MOUSE_PRESS;
 			input.data = 2;
-			drv->pointer_x = p.x;
-			drv->pointer_y = p.y;
 			break;
 		case Common::EVENT_LBUTTONUP:
 			input.type = SCI_EVT_MOUSE_RELEASE;
 			input.data = 1;
-			drv->pointer_x = p.x;
-			drv->pointer_y = p.y;
 			break;
 		case Common::EVENT_RBUTTONUP:
 			input.type = SCI_EVT_MOUSE_RELEASE;
 			input.data = 2;
-			drv->pointer_x = p.x;
-			drv->pointer_y = p.y;
 			break;
 
 			// Misc events

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-06-05 12:20:42 UTC (rev 41196)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-06-05 18:05:45 UTC (rev 41197)
@@ -152,15 +152,6 @@
 **                   to provide any useful graphics support
 */
 
-int gfxop_set_parameter(GfxState *state, char *attribute, char *value);
-/* Sets a driver-specific parameter
-** Parameters: (GfxState *) state: The state, encapsulating the driver object to manipulate
-**             (char *) attribute: The attribute to set
-**             (char *) value: The value the attribute should be set to
-** Returns   : (int) GFX_OK on success, GFX_FATAL on fatal error conditions triggered
-**                   by the command
-*/
-
 int gfxop_exit(GfxState *state);
 /* Deinitializes a currently active driver
 ** Parameters: (GfxState *) state: The state encapsulating the driver in question


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