hedgewars/uSound.pas
changeset 8471 7681d14b9f01
parent 8370 0c79946e96f8
child 8678 fb62d23c70f8
equal deleted inserted replaced
8470:01ddeb241c21 8471:7681d14b9f01
   103 
   103 
   104 // Returns a pointer to the voicepack with the given name.
   104 // Returns a pointer to the voicepack with the given name.
   105 function  AskForVoicepack(name: shortstring): Pointer;
   105 function  AskForVoicepack(name: shortstring): Pointer;
   106 
   106 
   107 
   107 
       
   108 var Volume: LongInt;
       
   109     SoundTimerTicks: Longword;
   108 implementation
   110 implementation
   109 uses uVariables, uConsole, uCommands, uDebug, uPhysFSLayer;
   111 uses uVariables, uConsole, uCommands, uDebug, uPhysFSLayer;
   110 
   112 
   111 const chanTPU = 32;
   113 const chanTPU = 32;
   112 var Volume: LongInt;
   114 var cInitVolume: LongInt;
   113     cInitVolume: LongInt;
       
   114     previousVolume: LongInt; // cached volume value
   115     previousVolume: LongInt; // cached volume value
   115     lastChan: array [TSound] of LongInt;
   116     lastChan: array [TSound] of LongInt;
   116     voicepacks: array[0..cMaxTeams] of TVoicepack;
   117     voicepacks: array[0..cMaxTeams] of TVoicepack;
   117     defVoicepack: PVoicepack;
   118     defVoicepack: PVoicepack;
   118     Mus: PMixMusic; // music pointer
   119     Mus: PMixMusic; // music pointer
   710     MusicFN:='';
   711     MusicFN:='';
   711     Mus:= nil;
   712     Mus:= nil;
   712     isAudioMuted:= false;
   713     isAudioMuted:= false;
   713     isSEBackup:= isSoundEnabled;
   714     isSEBackup:= isSoundEnabled;
   714     Volume:= 0;
   715     Volume:= 0;
       
   716     SoundTimerTicks:= 0;
   715     defVoicepack:= AskForVoicepack('Default');
   717     defVoicepack:= AskForVoicepack('Default');
   716 
   718 
   717     for i:= Low(TSound) to High(TSound) do
   719     for i:= Low(TSound) to High(TSound) do
   718         lastChan[i]:= -1;
   720         lastChan[i]:= -1;
   719 
   721