hedgewars/uVisualGears.pas
changeset 4420 6be946bcd17a
parent 4390 f219628ed666
child 4422 5e8cfef25ccb
equal deleted inserted replaced
4419:3d99c2c806ec 4420:6be946bcd17a
    23 uses uConsts, uFloat, GLunit, uTypes;
    23 uses uConsts, uFloat, GLunit, uTypes;
    24 
    24 
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 
    27 
    28 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
    28 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
    29 procedure ProcessVisualGears(Steps: Longword);
    29 procedure ProcessVisualGears(Steps: Longword);
    30 procedure KickFlakes(Radius, X, Y: LongInt);
    30 procedure KickFlakes(Radius, X, Y: LongInt);
    31 procedure DrawVisualGears(Layer: LongWord);
    31 procedure DrawVisualGears(Layer: LongWord);
    32 procedure DeleteVisualGear(Gear: PVisualGear);
    32 procedure DeleteVisualGear(Gear: PVisualGear);
    33 procedure AddClouds;
    33 procedure AddClouds;
    90             @doStepExplosion,
    90             @doStepExplosion,
    91             @doStepBigExplosion,
    91             @doStepBigExplosion,
    92             @doStepChunk,
    92             @doStepChunk,
    93             @doStepNote,
    93             @doStepNote,
    94             @doStepLineTrail,
    94             @doStepLineTrail,
    95             @doStepBulletHit
    95             @doStepBulletHit,
       
    96             @doStepCircle
    96         );
    97         );
    97 
    98 
    98 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
    99 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
    99 var gear: PVisualGear;
   100 var gear: PVisualGear;
   100     t: Longword;
   101     t: Longword;
   101     sp: real;
   102     sp: real;
   102 begin
   103 begin
   103 if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now
   104 if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now
   104     if Kind <> vgtCloud then
   105     if (Kind <> vgtCloud) and not Critical then
   105         begin
   106         begin
   106         AddVisualGear:= nil;
   107         AddVisualGear:= nil;
   107         exit
   108         exit
   108         end;
   109         end;
   109 
   110 
   110 if ((cReducedQuality and rqFancyBoom) <> 0) and
   111 if ((cReducedQuality and rqFancyBoom) <> 0) and
       
   112    not Critical and
   111    not (Kind in
   113    not (Kind in
   112    [vgtTeamHealthSorter,
   114    [vgtTeamHealthSorter,
   113     vgtSmallDamageTag,
   115     vgtSmallDamageTag,
   114     vgtSpeechBubble,
   116     vgtSpeechBubble,
   115     vgtHealthTag,
   117     vgtHealthTag,
   464             end;
   466             end;
   465         case Gear^.Kind of
   467         case Gear^.Kind of
   466             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   468             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   467             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   469             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   468             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   470             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
       
   471             vgtCircle: DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer, 
       
   472                       ((Gear^.Tint shr 24) and $FF), ((Gear^.Tint shr 16) and $FF), ((Gear^.Tint shr 8) and $FF), Gear^.Tint and $FF); 
       
   473 // Consider adding a version of DrawCircle that does not set Tint internally, and just call it here...
   469         end;
   474         end;
   470         Gear:= Gear^.NextGear
   475         Gear:= Gear^.NextGear
   471         end
   476         end
   472     end
   477     end
   473 end;
   478 end;