hedgewars/uVisualGearsList.pas
changeset 9769 5814e0c47c99
parent 9287 bb9ad6a5f625
child 9960 fac73b8a52d3
child 9998 736015b847e3
equal deleted inserted replaced
9768:08799c901a42 9769:5814e0c47c99
    22 interface
    22 interface
    23 uses uTypes;
    23 uses uTypes;
    24 
    24 
    25 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
    25 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
    26 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
    26 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
    27 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear;
    27 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear; inline;
       
    28 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean; Layer: LongInt): PVisualGear;
    28 procedure DeleteVisualGear(Gear: PVisualGear);
    29 procedure DeleteVisualGear(Gear: PVisualGear);
    29 function  VisualGearByUID(uid : Longword) : PVisualGear;
    30 function  VisualGearByUID(uid : Longword) : PVisualGear;
    30 
    31 
    31 const 
    32 const 
    32     cExplFrameTicks = 110;
    33     cExplFrameTicks = 110;
    37 implementation
    38 implementation
    38 uses uFloat, uVariables, uConsts, uTextures, uVisualGearsHandlers;
    39 uses uFloat, uVariables, uConsts, uTextures, uVisualGearsHandlers;
    39 
    40 
    40 function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
    41 function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear; inline;
    41 begin
    42 begin
    42     AddVisualGear:= AddVisualGear(X, Y, Kind, 0, false);
    43     AddVisualGear:= AddVisualGear(X, Y, Kind, 0, false, -1);
    43 end;
    44 end;
    44 
    45 
    45 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
    46 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord): PVisualGear; inline;
    46 begin
    47 begin
    47     AddVisualGear:= AddVisualGear(X, Y, Kind, State, false);
    48     AddVisualGear:= AddVisualGear(X, Y, Kind, State, false, -1);
    48 end;
    49 end;
    49 
    50 
    50 function AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear;
    51 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean): PVisualGear; inline;
       
    52 begin
       
    53     AddVisualGear:= AddVisualGear(X, Y, Kind, State, Critical, -1);
       
    54 end;
       
    55 
       
    56 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord; Critical: Boolean; Layer: LongInt): PVisualGear;
    51 var gear: PVisualGear;
    57 var gear: PVisualGear;
    52     t: Longword;
    58     t: Longword;
    53     sp: real;
    59     sp: real;
    54 begin
    60 begin
    55 AddVisualGear:= nil;
    61 AddVisualGear:= nil;
   398     vgtSmokeRing,
   404     vgtSmokeRing,
   399     vgtNote,
   405     vgtNote,
   400     vgtBulletHit,
   406     vgtBulletHit,
   401     vgtCircle: gear^.Layer:= 2
   407     vgtCircle: gear^.Layer:= 2
   402 end;
   408 end;
       
   409 
       
   410 if Layer <> -1 then gear^.Layer:= Layer;
   403 
   411 
   404 if VisualGearLayers[gear^.Layer] <> nil then
   412 if VisualGearLayers[gear^.Layer] <> nil then
   405     begin
   413     begin
   406     VisualGearLayers[gear^.Layer]^.PrevGear:= gear;
   414     VisualGearLayers[gear^.Layer]^.PrevGear:= gear;
   407     gear^.NextGear:= VisualGearLayers[gear^.Layer]
   415     gear^.NextGear:= VisualGearLayers[gear^.Layer]