hedgewars/uMisc.pas
changeset 2747 7889a3a9724f
parent 2745 11fce231f24a
child 2753 2305bb5dc5f2
equal deleted inserted replaced
2746:55593f8a490b 2747:7889a3a9724f
   106 	cGravity	: hwFloat;
   106 	cGravity	: hwFloat;
   107 	cDamageModifier	: hwFloat;
   107 	cDamageModifier	: hwFloat;
   108 	cLaserSighting	: boolean;
   108 	cLaserSighting	: boolean;
   109 	cVampiric	: boolean;
   109 	cVampiric	: boolean;
   110 	cArtillery	: boolean;
   110 	cArtillery	: boolean;
       
   111 	WeaponTooltipTex : PTexture;
       
   112 	cWeaponTooltips: boolean;
   111 
   113 
   112 	flagMakeCapture	: boolean;
   114 	flagMakeCapture	: boolean;
   113 
   115 
   114 	InitStepsFlags	: Longword;
   116 	InitStepsFlags	: Longword;
   115 	RealTicks	: Longword;
   117 	RealTicks	: Longword;
   123     TextureList : PTexture;
   125     TextureList : PTexture;
   124 
   126 
   125 
   127 
   126 procedure init_uMisc;
   128 procedure init_uMisc;
   127 procedure free_uMisc;
   129 procedure free_uMisc;
       
   130 procedure SplitBySpace(var a, b: shortstring);
       
   131 procedure SplitByChar(var a, b: string; c: char);
   128 procedure movecursor(dx, dy: Integer);
   132 procedure movecursor(dx, dy: Integer);
   129 function  hwSign(r: hwFloat): LongInt;
   133 function  hwSign(r: hwFloat): LongInt;
   130 function  Min(a, b: LongInt): LongInt;
   134 function  Min(a, b: LongInt): LongInt;
   131 function  Max(a, b: LongInt): LongInt;
   135 function  Max(a, b: LongInt): LongInt;
   132 procedure OutError(Msg: String; isFatalError: boolean);
   136 procedure OutError(Msg: String; isFatalError: boolean);
   163 
   167 
   164 var KBnum: Longword;
   168 var KBnum: Longword;
   165 {$IFDEF DEBUGFILE}
   169 {$IFDEF DEBUGFILE}
   166     f: textfile;
   170     f: textfile;
   167 {$ENDIF}
   171 {$ENDIF}
       
   172 
       
   173 // should this include "strtolower()" for the split string?
       
   174 procedure SplitBySpace(var a, b: shortstring);
       
   175 var i, t: LongInt;
       
   176 begin
       
   177 i:= Pos(' ', a);
       
   178 if i > 0 then
       
   179 	begin
       
   180 	for t:= 1 to Pred(i) do
       
   181 		if (a[t] >= 'A')and(a[t] <= 'Z') then Inc(a[t], 32);
       
   182 	b:= copy(a, i + 1, Length(a) - i);
       
   183 	byte(a[0]):= Pred(i)
       
   184 	end else b:= '';
       
   185 end;
       
   186 
       
   187 procedure SplitByChar(var a, b: string; c: char);
       
   188 var i: LongInt;
       
   189 begin
       
   190 i:= Pos(c, a);
       
   191 if i > 0 then
       
   192 	begin
       
   193 	b:= copy(a, i + 1, Length(a) - i);
       
   194 	byte(a[0]):= Pred(i)
       
   195 	end else b:= '';
       
   196 end;
   168 
   197 
   169 procedure movecursor(dx, dy: Integer);
   198 procedure movecursor(dx, dy: Integer);
   170 var x, y: LongInt;
   199 var x, y: LongInt;
   171 begin
   200 begin
   172 if (dx = 0) and (dy = 0) then exit;
   201 if (dx = 0) and (dy = 0) then exit;