aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/include')
-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
7 files changed, 47 insertions, 43 deletions
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