Get rid of stupid ToggleLongInt and ToggleString functions
authorunc0rr
Sun, 29 Nov 2009 18:30:21 +0000
changeset 2648 415a75d45693
parent 2647 0e1208e92dfe
child 2649 afec403dce10
Get rid of stupid ToggleLongInt and ToggleString functions
hedgewars/uLandGraphics.pas
hedgewars/uMisc.pas
--- a/hedgewars/uLandGraphics.pas	Sun Nov 29 16:56:04 2009 +0000
+++ b/hedgewars/uLandGraphics.pas	Sun Nov 29 18:30:21 2009 +0000
@@ -499,7 +499,7 @@
 
 	if c < 4 then // 0-3 neighbours
 		begin
-        LandPixels[Y, X]:= ToggleLongInt(Land[Y, X] = COLOR_LAND, LandBackPixel(X, Y), 0);
+        if Land[Y, X] = COLOR_LAND then LandPixels[Y, X]:= LandBackPixel(X, Y) else LandPixels[Y, X]:= 0;
 		Land[Y, X]:= 0;
 		exit(true);
 		end;
--- a/hedgewars/uMisc.pas	Sun Nov 29 16:56:04 2009 +0000
+++ b/hedgewars/uMisc.pas	Sun Nov 29 18:30:21 2009 +0000
@@ -174,9 +174,6 @@
 procedure MakeScreenshot(s: shortstring);
 {$ENDIF}
 
-function ToggleLongInt(t: Boolean; a, b: LongInt): LongInt;
-function ToggleString(t: Boolean; a, b: string): string;
-
 function modifyDamage(dmg: Longword): Longword;
 
 var CursorPoint: TPoint;
@@ -563,24 +560,6 @@
 end;
 
 
-{$inline on}
-function ToggleLongInt(t: Boolean; a, b: LongInt): LongInt;
-begin
-    if t then
-	    ToggleLongInt:= a
-    else
-        ToggleLongInt:= b;
-end;
-
-function ToggleString(t: Boolean; a, b: string): string;
-begin
-    if t then
-	    ToggleString:= a
-    else
-        ToggleString:= b;
-end;
-{$inline off}
-
 initialization
 cDrownSpeed.QWordValue:= 257698038;// 0.06
 cMaxWindSpeed.QWordValue:= 2147484;// 0.0005