[Scummvm-cvs-logs] SF.net SVN: scummvm:[39375] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Mar 14 01:05:01 CET 2009
Revision: 39375
http://scummvm.svn.sourceforge.net/scummvm/?rev=39375&view=rev
Author: thebluegr
Date: 2009-03-14 00:05:01 +0000 (Sat, 14 Mar 2009)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/savegame.cfsml
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
scummvm/trunk/engines/sci/gfx/gfx_resource.h
scummvm/trunk/engines/sci/gfx/operations.cpp
scummvm/trunk/engines/sci/gfx/operations.h
scummvm/trunk/engines/sci/gfx/resource/res_pic.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-03-14 00:05:01 UTC (rev 39375)
@@ -1048,7 +1048,7 @@
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) {
Modified: scummvm/trunk/engines/sci/engine/savegame.cfsml
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-03-14 00:05:01 UTC (rev 39375)
@@ -1115,7 +1115,7 @@
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;
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2009-03-14 00:05:01 UTC (rev 39375)
@@ -5276,7 +5276,7 @@
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;
Modified: scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resource.cpp 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/gfx/gfx_resource.cpp 2009-03-14 00:05:01 UTC (rev 39375)
@@ -400,9 +400,9 @@
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;
Modified: scummvm/trunk/engines/sci/gfx/gfx_resource.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resource.h 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/gfx/gfx_resource.h 2009-03-14 00:05:01 UTC (rev 39375)
@@ -98,9 +98,7 @@
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;
};
Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp 2009-03-14 00:05:01 UTC (rev 39375)
@@ -1835,8 +1835,8 @@
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) {
Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/gfx/operations.h 2009-03-14 00:05:01 UTC (rev 39375)
@@ -526,10 +526,10 @@
** 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
*/
Modified: scummvm/trunk/engines/sci/gfx/resource/res_pic.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/res_pic.cpp 2009-03-14 00:02:01 UTC (rev 39374)
+++ scummvm/trunk/engines/sci/gfx/resource/res_pic.cpp 2009-03-14 00:05:01 UTC (rev 39375)
@@ -183,7 +183,7 @@
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 @@
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 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list