aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx/operations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/gfx/operations.cpp')
-rw-r--r--engines/sci/gfx/operations.cpp57
1 files changed, 9 insertions, 48 deletions
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 7ab1bc28cd..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;
@@ -1326,28 +1317,8 @@ int _gfxop_shiftify(int c) {
}
}
- switch (c) {
- case SCI_K_F1 :
- return SCI_K_SHIFT_F1;
- case SCI_K_F2 :
- return SCI_K_SHIFT_F2;
- case SCI_K_F3 :
- return SCI_K_SHIFT_F3;
- case SCI_K_F4 :
- return SCI_K_SHIFT_F4;
- case SCI_K_F5 :
- return SCI_K_SHIFT_F5;
- case SCI_K_F6 :
- return SCI_K_SHIFT_F6;
- case SCI_K_F7 :
- return SCI_K_SHIFT_F7;
- case SCI_K_F8 :
- return SCI_K_SHIFT_F8;
- case SCI_K_F9 :
- return SCI_K_SHIFT_F9;
- case SCI_K_F10 :
- return SCI_K_SHIFT_F10;
- }
+ if (c >= SCI_K_F1 && c <= SCI_K_F10)
+ return c + 25;
return c;
}
@@ -1393,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);
}
@@ -1488,7 +1457,7 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
// SCI_K_SHIFT_F1 == 84 << 8
input.data = SCI_K_F1 + ((input.data - Common::KEYCODE_F1)<<8);
if (input.buckybits & (SCI_EVM_LSHIFT | SCI_EVM_RSHIFT))
- input.character = input.data + SCI_K_SHIFT_F1 - SCI_K_F1;
+ input.character = input.data + 25;
else
input.character = input.data;
} else {
@@ -1558,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