[Scummvm-cvs-logs] SF.net SVN: scummvm:[45994] scummvm/trunk/engines/sci/sfx/soundcmd.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Nov 19 23:57:28 CET 2009
Revision: 45994
http://scummvm.svn.sourceforge.net/scummvm/?rev=45994&view=rev
Author: thebluegr
Date: 2009-11-19 22:57:26 +0000 (Thu, 19 Nov 2009)
Log Message:
-----------
Simplified some music checks for SCI0
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2009-11-19 22:22:08 UTC (rev 45993)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2009-11-19 22:57:26 UTC (rev 45994)
@@ -129,7 +129,7 @@
SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, SfxState *state, AudioPlayer *audio, SciVersion doSoundVersion) :
_resMan(resMan), _segMan(segMan), _state(state), _audio(audio), _doSoundVersion(doSoundVersion) {
- _hasNodePtr = (_doSoundVersion != SCI_VERSION_0_EARLY);
+ _hasNodePtr = (((SciEngine*)g_engine)->getKernel()->_selectorCache.nodePtr != -1);
#ifndef USE_OLD_MUSIC_FUNCTIONS
_music = new SciMusic();
@@ -237,7 +237,7 @@
return;
}
- SongIteratorType type = (_doSoundVersion == SCI_VERSION_0_EARLY) ? SCI_SONG_ITERATOR_TYPE_SCI0 : SCI_SONG_ITERATOR_TYPE_SCI1;
+ SongIteratorType type = !_hasNodePtr ? SCI_SONG_ITERATOR_TYPE_SCI0 : SCI_SONG_ITERATOR_TYPE_SCI1;
int number = obj.segment ? GET_SEL32V(_segMan, obj, number) : -1;
if (_hasNodePtr) {
@@ -292,7 +292,7 @@
if (!obj.segment)
return;
- if (_doSoundVersion == SCI_VERSION_0_EARLY) {
+ if (!_hasNodePtr) {
_state->sfx_song_set_status(handle, SOUND_STATUS_PLAYING);
_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
PUT_SEL32V(_segMan, obj, state, _K_SOUND_STATUS_PLAYING);
@@ -363,7 +363,7 @@
void SoundCommandParser::changeHandleStatus(reg_t obj, SongHandle handle, int newStatus) {
if (obj.segment) {
_state->sfx_song_set_status(handle, newStatus);
- if (_doSoundVersion == SCI_VERSION_0_EARLY)
+ if (!_hasNodePtr)
PUT_SEL32V(_segMan, obj, state, newStatus);
}
}
@@ -598,7 +598,7 @@
}
void SoundCommandParser::cmdUpdateVolumePriority(reg_t obj, SongHandle handle, int value) {
- if (_doSoundVersion == SCI_VERSION_0_EARLY && obj.segment) {
+ if (!_hasNodePtr && obj.segment) {
_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
script_set_priority(_resMan, _segMan, _state, obj, GET_SEL32V(_segMan, obj, pri));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list