aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/console.cpp32
-rw-r--r--engines/sci/engine/game.cpp6
-rw-r--r--engines/sci/engine/kgraphics.cpp8
-rw-r--r--engines/sci/engine/kmenu.cpp2
-rw-r--r--engines/sci/engine/kscripts.cpp10
-rw-r--r--engines/sci/engine/ksound.cpp2
-rw-r--r--engines/sci/engine/kstring.cpp4
-rw-r--r--engines/sci/engine/message.cpp2
-rw-r--r--engines/sci/engine/savegame.cpp12
-rw-r--r--engines/sci/engine/state.cpp6
-rw-r--r--engines/sci/engine/state.h3
-rw-r--r--engines/sci/engine/vm.cpp2
-rw-r--r--engines/sci/graphics/gui.cpp10
-rw-r--r--engines/sci/graphics/gui32.cpp6
-rw-r--r--engines/sci/sci.cpp2
-rw-r--r--engines/sci/sci.h7
-rw-r--r--engines/sci/sound/drivers/mididriver.h2
17 files changed, 58 insertions, 58 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 7c811e3896..d6193ba92e 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -411,7 +411,7 @@ bool Console::cmdGetVersion(int argc, const char **argv) {
const char *viewTypeDesc[] = { "Unknown", "EGA", "VGA", "VGA SCI1.1", "Amiga" };
EngineState *s = _engine->_gamestate;
- bool hasVocab997 = s->resMan->testResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SELECTORS)) ? true : false;
+ bool hasVocab997 = g_sci->getResMan()->testResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SELECTORS)) ? true : false;
DebugPrintf("Game ID: %s\n", s->_gameId.c_str());
DebugPrintf("Emulated interpreter version: %s\n", getSciVersionDesc(getSciVersion()));
@@ -423,9 +423,9 @@ bool Console::cmdGetVersion(int argc, const char **argv) {
DebugPrintf("Lofs type: %s\n", getSciVersionDesc(s->_features->detectLofsType()));
DebugPrintf("Move count type: %s\n", (s->_features->detectMoveCountType() == kIncrementMoveCount) ? "increment" : "ignore");
DebugPrintf("SetCursor type: %s\n", getSciVersionDesc(s->_features->detectSetCursorType()));
- DebugPrintf("View type: %s\n", viewTypeDesc[s->resMan->getViewType()]);
- DebugPrintf("Resource volume version: %s\n", s->resMan->getVolVersionDesc());
- DebugPrintf("Resource map version: %s\n", s->resMan->getMapVersionDesc());
+ DebugPrintf("View type: %s\n", viewTypeDesc[g_sci->getResMan()->getViewType()]);
+ DebugPrintf("Resource volume version: %s\n", g_sci->getResMan()->getVolVersionDesc());
+ DebugPrintf("Resource map version: %s\n", g_sci->getResMan()->getMapVersionDesc());
DebugPrintf("Contains selector vocabulary (vocab.997): %s\n", hasVocab997 ? "yes" : "no");
DebugPrintf("\n");
@@ -434,7 +434,7 @@ bool Console::cmdGetVersion(int argc, const char **argv) {
bool Console::cmdOpcodes(int argc, const char **argv) {
// Load the opcode table from vocab.998 if it exists, to obtain the opcode names
- Resource *r = _engine->getResourceManager()->findResource(ResourceId(kResourceTypeVocab, 998), 0);
+ Resource *r = _engine->getResMan()->findResource(ResourceId(kResourceTypeVocab, 998), 0);
// If the resource couldn't be loaded, leave
if (!r) {
@@ -610,7 +610,7 @@ bool Console::cmdDiskDump(int argc, const char **argv) {
if (res == kResourceTypeInvalid)
DebugPrintf("Resource type '%s' is not valid\n", argv[1]);
else {
- Resource *resource = _engine->getResourceManager()->findResource(ResourceId(res, resNum), 0);
+ Resource *resource = _engine->getResMan()->findResource(ResourceId(res, resNum), 0);
if (resource) {
char outFileName[50];
sprintf(outFileName, "%s.%03d", getResourceTypeName(res), resNum);
@@ -647,7 +647,7 @@ bool Console::cmdHexDump(int argc, const char **argv) {
if (res == kResourceTypeInvalid)
DebugPrintf("Resource type '%s' is not valid\n", argv[1]);
else {
- Resource *resource = _engine->getResourceManager()->findResource(ResourceId(res, resNum), 0);
+ Resource *resource = _engine->getResMan()->findResource(ResourceId(res, resNum), 0);
if (resource) {
Common::hexdump(resource->data, resource->size, 16, 0);
DebugPrintf("Resource %s.%03d has been dumped to standard output\n", argv[1], resNum);
@@ -714,7 +714,7 @@ bool Console::cmdResourceSize(int argc, const char **argv) {
if (res == kResourceTypeInvalid)
DebugPrintf("Resource type '%s' is not valid\n", argv[1]);
else {
- Resource *resource = _engine->getResourceManager()->findResource(ResourceId(res, resNum), 0);
+ Resource *resource = _engine->getResMan()->findResource(ResourceId(res, resNum), 0);
if (resource) {
DebugPrintf("Resource size: %d\n", resource->size);
} else {
@@ -770,7 +770,7 @@ bool Console::cmdHexgrep(int argc, const char **argv) {
}
for (; resNumber <= resMax; resNumber++) {
- script = _engine->getResourceManager()->findResource(ResourceId(restype, resNumber), 0);
+ script = _engine->getResMan()->findResource(ResourceId(restype, resNumber), 0);
if (script) {
unsigned int seeker = 0, seekerold = 0;
uint32 comppos = 0;
@@ -826,7 +826,7 @@ bool Console::cmdList(int argc, const char **argv) {
number = atoi(argv[2]);
}
- Common::List<ResourceId> *resources = _engine->getResourceManager()->listResources(res, number);
+ Common::List<ResourceId> *resources = _engine->getResMan()->listResources(res, number);
sort(resources->begin(), resources->end(), ResourceIdLess());
Common::List<ResourceId>::iterator itr = resources->begin();
@@ -1483,7 +1483,7 @@ bool Console::cmdStartSound(int argc, const char **argv) {
int16 number = atoi(argv[1]);
- if (!_engine->getResourceManager()->testResource(ResourceId(kResourceTypeSound, number))) {
+ if (!_engine->getResMan()->testResource(ResourceId(kResourceTypeSound, number))) {
DebugPrintf("Unable to load this sound resource, most probably it has an equivalent audio resource (SCI1.1)\n");
return true;
}
@@ -1557,7 +1557,7 @@ bool Console::cmdIsSample(int argc, const char **argv) {
}
#ifdef USE_OLD_MUSIC_FUNCTIONS
- Resource *song = _engine->getResourceManager()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
+ Resource *song = _engine->getResMan()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
SongIterator *songit;
Audio::AudioStream *data;
@@ -1588,12 +1588,12 @@ bool Console::cmdIsSample(int argc, const char **argv) {
#else
int16 number = atoi(argv[1]);
- if (!_engine->getResourceManager()->testResource(ResourceId(kResourceTypeSound, number))) {
+ if (!_engine->getResMan()->testResource(ResourceId(kResourceTypeSound, number))) {
DebugPrintf("Unable to load this sound resource, most probably it has an equivalent audio resource (SCI1.1)\n");
return true;
}
- SoundResource *soundRes = new SoundResource(number, _engine->getResourceManager(), _engine->_gamestate->_features->detectDoSoundType());
+ SoundResource *soundRes = new SoundResource(number, _engine->getResMan(), _engine->_gamestate->_features->detectDoSoundType());
if (!soundRes) {
DebugPrintf("Not a sound resource!\n");
@@ -2481,7 +2481,7 @@ bool Console::cmdSfx01Header(int argc, const char **argv) {
return true;
}
- Resource *song = _engine->getResourceManager()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
+ Resource *song = _engine->getResMan()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
if (!song) {
DebugPrintf("Doesn't exist\n");
@@ -2646,7 +2646,7 @@ bool Console::cmdSfx01Track(int argc, const char **argv) {
return true;
}
- Resource *song = _engine->getResourceManager()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
+ Resource *song = _engine->getResMan()->findResource(ResourceId(kResourceTypeSound, atoi(argv[1])), 0);
int offset = atoi(argv[2]);
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index b72322ada3..5b61fdd734 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -182,7 +182,7 @@ int game_init_sound(EngineState *s, int sound_flags, SciVersion soundVersion) {
sound_flags |= SFX_STATE_FLAG_MULTIPLAY;
s->sfx_init_flags = sound_flags;
- s->_sound.sfx_init(s->resMan, sound_flags, soundVersion);
+ s->_sound.sfx_init(g_sci->getResMan(), sound_flags, soundVersion);
return 0;
}
@@ -243,7 +243,7 @@ int game_init(EngineState *s) {
s->stack_base = stack->_entries;
s->stack_top = stack->_entries + stack->_capacity;
- if (!script_instantiate(s->resMan, s->_segMan, 0)) {
+ if (!script_instantiate(g_sci->getResMan(), s->_segMan, 0)) {
warning("game_init(): Could not instantiate script 0");
return 1;
}
@@ -274,7 +274,7 @@ int game_init(EngineState *s) {
// The first entry in the export table of script 0 points to the game object
s->_gameObj = s->_segMan->lookupScriptExport(0, 0);
uint32 gameFlags = 0; // unused
- s->_gameId = convertSierraGameId(s->_segMan->getObjectName(s->_gameObj), &gameFlags, s->resMan);
+ s->_gameId = convertSierraGameId(s->_segMan->getObjectName(s->_gameObj), &gameFlags, g_sci->getResMan());
debug(2, " \"%s\" at %04x:%04x", s->_gameId.c_str(), PRINT_REG(s->_gameObj));
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index f031b5130b..e82bf17182 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -234,9 +234,9 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
switch (argv[0].toSint16()) {
case K_GRAPH_GET_COLORS_NR:
- if (s->resMan->isAmiga32color())
+ if (g_sci->getResMan()->isAmiga32color())
return make_reg(0, 32);
- return make_reg(0, !s->resMan->isVGA() ? 16 : 256);
+ return make_reg(0, !g_sci->getResMan()->isVGA() ? 16 : 256);
break;
case K_GRAPH_DRAW_LINE:
@@ -245,7 +245,7 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
color = argv[5].toSint16();
// TODO: Find out why we get >15 for color in EGA
- if (!s->resMan->isVGA() && !s->resMan->isAmiga32color())
+ if (!g_sci->getResMan()->isVGA() && !g_sci->getResMan()->isAmiga32color())
color &= 0x0F;
g_sci->_gfxPaint16->kernelGraphDrawLine(Common::Point(x, y), Common::Point(x1, y1), color, priority, control);
@@ -552,7 +552,7 @@ reg_t kSetNowSeen(EngineState *s, int argc, reg_t *argv) {
reg_t kPalette(EngineState *s, int argc, reg_t *argv) {
// we are called on EGA/amiga games as well, this doesnt make sense.
// doing this would actually break the system EGA/amiga palette
- if (!s->resMan->isVGA())
+ if (!g_sci->getResMan()->isVGA())
return s->r_acc;
switch (argv[0].toUint16()) {
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index 4fca99b974..631deffe3a 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -71,7 +71,7 @@ reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
reg_t textReference = argv[0];
Common::String text;
int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0;
- int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15;
+ int16 colorBack = (argc > 2) ? argv[2].toSint16() : g_sci->getResMan()->isVGA() ? 255 : 15;
if (!textReference.isNull()) {
// Sometimes this is called without giving text, if thats the case dont process it
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 1fca13cb44..945a63459b 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -54,13 +54,13 @@ reg_t kLock(EngineState *s, int argc, reg_t *argv) {
switch (state) {
case 1 :
- s->resMan->findResource(id, 1);
+ g_sci->getResMan()->findResource(id, 1);
break;
case 0 :
- which = s->resMan->findResource(id, 0);
+ which = g_sci->getResMan()->findResource(id, 0);
if (which)
- s->resMan->unlockResource(which);
+ g_sci->getResMan()->unlockResource(which);
else {
if (id.type == kResourceTypeInvalid)
warning("[resMan] Attempt to unlock resource %i of invalid type %i", id.number, type);
@@ -101,10 +101,10 @@ reg_t kResCheck(EngineState *s, int argc, reg_t *argv) {
uint cond = argv[4].toUint16() & 0xff;
uint seq = argv[5].toUint16() & 0xff;
- res = s->resMan->testResource(ResourceId(restype, argv[1].toUint16(), noun, verb, cond, seq));
+ res = g_sci->getResMan()->testResource(ResourceId(restype, argv[1].toUint16(), noun, verb, cond, seq));
}
} else {
- res = s->resMan->testResource(ResourceId(restype, argv[1].toUint16()));
+ res = g_sci->getResMan()->testResource(ResourceId(restype, argv[1].toUint16()));
}
return make_reg(0, res != NULL);
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 8106a19aec..21a22438d2 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -147,7 +147,7 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
int16 language = argv[1].toSint16();
if (language != -1)
- s->resMan->setAudioLanguage(language);
+ g_sci->getResMan()->setAudioLanguage(language);
return make_reg(0, s->getLanguage());
}
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index f3662da6fe..14b5ab6742 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -43,7 +43,7 @@ Common::String kernel_lookup_text(EngineState *s, reg_t address, int index) {
else {
int textlen;
int _index = index;
- textres = s->resMan->findResource(ResourceId(kResourceTypeText, address.offset), 0);
+ textres = g_sci->getResMan()->findResource(ResourceId(kResourceTypeText, address.offset), 0);
if (!textres) {
error("text.%03d not found", address.offset);
@@ -420,7 +420,7 @@ reg_t kStrLen(EngineState *s, int argc, reg_t *argv) {
reg_t kGetFarText(EngineState *s, int argc, reg_t *argv) {
- Resource *textres = s->resMan->findResource(ResourceId(kResourceTypeText, argv[0].toUint16()), 0);
+ Resource *textres = g_sci->getResMan()->findResource(ResourceId(kResourceTypeText, argv[0].toUint16()), 0);
char *seeker;
int counter = argv[1].toUint16();
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index 5d72248939..84029392d1 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -135,7 +135,7 @@ public:
};
bool MessageState::getRecord(CursorStack &stack, bool recurse, MessageRecord &record) {
- Resource *res = g_sci->getResourceManager()->findResource(ResourceId(kResourceTypeMessage, stack.getModule()), 0);
+ Resource *res = g_sci->getResMan()->findResource(ResourceId(kResourceTypeMessage, stack.getModule()), 0);
if (!res) {
warning("Failed to open message resource %d", stack.getModule());
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 23a97166fa..d579b29b9e 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -292,7 +292,7 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(Nodes_seg_id);
}
-static void sync_SegManagerPtr(Common::Serializer &s, ResourceManager *&resMan, SegManager *&obj) {
+static void sync_SegManagerPtr(Common::Serializer &s, SegManager *&obj) {
s.skip(1, VER(9), VER(9)); // obsolete: used to be a flag indicating if we got sci11 or not
if (s.isLoading())
@@ -380,7 +380,7 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint16LE(picPortLeft);
}
- sync_SegManagerPtr(s, resMan, _segMan);
+ sync_SegManagerPtr(s, _segMan);
syncArray<Class>(s, _segMan->_classtable);
@@ -776,14 +776,14 @@ static void load_script(EngineState *s, Script *scr) {
scr->_buf = (byte *)malloc(scr->_bufSize);
assert(scr->_buf);
- Resource *script = s->resMan->findResource(ResourceId(kResourceTypeScript, scr->_nr), 0);
+ Resource *script = g_sci->getResMan()->findResource(ResourceId(kResourceTypeScript, scr->_nr), 0);
assert(script != 0);
assert(scr->_bufSize >= script->size);
memcpy(scr->_buf, script->data, script->size);
if (getSciVersion() >= SCI_VERSION_1_1) {
- Resource *heap = s->resMan->findResource(ResourceId(kResourceTypeHeap, scr->_nr), 0);
+ Resource *heap = g_sci->getResMan()->findResource(ResourceId(kResourceTypeHeap, scr->_nr), 0);
assert(heap != 0);
scr->_heapStart = scr->_buf + scr->_scriptSize;
@@ -887,7 +887,7 @@ static void reconstruct_sounds(EngineState *s) {
int oldstatus;
SongIterator::Message msg;
- base = ff = build_iterator(s->resMan, seeker->_resourceNum, it_type, seeker->_handle);
+ base = ff = build_iterator(g_sci->getResMan(), seeker->_resourceNum, it_type, seeker->_handle);
if (seeker->_restoreBehavior == RESTORE_BEHAVIOR_CONTINUE)
ff = new_fast_forward_iterator(base, seeker->_restoreTime);
ff->init();
@@ -943,7 +943,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
}
// Create a new EngineState object
- retval = new EngineState(s->resMan, s->_kernel, s->_voc, s->_segMan, s->_audio);
+ retval = new EngineState(s->_kernel, s->_voc, s->_segMan, s->_audio);
retval->_event = new SciEvent();
// Copy some old data
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index da670369e6..6599a8b287 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -33,8 +33,8 @@
namespace Sci {
-EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SegManager *segMan, AudioPlayer *audio)
-: resMan(res), _kernel(kernel), _voc(voc), _segMan(segMan), _audio(audio), _dirseeker() {
+EngineState::EngineState(Kernel *kernel, Vocabulary *voc, SegManager *segMan, AudioPlayer *audio)
+: _kernel(kernel), _voc(voc), _segMan(segMan), _audio(audio), _dirseeker() {
#ifdef USE_OLD_MUSIC_FUNCTIONS
sfx_init_flags = 0;
@@ -142,7 +142,7 @@ Common::String EngineState::getLanguageString(const char *str, kLanguage lang) c
}
kLanguage EngineState::getLanguage() {
- kLanguage lang = (kLanguage)resMan->getAudioLanguage();
+ kLanguage lang = (kLanguage)g_sci->getResMan()->getAudioLanguage();
if (lang != K_LANG_NONE)
return lang;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 29de9174b4..afa3389464 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -110,13 +110,12 @@ public:
struct EngineState : public Common::Serializable {
public:
- EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SegManager *segMan, AudioPlayer *audio);
+ EngineState(Kernel *kernel, Vocabulary *voc, SegManager *segMan, AudioPlayer *audio);
virtual ~EngineState();
virtual void saveLoadWithSerializer(Common::Serializer &ser);
public:
- ResourceManager *resMan; /**< The resource manager */
SegManager *_segMan; /**< The segment manager */
Kernel *_kernel;
Vocabulary *_voc;
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index aa7163929b..aac08c09e2 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -261,7 +261,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
Script *scr = s->_segMan->getScriptIfLoaded(seg);
if (!scr || scr->isMarkedAsDeleted()) // Script not present yet?
- seg = script_instantiate(s->resMan, s->_segMan, script);
+ seg = script_instantiate(g_sci->getResMan(), s->_segMan, script);
const int temp = s->_segMan->validateExportFunc(pubfunct, seg);
if (!temp) {
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 0ddb211905..5f3fa32ff8 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -62,13 +62,13 @@ SciGui::SciGui(EngineState *state, GfxScreen *screen, GfxPalette *palette, GfxCa
_cursor->init(_coordAdjuster, _s->_event);
_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen, _coordAdjuster);
g_sci->_gfxCompare = _compare;
- _transitions = new GfxTransitions(this, _screen, _palette, _s->resMan->isVGA());
- _paint16 = new GfxPaint16(_s->resMan, _s->_segMan, _s->_kernel, this, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
+ _transitions = new GfxTransitions(this, _screen, _palette, g_sci->getResMan()->isVGA());
+ _paint16 = new GfxPaint16(g_sci->getResMan(), _s->_segMan, _s->_kernel, this, _cache, _ports, _coordAdjuster, _screen, _palette, _transitions);
g_sci->_gfxPaint = _paint16;
g_sci->_gfxPaint16 = _paint16;
_animate = new GfxAnimate(_s, _cache, _ports, _paint16, _screen, _palette, _cursor, _transitions);
g_sci->_gfxAnimate = _animate;
- _text16 = new GfxText16(_s->resMan, _cache, _ports, _paint16, _screen);
+ _text16 = new GfxText16(g_sci->getResMan(), _cache, _ports, _paint16, _screen);
_controls = new GfxControls(_s->_segMan, _ports, _paint16, _text16, _screen);
g_sci->_gfxControls = _controls;
_menu = new GfxMenu(_s->_event, _s->_segMan, this, _ports, _paint16, _text16, _screen, _cursor);
@@ -125,12 +125,12 @@ void SciGui::textColors(int argc, reg_t *argv) {
}
reg_t SciGui::portraitLoad(Common::String resourceName) {
- //Portrait *myPortrait = new Portrait(_s->resMan, _screen, _palette, resourceName);
+ //Portrait *myPortrait = new Portrait(g_sci->getResMan(), _screen, _palette, resourceName);
return NULL_REG;
}
void SciGui::portraitShow(Common::String resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
- Portrait *myPortrait = new Portrait(_s->resMan, _s->_event, this, _screen, _palette, _audio, resourceName);
+ Portrait *myPortrait = new Portrait(g_sci->getResMan(), _s->_event, this, _screen, _palette, _audio, resourceName);
// TODO: cache portraits
// adjust given coordinates to curPort (but dont adjust coordinates on upscaledHires_Save_Box and give us hires coordinates
// on kDrawCel, yeah this whole stuff makes sense)
diff --git a/engines/sci/graphics/gui32.cpp b/engines/sci/graphics/gui32.cpp
index adc2c3a4e1..80454378d5 100644
--- a/engines/sci/graphics/gui32.cpp
+++ b/engines/sci/graphics/gui32.cpp
@@ -54,9 +54,9 @@ SciGui32::SciGui32(EngineState *state, GfxScreen *screen, GfxPalette *palette, G
_cursor->init(_coordAdjuster, _s->_event);
_compare = new GfxCompare(_s->_segMan, _s->_kernel, _cache, _screen, _coordAdjuster);
g_sci->_gfxCompare = _compare;
- _paint32 = new GfxPaint32(_s->resMan, _s->_segMan, _s->_kernel, _coordAdjuster, _cache, _screen, _palette);
+ _paint32 = new GfxPaint32(g_sci->getResMan(), _s->_segMan, _s->_kernel, _coordAdjuster, _cache, _screen, _palette);
g_sci->_gfxPaint = _paint32;
- _frameout = new GfxFrameout(_s->_segMan, _s->resMan, _coordAdjuster, _cache, _screen, _palette, _paint32);
+ _frameout = new GfxFrameout(_s->_segMan, g_sci->getResMan(), _coordAdjuster, _cache, _screen, _palette, _paint32);
g_sci->_gfxFrameout = _frameout;
}
@@ -80,7 +80,7 @@ void SciGui32::textSize(const char *text, int16 font, int16 maxWidth, int16 *tex
}
void SciGui32::drawRobot(GuiResourceId robotId) {
- Robot *test = new Robot(_s->resMan, _screen, robotId);
+ Robot *test = new Robot(g_sci->getResMan(), _screen, robotId);
test->draw();
delete test;
}
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 4cc2e97b95..40bb1f03cc 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -176,7 +176,7 @@ Common::Error SciEngine::run() {
SegManager *segMan = new SegManager(_resMan);
// We'll set the GUI below
- _gamestate = new EngineState(_resMan, _kernel, _vocabulary, segMan, _audio);
+ _gamestate = new EngineState(_kernel, _vocabulary, segMan, _audio);
_gamestate->_event = new SciEvent();
if (script_init_engine(_gamestate))
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index beacc956e3..4fbdf775ef 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -147,11 +147,12 @@ public:
Common::Language getLanguage() const;
Common::Platform getPlatform() const;
uint32 getFlags() const;
- ResourceManager *getResourceManager() const { return _resMan; }
+ bool isDemo() const;
+
+ ResourceManager *getResMan() const { return _resMan; }
Kernel *getKernel() const { return _kernel; }
EngineState *getEngineState() const { return _gamestate; }
Vocabulary *getVocabulary() const { return _vocabulary; }
- bool isDemo() const;
Common::String getSavegameName(int nr) const;
Common::String getSavegamePattern() const;
@@ -187,7 +188,7 @@ public:
private:
const ADGameDescription *_gameDescription;
AudioPlayer *_audio;
- ResourceManager *_resMan;
+ ResourceManager *_resMan; /**< The resource manager */
EngineState *_gamestate;
Kernel *_kernel;
Vocabulary *_vocabulary;
diff --git a/engines/sci/sound/drivers/mididriver.h b/engines/sci/sound/drivers/mididriver.h
index 22b08e22d6..a3f9c7302a 100644
--- a/engines/sci/sound/drivers/mididriver.h
+++ b/engines/sci/sound/drivers/mididriver.h
@@ -73,7 +73,7 @@ public:
MidiPlayer(SciVersion version) : _reverb(0), _version(version) { }
int open() {
- ResourceManager *resMan = g_sci->getResourceManager(); // HACK
+ ResourceManager *resMan = g_sci->getResMan(); // HACK
return open(resMan);
}
virtual int open(ResourceManager *resMan) { return _driver->open(); }