From 4a0cdf00e1d90ee6a7baf74190f9e85f0a4eec27 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 17 Aug 2010 11:01:41 +0000 Subject: TINSEL: fix warning svn-id: r52149 --- engines/tinsel/tinsel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 6c77a98dda..0f5b27c85a 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -283,7 +283,7 @@ static void SingleLeftProcess(CORO_PARAM, const void *param) { } while (DwGetCurrentTime() < _ctx->endTicks); if (GetProvNotProcessed()) { - Common::Point clickPos = *(Common::Point *)param; + const Common::Point clickPos = *(const Common::Point *)param; PlayerEvent(PLR_WALKTO, clickPos); } -- cgit v1.2.3 From 95748c07cc2f6962ba3910e633f948bde6263549 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 24 Aug 2010 09:46:17 +0000 Subject: TINSEL: Partial fix for MIDI in German release. Bug #2827022: "DW: Enhanced music doesn't work". This release has completely different MIDI.DAT file. So far offsets and detection for this version were added. The mapping has to be confirmed with James Woodcock. svn-id: r52323 --- engines/tinsel/detection_tables.h | 2 +- engines/tinsel/music.cpp | 51 +++++++++++++++++++++++++++++++++++++-- engines/tinsel/tinsel.h | 7 +++--- 3 files changed, 54 insertions(+), 6 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h index b467cc613e..a2a32d2e13 100644 --- a/engines/tinsel/detection_tables.h +++ b/engines/tinsel/detection_tables.h @@ -394,7 +394,7 @@ static const TinselGameDescription gameDescriptions[] = { }, GID_DW1, 0, - GF_CD | GF_SCNFILES | GF_ENHANCED_AUDIO_SUPPORT, + GF_CD | GF_SCNFILES | GF_ENHANCED_AUDIO_SUPPORT | GF_ALT_MIDI, TINSEL_V1, }, diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index cef7f0a781..91710d8053 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -107,6 +107,26 @@ static const SCNHANDLE midiOffsetsSCNVersion[] = { 869822, 875436, 877234, 879818 }; +// Alternative version used in German CD re-release "Neon Edition" +static const SCNHANDLE midiOffsetsSCNVersionALT[] = { + 4, 4504, 11762, 21532, 26070, 28754, 33254, 40512, 56310, 59066, + 61822, 64354, 64864, 69402, 74184, 76470, 81252, 89668, 105466, 117396, + 129326, 130130, 132496, 134862, 137228, 139594, 141960, 152474, 154840, 157206, + 169724, 177068, 184412, 196930, 201202, 201864, 208456, 208958, 218956, 228954, + 229458, 230152, 239458, 248764, 252880, 253394, 254954, 256514, 266914, 272514, + 278114, 287388, 301826, 308412, 315882, 317410, 323086, 328762, 335680, 340464, + 340754, 343872, 346990, 350108, 353226, 360216, 363334, 364416, 365498, 373960, + 378366, 386828, 388214, 398964, 400046, 400754, 403554, 405082, 407882, 422438, + 423540, 424642, 429212, 437628, 438478, 445600, 456234, 466868, 476918, 490892, + 495428, 501856, 505400, 511828, 513878, 526016, 530412, 531734, 539764, 544518, + 555306, 566164, 570918, 571604, 573038, 573920, 576448, 580414, 581218, 588838, + 592676, 607064, 611062, 620146, 622902, 625658, 629500, 633342, 637184, 639940, + 654496, 669052, 673634, 687830, 688052, 689018, 690552, 690774, 700544, 710314, + 720084, 729854, 739624, 749394, 759164, 768934, 778704, 788474, 798244, 808014, + 817198, 830488, 831526, 837916, 839526, 841136, 841988, 846698, 851268, 854024, + 859638, 861436, 864020 +}; + static const int enhancedAudioGRAVersion[] = { 1, 2, 1, 1, 3, 3, 4, 4, 5, 6, // 1-10 1, 7, 8, 9, 10, 3, 11, 11, 12, 13, // 11-20 @@ -144,8 +164,33 @@ 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 + 3141, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150 + 97, 98, 99 // 151-153 +}; + int GetTrackNumber(SCNHANDLE hMidi) { - if (_vm->getFeatures() & GF_SCNFILES) { + if (_vm->getFeatures() & GF_ALT_MIDI) { + for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersionALT); i++) { + if (midiOffsetsSCNVersionALT[i] == hMidi) + return i; + } + } else if (_vm->getFeatures() & GF_SCNFILES) { for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersion); i++) { if (midiOffsetsSCNVersion[i] == hMidi) return i; @@ -199,7 +244,9 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) { int trackNumber = GetTrackNumber(dwFileOffset); int track = 0; if (trackNumber >= 0) { - if (_vm->getFeatures() & GF_SCNFILES) + if (_vm->getFeatures() & GF_ALT_MIDI) + track = enhancedAudioSCNVersionALT[trackNumber]; + else if (_vm->getFeatures() & GF_SCNFILES) track = enhancedAudioSCNVersion[trackNumber]; else track = enhancedAudioGRAVersion[trackNumber]; diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index df27a1e0e1..b11724239c 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -74,13 +74,14 @@ enum TinselGameFeatures { GF_FLOPPY = 1 << 2, GF_SCNFILES = 1 << 3, GF_ENHANCED_AUDIO_SUPPORT = 1 << 4, + GF_ALT_MIDI = 1 << 5, // Alternate sequence in midi.dat file // The GF_USE_?FLAGS values specify how many country flags are displayed // in the subtitles options dialog. // None of these defined -> 1 language, in ENGLISH.TXT - GF_USE_3FLAGS = 1 << 5, // French, German, Spanish - GF_USE_4FLAGS = 1 << 6, // French, German, Spanish, Italian - GF_USE_5FLAGS = 1 << 7 // All 5 flags + GF_USE_3FLAGS = 1 << 6, // French, German, Spanish + GF_USE_4FLAGS = 1 << 7, // French, German, Spanish, Italian + GF_USE_5FLAGS = 1 << 8 // All 5 flags }; /** -- cgit v1.2.3 From cb93679ea24c8304da7ebc8870ea2421a94f044e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 24 Aug 2010 09:47:04 +0000 Subject: TINSEL: Fixed final track mapping to Ench soundtrack. For some reason it referred to non-existent 3141. Changed it to correct 3142. svn-id: r52324 --- engines/tinsel/music.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 91710d8053..e9f7e854db 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -160,7 +160,7 @@ static const int enhancedAudioSCNVersion[] = { 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 - 3141, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150 + 3142, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150 97, 98, 99, 99 // 151-154 }; @@ -180,7 +180,7 @@ static const int enhancedAudioSCNVersionALT[] = { 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 - 3141, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150 + 3142, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150 97, 98, 99 // 151-153 }; -- cgit v1.2.3 From 808e36541e306c3bb77bb8748b4dc6f40ad3c796 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 24 Aug 2010 12:27:22 +0000 Subject: TINSEL: Removed the hardcoded MIDI offset arrays. MIDI offsets for the enhanced music soundtrack are now calculated on the fly svn-id: r52331 --- engines/tinsel/music.cpp | 108 +++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 79 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index e9f7e854db..fdc7702771 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -70,62 +70,8 @@ static SOUND_BUFFER midiBuffer = { 0, 0 }; static SCNHANDLE currentMidi = 0; static bool currentLoop = false; -static const SCNHANDLE midiOffsetsGRAVersion[] = { - 4, 4534, 14298, 18828, 23358, 38888, 54418, 57172, 59926, 62450, - 62952, 67482, 72258, 74538, 79314, 87722, 103252, 115176, 127100, 127898, - 130256, 132614, 134972, 137330, 139688, 150196, 152554, 154912, 167422, 174762, - 182102, 194612, 198880, 199536, 206128, 206380, 216372, 226364, 235676, 244988, - 249098, 249606, 251160, 252714, 263116, 268706, 274296, 283562, 297986, 304566, - 312028, 313524, 319192, 324860, 331772, 336548, 336838, 339950, 343062, 346174, - 349286, 356246, 359358, 360434, 361510, 369966, 374366, 382822, 384202, 394946, - 396022, 396730, 399524, 401020, 403814, 418364, 419466, 420568, 425132, 433540, - 434384, 441504, 452132, 462760, 472804, 486772, 491302, 497722, 501260, 507680, - 509726, 521858, 524136, 525452, 533480, 538236, 549018, 559870, 564626, 565306, - 566734, 567616, 570144, 574102, 574900, 582518, 586350, 600736, 604734, 613812, - 616566, 619626, 623460, 627294, 631128, 634188, 648738, 663288, 667864, 681832, - 682048, 683014, 688908, 689124, 698888, 708652, 718416, 728180, 737944, 747708, - 752238, 765522, 766554, 772944, 774546, 776148, 776994, 781698, 786262, 789016, - 794630, 796422, 798998 -}; - -static const SCNHANDLE midiOffsetsSCNVersion[] = { - 4, 4504, 11762, 21532, 26070, 28754, 33254, 40512, 56310, 72108, - 74864, 77620, 80152, 80662, 85200, 89982, 92268, 97050, 105466, 121264, - 133194, 145124, 145928, 148294, 150660, 153026, 155392, 157758, 168272, 170638, - 173004, 185522, 192866, 200210, 212728, 217000, 217662, 224254, 224756, 234754, - 244752, 245256, 245950, 255256, 264562, 268678, 269192, 270752, 272312, 282712, - 288312, 293912, 303186, 317624, 324210, 331680, 333208, 338884, 344560, 351478, - 356262, 356552, 359670, 362788, 365906, 369024, 376014, 379132, 380214, 381296, - 389758, 394164, 402626, 404012, 414762, 415844, 416552, 419352, 420880, 423680, - 438236, 439338, 440440, 445010, 453426, 454276, 461398, 472032, 482666, 492716, - 506690, 511226, 517654, 521198, 527626, 529676, 541814, 546210, 547532, 555562, - 560316, 571104, 581962, 586716, 587402, 588836, 589718, 592246, 596212, 597016, - 604636, 608474, 622862, 626860, 635944, 638700, 641456, 645298, 649140, 652982, - 655738, 670294, 684850, 689432, 703628, 703850, 704816, 706350, 706572, 716342, - 726112, 735882, 745652, 755422, 765192, 774962, 784732, 794502, 804272, 814042, - 823812, 832996, 846286, 847324, 853714, 855324, 856934, 857786, 862496, 867066, - 869822, 875436, 877234, 879818 -}; - -// Alternative version used in German CD re-release "Neon Edition" -static const SCNHANDLE midiOffsetsSCNVersionALT[] = { - 4, 4504, 11762, 21532, 26070, 28754, 33254, 40512, 56310, 59066, - 61822, 64354, 64864, 69402, 74184, 76470, 81252, 89668, 105466, 117396, - 129326, 130130, 132496, 134862, 137228, 139594, 141960, 152474, 154840, 157206, - 169724, 177068, 184412, 196930, 201202, 201864, 208456, 208958, 218956, 228954, - 229458, 230152, 239458, 248764, 252880, 253394, 254954, 256514, 266914, 272514, - 278114, 287388, 301826, 308412, 315882, 317410, 323086, 328762, 335680, 340464, - 340754, 343872, 346990, 350108, 353226, 360216, 363334, 364416, 365498, 373960, - 378366, 386828, 388214, 398964, 400046, 400754, 403554, 405082, 407882, 422438, - 423540, 424642, 429212, 437628, 438478, 445600, 456234, 466868, 476918, 490892, - 495428, 501856, 505400, 511828, 513878, 526016, 530412, 531734, 539764, 544518, - 555306, 566164, 570918, 571604, 573038, 573920, 576448, 580414, 581218, 588838, - 592676, 607064, 611062, 620146, 622902, 625658, 629500, 633342, 637184, 639940, - 654496, 669052, 673634, 687830, 688052, 689018, 690552, 690774, 700544, 710314, - 720084, 729854, 739624, 749394, 759164, 768934, 778704, 788474, 798244, 808014, - 817198, 830488, 831526, 837916, 839526, 841136, 841988, 846698, 851268, 854024, - 859638, 861436, 864020 -}; +// We allocate 155 entries because that's the maximum, used in the SCN version +static SCNHANDLE midiOffsets[155]; static const int enhancedAudioGRAVersion[] = { 1, 2, 1, 1, 3, 3, 4, 4, 5, 6, // 1-10 @@ -185,34 +131,16 @@ static const int enhancedAudioSCNVersionALT[] = { }; int GetTrackNumber(SCNHANDLE hMidi) { - if (_vm->getFeatures() & GF_ALT_MIDI) { - for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersionALT); i++) { - if (midiOffsetsSCNVersionALT[i] == hMidi) - return i; - } - } else if (_vm->getFeatures() & GF_SCNFILES) { - for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersion); i++) { - if (midiOffsetsSCNVersion[i] == hMidi) - return i; - } - } else { - for (int i = 0; i < ARRAYSIZE(midiOffsetsGRAVersion); i++) { - if (midiOffsetsGRAVersion[i] == hMidi) - return i; - } - } + for (int i = 0; i < ARRAYSIZE(midiOffsets); i++) + if (midiOffsets[i] == hMidi) + return i; return -1; } SCNHANDLE GetTrackOffset(int trackNumber) { - if (_vm->getFeatures() & GF_SCNFILES) { - assert(trackNumber < ARRAYSIZE(midiOffsetsSCNVersion)); - return midiOffsetsSCNVersion[trackNumber]; - } else { - assert(trackNumber < ARRAYSIZE(midiOffsetsGRAVersion)); - return midiOffsetsGRAVersion[trackNumber]; - } + assert(trackNumber < ARRAYSIZE(midiOffsets)); + return midiOffsets[trackNumber]; } /** @@ -431,6 +359,28 @@ void OpenMidiFiles() { } } + // Now scan through the contents of the MIDI file to find the offset + // of each individual track, in order to create a mapping from MIDI + // offset to track number, for the enhanced MIDI soundtrack + // The first song is always at position 4. The subsequent ones are + // calculated dynamically. + uint32 curOffset = 4; + uint32 curTrack = 0; + uint32 songLength = 0; + + while (!midiStream.eos() && !midiStream.err()) { + assert(curTrack < ARRAYSIZE(midiOffsets)); + midiOffsets[curTrack++] = curOffset + (4 * curTrack); + //printf("%d: %d\n", curTrack - 1, midiOffsets[curTrack - 1]); + + songLength = midiStream.readUint32LE(); + curOffset += songLength; + midiStream.skip(songLength); + + if (curOffset + (4 * curTrack) >= (uint32)midiStream.size()) + break; + } + midiStream.close(); } -- cgit v1.2.3 From 3082354fa42c52317edd0e21703275e4e5b1493c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 24 Aug 2010 12:45:19 +0000 Subject: TINSEL: Adjusted the commented out music debug code for the latest changes to the lookup tables svn-id: r52333 --- engines/tinsel/music.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index fdc7702771..c360e2466a 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -368,6 +368,10 @@ void OpenMidiFiles() { uint32 curTrack = 0; uint32 songLength = 0; + // Init + for (int i = 0; i < ARRAYSIZE(midiOffsets); i++) + midiOffsets[i] = 0; + while (!midiStream.eos() && !midiStream.err()) { assert(curTrack < ARRAYSIZE(midiOffsets)); midiOffsets[curTrack++] = curOffset + (4 * curTrack); @@ -976,29 +980,21 @@ void dumpMusic() { int outFileSize = 0; char buffer[20000]; - int total = (_vm->getFeatures() & GF_SCNFILES) ? - ARRAYSIZE(midiOffsetsSCNVersion) : - ARRAYSIZE(midiOffsetsGRAVersion); + const int total = 155; // maximum (SCN version) for (int i = 0; i < total; i++) { + if (midiOffsets[i] == 0) + break; + sprintf(outName, "track%03d.xmi", i + 1); outFile.open(outName); - if (_vm->getFeatures() & GF_SCNFILES) { - if (i < total - 1) - outFileSize = midiOffsetsSCNVersion[i + 1] - midiOffsetsSCNVersion[i] - 4; - else - outFileSize = midiFile.size() - midiOffsetsSCNVersion[i] - 4; - - midiFile.seek(midiOffsetsSCNVersion[i] + 4, SEEK_SET); - } else { - if (i < total - 1) - outFileSize = midiOffsetsGRAVersion[i + 1] - midiOffsetsGRAVersion[i] - 4; - else - outFileSize = midiFile.size() - midiOffsetsGRAVersion[i] - 4; + if (i < total - 1) + outFileSize = midiOffsets[i + 1] - midiOffsets[i] - 4; + else + outFileSize = midiFile.size() - midiOffsets[i] - 4; - midiFile.seek(midiOffsetsGRAVersion[i] + 4, SEEK_SET); - } + midiFile.seek(midiOffsets[i] + 4, SEEK_SET); assert(outFileSize < 20000); midiFile.read(buffer, outFileSize); -- cgit v1.2.3 From 83c8ed97e3e5204e408e4ec8b73068142891ea25 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 24 Aug 2010 13:31:44 +0000 Subject: TINSEL: Code cleanup, fixed potentially undefined behavior svn-id: r52338 --- engines/tinsel/music.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index c360e2466a..ea34fa963a 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -361,7 +361,7 @@ void OpenMidiFiles() { // Now scan through the contents of the MIDI file to find the offset // of each individual track, in order to create a mapping from MIDI - // offset to track number, for the enhanced MIDI soundtrack + // offset to track number, for the enhanced MIDI soundtrack. // The first song is always at position 4. The subsequent ones are // calculated dynamically. uint32 curOffset = 4; @@ -373,16 +373,18 @@ void OpenMidiFiles() { midiOffsets[i] = 0; while (!midiStream.eos() && !midiStream.err()) { + if (curOffset + (4 * curTrack) >= (uint32)midiStream.size()) + break; + assert(curTrack < ARRAYSIZE(midiOffsets)); - midiOffsets[curTrack++] = curOffset + (4 * curTrack); - //printf("%d: %d\n", curTrack - 1, midiOffsets[curTrack - 1]); + midiOffsets[curTrack] = curOffset + (4 * curTrack); + //printf("%d: %d\n", curTrack, midiOffsets[curTrack]); songLength = midiStream.readUint32LE(); curOffset += songLength; midiStream.skip(songLength); - if (curOffset + (4 * curTrack) >= (uint32)midiStream.size()) - break; + curTrack++; } midiStream.close(); -- cgit v1.2.3 From 99c9ba697c0ae0296a3042166e09171123000525 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 25 Aug 2010 07:41:35 +0000 Subject: TINSEL: Fix bug #3032780: "DW: Mute setting does not work" Bug #3032778 was fixed too as it is the duplicate. Since there is no engine-specific logic, rely on superclass' setupSoundSettings(), and use it on startup too. svn-id: r52374 --- engines/tinsel/tinsel.cpp | 14 +------------- engines/tinsel/tinsel.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 0f5b27c85a..248c97e209 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -834,8 +834,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) DebugMan.addDebugChannel(kTinselDebugMusic, "music", "Music debugging"); // Setup mixer - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); - _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + syncSoundSettings(); // Add DW2 subfolder to search path in case user is running directly from the CDs const Common::FSNode gameDataDir(ConfMan.get("path")); @@ -907,17 +906,6 @@ TinselEngine::~TinselEngine() { MemoryDeinit(); } -void TinselEngine::syncSoundSettings() { - // Sync the engine with the config manager - int soundVolumeMusic = ConfMan.getInt("music_volume"); - int soundVolumeSFX = ConfMan.getInt("sfx_volume"); - int soundVolumeSpeech = ConfMan.getInt("speech_volume"); - - _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); - _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); -} - Common::String TinselEngine::getSavegameFilename(int16 saveNum) const { char filename[256]; snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index b11724239c..ed70979349 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -170,7 +170,6 @@ protected: #if 0 bool canSaveGameStateCurrently(); #endif - virtual void syncSoundSettings(); public: TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc); -- cgit v1.2.3 From 77c43f4d0dad81d31a502320e0d423e0f50cb17a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 11 Sep 2010 04:32:53 +0000 Subject: TINSEL: Fix for #3032778 - Mute not respected in DW2 svn-id: r52673 --- engines/tinsel/sound.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index ce2ed51d09..d97137d3ef 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -34,6 +34,7 @@ #include "tinsel/sysvar.h" #include "tinsel/background.h" +#include "common/config-manager.h" #include "common/endian.h" #include "common/file.h" #include "common/system.h" @@ -318,9 +319,13 @@ bool SoundManager::playSample(int id, int sub, bool bLooped, int x, int y, int p } // FIXME: Should set this in a different place ;) - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : _vm->_config->_soundVolume); //_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : _vm->_config->_voiceVolume); curChan->sampleNum = id; curChan->subSample = sub; -- cgit v1.2.3 From 70fed746df6ab0ff7fe2c80725fb0c94b8ea821a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 11 Sep 2010 05:28:54 +0000 Subject: TINSEL: Fix for #3032780 - Mute not respected in DW1 svn-id: r52674 --- engines/tinsel/music.cpp | 12 ++++++++++-- engines/tinsel/sound.cpp | 8 ++++++-- engines/tinsel/tinsel.cpp | 6 +++++- 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index ea34fa963a..9560624e05 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -158,7 +158,11 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) { if (TinselV1PSX) return false; if (_vm->_config->_musicVolume != 0) { - SetMidiVolume(_vm->_config->_musicVolume); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + SetMidiVolume(mute ? 0 : _vm->_config->_musicVolume); } // the index and length of the last tune loaded @@ -967,8 +971,12 @@ void RestoreMidiFacts(SCNHANDLE Midi, bool Loop) { currentLoop = Loop; if (_vm->_config->_musicVolume != 0 && Loop) { + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + PlayMidiSequence(currentMidi, true); - SetMidiVolume(_vm->_config->_musicVolume); + SetMidiVolume(mute ? 0 : _vm->_config->_musicVolume); } } diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index d97137d3ef..6e8e736e14 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -129,9 +129,13 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); // FIXME: Should set this in a different place ;) - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_config->_soundVolume); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : _vm->_config->_soundVolume); //_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume); + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : _vm->_config->_voiceVolume); Audio::AudioStream *sampleStream = 0; diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 248c97e209..702606e84b 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -1169,7 +1169,11 @@ void TinselEngine::RestartDrivers() { } // Set midi volume - SetMidiVolume(_vm->_config->_musicVolume); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + SetMidiVolume(mute ? 0 : _vm->_config->_musicVolume); } /** -- cgit v1.2.3 From f7f5a561eb389d1e31c50fd36b50178f9393c1ef Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 12 Sep 2010 14:18:40 +0000 Subject: TINSEL: Remove unused variable svn-id: r52684 --- engines/tinsel/tinsel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 702606e84b..888a47648f 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -146,7 +146,6 @@ void KeyboardProcess(CORO_PARAM, const void *) { // Get the next keyboard event off the stack Common::Event evt = _vm->_keypresses.front(); _vm->_keypresses.pop_front(); - const Common::Point mousePos = _vm->getMousePosition(); // Switch for special keys switch (evt.kbd.keycode) { -- cgit v1.2.3 From 6588398ce6fab85e287b10c2781d3797d7639cb9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 15 Sep 2010 22:00:20 +0000 Subject: MIDI: Send a reset MIDI device signal on startup. This is currently done in the engine code. I adapted AGI, AGOS, DRACI, GROOVIE, LURE, MADE, QUEEN, SAGA, SKY, TINSEL and TOUCHE to send a reset device on startup. The sound output still works fine (started up a game from every engine), so this should hopefully not introduce any regressions. As far as I can tell it seems that SCUMM does send a proper device reset, so I did not touch it. KYRA only sends a proper reset for MT-32 currently. I am not sure about SCI though. This fixes bug #3066826 "SIMON: MIDI notes off when using RTL after SCI". svn-id: r52736 --- engines/tinsel/tinsel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/tinsel') diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 888a47648f..bb6ed99138 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -867,6 +867,11 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc) //_midiMusic->setNativeMT32(native_mt32); //_midiMusic->setAdLib(adlib); + if (native_mt32) + _driver->sendMT32Reset(); + else + _driver->sendGMReset(); + _musicVolume = ConfMan.getInt("music_volume"); _sound = new SoundManager(this); -- cgit v1.2.3 From 2db927c22385586b20a514c5a920bb64b079267a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 28 Sep 2010 19:06:03 +0000 Subject: TINSEL: Remove redundant '_Windows' check svn-id: r52932 --- engines/tinsel/bmv.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'engines/tinsel') diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index b13de103c0..2077789b9c 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -66,13 +66,7 @@ namespace Tinsel { #define PREFETCH (NUM_SLOTS/2) // For initial test -#ifndef _Windows -//#define ADVANCE_SOUND 12 // 1 second -#define ADVANCE_SOUND 18 // 1 1/2 second -//#define MAX_ADVANCE_SOUND 36 // 3 seconds -#else #define ADVANCE_SOUND 18 // 1 1/2 seconds -#endif #define SUBSEQUENT_SOUND 6 // 1/2 second -- cgit v1.2.3