hedgewars/uMisc.pas
changeset 2647 0e1208e92dfe
parent 2639 8c6044bf1bb8
child 2648 415a75d45693
--- a/hedgewars/uMisc.pas	Sun Nov 29 16:37:12 2009 +0000
+++ b/hedgewars/uMisc.pas	Sun Nov 29 16:56:04 2009 +0000
@@ -174,6 +174,9 @@
 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;
@@ -560,6 +563,24 @@
 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