hedgewars/uMisc.pas
changeset 2670 1b327b7515ed
parent 2666 2b8c8f16421e
child 2671 7e0f88013fe8
equal deleted inserted replaced
2669:4eec706e86b0 2670:1b327b7515ed
   167 function  Str2PChar(const s: shortstring): PChar;
   167 function  Str2PChar(const s: shortstring): PChar;
   168 function NewTexture(width, height: Longword; buf: Pointer): PTexture;
   168 function NewTexture(width, height: Longword; buf: Pointer): PTexture;
   169 function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
   169 function  Surface2Tex(surf: PSDL_Surface; enableClamp: boolean): PTexture;
   170 procedure FreeTexture(tex: PTexture);
   170 procedure FreeTexture(tex: PTexture);
   171 function  toPowerOf2(i: Longword): Longword;
   171 function  toPowerOf2(i: Longword): Longword;
   172 function DecodeBase64(s: shortstring): shortstring;
   172 function  DecodeBase64(s: shortstring): shortstring;
   173 function doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
   173 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
       
   174 function  endian(independent: LongWord): LongWord;
   174 {$IFNDEF IPHONEOS}
   175 {$IFNDEF IPHONEOS}
   175 procedure MakeScreenshot(s: shortstring);
   176 procedure MakeScreenshot(s: shortstring);
   176 {$ENDIF}
   177 {$ENDIF}
   177 
   178 
   178 function modifyDamage(dmg: Longword): Longword;
   179 function modifyDamage(dmg: Longword): Longword;
   558 		doSurfaceConversion:= convertedSurf
   559 		doSurfaceConversion:= convertedSurf
   559 	end
   560 	end
   560 	else doSurfaceConversion:= tmpsurf;
   561 	else doSurfaceConversion:= tmpsurf;
   561 end;
   562 end;
   562 
   563 
       
   564 function endian(independent: LongWord): LongWord;
       
   565 begin
       
   566 {$IFDEF ENDIAN_LITTLE}
       
   567 endian:= independent;
       
   568 {$ELSE}
       
   569 endian:= (((independent and $FF000000) shr 24) or
       
   570 	  ((independent and $00FF0000) shr 8) or
       
   571 	  ((independent and $0000FF00) shl 8) or
       
   572 	  ((independent and $000000FF) shl 24))
       
   573 {$ENDIF}
       
   574 end;
   563 
   575 
   564 initialization
   576 initialization
   565 cDrownSpeed.QWordValue:= 257698038;// 0.06
   577 cDrownSpeed.QWordValue:= 257698038;// 0.06
   566 cMaxWindSpeed.QWordValue:= 2147484;// 0.0005
   578 cMaxWindSpeed.QWordValue:= 2147484;// 0.0005
   567 cWindSpeed.QWordValue:= 429496;// 0.0001
   579 cWindSpeed.QWordValue:= 429496;// 0.0001