hedgewars/uGears.pas
changeset 4357 a1fcfc341a52
parent 4344 23ab3bdbf218
child 4359 83ef50815535
equal deleted inserted replaced
4355:4554c4df9f1a 4357:a1fcfc341a52
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uGears;
    21 unit uGears;
    22 interface
    22 interface
    23 uses SDLh, uConsts, uFloat, Math;
    23 uses SDLh, uConsts, uFloat, Math, uTypes;
    24 
    24 
    25 
       
    26 type
       
    27     PGear = ^TGear;
       
    28     TGearStepProcedure = procedure (Gear: PGear);
       
    29     TGear = record
       
    30             NextGear, PrevGear: PGear;
       
    31             Active: Boolean;
       
    32             AdvBounce: Longword;
       
    33             Invulnerable: Boolean;
       
    34             RenderTimer: Boolean;
       
    35             AmmoType : TAmmoType;
       
    36             State : Longword;
       
    37             X : hwFloat;
       
    38             Y : hwFloat;
       
    39             dX: hwFloat;
       
    40             dY: hwFloat;
       
    41             Kind: TGearType;
       
    42             Pos: Longword;
       
    43             doStep: TGearStepProcedure;
       
    44             Radius: LongInt;
       
    45             Angle, Power : Longword;
       
    46             DirAngle: real;
       
    47             Timer : LongWord;
       
    48             Elasticity: hwFloat;
       
    49             Friction  : hwFloat;
       
    50             Message, MsgParam : Longword;
       
    51             Hedgehog: pointer;
       
    52             Health, Damage, Karma: LongInt;
       
    53             CollisionIndex: LongInt;
       
    54             Tag: LongInt;
       
    55             Tex: PTexture;
       
    56             Z: Longword;
       
    57             IntersectGear: PGear;
       
    58             FlightTime: Longword;
       
    59             uid: Longword;
       
    60             ImpactSound: TSound; // first sound, others have to be after it in the sounds def.
       
    61             nImpactSounds: Word; // count of ImpactSounds
       
    62             SoundChannel: LongInt;
       
    63             PortalCounter: LongWord  // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion.
       
    64         end;
       
    65     TPGearArray = Array of PGear;
       
    66 
    25 
    67 var AllInactive: boolean;
    26 var AllInactive: boolean;
    68     PrvInactive: boolean;
    27     PrvInactive: boolean;
    69     CurAmmoGear: PGear;
    28     CurAmmoGear: PGear;
    70     GearsList: PGear;
    29     GearsList: PGear;