hedgewars/uSound.pas
changeset 2230 d6963f72d21a
parent 2222 2e98698b76aa
child 2232 3605547e7f4a
equal deleted inserted replaced
2229:081081a61a16 2230:d6963f72d21a
    25 	{$linkframework OpenAL}
    25 	{$linkframework OpenAL}
    26 	{$linkframework Ogg}
    26 	{$linkframework Ogg}
    27 	{$linkframework Vorbis}
    27 	{$linkframework Vorbis}
    28 {$ELSE}
    28 {$ELSE}
    29 {$IFNDEF MSVC}
    29 {$IFNDEF MSVC}
       
    30 	{$linklib openalbridge}
       
    31 {$IFNDEF WIN32}
    30 	{$linklib openal}
    32 	{$linklib openal}
       
    33 {$ELSE}
       
    34 	{$linklib openal32}
       
    35 {$ENDIF}
    31 	{$linklib ogg}
    36 	{$linklib ogg}
    32 	{$linklib vorbis}
    37 	{$linklib vorbis}
    33 	{$linklib vorbisfile}
    38 	{$linklib vorbisfile}
    34 {$ENDIF}
    39 {$ENDIF}
    35 {$ENDIF}
    40 {$ENDIF}
    41 	TVoicepack = record
    46 	TVoicepack = record
    42 		name: shortstring;
    47 		name: shortstring;
    43 		chunks: array [TSound] of LongInt;
    48 		chunks: array [TSound] of LongInt;
    44 		end;
    49 		end;
    45 
    50 
    46 const OpenALBridge = 'openalbridge';
    51 const OpenALBridge = 'libopenalbridge';
    47 
    52 
    48 procedure InitSound;
    53 procedure InitSound;
    49 procedure ReleaseSound;
    54 procedure ReleaseSound;
    50 procedure SoundLoad;
    55 procedure SoundLoad;
    51 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
    56 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
    72 
    77 
    73 var MusicFN: shortstring = '';
    78 var MusicFN: shortstring = '';
    74 
    79 
    75 implementation
    80 implementation
    76 
    81 
    77 uses uMisc, uConsole, uStore;
    82 uses uMisc, uConsole;
    78 
    83 
    79 const chanTPU = 12;
    84 const chanTPU = 12;
    80 var	lastChan: array [TSound] of LongInt;
    85 var	lastChan: array [TSound] of LongInt;
    81 	voicepacks: array[0..cMaxTeams] of TVoicepack;
    86 	voicepacks: array[0..cMaxTeams] of TVoicepack;
    82 	defVoicepack: PVoicepack;
    87 	defVoicepack: PVoicepack;
   146 				if voicepacks[t].chunks[i] < 0 then
   151 				if voicepacks[t].chunks[i] < 0 then
   147 					WriteLnToConsole(msgFailed)
   152 					WriteLnToConsole(msgFailed)
   148 				else
   153 				else
   149 					WriteLnToConsole(msgOK)
   154 					WriteLnToConsole(msgOK)
   150 				end;
   155 				end;
   151 				
       
   152 AddProgress;
       
   153 end;
   156 end;
   154 
   157 
   155 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
   158 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
   156 begin
   159 begin
   157 if (not isSoundEnabled) or fastUntilLag then exit;
   160 if (not isSoundEnabled) or fastUntilLag then exit;