aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-03-11 17:09:30 +0000
committerFilippos Karapetis2009-03-11 17:09:30 +0000
commit3e7fe64a2248d95bccc937aef8aced0a80e984c7 (patch)
tree65828d276c33fa439d02416494c7289d4a1d76b0
parentaacb916e5ebe8ae3fee955e54e5b27ad7fc1b04b (diff)
downloadscummvm-rg350-3e7fe64a2248d95bccc937aef8aced0a80e984c7.tar.gz
scummvm-rg350-3e7fe64a2248d95bccc937aef8aced0a80e984c7.tar.bz2
scummvm-rg350-3e7fe64a2248d95bccc937aef8aced0a80e984c7.zip
Untangled the parameters in gfxr_interpreter_get_view() as well. Updated comments
svn-id: r39332
-rw-r--r--engines/sci/gfx/gfx_resmgr.h19
-rw-r--r--engines/sci/gfx/resmgr.cpp2
-rw-r--r--engines/sci/gfx/resource/res_manager.cpp17
3 files changed, 21 insertions, 17 deletions
diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h
index edc86b0a63..0be816dd26 100644
--- a/engines/sci/gfx/gfx_resmgr.h
+++ b/engines/sci/gfx/gfx_resmgr.h
@@ -241,7 +241,7 @@ int *gfxr_interpreter_get_resources(ResourceManager *resourceManager, gfx_resour
/* 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) version: The interpreter version
** (int *) entries_nr: The variable the number of entries will eventually be stored in
** Returns : (int *) An array of resource numbers
** Unsupported/non-existing resources should return NULL here; this is equivalent to supported
@@ -279,23 +279,26 @@ int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic
** 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, int palette);
+gfxr_view_t *gfxr_interpreter_get_view(ResourceManager* resourceManager, int nr, int palette, Palette* staticPalette, int version);
/* Instructs the interpreter-specific code to calculate a view
-** Parameters: (gfx_resstate_t *) state: The resource manager state
+** Parameters: (ResourceManager *) resourceManager: The resource manager
** (int) nr: The view resource number
+** (int) palette: The palette number to use
+** (Palette*) staticPalette: The static palette to use in VGA games
+** (int) version: The interpreter version
** Returns : (gfx_view_t *) The appropriate view, or NULL on error
*/
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
+** Parameters: (ResourceManager *) resourceManager: The resource manager
** (int) nr: The font resource number
** Returns : (gfx_font_t *) The newly calculated font, or NULL on error
*/
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
+** Parameters: (ResourceManager *) state: The resource manager
** (int nr): The cursor resource number
** (int version): The SCI version used
** Returns : (gfx_pixmap_t *) The cursor pixmap, or NULL on error
@@ -303,7 +306,8 @@ gfx_pixmap_t *gfxr_interpreter_get_cursor(ResourceManager *resourceManager, int
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
+** Parameters: (ResourceManager *) state: The resource manager
+** (int) version: Interpreter version to use
** (int *) colors_nr: Number of colors to use
** Returns : (gfx_pixmap_color_t *) *colors_nr static color entries
** if a static palette must be used, NULL otherwise
@@ -311,7 +315,8 @@ Palette *gfxr_interpreter_get_static_palette(ResourceManager *resourceManager, i
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
+** Parameters: (ResourceManager *) state: The resource manager
+** (int) version: Interpreter version to use
** (int *) colors_nr: Number of colors to use
** (int) nr: The palette to read
** Returns : (gfx_pixmap_color_t *) *colors_nr static color entries
diff --git a/engines/sci/gfx/resmgr.cpp b/engines/sci/gfx/resmgr.cpp
index 60c89cb0b5..6ddd89bb18 100644
--- a/engines/sci/gfx/resmgr.cpp
+++ b/engines/sci/gfx/resmgr.cpp
@@ -459,7 +459,7 @@ gfxr_view_t *gfxr_get_view(gfx_resstate_t *state, int nr, int *loop, int *cel, i
res = (gfx_resource_t *) sbtree_get(tree, nr);
if (!res || res->mode != hash) {
- view = gfxr_interpreter_get_view(state, nr, palette);
+ view = gfxr_interpreter_get_view(state->resManager, nr, palette, state->static_palette, state->version);
if (!view)
return NULL;
diff --git a/engines/sci/gfx/resource/res_manager.cpp b/engines/sci/gfx/resource/res_manager.cpp
index 1c8c6de1bc..ae7fb2f785 100644
--- a/engines/sci/gfx/resource/res_manager.cpp
+++ b/engines/sci/gfx/resource/res_manager.cpp
@@ -142,18 +142,17 @@ void gfxr_palettize_view(gfxr_view_t *view, Palette *source) {
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, int palette) {
- ResourceManager *resmgr = state->resManager;
- Resource *res = resmgr->findResource(kResourceTypeView, nr, 0);
+gfxr_view_t *gfxr_interpreter_get_view(ResourceManager* resourceManager, int nr, int palette, Palette* staticPalette, int version) {
+ Resource *res = resourceManager->findResource(kResourceTypeView, nr, 0);
int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
gfxr_view_t *result = 0;
if (!res || !res->data)
return NULL;
- if (state->version < SCI_VERSION_01) palette = -1;
+ if (version < SCI_VERSION_01) palette = -1;
- switch (state->version) {
+ switch (version) {
case SCI_VERSION_0:
case SCI_VERSION_01:
result = gfxr_draw_view0(resid, res->data, res->size, palette);
@@ -162,7 +161,7 @@ gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, int palett
case SCI_VERSION_01_VGA_ODD:
case SCI_VERSION_1_EARLY:
case SCI_VERSION_1_LATE:
- result = gfxr_draw_view1(resid, res->data, res->size, state->static_palette);
+ result = gfxr_draw_view1(resid, res->data, res->size, staticPalette);
break;
case SCI_VERSION_1_1:
case SCI_VERSION_32:
@@ -170,12 +169,12 @@ gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, int palett
break;
}
- if (state->version >= SCI_VERSION_01_VGA) {
+ if (version >= SCI_VERSION_01_VGA) {
if (!result->palette) {
- result->palette = new Palette(state->static_palette->size());
+ result->palette = new Palette(staticPalette->size());
result->palette->name = "interpreter_get_view";
}
- gfxr_palettize_view(result, state->static_palette);
+ gfxr_palettize_view(result, staticPalette);
}
return result;
}