aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/message.cpp2
-rw-r--r--engines/sci/engine/message.h4
-rw-r--r--engines/sci/gfx/resmgr.cpp3
-rw-r--r--engines/sci/gfx/resource/sci_resmgr.cpp12
-rw-r--r--engines/sci/include/engine.h2
-rw-r--r--engines/sci/include/gfx_resmgr.h4
-rw-r--r--engines/sci/include/sciresource.h48
-rw-r--r--engines/sci/include/script.h2
-rw-r--r--engines/sci/include/sfx_engine.h4
-rw-r--r--engines/sci/include/sfx_player.h4
-rw-r--r--engines/sci/include/vocabulary.h26
-rw-r--r--engines/sci/sci.cpp2
-rw-r--r--engines/sci/scicore/resource.cpp40
-rw-r--r--engines/sci/scicore/resource_map.cpp6
-rw-r--r--engines/sci/scicore/script.cpp2
-rw-r--r--engines/sci/scicore/vocab.cpp8
-rw-r--r--engines/sci/scicore/vocab_debug.cpp14
-rw-r--r--engines/sci/sfx/core.cpp2
-rw-r--r--engines/sci/sfx/player/polled.cpp2
-rw-r--r--engines/sci/sfx/player/realtime.cpp4
20 files changed, 99 insertions, 92 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index dd3a7c944d..c46ef81685 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -199,7 +199,7 @@ static message_handler_t fixed_handler = {3411,
11
};
-void message_state_initialize(resource_mgr_t *resmgr, message_state_t *state) {
+void message_state_initialize(ResourceManager *resmgr, message_state_t *state) {
// resource_t *tester = scir_find_resource(resmgr, sci_message, 0, 0);
//int version;
diff --git a/engines/sci/engine/message.h b/engines/sci/engine/message.h
index 56268cca9d..2b7b83655a 100644
--- a/engines/sci/engine/message.h
+++ b/engines/sci/engine/message.h
@@ -58,7 +58,7 @@ typedef struct {
typedef struct {
int initialized;
message_handler_t *handler;
- resource_mgr_t *resmgr;
+ ResourceManager *resmgr;
resource_t *current_res;
int module;
int record_count;
@@ -72,6 +72,6 @@ int message_get_talker(message_state_t *state);
int message_get_length(message_state_t *state);
int message_get_text(message_state_t *state, char *buffer, int length);
int message_state_load_res(message_state_t *state, int module);
-void message_state_initialize(resource_mgr_t *resmgr, message_state_t *state);
+void message_state_initialize(ResourceManager *resmgr, message_state_t *state);
diff --git a/engines/sci/gfx/resmgr.cpp b/engines/sci/gfx/resmgr.cpp
index 861152ded9..1a4450baeb 100644
--- a/engines/sci/gfx/resmgr.cpp
+++ b/engines/sci/gfx/resmgr.cpp
@@ -25,6 +25,9 @@
/* Resource manager core part */
+// FIXME/TODO: The name "(Graphics) resource manager", and the associated
+// filenames, are misleading. This should be renamed to "Graphics manager"
+// or something like that.
#include "sci/include/gfx_resource.h"
#include "sci/include/gfx_tools.h"
diff --git a/engines/sci/gfx/resource/sci_resmgr.cpp b/engines/sci/gfx/resource/sci_resmgr.cpp
index ef4d9460a6..7f7ba30acc 100644
--- a/engines/sci/gfx/resource/sci_resmgr.cpp
+++ b/engines/sci/gfx/resource/sci_resmgr.cpp
@@ -81,7 +81,7 @@ gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal) {
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) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
resource_t *res = scir_find_resource(resmgr, sci_pic, nr, 0);
int need_unscaled = unscaled_pic != NULL;
gfxr_pic0_params_t style, basic_style;
@@ -165,7 +165,7 @@ 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) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
resource_t *res = scir_find_resource(resmgr, sci_view, nr, 0);
int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
gfxr_view_t *result = 0;
@@ -206,7 +206,7 @@ gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, void *internal, int pal
gfx_bitmap_font_t *
gfxr_interpreter_get_font(gfx_resstate_t *state, int nr, void *internal) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
resource_t *res = scir_find_resource(resmgr, sci_font, nr, 0);
if (!res || !res->data)
return NULL;
@@ -217,7 +217,7 @@ gfxr_interpreter_get_font(gfx_resstate_t *state, int nr, void *internal) {
gfx_pixmap_t *
gfxr_interpreter_get_cursor(gfx_resstate_t *state, int nr, void *internal) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
resource_t *res = scir_find_resource(resmgr, sci_cursor, nr, 0);
int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, nr);
@@ -239,7 +239,7 @@ gfxr_interpreter_get_cursor(gfx_resstate_t *state, int nr, void *internal) {
int *
gfxr_interpreter_get_resources(gfx_resstate_t *state, gfx_resource_type_t type,
int version, int *entries_nr, void *internal) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
int restype;
int *resources;
int count = 0;
@@ -292,7 +292,7 @@ gfxr_interpreter_get_static_palette(gfx_resstate_t *state, int version, int *col
gfx_pixmap_color_t *
gfxr_interpreter_get_palette(gfx_resstate_t *state, int version, int *colors_nr,
void *internal, int nr) {
- resource_mgr_t *resmgr = (resource_mgr_t *) state->misc_payload;
+ ResourceManager *resmgr = (ResourceManager *) state->misc_payload;
resource_t *res;
if (version < SCI_VERSION_01_VGA)
diff --git a/engines/sci/include/engine.h b/engines/sci/include/engine.h
index c70d3c3a96..5b6330587f 100644
--- a/engines/sci/include/engine.h
+++ b/engines/sci/include/engine.h
@@ -88,7 +88,7 @@ typedef struct _state {
char *resource_dir; /* Directory the resource files are kept in */
char *work_dir; /* Directory the game metadata should be written to */
- resource_mgr_t *resmgr; /* The resource manager */
+ ResourceManager *resmgr; /* The resource manager */
char *game_name; /* Designation of the primary object (which inherits from Game) */
char *game_version;
diff --git a/engines/sci/include/gfx_resmgr.h b/engines/sci/include/gfx_resmgr.h
index 508f6601c8..22a944f233 100644
--- a/engines/sci/include/gfx_resmgr.h
+++ b/engines/sci/include/gfx_resmgr.h
@@ -26,6 +26,10 @@
#ifndef _GFX_RESMGR_H_
#define _GFX_RESMGR_H_
+// FIXME/TODO: The name "(Graphics) resource manager", and the associated
+// filenames, are misleading. This should be renamed to "Graphics manager"
+// or something like that.
+
#include "sci/include/gfx_resource.h"
#include "sci/include/sbtree.h"
diff --git a/engines/sci/include/sciresource.h b/engines/sci/include/sciresource.h
index 497f2eddd9..79f7467920 100644
--- a/engines/sci/include/sciresource.h
+++ b/engines/sci/include/sciresource.h
@@ -190,13 +190,13 @@ typedef struct {
/* LRU queue: lru_first points to the most recent entry */
unsigned char allow_patches;
-} resource_mgr_t;
+} ResourceManager;
/**** FUNCTION DECLARATIONS ****/
/**--- New Resource manager ---**/
-resource_mgr_t *
+ResourceManager *
scir_new_resource_manager(char *dir, int version, char allow_patches, int max_memory);
/* Creates a new FreeSCI resource manager
** Parameters: (char *) dir: Path to the resource and patch files (not modified or freed
@@ -206,16 +206,16 @@ scir_new_resource_manager(char *dir, int version, char allow_patches, int max_me
** (char ) allow_patches: Set to 1 if external patches (those look like
** "view.101" or "script.093") should be applied
** (int) max_memory: Maximum number of bytes to allow allocated for resources
-** Returns : (resource_mgr_t *) A newly allocated resource manager
+** Returns : (ResourceManager *) A newly allocated resource manager
** max_memory will not be interpreted as a hard limit, only as a restriction for resources
** which are not explicitly locked. However, a warning will be issued whenever this limit
** is exceeded.
*/
resource_source_t *
-scir_add_patch_dir(resource_mgr_t *mgr, int type, char *path);
+scir_add_patch_dir(ResourceManager *mgr, int type, char *path);
/* Add a path to the resource manager's list of sources.
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (int) dirtype: The type of patch directory to add,
** either RESSOURCE_TYPE_DIRECTORY or RESSOURCE_TYPE_AUDIO_DIRECTORY
** (char *) path: The path to add
@@ -223,13 +223,13 @@ scir_add_patch_dir(resource_mgr_t *mgr, int type, char *path);
*/
resource_source_t *
-scir_get_volume(resource_mgr_t *mgr, resource_source_t *map, int volume_nr);
+scir_get_volume(ResourceManager *mgr, resource_source_t *map, int volume_nr);
resource_source_t *
-scir_add_volume(resource_mgr_t *mgr, resource_source_t *map, char *filename,
+scir_add_volume(ResourceManager *mgr, resource_source_t *map, char *filename,
int number, int extended_addressing);
/* Add a volume to the resource manager's list of sources.
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (resource_source_t *) map: The map associated with this volume
** (char *) filename: The name of the volume to add
** (int) extended_addressing: 1 if this volume uses extended addressing,
@@ -238,34 +238,34 @@ scir_add_volume(resource_mgr_t *mgr, resource_source_t *map, char *filename,
*/
resource_source_t *
-scir_add_external_map(resource_mgr_t *mgr, char *file_name);
+scir_add_external_map(ResourceManager *mgr, char *file_name);
/* Add an external (i.e. separate file) map resource to the resource manager's list of sources.
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (char *) file_name: The name of the volume to add
** Returns: A pointer to the added source structure, or NULL if an error occurred.
*/
resource_source_t *
-scir_add_internal_map(resource_mgr_t *mgr, resource_t *map);
+scir_add_internal_map(ResourceManager *mgr, resource_t *map);
/* Add an internal (i.e. a resource) map resource to the resource manager's list of sources.
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (char *) file_name: The name of the volume to add
** Returns: A pointer to the added source structure, or NULL if an error occurred.
*/
int
-scir_scan_new_sources(resource_mgr_t *mgr, int *detected_version);
+scir_scan_new_sources(ResourceManager *mgr, int *detected_version);
/* Scans newly registered resource sources for resources, earliest addition first.
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (int *) detected_version: Pointer to the detected version number,
** used during startup. May be NULL.
** Returns: One of SCI_ERROR_*.
*/
resource_t *
-scir_find_resource(resource_mgr_t *mgr, int type, int number, int lock);
+scir_find_resource(ResourceManager *mgr, int type, int number, int lock);
/* Looks up a resource's data
-** Parameters: (resource_mgr_t *) mgr: The resource manager to look up in
+** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (int) type: The resource type to look for
** (int) number: The resource number to search
** (int) lock: non-zero iff the resource should be locked
@@ -275,9 +275,9 @@ scir_find_resource(resource_mgr_t *mgr, int type, int number, int lock);
*/
void
-scir_unlock_resource(resource_mgr_t *mgr, resource_t *res, int restype, int resnum);
+scir_unlock_resource(ResourceManager *mgr, resource_t *res, int restype, int resnum);
/* Unlocks a previously locked resource
-** Parameters: (resource_mgr_t *) mgr: The manager the resource should be freed from
+** Parameters: (ResourceManager *) mgr: The manager the resource should be freed from
** (resource_t *) res: The resource to free
** (int) type: Type of the resource to check (for error checking)
** (int) number: Number of the resource to check (ditto)
@@ -285,9 +285,9 @@ scir_unlock_resource(resource_mgr_t *mgr, resource_t *res, int restype, int resn
*/
resource_t *
-scir_test_resource(resource_mgr_t *mgr, int type, int number);
+scir_test_resource(ResourceManager *mgr, int type, int number);
/* Tests whether a resource exists
-** Parameters: (resource_mgr_t *) mgr: The resource manager to search in
+** Parameters: (ResourceManager *) mgr: The resource manager to search in
** (int) type: Type of the resource to check
** (int) number: Number of the resource to check
** Returns : (resource_t *) non-NULL if the resource exists, NULL otherwise
@@ -299,16 +299,16 @@ scir_test_resource(resource_mgr_t *mgr, int type, int number);
*/
void
-scir_free_resource_manager(resource_mgr_t *mgr);
+scir_free_resource_manager(ResourceManager *mgr);
/* Frees a resource manager and all memory handled by it
-** Parameters: (resource_mgr_t *) mgr: The Manager to free
+** Parameters: (ResourceManager *) mgr: The Manager to free
** Returns : (void)
*/
/**--- Resource map decoding functions ---*/
int
-sci0_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_t **resources, int *resource_nr_p, int *sci_version);
+sci0_read_resource_map(ResourceManager *mgr, resource_source_t *map, resource_t **resources, int *resource_nr_p, int *sci_version);
/* Reads the SCI0 resource.map file from a local directory
** Parameters: (char *) path: (unused)
** (resource_t **) resources: Pointer to a pointer
@@ -322,7 +322,7 @@ sci0_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_t *
*/
int
-sci1_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_source_t *vol,
+sci1_read_resource_map(ResourceManager *mgr, resource_source_t *map, resource_source_t *vol,
resource_t **resource_p, int *resource_nr_p, int *sci_version);
/* Reads the SCI1 resource.map file from a local directory
** Parameters: (char *) path: (unused)
diff --git a/engines/sci/include/script.h b/engines/sci/include/script.h
index d4f52f23ca..f1886a89e3 100644
--- a/engines/sci/include/script.h
+++ b/engines/sci/include/script.h
@@ -53,7 +53,7 @@ typedef enum {
sci_obj_localvars
} script_object_types;
-void script_dissect(resource_mgr_t *resmgr, int res_no, char **snames, int snames_nr);
+void script_dissect(ResourceManager *resmgr, int res_no, char **snames, int snames_nr);
/* Opcode formats as used by script.c */
typedef enum {
diff --git a/engines/sci/include/sfx_engine.h b/engines/sci/include/sfx_engine.h
index a86fad4392..47d4ffa058 100644
--- a/engines/sci/include/sfx_engine.h
+++ b/engines/sci/include/sfx_engine.h
@@ -60,9 +60,9 @@ typedef struct {
/***********/
void
-sfx_init(sfx_state_t *self, resource_mgr_t *resmgr, int flags);
+sfx_init(sfx_state_t *self, ResourceManager *resmgr, int flags);
/* Initializes the sound engine
-** Parameters: (resource_mgr_t *) resmgr: Resource manager for initialization
+** Parameters: (ResourceManager *) resmgr: Resource manager for initialization
** (int) flags: SFX_STATE_FLAG_*
*/
diff --git a/engines/sci/include/sfx_player.h b/engines/sci/include/sfx_player.h
index 2ebe9e2214..526d8b46d6 100644
--- a/engines/sci/include/sfx_player.h
+++ b/engines/sci/include/sfx_player.h
@@ -47,9 +47,9 @@ typedef struct {
*/
int
- (*init)(resource_mgr_t *resmgr, int expected_latency);
+ (*init)(ResourceManager *resmgr, int expected_latency);
/* Initializes the player
- ** Parameters: (resource_mgr_t *) resmgr: A resource manager for driver initialization
+ ** Parameters: (ResourceManager *) resmgr: A resource manager for driver initialization
** (int) expected_latency: Expected delay in between calls to 'maintenance'
** (in microseconds)
** Returns : (int) SFX_OK on success, SFX_ERROR on failure
diff --git a/engines/sci/include/vocabulary.h b/engines/sci/include/vocabulary.h
index 1ae68122f5..33bc32409a 100644
--- a/engines/sci/include/vocabulary.h
+++ b/engines/sci/include/vocabulary.h
@@ -189,14 +189,14 @@ typedef struct {
/*FIXME: These need freeing functions...*/
-int* vocabulary_get_classes(resource_mgr_t *resmgr, int *count);
+int* vocabulary_get_classes(ResourceManager *resmgr, int *count);
-int vocabulary_get_class_count(resource_mgr_t *resmgr);
+int vocabulary_get_class_count(ResourceManager *resmgr);
/**
* Returns a null terminated array of selector names.
*/
-char** vocabulary_get_snames(resource_mgr_t *resmgr, int *pcount, sci_version_t version);
+char** vocabulary_get_snames(ResourceManager *resmgr, int *pcount, sci_version_t version);
/**
* Frees the aforementioned array
@@ -210,7 +210,7 @@ int vocabulary_lookup_sname(char **snames_list, char *sname);
/**
* Returns a null terminated array of opcodes.
*/
-opcode* vocabulary_get_opcodes(resource_mgr_t *resmgr);
+opcode* vocabulary_get_opcodes(ResourceManager *resmgr);
void
vocabulary_free_opcodes(opcode *opcodes);
@@ -227,15 +227,15 @@ vocabulary_free_opcodes(opcode *opcodes);
* The returned array has the same format regardless of the format of the
* name table of the resource (the format changed between version 0 and 1).
*/
-char** vocabulary_get_knames(resource_mgr_t *resmgr, int* count);
+char** vocabulary_get_knames(ResourceManager *resmgr, int* count);
void vocabulary_free_knames(char** names);
word_t **
-vocab_get_words(resource_mgr_t *resmgr, int *word_counter);
+vocab_get_words(ResourceManager *resmgr, int *word_counter);
/* Gets all words from the main vocabulary
-** Parameters: (resource_mgr_t *) resmr: The resource manager to read from
+** Parameters: (ResourceManager *) resmr: The resource manager to read from
** (int *) word_counter: The int which the number of words is stored in
** Returns : (word_t **): A list of all words, dynamically allocated
*/
@@ -251,27 +251,27 @@ vocab_free_words(word_t **words, int words_nr);
suffix_t **
-vocab_get_suffices(resource_mgr_t *resmgr, int *suffices_nr);
+vocab_get_suffices(ResourceManager *resmgr, int *suffices_nr);
/* Gets all suffixes from the suffix vocabulary
-** Parameters: (resource_mgr_t*) resmgr: Resource manager the resources are
+** Parameters: (ResourceManager*) resmgr: Resource manager the resources are
** read from
** (int *) suffices_nr: The variable to store the number of suffices in
** Returns : (suffix_t **): A list of suffixes
*/
void
-vocab_free_suffices(resource_mgr_t *resmgr, suffix_t **suffices, int suffices_nr);
+vocab_free_suffices(ResourceManager *resmgr, suffix_t **suffices, int suffices_nr);
/* Frees suffices_nr suffices
-** Parameters: (resource_mgr_t *) resmgr: The resource manager to free from
+** Parameters: (ResourceManager *) resmgr: The resource manager to free from
** (suffix_t **) suffices: The suffixes to free
** (int) suffices_nr: Number of entrie sin suffices
** Returns : (void)
*/
parse_tree_branch_t *
-vocab_get_branches(resource_mgr_t *resmgr, int *branches_nr);
+vocab_get_branches(ResourceManager *resmgr, int *branches_nr);
/* Retrieves all grammar rules from the resource data
-** Parameters: (resource_mgr_t*) resmgr: Resource manager the rules are
+** Parameters: (ResourceManager*) resmgr: Resource manager the rules are
** read from
** (int *) branches_nr: Pointer to the variable which the number of entries is to be
** stored in
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index b4336e9b4f..22c7768bdb 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -182,7 +182,7 @@ Common::Error SciEngine::go() {
} */
// FIXME/TODO: Move some of the stuff below to init()
- resource_mgr_t *resmgr;
+ ResourceManager *resmgr;
init_console(); /* So we can get any output */
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index 21af0711d7..69576159c4 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -160,7 +160,7 @@ _scir_find_resource_unsorted(resource_t *res, int res_nr, int type, int number)
/*-----------------------------------*/
resource_source_t *
-scir_add_external_map(resource_mgr_t *mgr, char *file_name) {
+scir_add_external_map(ResourceManager *mgr, char *file_name) {
resource_source_t *newsrc = (resource_source_t *)
malloc(sizeof(resource_source_t));
@@ -177,7 +177,7 @@ scir_add_external_map(resource_mgr_t *mgr, char *file_name) {
}
resource_source_t *
-scir_add_volume(resource_mgr_t *mgr, resource_source_t *map, char *filename,
+scir_add_volume(ResourceManager *mgr, resource_source_t *map, char *filename,
int number, int extended_addressing) {
resource_source_t *newsrc = (resource_source_t *)
malloc(sizeof(resource_source_t));
@@ -195,7 +195,7 @@ scir_add_volume(resource_mgr_t *mgr, resource_source_t *map, char *filename,
}
resource_source_t *
-scir_add_patch_dir(resource_mgr_t *mgr, int type, char *dirname) {
+scir_add_patch_dir(ResourceManager *mgr, int type, char *dirname) {
resource_source_t *newsrc = (resource_source_t *)
malloc(sizeof(resource_source_t));
@@ -210,7 +210,7 @@ scir_add_patch_dir(resource_mgr_t *mgr, int type, char *dirname) {
}
resource_source_t *
-scir_get_volume(resource_mgr_t *mgr, resource_source_t *map, int volume_nr) {
+scir_get_volume(ResourceManager *mgr, resource_source_t *map, int volume_nr) {
resource_source_t *seeker = mgr->sources;
while (seeker) {
@@ -229,7 +229,7 @@ scir_get_volume(resource_mgr_t *mgr, resource_source_t *map, int volume_nr) {
/*------------------------------------------------*/
static void
-_scir_init_trivial(resource_mgr_t *mgr) {
+_scir_init_trivial(ResourceManager *mgr) {
mgr->resources_nr = 0;
mgr->resources = (resource_t*)sci_malloc(1);
}
@@ -252,7 +252,7 @@ _scir_load_from_patch_file(int fh, resource_t *res, char *filename) {
}
static void
-_scir_load_resource(resource_mgr_t *mgr, resource_t *res, int protect) {
+_scir_load_resource(ResourceManager *mgr, resource_t *res, int protect) {
char filename[MAXPATHLEN];
int fh;
resource_t backup;
@@ -334,7 +334,7 @@ _scir_load_resource(resource_mgr_t *mgr, resource_t *res, int protect) {
}
resource_t *
-scir_test_resource(resource_mgr_t *mgr, int type, int number) {
+scir_test_resource(ResourceManager *mgr, int type, int number) {
resource_t binseeker;
binseeker.type = type;
binseeker.number = number;
@@ -346,7 +346,7 @@ scir_test_resource(resource_mgr_t *mgr, int type, int number) {
int sci0_get_compression_method(int resh);
int
-sci_test_view_type(resource_mgr_t *mgr) {
+sci_test_view_type(ResourceManager *mgr) {
int fh;
char filename[MAXPATHLEN];
int compression;
@@ -425,7 +425,7 @@ sci_test_view_type(resource_mgr_t *mgr) {
int
-scir_add_appropriate_sources(resource_mgr_t *mgr,
+scir_add_appropriate_sources(ResourceManager *mgr,
int allow_patches,
char *dir) {
const char *trailing_slash = "";
@@ -469,7 +469,7 @@ scir_add_appropriate_sources(resource_mgr_t *mgr,
}
static int
-_scir_scan_new_sources(resource_mgr_t *mgr, int *detected_version, resource_source_t *source) {
+_scir_scan_new_sources(ResourceManager *mgr, int *detected_version, resource_source_t *source) {
int preset_version = mgr->sci_version;
int resource_error = 0;
int dummy = mgr->sci_version;
@@ -563,7 +563,7 @@ _scir_scan_new_sources(resource_mgr_t *mgr, int *detected_version, resource_sour
}
int
-scir_scan_new_sources(resource_mgr_t *mgr, int *detected_version) {
+scir_scan_new_sources(ResourceManager *mgr, int *detected_version) {
_scir_scan_new_sources(mgr, detected_version, mgr->sources);
return 0;
}
@@ -576,11 +576,11 @@ _scir_free_resource_sources(resource_source_t *rss) {
}
}
-resource_mgr_t *
+ResourceManager *
scir_new_resource_manager(char *dir, int version,
char allow_patches, int max_memory) {
int resource_error = 0;
- resource_mgr_t *mgr = (resource_mgr_t*)sci_malloc(sizeof(resource_mgr_t));
+ ResourceManager *mgr = (ResourceManager*)sci_malloc(sizeof(ResourceManager));
char *caller_cwd = sci_getcwd();
int resmap_version = version;
@@ -735,7 +735,7 @@ _scir_free_resources(resource_t *resources, int resources_nr) {
}
void
-scir_free_resource_manager(resource_mgr_t *mgr) {
+scir_free_resource_manager(ResourceManager *mgr) {
_scir_free_resources(mgr->resources, mgr->resources_nr);
_scir_free_resource_sources(mgr->sources);
mgr->resources = NULL;
@@ -753,7 +753,7 @@ _scir_unalloc(resource_t *res) {
static void
-_scir_remove_from_lru(resource_mgr_t *mgr, resource_t *res) {
+_scir_remove_from_lru(ResourceManager *mgr, resource_t *res) {
if (res->status != SCI_STATUS_ENQUEUED) {
sciprintf("Resmgr: Oops: trying to remove resource that isn't"
" enqueued\n");
@@ -775,7 +775,7 @@ _scir_remove_from_lru(resource_mgr_t *mgr, resource_t *res) {
}
static void
-_scir_add_to_lru(resource_mgr_t *mgr, resource_t *res) {
+_scir_add_to_lru(ResourceManager *mgr, resource_t *res) {
if (res->status != SCI_STATUS_ALLOCATED) {
sciprintf("Resmgr: Oops: trying to enqueue resource with state"
" %d\n", res->status);
@@ -802,7 +802,7 @@ _scir_add_to_lru(resource_mgr_t *mgr, resource_t *res) {
}
static void
-_scir_print_lru_list(resource_mgr_t *mgr) {
+_scir_print_lru_list(ResourceManager *mgr) {
int mem = 0;
int entries = 0;
resource_t *res = mgr->lru_first;
@@ -821,7 +821,7 @@ _scir_print_lru_list(resource_mgr_t *mgr) {
}
static void
-_scir_free_old_resources(resource_mgr_t *mgr, int last_invulnerable) {
+_scir_free_old_resources(ResourceManager *mgr, int last_invulnerable) {
while (mgr->max_memory < mgr->memory_lru
&& (!last_invulnerable || mgr->lru_first != mgr->lru_last)) {
resource_t *goner = mgr->lru_last;
@@ -843,7 +843,7 @@ _scir_free_old_resources(resource_mgr_t *mgr, int last_invulnerable) {
}
resource_t *
-scir_find_resource(resource_mgr_t *mgr, int type, int number, int lock) {
+scir_find_resource(ResourceManager *mgr, int type, int number, int lock) {
resource_t *retval;
if (number >= sci_max_resource_nr[mgr->sci_version]) {
@@ -893,7 +893,7 @@ scir_find_resource(resource_mgr_t *mgr, int type, int number, int lock) {
}
void
-scir_unlock_resource(resource_mgr_t *mgr, resource_t *res, int resnum, int restype) {
+scir_unlock_resource(ResourceManager *mgr, resource_t *res, int resnum, int restype) {
if (!res) {
if (restype >= ARRAYSIZE(sci_resource_types))
sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d!\n", restype, resnum);
diff --git a/engines/sci/scicore/resource_map.cpp b/engines/sci/scicore/resource_map.cpp
index 7e033c05b2..3af9b286f5 100644
--- a/engines/sci/scicore/resource_map.cpp
+++ b/engines/sci/scicore/resource_map.cpp
@@ -73,7 +73,7 @@ detect_odd_sci01(int fh) {
}
static int
-sci_res_read_entry(resource_mgr_t *mgr, resource_source_t *map,
+sci_res_read_entry(ResourceManager *mgr, resource_source_t *map,
byte *buf, resource_t *res, int sci_version) {
res->id = buf[0] | (buf[1] << 8);
res->type = SCI0_RESID_GET_TYPE(buf);
@@ -149,7 +149,7 @@ int sci1_parse_header(int fd, int *types, int *lastrt) {
int
-sci0_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_t **resource_p, int *resource_nr_p, int *sci_version) {
+sci0_read_resource_map(ResourceManager *mgr, resource_source_t *map, resource_t **resource_p, int *resource_nr_p, int *sci_version) {
int fsize;
int fd;
resource_t *resources;
@@ -334,7 +334,7 @@ static int sci10_or_11(int *types) {
}
int
-sci1_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_source_t *vol,
+sci1_read_resource_map(ResourceManager *mgr, resource_source_t *map, resource_source_t *vol,
resource_t **resource_p, int *resource_nr_p, int *sci_version) {
int fsize;
int fd;
diff --git a/engines/sci/scicore/script.cpp b/engines/sci/scicore/script.cpp
index d6d1ba8422..b8300a2696 100644
--- a/engines/sci/scicore/script.cpp
+++ b/engines/sci/scicore/script.cpp
@@ -335,7 +335,7 @@ script_dump_class(char *data, int seeker, int objsize, char **snames, int snames
void
-script_dissect(resource_mgr_t *resmgr, int res_no, char **snames, int snames_nr) {
+script_dissect(ResourceManager *resmgr, int res_no, char **snames, int snames_nr) {
int objectctr[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned int _seeker = 0;
resource_t *script = scir_find_resource(resmgr, sci_script, res_no, 0);
diff --git a/engines/sci/scicore/vocab.cpp b/engines/sci/scicore/vocab.cpp
index cff7f336de..904c0d28c1 100644
--- a/engines/sci/scicore/vocab.cpp
+++ b/engines/sci/scicore/vocab.cpp
@@ -66,7 +66,7 @@ _vocab_cmp_words(const void *word1, const void *word2) {
word_t **
-vocab_get_words(resource_mgr_t *resmgr, int *word_counter) {
+vocab_get_words(ResourceManager *resmgr, int *word_counter) {
int counter = 0;
unsigned int seeker;
word_t **words;
@@ -190,7 +190,7 @@ inverse_16(unsigned int foo) {
}
suffix_t **
-vocab_get_suffices(resource_mgr_t *resmgr, int *suffices_nr) {
+vocab_get_suffices(ResourceManager *resmgr, int *suffices_nr) {
int counter = 0;
suffix_t **suffices;
resource_t *resource = scir_find_resource(resmgr, sci_vocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 1);
@@ -241,7 +241,7 @@ vocab_get_suffices(resource_mgr_t *resmgr, int *suffices_nr) {
void
-vocab_free_suffices(resource_mgr_t *resmgr, suffix_t **suffices, int suffices_nr) {
+vocab_free_suffices(ResourceManager *resmgr, suffix_t **suffices, int suffices_nr) {
int i;
scir_unlock_resource(resmgr, scir_find_resource(resmgr, sci_vocab, VOCAB_RESOURCE_SUFFIX_VOCAB, 0),
@@ -262,7 +262,7 @@ vocab_free_branches(parse_tree_branch_t *parser_branches) {
parse_tree_branch_t *
-vocab_get_branches(resource_mgr_t * resmgr, int *branches_nr) {
+vocab_get_branches(ResourceManager * resmgr, int *branches_nr) {
resource_t *resource = scir_find_resource(resmgr, sci_vocab,
VOCAB_RESOURCE_PARSE_TREE_BRANCHES, 0);
parse_tree_branch_t *retval;
diff --git a/engines/sci/scicore/vocab_debug.cpp b/engines/sci/scicore/vocab_debug.cpp
index 59d1530215..782b75432b 100644
--- a/engines/sci/scicore/vocab_debug.cpp
+++ b/engines/sci/scicore/vocab_debug.cpp
@@ -153,7 +153,7 @@ int getInt(unsigned char* d) {
return d[0] | (d[1] << 8);
}
-int* vocabulary_get_classes(resource_mgr_t *resmgr, int* count) {
+int* vocabulary_get_classes(ResourceManager *resmgr, int* count) {
resource_t* r;
int *c;
unsigned int i;
@@ -169,13 +169,13 @@ int* vocabulary_get_classes(resource_mgr_t *resmgr, int* count) {
return c;
}
-int vocabulary_get_class_count(resource_mgr_t *resmgr) {
+int vocabulary_get_class_count(ResourceManager *resmgr) {
resource_t* r;
if ((r = scir_find_resource(resmgr, sci_vocab, 996, 0)) == 0) return 0;
return r->size / 4;
}
-char** vocabulary_get_snames(resource_mgr_t *resmgr, int* pcount, sci_version_t version) {
+char** vocabulary_get_snames(ResourceManager *resmgr, int* pcount, sci_version_t version) {
char** t;
int count;
int i, j;
@@ -237,7 +237,7 @@ vocabulary_free_snames(char **snames_list) {
free(snames_list);
}
-opcode* vocabulary_get_opcodes(resource_mgr_t *resmgr) {
+opcode* vocabulary_get_opcodes(ResourceManager *resmgr) {
opcode* o;
int count, i = 0;
resource_t* r = scir_find_resource(resmgr, sci_vocab, VOCAB_RESOURCE_OPCODES, 0);
@@ -319,7 +319,7 @@ static char** _vocabulary_get_knames0alt(int *names, resource_t *r) {
}
-static char** vocabulary_get_knames0(resource_mgr_t *resmgr, int* names) {
+static char** vocabulary_get_knames0(ResourceManager *resmgr, int* names) {
char** t;
int count, i, index = 2, empty_to_add = 1;
resource_t* r = scir_find_resource(resmgr, sci_vocab, VOCAB_RESOURCE_KNAMES, 0);
@@ -369,7 +369,7 @@ static char** vocabulary_get_knames0(resource_mgr_t *resmgr, int* names) {
}
/*NOTE: Untested*/
-static char** vocabulary_get_knames1(resource_mgr_t *resmgr, int *count) {
+static char** vocabulary_get_knames1(ResourceManager *resmgr, int *count) {
char** t = NULL;
unsigned int size = 64, used = 0, pos = 0;
resource_t* r = scir_find_resource(resmgr, sci_vocab, VOCAB_RESOURCE_KNAMES, 0);
@@ -392,7 +392,7 @@ static char** vocabulary_get_knames1(resource_mgr_t *resmgr, int *count) {
return t;
}
-char** vocabulary_get_knames(resource_mgr_t *resmgr, int* count) {
+char** vocabulary_get_knames(ResourceManager *resmgr, int* count) {
switch (resmgr->sci_version) {
case SCI_VERSION_0:
case SCI_VERSION_01:
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 70eb8d215d..47942bdbf4 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -430,7 +430,7 @@ _sfx_timer_callback(void *data) {
}
void
-sfx_init(sfx_state_t *self, resource_mgr_t *resmgr, int flags) {
+sfx_init(sfx_state_t *self, ResourceManager *resmgr, int flags) {
callbackMutex = new Common::Mutex();
song_lib_init(&self->songlib);
self->song = NULL;
diff --git a/engines/sci/sfx/player/polled.cpp b/engines/sci/sfx/player/polled.cpp
index 4eacb63d48..b5b2eaf386 100644
--- a/engines/sci/sfx/player/polled.cpp
+++ b/engines/sci/sfx/player/polled.cpp
@@ -163,7 +163,7 @@ pp_set_option(char *name, char *value) {
}
static int
-pp_init(resource_mgr_t *resmgr, int expected_latency) {
+pp_init(ResourceManager *resmgr, int expected_latency) {
resource_t *res = NULL, *res2 = NULL;
if (!mixer)
diff --git a/engines/sci/sfx/player/realtime.cpp b/engines/sci/sfx/player/realtime.cpp
index a46d8fdd09..5821d0b59d 100644
--- a/engines/sci/sfx/player/realtime.cpp
+++ b/engines/sci/sfx/player/realtime.cpp
@@ -152,7 +152,7 @@ rt_timer_callback(void) {
}
static resource_t *
-find_patch(resource_mgr_t *resmgr, const char *seq_name, int patchfile) {
+find_patch(ResourceManager *resmgr, const char *seq_name, int patchfile) {
resource_t *res = NULL;
if (patchfile != SFX_SEQ_PATCHFILE_NONE) {
@@ -174,7 +174,7 @@ rt_set_option(char *name, char *value) {
}
static int
-rt_init(resource_mgr_t *resmgr, int expected_latency) {
+rt_init(ResourceManager *resmgr, int expected_latency) {
resource_t *res = NULL, *res2 = NULL;
void *seq_dev = NULL;
GTimeVal foo = {0, 0};