aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/kgraphics.cpp2
-rw-r--r--engines/sci/engine/savegame.cfsml2
-rw-r--r--engines/sci/engine/savegame.cpp2
-rw-r--r--engines/sci/gfx/gfx_resource.cpp6
-rw-r--r--engines/sci/gfx/gfx_resource.h4
-rw-r--r--engines/sci/gfx/operations.cpp4
-rw-r--r--engines/sci/gfx/operations.h4
-rw-r--r--engines/sci/gfx/resource/res_pic.cpp18
8 files changed, 20 insertions, 22 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index e1dcfad108..604160f3d1 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -1048,7 +1048,7 @@ reg_t kDrawPic(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->port = s->picture_port;
- s->pic_priority_table = (int*)gfxop_get_pic_metainfo(s->gfx_state);
+ s->pic_priority_table = gfxop_get_pic_metainfo(s->gfx_state);
if (sci01_priority_table_flags & 0x2) {
if (s->pic_priority_table) {
diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml
index b41af91e5f..a2e64c9a35 100644
--- a/engines/sci/engine/savegame.cfsml
+++ b/engines/sci/engine/savegame.cfsml
@@ -1115,7 +1115,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
retval->have_mouse_flag = 1;
retval->successor = NULL;
- retval->pic_priority_table = (int*)gfxop_get_pic_metainfo(retval->gfx_state);
+ retval->pic_priority_table = gfxop_get_pic_metainfo(retval->gfx_state);
retval->game_name = sci_strdup(obj_get_name(retval, retval->game_obj));
retval->sound.it = NULL;
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index ab9e97b9e9..ab04e5475d 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -5276,7 +5276,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
retval->have_mouse_flag = 1;
retval->successor = NULL;
- retval->pic_priority_table = (int*)gfxop_get_pic_metainfo(retval->gfx_state);
+ retval->pic_priority_table = gfxop_get_pic_metainfo(retval->gfx_state);
retval->game_name = sci_strdup(obj_get_name(retval, retval->game_obj));
retval->sound.it = NULL;
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);