hedgewars/uSound.pas
changeset 10015 4feced261c68
parent 9998 736015b847e3
parent 9127 e350500c4edb
child 10108 c68cf030eded
equal deleted inserted replaced
10014:56d2f2d5aad8 10015:4feced261c68
   313     WriteToConsole('Init SDL_mixer... ');
   313     WriteToConsole('Init SDL_mixer... ');
   314     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
   314     SDLTry(Mix_Init(MIX_INIT_OGG) <> 0, true);
   315     WriteLnToConsole(msgOK);
   315     WriteLnToConsole(msgOK);
   316 
   316 
   317     Mix_AllocateChannels(Succ(chanTPU));
   317     Mix_AllocateChannels(Succ(chanTPU));
   318     ChangeVolume(cInitVolume);	
   318     ChangeVolume(cInitVolume);
   319 end;
   319 end;
   320 
   320 
   321 procedure ResetSound;
   321 procedure ResetSound;
   322 begin
   322 begin
   323     isSoundEnabled:= isSEBackup;
   323     isSoundEnabled:= isSEBackup;
   450     if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd <> sndNone) and (lastChan[LastVoice.snd] <> -1) and (Mix_Playing(lastChan[LastVoice.snd]) <> 0)) then
   450     if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd <> sndNone) and (lastChan[LastVoice.snd] <> -1) and (Mix_Playing(lastChan[LastVoice.snd]) <> 0)) then
   451         exit;
   451         exit;
   452     i:= 0;
   452     i:= 0;
   453     while (i<High(VoiceList)) and (VoiceList[i].snd = sndNone) do
   453     while (i<High(VoiceList)) and (VoiceList[i].snd = sndNone) do
   454         inc(i);
   454         inc(i);
   455     
   455 
   456     if (VoiceList[i].snd <> sndNone) then
   456     if (VoiceList[i].snd <> sndNone) then
   457         begin
   457         begin
   458         LastVoice.snd:= VoiceList[i].snd;
   458         LastVoice.snd:= VoiceList[i].snd;
   459         LastVoice.voicepack:= VoiceList[i].voicepack;
   459         LastVoice.voicepack:= VoiceList[i].voicepack;
   460         VoiceList[i].snd:= sndNone;
   460         VoiceList[i].snd:= sndNone;