aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/game.cpp
diff options
context:
space:
mode:
authorGreg Frieger2009-02-28 20:45:36 +0000
committerGreg Frieger2009-02-28 20:45:36 +0000
commit4dd1b7dad55333fdbfefb6c1ea7acb55a5127863 (patch)
tree07c7b74de7e3f50273dc53cc8927e90075f0ce4c /engines/sci/engine/game.cpp
parent460131f5d35fffba4126cdf4ea24f2f32cfebc25 (diff)
downloadscummvm-rg350-4dd1b7dad55333fdbfefb6c1ea7acb55a5127863.tar.gz
scummvm-rg350-4dd1b7dad55333fdbfefb6c1ea7acb55a5127863.tar.bz2
scummvm-rg350-4dd1b7dad55333fdbfefb6c1ea7acb55a5127863.zip
Turned ResourceManager into a class, along with all related functions
svn-id: r38978
Diffstat (limited to 'engines/sci/engine/game.cpp')
-rw-r--r--engines/sci/engine/game.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index fbccc9a7cc..9d5f20043b 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -142,7 +142,7 @@ int _reset_graphics_input(EngineState *s) {
file.close();
_sci1_alloc_system_colors(s);
} else {
- resource = scir_find_resource(s->resmgr, sci_palette, 999, 1);
+ resource = s->resmgr->findResource(sci_palette, 999, 1);
if (resource) {
if (s->version < SCI_VERSION(1, 001, 000))
s->gfx_state->resstate->static_palette = gfxr_read_pal1(999, &s->gfx_state->resstate->static_palette_entries,
@@ -151,7 +151,7 @@ int _reset_graphics_input(EngineState *s) {
s->gfx_state->resstate->static_palette = gfxr_read_pal11(999, &s->gfx_state->resstate->static_palette_entries,
resource->data, resource->size);
_sci1_alloc_system_colors(s);
- scir_unlock_resource(s->resmgr, resource, sci_palette, 999);
+ s->resmgr->unlockResource(resource, sci_palette, 999);
} else {
sciprintf("Couldn't find the default palette!\n");
}
@@ -184,7 +184,7 @@ int _reset_graphics_input(EngineState *s) {
font_nr = -1;
do {
- resource = scir_test_resource(s->resmgr, sci_font, ++font_nr);
+ resource = s->resmgr->testResource(sci_font, ++font_nr);
} while ((!resource) && (font_nr < sci_max_resource_nr[s->resmgr->sci_version]));
if (!resource) {
@@ -295,7 +295,7 @@ int test_cursor_style(EngineState *s) {
int ok = 0;
do {
- ok |= scir_test_resource(s->resmgr, sci_cursor, resource_nr++) != NULL;
+ ok |= s->resmgr->testResource(sci_cursor, resource_nr++) != NULL;
} while (resource_nr < 1000 && !ok);
return ok;
@@ -307,7 +307,7 @@ int create_class_table_sci11(EngineState *s) {
char *seeker_ptr;
int classnr;
- resource_t *vocab996 = scir_find_resource(s->resmgr, sci_vocab, 996, 1);
+ resource_t *vocab996 = s->resmgr->findResource(sci_vocab, 996, 1);
if (!vocab996)
s->classtable_size = 20;
@@ -317,7 +317,7 @@ int create_class_table_sci11(EngineState *s) {
s->classtable = (Class*)sci_calloc(sizeof(Class), s->classtable_size);
for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
- resource_t *heap = scir_find_resource(s->resmgr, sci_heap, scriptnr, 0);
+ resource_t *heap = s->resmgr->findResource(sci_heap, scriptnr, 0);
if (heap) {
int global_vars = getUInt16(heap->data + 2);
@@ -362,7 +362,7 @@ static int create_class_table_sci0(EngineState *s) {
int classnr;
int magic_offset; // For strange scripts in older SCI versions
- resource_t *vocab996 = scir_find_resource(s->resmgr, sci_vocab, 996, 1);
+ resource_t *vocab996 = s->resmgr->findResource(sci_vocab, 996, 1);
if (!vocab996)
s->classtable_size = 20;
@@ -373,7 +373,7 @@ static int create_class_table_sci0(EngineState *s) {
for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
int objtype = 0;
- resource_t *script = scir_find_resource(s->resmgr, sci_script, scriptnr, 0);
+ resource_t *script = s->resmgr->findResource(sci_script, scriptnr, 0);
if (script) {
if (s->version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER)
@@ -435,7 +435,7 @@ static int create_class_table_sci0(EngineState *s) {
}
}
- scir_unlock_resource(s->resmgr, vocab996, sci_vocab, 996);
+ s->resmgr->unlockResource(vocab996, sci_vocab, 996);
vocab996 = NULL;
return 0;
}