aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-15 23:39:55 +0000
committerFilippos Karapetis2009-11-15 23:39:55 +0000
commit8d99384ab99ed84eba2dd010b6a7a14748c419f5 (patch)
treeda9aa7ea4150a9f43c57b7e22aa776dbed1e3acf
parent3013a63890679bfb7be9aa7d7398935c23751307 (diff)
downloadscummvm-rg350-8d99384ab99ed84eba2dd010b6a7a14748c419f5.tar.gz
scummvm-rg350-8d99384ab99ed84eba2dd010b6a7a14748c419f5.tar.bz2
scummvm-rg350-8d99384ab99ed84eba2dd010b6a7a14748c419f5.zip
Some more work on music code
svn-id: r45934
-rw-r--r--engines/sci/sfx/music.h3
-rw-r--r--engines/sci/sfx/soundcmd.cpp15
-rw-r--r--engines/sci/sfx/soundcmd.h2
3 files changed, 11 insertions, 9 deletions
diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h
index 0e78418f32..26aa2d2bb9 100644
--- a/engines/sci/sfx/music.h
+++ b/engines/sci/sfx/music.h
@@ -34,6 +34,7 @@
#include "common/savefile.h"
#include "sci/sci.h"
+#include "sci/resource.h"
/*
Sound drivers info: (from driver cmd0)
@@ -53,7 +54,7 @@ namespace Sci {
typedef uint16 SCIHANDLE;
typedef uint16 HEAPHANDLE;
-class SoundRes {
+class SoundRes : Resource {
public:
enum kTrackType {
kTrackAdlib = 0,
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 7b713ecec7..2e0629edc4 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -262,22 +262,23 @@ void SoundCommandParser::cmdInitHandle(reg_t obj, SongHandle handle, int value)
if (!GET_SEL32V(_segMan, obj, nodePtr)) {
PUT_SEL32(_segMan, obj, nodePtr, obj);
- _soundList.push_back(obj.toUint16());
+ _soundList.push_back(obj);
}
- // TODO
- /*
- sciSound *pSnd = (sciSound *)heap2Ptr(hptr);
+ sciSound *pSnd = new sciSound();
pSnd->resnum = resnum;
pSnd->loop = (GET_SEL32V(_segMan, obj, loop) == 0xFFFF ? 1 : 0);
pSnd->prio = GET_SEL32V(_segMan, obj, pri) & 0xFF; // priority
pSnd->volume = GET_SEL32V(_segMan, obj, vol) & 0xFF; // volume
pSnd->signal = pSnd->dataInc = 0;
+ pSnd->pMidiParser = 0;
+ pSnd->pStreamAud = 0;
_music->soundKill(pSnd);
- if (res)
- _music->soundInitSnd(res, pSnd);
- */
+ if (res) {
+ SoundRes *sndRes = (SoundRes *)res;
+ _music->soundInitSnd(sndRes, pSnd);
+ }
#endif
}
diff --git a/engines/sci/sfx/soundcmd.h b/engines/sci/sfx/soundcmd.h
index 4061b10ea1..16700124cd 100644
--- a/engines/sci/sfx/soundcmd.h
+++ b/engines/sci/sfx/soundcmd.h
@@ -60,7 +60,7 @@ private:
reg_t _acc;
int _midiCmd, _controller, _param;
- Common::List<uint16> _soundList;
+ Common::List<reg_t> _soundList;
void cmdInitHandle(reg_t obj, SongHandle handle, int value);
void cmdPlayHandle(reg_t obj, SongHandle handle, int value);