diff -r c00db97a668f -r 4ac87acbaed9 hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Tue Jan 21 22:44:37 2014 +0100 +++ b/hedgewars/uGearsList.pas Tue Jan 21 22:53:15 2014 +0100 @@ -20,7 +20,7 @@ unit uGearsList; interface -uses uFloat, uTypes; +uses uFloat, uTypes, SDLh; function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; procedure DeleteGear(Gear: PGear); @@ -156,6 +156,7 @@ function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; var gear: PGear; + c: byte; begin inc(GCounter); @@ -182,6 +183,7 @@ // Define ammo association, if any. gear^.AmmoType:= GearKindAmmoTypeMap[Kind]; gear^.CollisionMask:= $FFFF; +gear^.Tint:= $FFFFFFFF; if CurrentHedgehog <> nil then begin @@ -237,6 +239,18 @@ if (GameFlags and gfAISurvival) <> 0 then if gear^.Hedgehog^.BotLevel > 0 then gear^.Hedgehog^.Effects[heResurrectable] := 1; + // this would presumably be set in the frontend + // if we weren't going to do that yet, would need to reinit GetRandom + // oh, and, randomising slightly R and B might be nice too. + //gear^.Tint:= $fa00efff or ((random(80)+128) shl 16) + //gear^.Tint:= $faa4efff + //gear^.Tint:= (($e0+random(32)) shl 24) or + // ((random(80)+128) shl 16) or + // (($d5+random(32)) shl 8) or $ff + c:= random(32); + gear^.Tint:= (($e0+c) shl 24) or + ((random(90)+128) shl 16) or + (($d5+c) shl 8) or $ff end; gtShell: begin gear^.Elasticity:= _0_8; @@ -274,6 +288,9 @@ Health:= random(vobFrameTicks); if gear^.Timer = 0 then Timer:= random(vobFramesCount); Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8; + Tint:= (ExplosionBorderColor and RMask shl RShift) or + (ExplosionBorderColor and GMask shl GShift) or + (ExplosionBorderColor and BMask shl BShift) or $FF; end end; gtGrave: begin @@ -402,7 +419,10 @@ gear^.Radius:= 15; gear^.Tag:= Y end; - gtAirAttack: gear^.Z:= cHHZ+2; + gtAirAttack: begin + gear^.Z:= cHHZ+2; + gear^.Tint:= gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF + end; gtAirBomb: begin gear^.Radius:= 5; gear^.Density:= _2; @@ -487,7 +507,8 @@ gtRCPlane: begin if gear^.Timer = 0 then gear^.Timer:= 15000; gear^.Health:= 3; - gear^.Radius:= 8 + gear^.Radius:= 8; + gear^.Tint:= gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF end; gtJetpack: begin gear^.Health:= 2000; @@ -546,10 +567,12 @@ gtPoisonCloud: begin if gear^.Timer = 0 then gear^.Timer:= 5000; gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000; + gear^.Tint:= $C0C000C0 end; gtResurrector: begin gear^.Radius := 100; - gear^.Tag := 0 + gear^.Tag := 0; + gear^.Tint:= $F5DB35FF end; gtWaterUp: begin gear^.Tag := 47;