[Scummvm-cvs-logs] SF.net SVN: scummvm:[39331] scummvm/trunk/engines/sci/gfx

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Mar 11 17:50:12 CET 2009


Revision: 39331
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39331&view=rev
Author:   thebluegr
Date:     2009-03-11 16:50:12 +0000 (Wed, 11 Mar 2009)

Log Message:
-----------
Got rid of misc_payload and stopped passing the whole graphics state structure in places where it's not necessary

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/operations.h
    scummvm/trunk/engines/sci/gfx/resmgr.cpp
    scummvm/trunk/engines/sci/gfx/resource/res_manager.cpp

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.h	2009-03-11 16:13:28 UTC (rev 39330)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.h	2009-03-11 16:50:12 UTC (rev 39331)
@@ -32,6 +32,7 @@
 
 #include "sci/gfx/gfx_resource.h"
 #include "sci/gfx/sbtree.h"
+#include "sci/scicore/resource.h"
 
 namespace Sci {
 
@@ -91,13 +92,13 @@
 	int tag_lock_counter; /* lock counter value at tag time */
 
 	sbtree_t *resource_trees[GFX_RESOURCE_TYPES_NR];
-	void *misc_payload;
+	ResourceManager *resManager;
 };
 
 
 
 gfx_resstate_t *gfxr_new_resource_manager(int version, gfx_options_t *options,
-	gfx_driver_t *driver, void *misc_payload);
+	gfx_driver_t *driver, ResourceManager *resManager);
 /* Allocates and initializes a new resource manager
 ** Parameters: (int) version: Interpreter version
 **             (gfx_options_t *): Pointer to all relevant drawing options
@@ -219,12 +220,11 @@
 
 
 int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version,
-	gfx_options_t *options, void *internal, int palette);
+	gfx_options_t *options, int palette);
 /* Calculates a unique hash value for the specified options/type setup
 ** Parameters: (gfx_resource_type_t) type: The type the hash is to be generated for
 **             (int) version: The interpreter type and version
 **             (gfx_options_t *) options: The options to hashify
-**             (void *) internal: Internal information provided by the interpreter
 **	       (int) palette: The palette to use (FIXME: should this be here?)
 ** Returns   : (int) A hash over the values of the options entries, covering entries iff
 **                   they are relevant for the specified type
@@ -236,42 +236,38 @@
 ** (Yes, this isn't really a "hash" in the traditional sense...)
 */
 
-int *gfxr_interpreter_get_resources(gfx_resstate_t *state, gfx_resource_type_t type,
-	int version, int *entries_nr, void *internal);
+int *gfxr_interpreter_get_resources(ResourceManager *resourceManager, gfx_resource_type_t type,
+	int version, int *entries_nr);
 /* Retreives all resources of a specified type that are available from the interpreter
 ** Parameters: (gfx_resstate_t *) state: The relevant resource state
 **             (gfx_respirce_type_t) type: The resource type to query
 **             (int) version: The interpreter type and version
 **             (int *) entries_nr: The variable the number of entries will eventually be stored in
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (int *) An array of resource numbers
 ** Unsupported/non-existing resources should return NULL here; this is equivalent to supported
 ** resources of which zero are available.
 ** The returned structure (if non-zero) must be freed by the querying code (the resource manager).
 */
 
-gfxr_pic_t *gfxr_interpreter_init_pic(int version, gfx_mode_t *mode, int ID, void *internal);
+gfxr_pic_t *gfxr_interpreter_init_pic(int version, gfx_mode_t *mode, int ID);
 /* Initializes a pic
 ** Parameters: (int) version: Interpreter version to use
 **             (gfx_mode_t *) mode: The graphics mode the pic will be using
 **             (int) ID: The ID to assign to the gfxr_pic_t structure
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (gfxr_pic_t *) A newly allocated pic
 ** This function is typically called befode gfxr_interpreter_clear_pic().
-** Must remember to initialize 'internal' to NULL or a malloc()'d area.
 */
 
-void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal);
+void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic);
 /* Clears a previously allocated pic
 ** Parameters: (int) version: Interpreter version
 **             (gfxr_pic_t *) pic: The pic to clear
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns  :  (void)
 ** This function is called in preparation for the pic to be drawn with gfxr_interpreter_calculate_pic.
 */
 
 int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic,
-	int flags, int default_palette, int nr, void *internal);
+	int flags, int default_palette, int nr);
 /* Instructs the interpreter-specific code to calculate a picture
 ** Parameters: (gfx_resstate_t *) state: The resource state, containing options and version information
 **             (gfxr_pic_t *) scaled_pic: The pic structure that is to be written to
@@ -280,56 +276,51 @@
 **             (int) flags: Pic drawing flags (interpreter dependant)
 **             (int) default_palette: The default palette to use for pic drawing (interpreter dependant)
 **             (int) nr: pic resource number
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (int) GFX_ERROR if the resource could not be found, GFX_OK otherwise
 */
 
-gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, void *internal, int palette);
+gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, int palette);
 /* Instructs the interpreter-specific code to calculate a view
 ** Parameters: (gfx_resstate_t *) state: The resource manager state
 **             (int) nr: The view resource number
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (gfx_view_t *) The appropriate view, or NULL on error
 */
 
-gfx_bitmap_font_t *gfxr_interpreter_get_font(gfx_resstate_t *state, int nr, void *internal);
+gfx_bitmap_font_t *gfxr_interpreter_get_font(ResourceManager *resourceManager, int nr);
 /* Instructs the interpreter-specific code to calculate a font
 ** Parameters: (gfx_resstate_t *) state: The resource manager state
 **             (int) nr: The font resource number
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (gfx_font_t *) The newly calculated font, or NULL on error
 */
 
-gfx_pixmap_t *gfxr_interpreter_get_cursor(gfx_resstate_t *state, int nr, void *internal);
+gfx_pixmap_t *gfxr_interpreter_get_cursor(ResourceManager *resourceManager, int nr, int version);
 /* Instructs the interpreter-specific code to calculate a cursor
 ** Paramaters: (gfx_resstate_t *) state: The resource manager state
 **             (int nr): The cursor resource number
-**             (void *) internal: Internal information provided by the interpreter
+**             (int version): The SCI version used
 ** Returns   : (gfx_pixmap_t *) The cursor pixmap, or NULL on error
 */
 
-Palette *gfxr_interpreter_get_static_palette(gfx_resstate_t *state, int version, int *colors_nr, void *internal);
-/* Retreives the static palette from the interpreter-specific code
+Palette *gfxr_interpreter_get_static_palette(ResourceManager *resourceManager, int version, int *colors_nr);
+/* Retreives the static palette (palette 999) from the interpreter-specific code
 ** Parameters: (int) version: Interpreter version to use
 **             (int *) colors_nr: Number of colors to use
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (gfx_pixmap_color_t *) *colors_nr static color entries
 **             if a static palette must be used, NULL otherwise
 */
 
-Palette *gfxr_interpreter_get_palette(gfx_resstate_t *state, int version, int *colors_nr, void *internal, int nr);
+Palette *gfxr_interpreter_get_palette(ResourceManager *resourceManager, int version, int *colors_nr, int nr);
 /* Retreives the static palette from the interpreter-specific code
 ** Parameters: (int) version: Interpreter version to use
 **             (int *) colors_nr: Number of colors to use
-**             (void *) internal: Internal information provided by the interpreter
+**             (int) nr: The palette to read
 ** Returns   : (gfx_pixmap_color_t *) *colors_nr static color entries
 **             if a static palette must be used, NULL otherwise
 */
 
-int gfxr_interpreter_needs_multicolored_pointers(int version, void *internal);
+int gfxr_interpreter_needs_multicolored_pointers(int version);
 /* Determines whether support for pointers with more than two colors is required
 ** Parameters: (int) version: Interpreter version to test for
-**             (void *) internal: Internal information provided by the interpreter
 ** Returns   : (int) 0 if no support for multi-colored pointers is required, non-0
 **                   otherwise
 */

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-03-11 16:13:28 UTC (rev 39330)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-03-11 16:50:12 UTC (rev 39331)
@@ -417,18 +417,18 @@
 	(*pixmap)->palette = new Palette(default_colors, DEFAULT_COLORS_NR);
 }
 
-static int _gfxop_init_common(gfx_state_t *state, gfx_options_t *options, void *misc_payload) {
+static int _gfxop_init_common(gfx_state_t *state, gfx_options_t *options, ResourceManager *resManager) {
 	gfxr_init_static_palette();
 
 	state->options = options;
 
-	if (!((state->resstate = gfxr_new_resource_manager(state->version, state->options, state->driver, misc_payload)))) {
+	if (!((state->resstate = gfxr_new_resource_manager(state->version, state->options, state->driver, resManager)))) {
 		GFXERROR("Failed to initialize resource manager!\n");
 		return GFX_FATAL;
 	}
 
 	int size;
-	state->static_palette = gfxr_interpreter_get_static_palette(state->resstate, state->version, &size, misc_payload);
+	state->static_palette = gfxr_interpreter_get_static_palette(state->resstate->resManager, state->version, &size);
 
 	state->visible_map = GFX_MASK_VISUAL;
 	state->fullscreen_override = NULL; // No magical override
@@ -453,16 +453,16 @@
 	return GFX_OK;
 }
 
-int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, void *misc_info) {
+int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, ResourceManager *resManager) {
 	BASIC_CHECKS(GFX_FATAL);
 	if (state->driver->init(state->driver))
 		return GFX_FATAL;
 
-	return _gfxop_init_common(state, options, misc_info);
+	return _gfxop_init_common(state, options, resManager);
 }
 
 int gfxop_init(gfx_state_t *state, int xfact, int yfact, gfx_color_mode_t bpp,
-	gfx_options_t *options, void *misc_info) {
+	gfx_options_t *options, ResourceManager *resManager) {
 	int color_depth = bpp ? bpp : 1;
 	int initialized = 0;
 
@@ -478,7 +478,7 @@
 	if (!initialized)
 		return GFX_FATAL;
 
-	return _gfxop_init_common(state, options, misc_info);
+	return _gfxop_init_common(state, options, resManager);
 }
 
 int gfxop_set_parameter(gfx_state_t *state, char *attribute, char *value) {

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-03-11 16:13:28 UTC (rev 39330)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-03-11 16:50:12 UTC (rev 39331)
@@ -139,7 +139,7 @@
 /* Fundamental operations */
 /**************************/
 
-int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, void *misc_info);
+int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, ResourceManager *resManager);
 /* Initializes a graphics mode suggested by the graphics driver
 ** Parameters: (gfx_state_ t *) state: The state to initialize in that mode
 **             (gfx_options_t *) options: Rendering options
@@ -149,7 +149,7 @@
 */
 
 int gfxop_init(gfx_state_t *state, int xfact, int yfact, gfx_color_mode_t bpp,
-	gfx_options_t *options, void *misc_info);
+	gfx_options_t *options, ResourceManager *resManager);
 /* Initializes a custom graphics mode
 ** Parameters: (gfx_state_t *) state: The state to initialize
 **             (int x int) xfact, yfact: Horizontal and vertical scale factors

Modified: scummvm/trunk/engines/sci/gfx/resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-03-11 16:13:28 UTC (rev 39330)
+++ scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-03-11 16:50:12 UTC (rev 39331)
@@ -50,14 +50,14 @@
 	gfx_driver_t *driver;
 };
 
-gfx_resstate_t *gfxr_new_resource_manager(int version, gfx_options_t *options, gfx_driver_t *driver, void *misc_payload) {
+gfx_resstate_t *gfxr_new_resource_manager(int version, gfx_options_t *options, gfx_driver_t *driver, ResourceManager *resManager) {
 	gfx_resstate_t *state = (gfx_resstate_t *)sci_malloc(sizeof(gfx_resstate_t));
 	int ii;
 
 	state->version = version;
 	state->options = options;
 	state->driver = driver;
-	state->misc_payload = misc_payload;
+	state->resManager = resManager;
 	state->static_palette = 0;
 
 	state->tag_lock_counter = state->lock_counter = 0;
@@ -65,7 +65,7 @@
 		gfx_resource_type_t i = (gfx_resource_type_t) ii;
 		sbtree_t *tree;
 		int entries_nr;
-		int *resources = gfxr_interpreter_get_resources(state, i, version, &entries_nr, misc_payload);
+		int *resources = gfxr_interpreter_get_resources(state->resManager, i, version, &entries_nr);
 
 		if (!resources)
 			state->resource_trees[i] = NULL;
@@ -259,7 +259,7 @@
 	gfx_resource_type_t restype = GFX_RESOURCE_TYPE_PIC;
 	sbtree_t *tree = state->resource_trees[restype];
 	gfx_resource_t *res = NULL;
-	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, state->misc_payload, 0);
+	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, 0);
 	int must_post_process_pic = 0;
 	int need_unscaled = (state->driver->mode->xfact != 1 || state->driver->mode->yfact != 1);
 
@@ -276,32 +276,31 @@
 
 		if (state->options->pic0_unscaled) {
 			need_unscaled = 0;
-			pic = gfxr_interpreter_init_pic(state->version, &mode_1x1_color_index, GFXR_RES_ID(restype, nr), state->misc_payload);
+			pic = gfxr_interpreter_init_pic(state->version, &mode_1x1_color_index, GFXR_RES_ID(restype, nr));
 		} else
-			pic = gfxr_interpreter_init_pic(state->version, state->driver->mode, GFXR_RES_ID(restype, nr), state->misc_payload);
+			pic = gfxr_interpreter_init_pic(state->version, state->driver->mode, GFXR_RES_ID(restype, nr));
 
 		if (!pic) {
 			GFXERROR("Failed to allocate scaled pic!\n");
 			return NULL;
 		}
 
-		gfxr_interpreter_clear_pic(state->version, pic, state->misc_payload);
+		gfxr_interpreter_clear_pic(state->version, pic);
 
 		if (need_unscaled) {
-			unscaled_pic = gfxr_interpreter_init_pic(state->version, &mode_1x1_color_index, GFXR_RES_ID(restype, nr),
-													state->misc_payload);
+			unscaled_pic = gfxr_interpreter_init_pic(state->version, &mode_1x1_color_index, GFXR_RES_ID(restype, nr));
 			if (!unscaled_pic) {
 				GFXERROR("Failed to allocate unscaled pic!\n");
 				return NULL;
 			}
-			gfxr_interpreter_clear_pic(state->version, unscaled_pic, state->misc_payload);
+			gfxr_interpreter_clear_pic(state->version, unscaled_pic);
 		}
 #ifdef TIME_PICDRAWING
 		{
 			uint32 start_msec, end_msec;
 			start_msec = g_system->getMillis();
 #endif
-			if (gfxr_interpreter_calculate_pic(state, pic, unscaled_pic, flags, default_palette, nr, state->misc_payload)) {
+			if (gfxr_interpreter_calculate_pic(state, pic, unscaled_pic, flags, default_palette, nr)) {
 				gfxr_free_pic(state->driver, pic);
 				if (unscaled_pic)
 					gfxr_free_pic(state->driver, unscaled_pic);
@@ -399,7 +398,7 @@
 	sbtree_t *tree = state->resource_trees[restype];
 	gfxr_pic_t *pic = NULL;
 	gfx_resource_t *res = NULL;
-	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, state->misc_payload, 0);
+	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, 0);
 	int need_unscaled = !(state->options->pic0_unscaled) && (state->driver->mode->xfact != 1 || state->driver->mode->yfact != 1);
 
 	if (!tree) {
@@ -427,7 +426,7 @@
 		res->lock_sequence_nr = state->options->buffer_pics_nr;
 
 		gfxr_interpreter_calculate_pic(state, res->scaled_data.pic, need_unscaled ? res->unscaled_data.pic : NULL,
-		                               flags | DRAWPIC01_FLAG_OVERLAID_PIC, default_palette, new_nr, state->misc_payload);
+		                               flags | DRAWPIC01_FLAG_OVERLAID_PIC, default_palette, new_nr);
 	}
 
 	res->mode = MODE_INVALID; // Invalidate
@@ -449,7 +448,7 @@
 	gfx_resource_type_t restype = GFX_RESOURCE_TYPE_VIEW;
 	sbtree_t *tree = state->resource_trees[restype];
 	gfx_resource_t *res = NULL;
-	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, state->misc_payload, palette);
+	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, palette);
 	gfxr_view_t *view = NULL;
 	gfxr_loop_t *loop_data = NULL;
 	gfx_pixmap_t *cel_data = NULL;
@@ -460,7 +459,7 @@
 	res = (gfx_resource_t *) sbtree_get(tree, nr);
 
 	if (!res || res->mode != hash) {
-		view = gfxr_interpreter_get_view(state, nr, state->misc_payload, palette);
+		view = gfxr_interpreter_get_view(state, nr, palette);
 
 		if (!view)
 			return NULL;
@@ -536,7 +535,7 @@
 
 	tree = state->resource_trees[restype];
 
-	hash = gfxr_interpreter_options_hash(restype, state->version, state->options, state->misc_payload, 0);
+	hash = gfxr_interpreter_options_hash(restype, state->version, state->options, 0);
 
 	if (!tree)
 		return NULL;
@@ -544,7 +543,7 @@
 	res = (gfx_resource_t *)sbtree_get(tree, nr);
 
 	if (!res || res->mode != hash) {
-		gfx_bitmap_font_t *font = gfxr_interpreter_get_font(state, nr, state->misc_payload);
+		gfx_bitmap_font_t *font = gfxr_interpreter_get_font(state->resManager, nr);
 
 		if (!font)
 			return NULL;
@@ -576,7 +575,7 @@
 	gfx_resource_type_t restype = GFX_RESOURCE_TYPE_CURSOR;
 	sbtree_t *tree = state->resource_trees[restype];
 	gfx_resource_t *res = NULL;
-	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, state->misc_payload, 0);
+	int hash = gfxr_interpreter_options_hash(restype, state->version, state->options, 0);
 
 	if (!tree)
 		return NULL;
@@ -584,7 +583,7 @@
 	res = (gfx_resource_t *)sbtree_get(tree, nr);
 
 	if (!res || res->mode != hash) {
-		gfx_pixmap_t *cursor = gfxr_interpreter_get_cursor(state, nr, state->misc_payload);
+		gfx_pixmap_t *cursor = gfxr_interpreter_get_cursor(state->resManager, nr, state->version);
 
 		if (!cursor)
 			return NULL;

Modified: scummvm/trunk/engines/sci/gfx/resource/res_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/res_manager.cpp	2009-03-11 16:13:28 UTC (rev 39330)
+++ scummvm/trunk/engines/sci/gfx/resource/res_manager.cpp	2009-03-11 16:50:12 UTC (rev 39331)
@@ -36,7 +36,7 @@
 
 namespace Sci {
 
-int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version, gfx_options_t *options, void *internal, int palette) {
+int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version, gfx_options_t *options, int palette) {
 	switch (type) {
 	case GFX_RESOURCE_TYPE_VIEW:
 		return palette;
@@ -61,17 +61,17 @@
 	}
 }
 
-gfxr_pic_t *gfxr_interpreter_init_pic(int version, gfx_mode_t *mode, int ID, void *internal) {
+gfxr_pic_t *gfxr_interpreter_init_pic(int version, gfx_mode_t *mode, int ID) {
 	return gfxr_init_pic(mode, ID, version >= SCI_VERSION_01_VGA);
 }
 
-void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal) {
+void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic) {
 	gfxr_clear_pic0(pic, SCI_TITLEBAR_SIZE);
 }
 
 int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic,
-	int flags, int default_palette, int nr, void *internal) {
-	ResourceManager *resmgr = (ResourceManager *)state->misc_payload;
+	int flags, int default_palette, int nr) {
+	ResourceManager *resmgr = state->resManager;
 	Resource *res = resmgr->findResource(kResourceTypePic, nr, 0);
 	int need_unscaled = unscaled_pic != NULL;
 	gfxr_pic0_params_t style, basic_style;
@@ -142,8 +142,8 @@
 
 gfxr_view_t *gfxr_draw_view11(int id, byte *resource, int size);
 
-gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, void *internal, int palette) {
-	ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
+gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, int palette) {
+	ResourceManager *resmgr = state->resManager;
 	Resource *res = resmgr->findResource(kResourceTypeView, nr, 0);
 	int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
 	gfxr_view_t *result = 0;
@@ -180,33 +180,31 @@
 	return result;
 }
 
-gfx_bitmap_font_t *gfxr_interpreter_get_font(gfx_resstate_t *state, int nr, void *internal) {
-	ResourceManager *resmgr = (ResourceManager *)state->misc_payload;
-	Resource *res = resmgr->findResource(kResourceTypeFont, nr, 0);
+gfx_bitmap_font_t *gfxr_interpreter_get_font(ResourceManager* resourceManager, int nr) {
+	Resource *res = resourceManager->findResource(kResourceTypeFont, nr, 0);
+
 	if (!res || !res->data)
 		return NULL;
 
 	return gfxr_read_font(res->id, res->data, res->size);
 }
 
-gfx_pixmap_t *gfxr_interpreter_get_cursor(gfx_resstate_t *state, int nr, void *internal) {
-	ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
-	Resource *res = resmgr->findResource(kResourceTypeCursor, nr, 0);
+gfx_pixmap_t *gfxr_interpreter_get_cursor(ResourceManager* resourceManager, int nr, int version) {
+	Resource *res = resourceManager->findResource(kResourceTypeCursor, nr, 0);
 	int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, nr);
 
 	if (!res || !res->data)
 		return NULL;
 
-	if (state->version >= SCI_VERSION_1_1) {
+	if (version >= SCI_VERSION_1_1) {
 		GFXWARN("Attempt to retrieve cursor in SCI1.1 or later\n");
 		return NULL;
 	}
 
-	return gfxr_draw_cursor(resid, res->data, res->size, state->version != SCI_VERSION_0);
+	return gfxr_draw_cursor(resid, res->data, res->size, version != SCI_VERSION_0);
 }
 
-int *gfxr_interpreter_get_resources(gfx_resstate_t *state, gfx_resource_type_t type, int version, int *entries_nr, void *internal) {
-	ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
+int *gfxr_interpreter_get_resources(ResourceManager* resourceManager, gfx_resource_type_t type, int version, int *entries_nr) {
 	ResourceType restype;
 	int *resources;
 	int count = 0;
@@ -238,7 +236,7 @@
 	resources = (int *)sci_malloc(sizeof(int) * top);
 
 	for (i = 0; i < top; i++)
-		if (resmgr->testResource(restype, i))
+		if (resourceManager->testResource(restype, i))
 			resources[count++] = i;
 
 	*entries_nr = count;
@@ -246,22 +244,21 @@
 	return resources;
 }
 
-Palette *gfxr_interpreter_get_static_palette(gfx_resstate_t *state, int version, int *colors_nr, void *internal) {
+Palette *gfxr_interpreter_get_static_palette(ResourceManager *resourceManager, int version, int *colors_nr) {
 	if (version >= SCI_VERSION_01_VGA)
-		return gfxr_interpreter_get_palette(state, version, colors_nr, internal, 999);
+		return gfxr_interpreter_get_palette(resourceManager, version, colors_nr, 999);
 
 	*colors_nr = GFX_SCI0_PIC_COLORS_NR;
 	return gfx_sci0_pic_colors->getref();
 }
 
-Palette *gfxr_interpreter_get_palette(gfx_resstate_t *state, int version, int *colors_nr, void *internal, int nr) {
-	ResourceManager *resmgr = (ResourceManager *)state->misc_payload;
+Palette *gfxr_interpreter_get_palette(ResourceManager *resourceManager, int version, int *colors_nr, int nr) {
 	Resource *res;
 
 	if (version < SCI_VERSION_01_VGA)
 		return NULL;
 
-	res = resmgr->findResource(kResourceTypePalette, nr, 0);
+	res = resourceManager->findResource(kResourceTypePalette, nr, 0);
 	if (!res || !res->data)
 		return NULL;
 
@@ -282,7 +279,7 @@
 	}
 }
 
-int gfxr_interpreter_needs_multicolored_pointers(int version, void *internal) {
+int gfxr_interpreter_needs_multicolored_pointers(int version) {
 	return (version > SCI_VERSION_1);
 }
 


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