equal
deleted
inserted
replaced
26 procedure SoundLoad; |
26 procedure SoundLoad; |
27 procedure PlaySound(snd: TSound; infinite: boolean); |
27 procedure PlaySound(snd: TSound; infinite: boolean); |
28 procedure PlayMusic; |
28 procedure PlayMusic; |
29 procedure StopSound(snd: TSound); |
29 procedure StopSound(snd: TSound); |
30 function ChangeVolume(voldelta: LongInt): LongInt; |
30 function ChangeVolume(voldelta: LongInt): LongInt; |
31 procedure InitPlaylistChunk(seed: LongWord); |
|
32 |
31 |
33 var MusicFN: shortstring = ''; |
32 var MusicFN: shortstring = ''; |
34 |
33 |
35 implementation |
34 implementation |
36 uses uMisc, uConsole; |
35 uses uMisc, uConsole; |
58 |
57 |
59 procedure ReleaseSound; |
58 procedure ReleaseSound; |
60 var i: TSound; |
59 var i: TSound; |
61 begin |
60 begin |
62 for i:= Low(TSound) to High(TSound) do |
61 for i:= Low(TSound) to High(TSound) do |
63 Mix_FreeChunk(Soundz[i].id); |
62 Mix_FreeChunk(Soundz[i].id); |
|
63 |
64 Mix_FreeMusic(Mus); |
64 Mix_FreeMusic(Mus); |
65 Mix_CloseAudio |
65 Mix_CloseAudio |
66 end; |
66 end; |
67 |
67 |
68 procedure SoundLoad; |
68 procedure SoundLoad; |
122 Volume:= Mix_Volume(-1, -1); |
122 Volume:= Mix_Volume(-1, -1); |
123 Mix_VolumeMusic(Volume * 3 div 8); |
123 Mix_VolumeMusic(Volume * 3 div 8); |
124 ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME |
124 ChangeVolume:= Volume * 100 div MIX_MAX_VOLUME |
125 end; |
125 end; |
126 |
126 |
127 procedure InitPlaylistChunk(seed: LongWord); |
|
128 {$IFDEF HAVE_MUSIC} |
|
129 var i, t, nt: Longword; |
|
130 {$ENDIF} |
|
131 begin |
|
132 {$IFDEF HAVE_MUSIC} |
|
133 for i:= 0 to Pred(cPlayListLength) do |
|
134 playlistchain[i]:= 0; |
|
135 |
|
136 t:= 0; |
|
137 for i:= 0 to cPlayListLength - 2 do |
|
138 begin |
|
139 repeat |
|
140 seed:= seed * 1664525 + 1013904223; |
|
141 nt:= seed mod cPlayListLength; |
|
142 until (t <> nt) and (playlistchain[nt] = 0); |
|
143 playlistchain[t]:= nt; |
|
144 t:= nt; |
|
145 end |
|
146 {$ENDIF} |
|
147 end; |
|
148 |
|
149 end. |
127 end. |