hedgewars/uVariables.pas
changeset 6982 8d41d22a291d
parent 6957 ab8034208fcd
child 7007 0ccdff4ae8e9
--- a/hedgewars/uVariables.pas	Tue May 01 20:54:30 2012 +0400
+++ b/hedgewars/uVariables.pas	Tue May 01 19:56:55 2012 +0200
@@ -110,6 +110,22 @@
 
     GameTicks   : LongWord;
 
+    // originally typed consts
+    CharArray: array[byte] of Char;
+    LastTint: Longword;
+    SocketString: shortstring;
+    VGCounter: Longword;
+    PrevX: LongInt;
+    timedelta: Longword;
+    StartTicks: Longword;
+    Counter: Longword;
+    StepTicks: LongWord;
+    ExplosionBorderColor: LongWord;
+    WaterOpacity: byte;
+    SDWaterOpacity: byte;
+    prevGState: TGameState;
+    GrayScale: Boolean;
+
     // originally from uConsts
     Pathz: array[TPathType] of shortstring;
     UserPathz: array[TPathType] of shortstring;
@@ -194,6 +210,17 @@
 
     LuaGoals        : shortstring;
 
+    VoiceList : array[0..7] of TVoice =  (
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil),
+                    ( snd: sndNone; voicepack: nil));
+    LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
+
 /////////////////////////////////////
 //Buttons
 {$IFDEF USE_TOUCH_INTERFACE}
@@ -203,14 +230,11 @@
     firebutton, jumpWidget, AMWidget          : TOnScreenWidget;
     pauseButton, utilityWidget                : TOnScreenWidget;
 {$ENDIF}
+    AMAnimType      : LongInt;
 
-    AMAnimType      : LongInt;
+
 const
-    cHHFileName = 'Hedgehog';
-    cCHFileName = 'Crosshair';
-    cThemeCFGFilename = 'theme.cfg';
-
-    FontBorder = 2;
+    // these consts are here because they would cause circular dependencies in uConsts/uTypes
     cPathz: array[TPathType] of shortstring = (
         '',                              // ptNone
         '',                              // ptData
@@ -236,20 +260,6 @@
         'Graphics/Buttons'                // ptButton
     );
 
-    cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
-    cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
-
-    VoiceList : array[0..7] of TVoice =  (
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil),
-                    ( snd: sndNone; voicepack: nil));
-    LastVoice : TVoice = ( snd: sndNone; voicepack: nil );
-
     Fontz: array[THWFont] of THHFont = (
             (Handle: nil;
             Height: 12;
@@ -279,6 +289,7 @@
             {$ENDIF}
             );
 
+var
     SpritesData: array[TSprite] of record
             FileName: string[15];
             Path, AltPath: TPathType;
@@ -664,7 +675,7 @@
             Width: 3; Height: 17; imageWidth: 3; imageHeight: 17; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprSlider
             );
 
-
+const
     Wavez: array [TWave] of record
             Sprite: TSprite;
             FramesCount: Longword;
@@ -801,7 +812,7 @@
             (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
             (FileName:               'TARDIS.ogg'; Path: ptSounds) // sndTardis
             );
-
+var
     Ammoz: array [TAmmoType] of record
             NameId: TAmmoStrId;
             NameTex: PTexture;
@@ -2297,6 +2308,7 @@
             ejectY: -3)
         );
 
+const
     GearKindAmmoTypeMap : array [TGearType] of TAmmoType = (    
 (*          gtFlame *)   amNothing
 (*       gtHedgehog *) , amNothing
@@ -2443,7 +2455,6 @@
     vobSDFrameTicks, vobSDFramesCount, vobSDCount: Longword;
     vobSDVelocity, vobSDFallSpeed: LongInt;
 
-
     hideAmmoMenu: boolean;
     wheelUp: boolean;
     wheelDown: boolean;
@@ -2459,29 +2470,7 @@
     ControllerHats: array[0..5] of array[0..19] of Byte;
     ControllerButtons: array[0..5] of array[0..19] of Byte;
 
-    DefaultBinds, CurrentBinds: TBinds;
-
-    coeff: LongInt;
-
-{$IFDEF HWLIBRARY}
-    leftClick: boolean;
-    middleClick: boolean;
-    rightClick: boolean;
-
-    upKey: boolean;
-    downKey: boolean;
-    rightKey: boolean;
-    leftKey: boolean;
-    preciseKey: boolean;
-
-    backspaceKey: boolean;
-    spaceKey: boolean;
-    enterKey: boolean;
-    tabKey: boolean;
-
-    chatAction: boolean;
-    pauseAction: boolean;
-{$ENDIF}
+    DefaultBinds : TBinds;
 
 var trammo:  array[TAmmoStrId] of ansistring;   // name of the weapon
     trammoc: array[TAmmoStrId] of ansistring;   // caption of the weapon
@@ -2640,6 +2629,16 @@
     vobSDVelocity:= 15;
     vobSDFallSpeed:= 250;
 
+    PrevX:= 0;
+    timedelta:= 0;
+    Counter:= 0;
+    StepTicks:= 0;
+    ExplosionBorderColor:= $FF808080;
+    WaterOpacity:= $80;
+    SDWaterOpacity:= $80;
+    prevGState:= gsConfirm;
+    GrayScale:= false;
+
     LuaGoals:= '';
 end;