hedgewars/uSound.pas
changeset 4398 36d7e4b6ca81
parent 4377 43945842da0c
child 4403 0dfe26f48ec1
equal deleted inserted replaced
4397:ab577db125c4 4398:36d7e4b6ca81
    44 function  ChangeVolume(voldelta: LongInt): LongInt;
    44 function  ChangeVolume(voldelta: LongInt): LongInt;
    45 function  AskForVoicepack(name: shortstring): Pointer;
    45 function  AskForVoicepack(name: shortstring): Pointer;
    46 
    46 
    47 
    47 
    48 implementation
    48 implementation
    49 uses uMisc, uVariables, uConsole, uUtils, uIO;
    49 uses uMisc, uVariables, uConsole, uUtils, uIO, uCommands;
    50 
    50 
    51 const chanTPU = 32;
    51 const chanTPU = 32;
    52 var Volume: LongInt;
    52 var Volume: LongInt;
    53     lastChan: array [TSound] of LongInt;
    53     lastChan: array [TSound] of LongInt;
    54     voicepacks: array[0..cMaxTeams] of TVoicepack;
    54     voicepacks: array[0..cMaxTeams] of TVoicepack;
   315         exit;
   315         exit;
   316 
   316 
   317     Mix_ResumeMusic(Mus);
   317     Mix_ResumeMusic(Mus);
   318 end;
   318 end;
   319 
   319 
       
   320 procedure chVoicepack(var s: shortstring);
       
   321 begin
       
   322     if CurrentTeam = nil then OutError(errmsgIncorrectUse + ' "/voicepack"', true);
       
   323     if s[1]='"' then Delete(s, 1, 1);
       
   324     if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
   325     CurrentTeam^.voicepack:= AskForVoicepack(s)
       
   326 end;
       
   327 
   320 procedure initModule;
   328 procedure initModule;
   321 begin
   329 begin
       
   330     RegisterVariable('voicepack', vtCommand, @chVoicepack, false);
   322     MusicFN:='';
   331     MusicFN:='';
   323 end;
   332 end;
   324 
   333 
   325 procedure freeModule;
   334 procedure freeModule;
   326 begin
   335 begin