fix chat color in ppc
authorkoda
Sun, 15 Nov 2009 19:42:28 +0000
changeset 2622 39932161194e
parent 2621 956ff066f3a5
child 2623 9332f744bbdf
fix chat color in ppc
hedgewars/uChat.pas
hedgewars/uGears.pas
hedgewars/uMisc.pas
--- a/hedgewars/uChat.pas	Sat Nov 14 11:06:55 2009 +0000
+++ b/hedgewars/uChat.pas	Sun Nov 15 19:42:28 2009 +0000
@@ -47,10 +47,19 @@
 	InputStrL: array[0..260] of char; // for full str + 4-byte utf-8 char
 
 const colors: array[#1..#4] of Longword = (
-	$FFFFFF, // chat message
-	$FF00FF, // action message
-	$90FF90, // join/leave message
-	$A0FFFF  // team message
+{$IFDEF ENDIAN_LITTLE}
+// ABGR
+	$FFFFFFFF, // chat message [White]
+	$FFFF00FF, // action message [Purple]
+	$FF90FF90, // join/leave message [Lime]
+	$FFA0FFFF  // team message [Light Yellow]
+{$ELSE}
+// RGBA
+	$FFFFFFFF, // chat message [White]
+	$FF00FFFF, // action message [Purple]
+	$90FF90FF, // join/leave message [Lime]
+	$FFFFA0FF  // team message [Light Yellow]
+{$ENDIF}
 	);
 
 procedure SetLine(var cl: TChatLine; str: shortstring; isInput: boolean);
@@ -66,7 +75,12 @@
 
 if isInput then
 	begin
-	color:= $FFFF00;
+	color:=
+{$IFDEF ENDIAN_LITTLE}	
+	$FFFFFF00; // [Yellow abgr]
+{$ELSE}
+	$00FFFFFF; // [Yellow rgba]
+{$ENDIF}	
 	str:= UserNick + '> ' + str + '_'
 	end
 	else begin
@@ -77,14 +91,9 @@
 
 TTF_SizeUTF8(Fontz[fnt16].Handle, Str2PChar(str), w, h);
 
-resSurface:= SDL_CreateRGBSurface(0,
-		toPowerOf2(w),
-		toPowerOf2(h),
-		32,
-		RMask, GMask, BMask, AMask);
+resSurface:= SDL_CreateRGBSurface(0, toPowerOf2(w), toPowerOf2(h), 32, RMask, GMask, BMask, AMask);
 
 strSurface:= TTF_RenderUTF8_Solid(Fontz[fnt16].Handle, Str2PChar(str), color);
-//strSurface:= doSurfaceConversion(strSurface);
 cl.Width:= w + 4;
 SDL_UpperBlit(strSurface, nil, resSurface, nil);
 SDL_FreeSurface(strSurface);
--- a/hedgewars/uGears.pas	Sat Nov 14 11:06:55 2009 +0000
+++ b/hedgewars/uGears.pas	Sun Nov 15 19:42:28 2009 +0000
@@ -16,10 +16,11 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
+{$INCLUDE "options.inc"}
+
 unit uGears;
 interface
 uses SDLh, uConsts, uFloat;
-{$INCLUDE "options.inc"}
 const AllInactive: boolean = false;
       PrvInactive: boolean = false;
 
--- a/hedgewars/uMisc.pas	Sat Nov 14 11:06:55 2009 +0000
+++ b/hedgewars/uMisc.pas	Sun Nov 15 19:42:28 2009 +0000
@@ -80,10 +80,11 @@
 	TimeTrialStartTime: Longword = 0;
 	TimeTrialStopTime : Longword = 0;
 	
-	cSkyColor     : Longword = 0;
-	cWhiteColor   : Longword = $FFFFFFFF;
-	cColorNearBlack       : Longword = $FF000010;
-	cExplosionBorderColor : LongWord = $808080;
+	cSkyColor		: Longword = 0;
+	cWhiteColor		: Longword = $FFFFFFFF;
+	cYellowColor		: Longword = $FFFFFF00;
+	cNearBlackColor		: Longword = $FF000010;
+	cExplosionBorderColor	: LongWord = $FF808080;
 
 	cShowFPS      : boolean = false;
 	cCaseFactor   : Longword = 5;  {0..9}