TINSEL: Added enhanced music support for the German CD "Neon Edition" re-release of DW1 (bug #2827022)

This commit is contained in:
md5 2011-02-24 14:51:05 +02:00
parent f5e10f33f5
commit a796f7843d

View File

@ -115,26 +115,6 @@ static const int enhancedAudioSCNVersion[] = {
97, 98, 99, 99 // 151-154
};
// TODO. This mapping is wrong
static const int enhancedAudioSCNVersionALT[] = {
301, 302, 2, 1, 1, 301, 302, 3, 3, 4, // 1-10
4, 5, 6, 1, 7, 8, 9, 10, 8, 11, // 11-20
11, 12, 13, 13, 13, 13, 13, 14, 13, 13, // 21-30
15, 16, 17, 15, 18, 19, 20, 338, 21, 21, // 31-40
341, 342, 22, 22, 23, 24, 25, 26, 27, 28, // 41-50
29, 30, 31, 32, 33, 34, 35, 35, 36, 37, // 51-60
38, 39, 39, 39, 39, 40, 39, 41, 41, 42, // 61-70
43, 42, 44, 45, 41, 46, 48, 47, 48, 49, // 71-80
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, // 81-90
60, 61, 62, 63, 61, 64, 65, 66, 67, 68, // 91-100
69, 70, 68, 71, 72, 73, 74, 75, 12, 76, // 101-110
77, 78, 79, 80, 4, 4, 82, 83, 77, 4, // 111-120
84, 85, 86, 3124, 88, 89, 90, 88, 2, 2, // 121-130
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 131-140
3142, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150
97, 98, 99 // 151-153
};
int GetTrackNumber(SCNHANDLE hMidi) {
for (int i = 0; i < ARRAYSIZE(midiOffsets); i++)
if (midiOffsets[i] == hMidi)
@ -179,11 +159,13 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
// Support for external music from the music enhancement project
if (_vm->getFeatures() & GF_ENHANCED_AUDIO_SUPPORT) {
int trackNumber = GetTrackNumber(dwFileOffset);
// Track 8 has been removed in the German CD re-release "Neon Edition"
if ((_vm->getFeatures() & GF_ALT_MIDI) && trackNumber >= 8)
trackNumber++;
int track = 0;
if (trackNumber >= 0) {
if (_vm->getFeatures() & GF_ALT_MIDI)
track = enhancedAudioSCNVersionALT[trackNumber];
else if (_vm->getFeatures() & GF_SCNFILES)
if (_vm->getFeatures() & GF_SCNFILES)
track = enhancedAudioSCNVersion[trackNumber];
else
track = enhancedAudioGRAVersion[trackNumber];