hedgewars/uMisc.pas
changeset 3599 715a43602da8
parent 3598 a8aa06bae895
child 3611 ed00aa2b339e
equal deleted inserted replaced
3598:a8aa06bae895 3599:715a43602da8
    15 * along with this program; if not, write to the Free Software
    15 * along with this program; if not, write to the Free Software
    16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17 *)
    17 *)
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
       
    20 {$INLINE ON}
    20 
    21 
    21 unit uMisc;
    22 unit uMisc;
    22 interface
    23 interface
    23 
    24 
    24 uses    SDLh, uConsts, uFloat, GLunit, Math;
    25 uses    SDLh, uConsts, uFloat, GLunit, Math;
   145 procedure movecursor(dx, dy: LongInt);
   146 procedure movecursor(dx, dy: LongInt);
   146 function  hwSign(r: hwFloat): LongInt;
   147 function  hwSign(r: hwFloat): LongInt;
   147 function  Min(a, b: LongInt): LongInt;
   148 function  Min(a, b: LongInt): LongInt;
   148 function  Max(a, b: LongInt): LongInt;
   149 function  Max(a, b: LongInt): LongInt;
   149 procedure OutError(Msg: shortstring; isFatalError: boolean);
   150 procedure OutError(Msg: shortstring; isFatalError: boolean);
   150 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean);
   151 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline;
   151 procedure SDLTry(Assert: boolean; isFatal: boolean);
   152 procedure SDLTry(Assert: boolean; isFatal: boolean);
   152 function  IntToStr(n: LongInt): shortstring;
   153 function  IntToStr(n: LongInt): shortstring;
   153 function  FloatToStr(n: hwFloat): shortstring;
   154 function  FloatToStr(n: hwFloat): shortstring;
   154 function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
   155 function  DxDy2Angle(const _dY, _dX: hwFloat): GLfloat;
   155 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
   156 function  DxDy2Angle32(const _dY, _dX: hwFloat): LongInt;
   161 procedure SendStat(sit: TStatInfoType; s: shortstring);
   162 procedure SendStat(sit: TStatInfoType; s: shortstring);
   162 function  Str2PChar(const s: shortstring): PChar;
   163 function  Str2PChar(const s: shortstring): PChar;
   163 function  NewTexture(width, height: Longword; buf: Pointer): PTexture;
   164 function  NewTexture(width, height: Longword; buf: Pointer): PTexture;
   164 function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
   165 function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
   165 procedure FreeTexture(tex: PTexture);
   166 procedure FreeTexture(tex: PTexture);
   166 function  toPowerOf2(i: Longword): Longword;
   167 function  toPowerOf2(i: Longword): Longword; inline;
   167 function  DecodeBase64(s: shortstring): shortstring;
   168 function  DecodeBase64(s: shortstring): shortstring;
   168 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
   169 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
   169 function  endian(independent: LongWord): LongWord;
   170 function  endian(independent: LongWord): LongWord;
   170 {$IFDEF DEBUGFILE}
   171 {$IFDEF DEBUGFILE}
   171 procedure AddFileLog(s: shortstring);
   172 procedure AddFileLog(s: shortstring);