Ticket #1091: song.txt

File song.txt, 3.2 KB (added by Kirben, 16 years ago)

New Patch

Line 
1Index: scumm/sound.cpp
2===================================================================
3RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
4retrieving revision 1.355
5diff -u -r1.355 sound.cpp
6--- scumm/sound.cpp 19 Jul 2004 10:50:52 -0000 1.355
7+++ scumm/sound.cpp 21 Jul 2004 07:38:08 -0000
8@@ -69,6 +69,7 @@
9 _endOfMouthSync(false),
10 _curSoundPos(0),
11 _overrideFreq(0),
12+ _curSndMode(0),
13 _currentCDSound(0),
14 _currentMusic(0),
15 _soundsPaused(false),
16@@ -628,10 +629,14 @@
17 // HACK: Checking for script 99 in Sam & Max is to keep Conroy's song
18 // from being interrupted.
19
20- if (mode == 1 && (_vm->_gameId == GID_TENTACLE
21- || (_vm->_gameId == GID_SAMNMAX && !_vm->isScriptRunning(99)))) {
22- id = 777777;
23- _vm->_mixer->stopID(id);
24+ if (mode == 1 && (_vm->_gameId == GID_TENTACLE || (_vm->_gameId == GID_SAMNMAX))) {
25+ if (_curSndMode == 1) {
26+ _vm->_mixer->stopHandle(_sfx1ChannelHandle);
27+ handle = (&_sfx1ChannelHandle);
28+ } else {
29+ _vm->_mixer->stopHandle(_sfx0ChannelHandle);
30+ handle = (&_sfx0ChannelHandle);
31+ }
32 }
33
34 if (b > 8) {
35@@ -874,7 +879,7 @@
36 }
37 }
38
39-void Sound::talkSound(uint32 a, uint32 b, int mode, int frame) {
40+void Sound::talkSound(uint32 a, uint32 b, int mode, int frame, int sndMode) {
41 if (mode == 1) {
42 _talk_sound_a1 = a;
43 _talk_sound_b1 = b;
44@@ -883,6 +888,7 @@
45 _talk_sound_b2 = b;
46 }
47
48+ _curSndMode = sndMode;
49 _talk_sound_frame = frame;
50 _talk_sound_mode |= mode;
51 }
52Index: scumm/sound.h
53===================================================================
54RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
55retrieving revision 1.68
56diff -u -r1.68 sound.h
57--- scumm/sound.h 14 Jul 2004 07:29:09 -0000 1.68
58+++ scumm/sound.h 21 Jul 2004 07:38:08 -0000
59@@ -71,12 +71,15 @@
60 uint _curSoundPos;
61
62 int _overrideFreq;
63+ int _curSndMode;
64
65 int _currentCDSound;
66 int _currentMusic;
67 public:
68 PlayingSoundHandle _talkChannelHandle; // Handle of mixer channel actor is talking on
69 PlayingSoundHandle _musicChannelHandle; // Handle of mixer channel music is on
70+ PlayingSoundHandle _sfx0ChannelHandle; // Handle of first sfx channel
71+ PlayingSoundHandle _sfx1ChannelHandle; // Handle of second sfx channel
72
73 bool _soundsPaused;
74 byte _sfxMode;
75@@ -97,7 +100,7 @@
76 void stopSound(int a);
77 void stopAllSounds();
78 void soundKludge(int *list, int num);
79- void talkSound(uint32 a, uint32 b, int mode, int frame);
80+ void talkSound(uint32 a, uint32 b, int mode, int frame, int sndMode = 1);
81 void setupSound();
82 void pauseSounds(bool pause);
83
84Index: scumm/string.cpp
85===================================================================
86RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
87retrieving revision 1.226
88diff -u -r1.226 string.cpp
89--- scumm/string.cpp 18 Jul 2004 22:29:21 -0000 1.226
90+++ scumm/string.cpp 21 Jul 2004 07:38:09 -0000
91@@ -54,8 +54,10 @@
92 // and setting VAR_V6_SOUNDMODE beforehand. See patch 609791.
93 // FIXME: There are other VAR_V6_SOUNDMODE states, as
94 // mentioned in the patch. FIXME after iMUSE is done.
95- if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2))
96- _sound->talkSound(a, b, 1, -1);
97+ if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2)) {
98+ int sndMode = VAR(VAR_V6_SOUNDMODE);
99+ _sound->talkSound(a, b, 1, -1, sndMode);
100+ }
101 }
102 }
103