Engine:
authorsmxx
Thu, 29 Apr 2010 19:39:58 +0000 (2010-04-29)
changeset 3379 f73e0e8e55c2
parent 3378 4f2185ed8ca8
child 3380 a46a311097af
Engine: * Fixed highlight color (little/big endian issue or just different byte order for clan colors?)
hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Thu Apr 29 19:21:40 2010 +0000
+++ b/hedgewars/uTeams.pas	Thu Apr 29 19:39:58 2010 +0000
@@ -80,6 +80,7 @@
 
     TClan = record
             Color: Longword;
+            RColor: Longword; // color with reversed byte order
             Teams: array[0..Pred(cMaxTeams)] of PTeam;
             TeamsNumber: Longword;
             CurrTeam: LongWord;
@@ -111,6 +112,7 @@
 function  CheckForWin: boolean;
 procedure TeamGone(s: shortstring);
 procedure TeamGoneEffect(var Team: TTeam);
+function GetTeamStatString(p: PTeam): shortstring;
 
 implementation
 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos, uChat;
@@ -312,7 +314,8 @@
    with team^.Clan^ do
         begin
         ClanIndex:= Pred(ClansCount);
-        Color:= TeamColor
+        Color:= TeamColor;
+        RColor:= $FF000000 or ((Color shr 16) and $FF) or ((Color shl 16) and $00FF0000) or (Color and $0000FF00)
         end
    end else
    begin
@@ -458,6 +461,13 @@
                 end
 end;
 
+function GetTeamStatString(p: PTeam): shortstring;
+var s: ansistring;
+begin
+    s:= p^.TeamName + ':' + inttostr(p^.TeamHealth) + ':';
+    GetTeamStatString:= s;
+end;
+
 procedure initModule;
 begin
     CurrentTeam:= nil;