diff options
Diffstat (limited to 'engines/sci/resource.cpp')
-rw-r--r-- | engines/sci/resource.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 526a71bf62..feff560c04 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1898,7 +1898,7 @@ SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersi _trackCount = 1; _tracks = new Track[_trackCount]; _tracks->digitalChannelNr = -1; - _tracks->type = TRACKTYPE_NONE; + _tracks->type = 0; // Not used for SCI0 _tracks->channelCount = 1; // Digital sample data included? -> Add an additional channel if (resource->data[0] == 2) @@ -1957,7 +1957,7 @@ SoundResource::SoundResource(uint32 resNumber, ResourceManager *resMan, SciVersi // 0xFF:BYTE as terminator to end that track and begin with another track type // Track type 0xFF is the marker signifying the end of the tracks - _tracks[trackNr].type = (TrackType) *data++; + _tracks[trackNr].type = *data++; // Counting # of channels used data2 = data; _tracks[trackNr].channelCount = 0; @@ -2028,7 +2028,7 @@ SoundResource::Track* SoundResource::getTrackByNumber(uint16 number) { } #endif -SoundResource::Track* SoundResource::getTrackByType(TrackType type) { +SoundResource::Track *SoundResource::getTrackByType(byte type) { if (_soundVersion <= SCI_VERSION_0_LATE) return &_tracks[0]; @@ -2039,6 +2039,14 @@ SoundResource::Track* SoundResource::getTrackByType(TrackType type) { return NULL; } +SoundResource::Track *SoundResource::getDigitalTrack() { + for (int trackNr = 0; trackNr < _trackCount; trackNr++) { + if (_tracks[trackNr].digitalChannelNr != -1) + return &_tracks[trackNr]; + } + return NULL; +} + // Gets the filter mask for SCI0 sound resources int SoundResource::getChannelFilterMask(int hardwareMask) { byte *data = _innerResource->data; |