hedgewars/uGears.pas
changeset 2699 249adefa9c1c
parent 2695 ed789a7ef68d
child 2716 b9ca1bfca24f
--- a/hedgewars/uGears.pas	Sat Jan 16 17:30:37 2010 +0000
+++ b/hedgewars/uGears.pas	Mon Jan 18 05:36:08 2010 +0000
@@ -59,6 +59,8 @@
 			uid: Longword
 			end;
 
+procedure init_uGears;
+procedure free_uGears;
 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
 procedure ProcessGears;
 procedure ResetUtilities;
@@ -72,24 +74,23 @@
 procedure InsertGearToList(Gear: PGear);
 procedure RemoveGearFromList(Gear: PGear);
 
-var CurAmmoGear: PGear = nil;
-    GearsList: PGear = nil;
-    KilledHHs: Longword = 0;
-    SuddenDeathDmg: Boolean = false;
-    SpeechType: Longword = 1;
+var CurAmmoGear: PGear;
+    GearsList: PGear;
+    KilledHHs: Longword;
+    SuddenDeathDmg: Boolean;
+    SpeechType: Longword;
     SpeechText: shortstring;
-	TrainingTargetGear: PGear = nil;
-	skipFlag: boolean = false;
+    TrainingTargetGear: PGear;
+    skipFlag: boolean;
 
 implementation
-uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
-	uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI, uAmmos, uTriggers,
+uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics,
+	uAIMisc, uLocale, uAI, uAmmos, uTriggers, uStats, uVisualGears,
 {$IFDEF GLES11}
-	gles11,
+	gles11;
 {$ELSE}
-	GL,
+	GL;
 {$ENDIF}
-	uStats, uVisualGears;
 
 const MAXROPEPOINTS = 384;
 var RopePoints: record
@@ -2041,9 +2042,20 @@
 	end
 end;
 
-initialization
+procedure init_uGears;
+begin
+	CurAmmoGear:= nil;
+	GearsList:= nil;
+	KilledHHs:= 0;
+	SuddenDeathDmg:= false;
+	SpeechType:= 1;
+	TrainingTargetGear:= nil;
+	skipFlag:= false;
+end;
 
-finalization
-FreeGearsList;
+procedure free_uGears;
+begin
+	FreeGearsList();
+end;
 
 end.