aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r--engines/sci/sfx/iterator/core.cpp (renamed from engines/sci/sfx/core.cpp)8
-rw-r--r--engines/sci/sfx/iterator/core.h (renamed from engines/sci/sfx/core.h)8
-rw-r--r--engines/sci/sfx/iterator/iterator.cpp (renamed from engines/sci/sfx/iterator.cpp)8
-rw-r--r--engines/sci/sfx/iterator/iterator.h (renamed from engines/sci/sfx/iterator.h)5
-rw-r--r--engines/sci/sfx/iterator/iterator_internal.h (renamed from engines/sci/sfx/iterator_internal.h)7
-rw-r--r--engines/sci/sfx/iterator/songlib.cpp (renamed from engines/sci/sfx/songlib.cpp)9
-rw-r--r--engines/sci/sfx/iterator/songlib.h (renamed from engines/sci/sfx/songlib.h)5
-rw-r--r--engines/sci/sfx/iterator/test-iterator.cpp (renamed from engines/sci/sfx/test-iterator.cpp)0
-rw-r--r--engines/sci/sfx/soundcmd.cpp9
-rw-r--r--engines/sci/sfx/soundcmd.h2
10 files changed, 49 insertions, 12 deletions
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/iterator/core.cpp
index 8da2c7cda5..0d11344b9f 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/iterator/core.cpp
@@ -26,8 +26,10 @@
/* Sound subsystem core: Event handler, sound player dispatching */
#include "sci/sci.h"
-#include "sci/sfx/core.h"
-#include "sci/sfx/iterator.h"
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+
+#include "sci/sfx/iterator/core.h"
+#include "sci/sfx/iterator/iterator.h"
#include "sci/sfx/softseq/mididriver.h"
#include "sci/sfx/softseq/pcjr.h"
@@ -1007,3 +1009,5 @@ void SfxState::sfx_all_stop() {
}
} // End of namespace Sci
+
+#endif // USE_OLD_MUSIC_FUNCTIONS
diff --git a/engines/sci/sfx/core.h b/engines/sci/sfx/iterator/core.h
index 60696583b7..0d3bbfb6a2 100644
--- a/engines/sci/sfx/core.h
+++ b/engines/sci/sfx/iterator/core.h
@@ -28,7 +28,11 @@
#define SCI_SFX_CORE_H
#include "common/error.h"
-#include "sci/sfx/songlib.h"
+
+#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
+
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+#include "sci/sfx/iterator/songlib.h"
#include "sci/resource.h"
namespace Sci {
@@ -200,4 +204,6 @@ protected:
} // End of namespace Sci
+#endif // USE_OLD_MUSIC_FUNCTIONS
+
#endif // SCI_SFX_CORE_H
diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator/iterator.cpp
index ba82211ada..924e1de0bc 100644
--- a/engines/sci/sfx/iterator.cpp
+++ b/engines/sci/sfx/iterator/iterator.cpp
@@ -28,9 +28,11 @@
#include "common/util.h"
#include "sci/sci.h"
-#include "sci/sfx/iterator_internal.h"
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+
+#include "sci/sfx/iterator/iterator_internal.h"
#include "sci/engine/state.h" // for sfx_player_tell_synth :/
-#include "sci/sfx/core.h" // for sfx_player_tell_synth
+#include "sci/sfx/iterator/core.h" // for sfx_player_tell_synth
#include "sound/audiostream.h"
#include "sound/mixer.h"
@@ -1701,3 +1703,5 @@ SongIterator *sfx_iterator_combine(SongIterator *it1, SongIterator *it2) {
}
} // End of namespace Sci
+
+#endif // USE_OLD_MUSIC_FUNCTIONS
diff --git a/engines/sci/sfx/iterator.h b/engines/sci/sfx/iterator/iterator.h
index f4e87d5b7f..ffd0679213 100644
--- a/engines/sci/sfx/iterator.h
+++ b/engines/sci/sfx/iterator/iterator.h
@@ -28,6 +28,9 @@
#ifndef SCI_SFX_SFX_ITERATOR_H
#define SCI_SFX_SFX_ITERATOR_H
+#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
+
+#ifdef USE_OLD_MUSIC_FUNCTIONS
#include "sci/sfx/softseq/mididriver.h"
namespace Audio {
@@ -318,4 +321,6 @@ SongIterator *sfx_iterator_combine(SongIterator *it1, SongIterator *it2);
} // End of namespace Sci
+#endif // USE_OLD_MUSIC_FUNCTIONS
+
#endif // SCI_SFX_SFX_ITERATOR_H
diff --git a/engines/sci/sfx/iterator_internal.h b/engines/sci/sfx/iterator/iterator_internal.h
index 1b5d856d33..f41b388008 100644
--- a/engines/sci/sfx/iterator_internal.h
+++ b/engines/sci/sfx/iterator/iterator_internal.h
@@ -26,7 +26,10 @@
#ifndef SCI_SFX_SFX_ITERATOR_INTERNAL
#define SCI_SFX_SFX_ITERATOR_INTERNAL
-#include "sci/sfx/iterator.h"
+#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
+
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+#include "sci/sfx/iterator/iterator.h"
#include "sci/sfx/softseq/mididriver.h"
#include "common/array.h"
@@ -268,4 +271,6 @@ public:
} // End of namespace Sci
+#endif // USE_OLD_MUSIC_FUNCTIONS
+
#endif // SCI_SFX_SFX_ITERATOR_INTERNAL
diff --git a/engines/sci/sfx/songlib.cpp b/engines/sci/sfx/iterator/songlib.cpp
index c30478d50d..657e52017d 100644
--- a/engines/sci/sfx/songlib.cpp
+++ b/engines/sci/sfx/iterator/songlib.cpp
@@ -23,8 +23,11 @@
*
*/
-#include "sci/sfx/core.h"
-#include "sci/sfx/iterator.h"
+#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
+
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+#include "sci/sfx/iterator/core.h"
+#include "sci/sfx/iterator/iterator.h"
namespace Sci {
@@ -182,3 +185,5 @@ void SongLibrary::setSongRestoreBehavior(SongHandle handle, RESTORE_BEHAVIOR act
}
} // End of namespace Sci
+
+#endif // USE_OLD_MUSIC_FUNCTIONS
diff --git a/engines/sci/sfx/songlib.h b/engines/sci/sfx/iterator/songlib.h
index 97c8ec8cc2..acb704edaa 100644
--- a/engines/sci/sfx/songlib.h
+++ b/engines/sci/sfx/iterator/songlib.h
@@ -31,6 +31,9 @@
#include "common/scummsys.h"
#include "sound/timestamp.h"
+#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
+#ifdef USE_OLD_MUSIC_FUNCTIONS
+
namespace Sci {
class SongIterator;
@@ -163,4 +166,6 @@ public:
} // End of namespace Sci
+#endif // USE_OLD_MUSIC_FUNCTIONS
+
#endif // SCI_SSFX_SFX_SONGLIB_H
diff --git a/engines/sci/sfx/test-iterator.cpp b/engines/sci/sfx/iterator/test-iterator.cpp
index 0d603a89fd..0d603a89fd 100644
--- a/engines/sci/sfx/test-iterator.cpp
+++ b/engines/sci/sfx/iterator/test-iterator.cpp
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 3b95ba28e3..adc732a6c6 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "sci/sfx/iterator.h" // for SongIteratorStatus
+#include "sci/sfx/iterator/iterator.h" // for SongIteratorStatus
#include "sci/sfx/music.h"
#include "sci/sfx/soundcmd.h"
@@ -126,8 +126,11 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their
#define SOUNDCOMMAND(x) _soundCommands.push_back(new SciSoundCommand(#x, &SoundCommandParser::x))
-SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, SfxState *state, AudioPlayer *audio, SciVersion doSoundVersion) :
- _resMan(resMan), _segMan(segMan), _state(state), _audio(audio), _doSoundVersion(doSoundVersion) {
+SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion doSoundVersion) :
+ _resMan(resMan), _segMan(segMan), _audio(audio), _doSoundVersion(doSoundVersion) {
+
+ // The following hack is needed to ease the change from old to new sound code (because the new sound code does not use SfxState)
+ _state = &((SciEngine *)g_engine)->getEngineState()->_sound; // HACK
_hasNodePtr = (((SciEngine*)g_engine)->getKernel()->_selectorCache.nodePtr != -1);
diff --git a/engines/sci/sfx/soundcmd.h b/engines/sci/sfx/soundcmd.h
index ac5f615f5a..593c4f4a1e 100644
--- a/engines/sci/sfx/soundcmd.h
+++ b/engines/sci/sfx/soundcmd.h
@@ -43,7 +43,7 @@ struct SciSoundCommand {
class SoundCommandParser {
public:
- SoundCommandParser(ResourceManager *resMan, SegManager *segMan, SfxState *state, AudioPlayer *audio, SciVersion doSoundVersion);
+ SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion doSoundVersion);
~SoundCommandParser();
void updateSfxState(SfxState *newState) { _state = newState; }