From b78001f7ca1fb433ce3605fb141ecc18ad436d7c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 14 Mar 2009 00:05:01 +0000 Subject: Changed the "internal" variable inside gfxr_pic_t to priorityTable (cause that's what it is), and changed its type to int * to avoid unneeded casts svn-id: r39375 --- engines/sci/gfx/gfx_resource.cpp | 6 +++--- engines/sci/gfx/gfx_resource.h | 4 +--- engines/sci/gfx/operations.cpp | 4 ++-- engines/sci/gfx/operations.h | 4 ++-- engines/sci/gfx/resource/res_pic.cpp | 18 +++++++++--------- 5 files changed, 17 insertions(+), 19 deletions(-) (limited to 'engines/sci/gfx') diff --git a/engines/sci/gfx/gfx_resource.cpp b/engines/sci/gfx/gfx_resource.cpp index 7e83606861..9097424aff 100644 --- a/engines/sci/gfx/gfx_resource.cpp +++ b/engines/sci/gfx/gfx_resource.cpp @@ -400,9 +400,9 @@ void gfxr_free_pic(gfx_driver_t *driver, gfxr_pic_t *pic) { pic->visual_map = NULL; pic->priority_map = NULL; pic->control_map = NULL; - if (pic->internal) - free(pic->internal); - pic->internal = NULL; + if (pic->priorityTable) + free(pic->priorityTable); + pic->priorityTable = NULL; if (pic->undithered_buffer) free(pic->undithered_buffer); pic->undithered_buffer = 0; diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h index f2736726b4..fba47c4f2f 100644 --- a/engines/sci/gfx/gfx_resource.h +++ b/engines/sci/gfx/gfx_resource.h @@ -98,9 +98,7 @@ struct gfxr_pic_t { void *undithered_buffer; /* copies visual_map->index_data before dithering */ int undithered_buffer_size; - void *internal; /* Interpreter information, or NULL. Will be freed - ** automatically when the pic is freed! */ - + int *priorityTable; }; diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index ae1bfd81b8..ea043b27b5 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -1835,8 +1835,8 @@ static int _gfxop_set_pic(gfx_state_t *state) { return state->driver->set_static_buffer(state->driver, state->pic->visual_map, state->pic->priority_map); } -void *gfxop_get_pic_metainfo(gfx_state_t *state) { - return (state->pic) ? state->pic->internal : NULL; +int *gfxop_get_pic_metainfo(gfx_state_t *state) { + return (state->pic) ? state->pic->priorityTable : NULL; } int gfxop_new_pic(gfx_state_t *state, int nr, int flags, int default_palette) { diff --git a/engines/sci/gfx/operations.h b/engines/sci/gfx/operations.h index 145e7b2f66..e3ed29533b 100644 --- a/engines/sci/gfx/operations.h +++ b/engines/sci/gfx/operations.h @@ -526,10 +526,10 @@ int gfxop_new_pic(gfx_state_t *state, int nr, int flags, int default_palette); ** See the resource manager tag functions for a full description. */ -void *gfxop_get_pic_metainfo(gfx_state_t *state); +int *gfxop_get_pic_metainfo(gfx_state_t *state); /* Retreives all meta-information assigned to the current pic ** Parameters: (gfx_state_t *) state: The state affected -** Returns : (void *) NULL if the pic doesn't exist or has no meta-information, +** Returns : (int *) NULL if the pic doesn't exist or has no meta-information, ** the meta-info otherwise ** This meta-information is referred to as 'internal data' in the pic code */ diff --git a/engines/sci/gfx/resource/res_pic.cpp b/engines/sci/gfx/resource/res_pic.cpp index a52f877d5b..6ba8ec660a 100644 --- a/engines/sci/gfx/resource/res_pic.cpp +++ b/engines/sci/gfx/resource/res_pic.cpp @@ -183,7 +183,7 @@ gfxr_pic_t *gfxr_init_pic(gfx_mode_t *mode, int ID, int sci1) { pic->undithered_buffer_size = pic->visual_map->index_xl * pic->visual_map->index_yl; pic->undithered_buffer = NULL; - pic->internal = NULL; + pic->priorityTable = NULL; return pic; } @@ -1717,13 +1717,13 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, int *pri_table; p0printf("Explicit priority table @%d\n", pos); - if (!pic->internal) { - pic->internal = sci_malloc(16 * sizeof(int)); + if (!pic->priorityTable) { + pic->priorityTable = (int*)sci_malloc(16 * sizeof(int)); } else { - GFXERROR("pic->internal is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", pic->internal); + GFXERROR("pic->priorityTable is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", pic->priorityTable); } - pri_table = (int*)pic->internal; + pri_table = pic->priorityTable; pri_table[0] = 0; pri_table[15] = 190; @@ -1739,13 +1739,13 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, int nr; int *pri_table; - if (!pic->internal) { - pic->internal = sci_malloc(16 * sizeof(int)); + if (!pic->priorityTable) { + pic->priorityTable = (int*)sci_malloc(16 * sizeof(int)); } else { - GFXERROR("pic->internal is not NULL (%p); possible memory corruption", pic->internal); + GFXERROR("pic->priorityTable is not NULL (%p); possible memory corruption", pic->priorityTable); } - pri_table = (int*)pic->internal; + pri_table = pic->priorityTable; for (nr = 0; nr < 16; nr ++) pri_table[nr] = SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr); -- cgit v1.2.3