hedgewars/uUtils.pas
changeset 14896 63357ed39886
parent 14895 d4a19bf6687e
child 14946 23fc5022bdea
equal deleted inserted replaced
14895:d4a19bf6687e 14896:63357ed39886
    82 function  GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
    82 function  GetLaunchY(at: TAmmoType; angle: LongInt): LongInt;
    83 
    83 
    84 function CalcWorldWrap(X, radius: LongInt): LongInt;
    84 function CalcWorldWrap(X, radius: LongInt): LongInt;
    85 
    85 
    86 procedure updateVolumeDelta(precise: boolean);
    86 procedure updateVolumeDelta(precise: boolean);
       
    87 procedure updateCursorMovementDelta(precise: boolean; dir: LongInt; var cursorVar: LongInt);
    87 
    88 
    88 function read1stLn(filePath: shortstring): shortstring;
    89 function read1stLn(filePath: shortstring): shortstring;
    89 function readValueFromINI(key, filePath: shortstring): shortstring;
    90 function readValueFromINI(key, filePath: shortstring): shortstring;
    90 
    91 
    91 {$IFNDEF PAS2C}
    92 {$IFNDEF PAS2C}
   715         cVolumeDelta:= -3
   716         cVolumeDelta:= -3
   716 else
   717 else
   717     cVolumeDelta:= 0;
   718     cVolumeDelta:= 0;
   718 end;
   719 end;
   719 
   720 
       
   721 // helper function for cursor movement change controls
       
   722 procedure updateCursorMovementDelta(precise: boolean; dir: LongInt; var cursorVar: LongInt);
       
   723 begin
       
   724 if dir > 0 then
       
   725     if precise then
       
   726         cursorVar:= cameraKeyboardSpeedSlow
       
   727     else
       
   728         cursorVar:= cameraKeyboardSpeed
       
   729 else if dir < 0 then
       
   730     if precise then
       
   731         cursorVar:= - cameraKeyboardSpeedSlow
       
   732     else
       
   733         cursorVar:= - cameraKeyboardSpeed
       
   734 else
       
   735     cursorVar:= 0;
       
   736 end;
       
   737 
   720 function read1stLn(filePath: shortstring): shortstring;
   738 function read1stLn(filePath: shortstring): shortstring;
   721 var f: pfsFile;
   739 var f: pfsFile;
   722 begin
   740 begin
   723     read1stLn:= '';
   741     read1stLn:= '';
   724     if pfsExists(filePath) then
   742     if pfsExists(filePath) then