aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/ksound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/ksound.cpp')
-rw-r--r--engines/sci/engine/ksound.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 44b2404e41..06da533003 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -123,7 +123,7 @@ enum AudioSyncCommands {
static void script_set_priority(EngineState *s, reg_t obj, int priority) {
int song_nr = GET_SEL32V(obj, number);
- Resource *song = s->resmgr->findResource(ResourceId(kResourceTypeSound, song_nr), 0);
+ Resource *song = s->resourceManager->findResource(ResourceId(kResourceTypeSound, song_nr), 0);
int flags = GET_SEL32V(obj, flags);
if (priority == -1) {
@@ -140,7 +140,7 @@ static void script_set_priority(EngineState *s, reg_t obj, int priority) {
}
SongIterator *build_iterator(EngineState *s, int song_nr, SongIteratorType type, songit_id_t id) {
- Resource *song = s->resmgr->findResource(ResourceId(kResourceTypeSound, song_nr), 0);
+ Resource *song = s->resourceManager->findResource(ResourceId(kResourceTypeSound, song_nr), 0);
if (!song)
return NULL;
@@ -157,13 +157,13 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
SongHandle handle;
int cue;
- if (s->_version > SCI_VERSION_01)
+ if (s->resourceManager->sciVersion() > SCI_VERSION_01)
return;
/* SCI1 and later explicitly poll for everything */
while ((result = s->_sound.sfx_poll(&handle, &cue))) {
reg_t obj = DEFROBNICATE_HANDLE(handle);
- if (!is_object(s, obj)) {
+ if (!is_object(s->segmentManager, obj)) {
warning("Non-object %04x:%04x received sound signal (%d/%d)", PRINT_REG(obj), result, cue);
return;
}
@@ -506,7 +506,7 @@ reg_t kDoSoundSci1Early(EngineState *s, int funct_nr, int argc, reg_t *argv) {
//int vol = GET_SEL32V(obj, vol);
//int pri = GET_SEL32V(obj, pri);
- if (obj.segment && (s->resmgr->testResource(ResourceId(kResourceTypeSound, number)))) {
+ if (obj.segment && (s->resourceManager->testResource(ResourceId(kResourceTypeSound, number)))) {
debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);
s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI1,
handle), 0, handle, number);
@@ -815,8 +815,8 @@ reg_t kDoSoundSci1Late(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// a relevant audio resource, play it, otherwise switch to synthesized
// effects. If the resource exists, play it using map 65535 (sound
// effects map)
- if (s->resmgr->testResource(ResourceId(kResourceTypeAudio, number)) &&
- s->_version >= SCI_VERSION_1_1) {
+ if (s->resourceManager->testResource(ResourceId(kResourceTypeAudio, number)) &&
+ s->resourceManager->sciVersion() >= SCI_VERSION_1_1) {
// Found a relevant audio resource, play it
s->_sound.stopAudio();
warning("Initializing audio resource instead of requested sound resource %d\n", number);
@@ -824,7 +824,7 @@ reg_t kDoSoundSci1Late(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// Also create iterator, that will fire SI_FINISHED event, when the sound is done playing
s->_sound.sfx_add_song(build_timeriterator(s, sampleLen), 0, handle, number);
} else {
- if (!s->resmgr->testResource(ResourceId(kResourceTypeSound, number))) {
+ if (!s->resourceManager->testResource(ResourceId(kResourceTypeSound, number))) {
warning("Could not open song number %d", number);
// Send a "stop handle" event so that the engine won't wait forever here
s->_sound.sfx_song_set_status(handle, SOUND_STATUS_STOPPED);
@@ -858,7 +858,7 @@ reg_t kDoSoundSci1Late(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->_sound.sfx_remove_song(handle);
}
- if (obj.segment && (s->resmgr->testResource(ResourceId(kResourceTypeSound, number)))) {
+ if (obj.segment && (s->resourceManager->testResource(ResourceId(kResourceTypeSound, number)))) {
debugC(2, kDebugLevelSound, "Initializing song number %d\n", number);
s->_sound.sfx_add_song(build_iterator(s, number, SCI_SONG_ITERATOR_TYPE_SCI1,
handle), 0, handle, number);
@@ -1051,7 +1051,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// In SCI1.1: tests for digital audio support
return make_reg(0, 1);
} else {
- s->resmgr->setAudioLanguage(argv[1].toSint16());
+ s->resourceManager->setAudioLanguage(argv[1].toSint16());
}
break;
default:
@@ -1067,7 +1067,7 @@ reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv) {
ResourceId id;
if (s->_sound._syncResource) {
- s->resmgr->unlockResource(s->_sound._syncResource);
+ s->resourceManager->unlockResource(s->_sound._syncResource);
s->_sound._syncResource = NULL;
}
@@ -1082,7 +1082,7 @@ reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
- s->_sound._syncResource = s->resmgr->findResource(id, 1);
+ s->_sound._syncResource = s->resourceManager->findResource(id, 1);
if (s->_sound._syncResource) {
PUT_SEL32V(argv[1], syncCue, 0);
@@ -1114,7 +1114,7 @@ reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv) {
}
case kSciAudioSyncStop:
if (s->_sound._syncResource) {
- s->resmgr->unlockResource(s->_sound._syncResource);
+ s->resourceManager->unlockResource(s->_sound._syncResource);
s->_sound._syncResource = NULL;
}
break;