diff options
-rw-r--r-- | engines/sci/gfx/gfx_driver.cpp | 3 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_driver.h | 34 | ||||
-rw-r--r-- | engines/sci/gfx/operations.cpp | 31 | ||||
-rw-r--r-- | engines/sci/gfx/operations.h | 9 |
4 files changed, 6 insertions, 71 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp index 2418f45824..c63bdf98f8 100644 --- a/engines/sci/gfx/gfx_driver.cpp +++ b/engines/sci/gfx/gfx_driver.cpp @@ -306,9 +306,6 @@ static int scummvm_set_pointer(gfx_driver_t *drv, gfx_pixmap_t *pointer, Common: gfx_driver_t gfx_driver_scummvm = { NULL, - 0, 0, - 0, - NULL, scummvm_init, scummvm_exit, scummvm_draw_line, diff --git a/engines/sci/gfx/gfx_driver.h b/engines/sci/gfx/gfx_driver.h index 254f619b34..47b5e7de21 100644 --- a/engines/sci/gfx/gfx_driver.h +++ b/engines/sci/gfx/gfx_driver.h @@ -38,10 +38,6 @@ enum gfx_buffer_t { }; -/* graphics driver hints */ -#define GFX_CAPABILITY_SHADING (1<<0) -#define GFX_CAPABILITY_STIPPLED_LINES (1<<6) - /* Principial graphics driver architecture ** --------------------------------------- ** @@ -71,38 +67,8 @@ struct gfx_driver_t { /* Graphics driver */ 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 diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 49c73ac0fd..d9dc539c79 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -265,8 +265,9 @@ static int _gfxop_draw_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm, int prior } 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 @@ int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, 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 @@ static int _gfxop_draw_line_clipped(GfxState *state, Common::Point start, Common 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 @@ int gfxop_draw_box(GfxState *state, rect_t box, gfx_color_t color1, gfx_color_t 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 @@ int gfxop_set_pointer_position(GfxState *state, Common::Point pos) { 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 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) { // 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 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) { 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 diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h index 2f4a443509..88af32c624 100644 --- a/engines/sci/gfx/operations.h +++ b/engines/sci/gfx/operations.h @@ -152,15 +152,6 @@ int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ** 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 |