aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-02-18 12:26:37 +0000
committerFilippos Karapetis2009-02-18 12:26:37 +0000
commitd16311f8bbf5183d264f03999fbb90c3fe448cdc (patch)
tree31d25c22da4fc5cfbd3528307f97a04bc524a251
parent0d82e05bb68215ee59a463b4771f2df7c72e29dd (diff)
downloadscummvm-rg350-d16311f8bbf5183d264f03999fbb90c3fe448cdc.tar.gz
scummvm-rg350-d16311f8bbf5183d264f03999fbb90c3fe448cdc.tar.bz2
scummvm-rg350-d16311f8bbf5183d264f03999fbb90c3fe448cdc.zip
Removed some unused GFX driver capability code and flags
svn-id: r38473
-rw-r--r--engines/sci/gfx/gfx_driver.cpp2
-rw-r--r--engines/sci/gfx/gfx_tools.cpp5
-rw-r--r--engines/sci/gfx/operations.cpp28
-rw-r--r--engines/sci/include/gfx_driver.h46
4 files changed, 2 insertions, 79 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index aed180a2df..85194a0858 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -531,8 +531,6 @@ gfx_driver_scummvm = {
scummvm_exit,
scummvm_draw_line,
scummvm_draw_filled_rect,
- NULL,
- NULL,
scummvm_draw_pixmap,
scummvm_grab_pixmap,
scummvm_update,
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index e32c1834e9..1aded808d7 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -174,11 +174,6 @@ gfx_new_pixmap(int xl, int yl, int resid, int loop, int cel) {
void
gfx_free_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm) {
if (driver) {
- if (pxm->flags & GFX_PIXMAP_FLAG_INSTALLED) {
- if (driver->capabilities & GFX_CAPABILITY_PIXMAP_REGISTRY)
- driver->unregister_pixmap(driver, pxm);
- }
-
if (driver->mode->palette
&& pxm->flags & GFX_PIXMAP_FLAG_PALETTE_ALLOCATED
&& !(pxm->flags & GFX_PIXMAP_FLAG_DONT_UNALLOCATE_PALETTE)
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 0bf4954b83..d1f19032e4 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -240,17 +240,6 @@ static int
_gfxop_install_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm) {
int error;
- if (driver->capabilities & GFX_CAPABILITY_PIXMAP_REGISTRY
- && !(pxm->flags & GFX_PIXMAP_FLAG_INSTALLED)) {
- error = driver->register_pixmap(driver, pxm);
-
- if (error) {
- GFXERROR("driver->register_pixmap() returned error!\n");
- return error;
- }
- pxm->flags |= GFX_PIXMAP_FLAG_INSTALLED;
- }
-
if (driver->mode->palette &&
(!(pxm->flags & GFX_PIXMAP_FLAG_PALETTE_SET))) {
int i;
@@ -1540,20 +1529,6 @@ _gfxop_set_pointer(gfx_state_t *state, gfx_pixmap_t *pxm) {
draw_old = state->mouse_pointer != NULL;
- if (!draw_old
- && state->mouse_pointer
- && (state->driver->capabilities & GFX_CAPABILITY_POINTER_PIXMAP_REGISTRY))
- if ((retval = state->driver->unregister_pixmap(state->driver, state->mouse_pointer))) {
- GFXERROR("Pointer un-registration failed!\n");
- return retval;
- }
-
- if (state->driver->capabilities & GFX_CAPABILITY_POINTER_PIXMAP_REGISTRY) {
- if ((pxm) && (retval = state->driver->register_pixmap(state->driver, pxm))) {
- GFXERROR("Pixmap-registering a new mouse pointer failed!\n");
- return retval;
- }
- }
draw_new = 0;
state->driver->set_pointer(state->driver, pxm);
state->mouse_pointer_in_hw = 1;
@@ -1836,8 +1811,7 @@ gfxop_get_event(gfx_state_t *state, unsigned int mask) {
return error_event;
}
- if (event.type == SCI_EVT_KEYBOARD
- && !(state->driver->capabilities & GFX_CAPABILITY_KEYTRANSLATE)) {
+ if (event.type == SCI_EVT_KEYBOARD) {
/* Do we still have to translate the key? */
event.character = event.data;
diff --git a/engines/sci/include/gfx_driver.h b/engines/sci/include/gfx_driver.h
index 27327f9733..4257bf46d9 100644
--- a/engines/sci/include/gfx_driver.h
+++ b/engines/sci/include/gfx_driver.h
@@ -39,11 +39,7 @@ typedef enum {
/* graphics driver hints */
#define GFX_CAPABILITY_SHADING (1<<0)
-#define GFX_CAPABILITY_PIXMAP_REGISTRY (1<<3)
-#define GFX_CAPABILITY_SCALEABLE_PIXMAPS (1<<4)
#define GFX_CAPABILITY_STIPPLED_LINES (1<<6)
-#define GFX_CAPABILITY_POINTER_PIXMAP_REGISTRY (1<<8)
-#define GFX_CAPABILITY_KEYTRANSLATE (1<<11)
#define GFX_DEBUG_POINTER (1<<0)
#define GFX_DEBUG_UPDATES (1<<1)
@@ -90,25 +86,8 @@ typedef struct _gfx_driver { /* Graphics driver */
**
** GFX_CAPABILITY_SHADING: draw_filled_rect() supports drawing shaded
** rectangles.
- ** GFX_CAPABILITY_PIXMAP_REGISTRY: System provides a pixmap registry. The
- ** invoking functions will assume that all pixmaps MUST be registered;
- ** if this flag is not set, it assumes that pixmaps MUST NOT be
- ** registered. Note that this excludes pointer pixmaps (see below)
- ** GFX_CAPABILITY_POINTER_PIXMAP_REGISTRY: The system provides a pixmap
- ** registry which mouse pointers have to be registered in explicitly.
- ** This MUST be used only if the registry is identical to the 'normal' pixmap
- ** registry. Otherwise, it MUST be handled manually by the driver,
- ** unless pointer support is disabled completely.
- ** GFX_CAPABILITY_SCALEABLE_PIXMAPS: Pixmap scaling is fully supported.
- ** If this capability is flag is set, all pixmaps passed to the driver
- ** will be unscaled.
** GFX_CAPABILITY_STIPPLED_LINES: The driver is able to draw stippled lines
** horizontally and vertically (xl = 0 or yl = 0).
- ** GFX_CAPABILITY_KEYTRANSLATE: The driver's input layer automatically
- ** handles 'shifted' keys (i.e. turning shift-'a' to 'A' etc.).
- ** Drivers only need to handle this if they desire to support
- ** non-US keyboard layouts, usually by localisation methods
- ** provided by the underlying windowing or operating system.
*/
unsigned int debug_flags; /* Driver debug flags */
@@ -212,26 +191,6 @@ typedef struct _gfx_driver { /* Graphics driver */
/*** Pixmap operations ***/
- int (*register_pixmap)(struct _gfx_driver *drv, gfx_pixmap_t *pxm);
- /* Registers a pixmap with the driver.
- ** Parameters: (gfx_driver_t *) drv: The driver
- ** (gfx_pixmap_t *) pxm: The pixmap to register
- ** Returns : GFX_OK or GFX_FATAL
- ** This function may be NULL if GFX_CAPABILITY_PIXMAP_REGISTRY is not
- ** set.
- ** pxm->internal may be used to store any handle or meta information.
- */
-
- int (*unregister_pixmap)(struct _gfx_driver *drv, gfx_pixmap_t *pxm);
- /* Unregisters a pixmap previously registered with register_pixmap()
- ** Parameters: (gfx_driver_t *) drv: The driver
- ** (gfx_pixmap_t *) pxm: The pixmap to register
- ** Returns : (int) GFX_OK or GFX_FATAL, or GFX_ERROR if pxm was
- ** not registered
- ** Just like register_pixmap(), this function may be NULL unless
- ** GFX_CAPABILITY_PIXMAP_REGISTRY is set.
- */
-
int (*draw_pixmap)(struct _gfx_driver *drv, gfx_pixmap_t *pxm, int priority,
rect_t src, rect_t dest, gfx_buffer_t buffer);
/* Draws part of a pixmap to the static or back buffer
@@ -245,8 +204,6 @@ typedef struct _gfx_driver { /* Graphics driver */
** (int) buffer: One of GFX_BUFFER_STATIC and GFX_BUFFER_BACK
** Returns : (int) GFX_OK or GFX_FATAL, or GFX_ERROR if pxm was not
** (but should have been) registered.
- ** dest.xl and dest.yl must be evaluated and used for scaling if
- ** GFX_CAPABILITY_SCALEABLE_PIXMAPS is supported.
*/
int (*grab_pixmap)(struct _gfx_driver *drv, rect_t src, gfx_pixmap_t *pxm,
@@ -298,8 +255,7 @@ typedef struct _gfx_driver { /* Graphics driver */
** exit() was called in between.
** Note that later version of the driver interface may disallow modifying
** pic and priority.
- ** pic and priority are always scaled to the appropriate resolution, even
- ** if GFX_CAPABILITY_SCALEABLE_PIXMAPS is set.
+ ** pic and priority are always scaled to the appropriate resolution
*/