diff -r f7944d5adc5f -r aa79f631711b hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sun Apr 19 11:40:41 2009 +0000 +++ b/hedgewars/GSHandlers.inc Sun Apr 19 11:59:23 2009 +0000 @@ -1095,83 +1095,6 @@ end; //////////////////////////////////////////////////////////////////////////////// -const cSorterWorkTime = 640; -var thexchar: array[0..cMaxTeams] of - record - dy, ny, dw: LongInt; - team: PTeam; - SortFactor: QWord; - end; - currsorter: PGear = nil; - -procedure doStepTeamHealthSorterWork(Gear: PGear); -var i: LongInt; -begin -AllInactive:= false; -dec(Gear^.Timer); -if (Gear^.Timer and 15) = 0 then - for i:= 0 to Pred(TeamsCount) do - with thexchar[i] do - begin - {$WARNINGS OFF} - team^.DrawHealthY:= ny + dy * Gear^.Timer div 640; - team^.TeamHealthBarWidth:= team^.NewTeamHealthBarWidth + dw * Gear^.Timer div cSorterWorkTime; - {$WARNINGS ON} - end; - -if (Gear^.Timer = 0) or (currsorter <> Gear) then - begin - if currsorter = Gear then currsorter:= nil; - DeleteGear(Gear) - end -end; - -procedure doStepTeamHealthSorter(Gear: PGear); -var i: Longword; - b: boolean; - t: LongInt; -begin -AllInactive:= false; - -for t:= 0 to Pred(TeamsCount) do - with thexchar[t] do - begin - dy:= TeamsArray[t]^.DrawHealthY; - dw:= TeamsArray[t]^.TeamHealthBarWidth - TeamsArray[t]^.NewTeamHealthBarWidth; - team:= TeamsArray[t]; - SortFactor:= TeamsArray[t]^.Clan^.ClanHealth; - SortFactor:= (SortFactor shl 3) + TeamsArray[t]^.Clan^.ClanIndex; - SortFactor:= (SortFactor shl 30) + TeamsArray[t]^.TeamHealth; - end; - -if TeamsCount > 1 then - repeat - b:= true; - for t:= 0 to TeamsCount - 2 do - if (thexchar[t].SortFactor > thexchar[Succ(t)].SortFactor) then - begin - thexchar[cMaxTeams]:= thexchar[t]; - thexchar[t]:= thexchar[Succ(t)]; - thexchar[Succ(t)]:= thexchar[cMaxTeams]; - b:= false - end - until b; - -t:= - 4; -for i:= 0 to Pred(TeamsCount) do - with thexchar[i] do - begin - dec(t, team^.HealthTex^.h + 2); - ny:= t; - dy:= dy - ny - end; - -Gear^.Timer:= cSorterWorkTime; -Gear^.doStep:= @doStepTeamHealthSorterWork; -currsorter:= Gear -end; - -//////////////////////////////////////////////////////////////////////////////// procedure doStepIdle(Gear: PGear); begin AllInactive:= false;