(svn r6183) Move GetDrawStringPlayerColor() out of gfx.[ch]
authortron
Mon, 28 Aug 2006 06:21:48 +0000
changeset 4428 6d9fab57f2af
parent 4427 46b841560ec7
child 4429 b4eb6d97996f
(svn r6183) Move GetDrawStringPlayerColor() out of gfx.[ch]
gfx.c
gfx.h
network_client.c
network_server.c
player.h
players.c
--- a/gfx.c	Mon Aug 28 06:18:35 2006 +0000
+++ b/gfx.c	Mon Aug 28 06:21:48 2006 +0000
@@ -3,7 +3,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
-#include "player.h"
+#include "macros.h"
 #include "spritecache.h"
 #include "strings.h"
 #include "string.h"
@@ -1998,11 +1998,3 @@
 {
 	qsort(_resolutions, count, sizeof(_resolutions[0]), compare_res);
 }
-
-uint16 GetDrawStringPlayerColor(PlayerID player)
-{
-	// Get the color for DrawString-subroutines which matches the color
-	//  of the player
-	if (player == OWNER_SPECTATOR || player == OWNER_SPECTATOR - 1) return 1;
-	return (_color_list[_player_colors[player]].window_color_1b) | IS_PALETTE_COLOR;
-}
--- a/gfx.h	Mon Aug 28 06:18:35 2006 +0000
+++ b/gfx.h	Mon Aug 28 06:21:48 2006 +0000
@@ -74,7 +74,6 @@
 void GfxFillRect(int left, int top, int right, int bottom, int color);
 void GfxDrawLine(int left, int top, int right, int bottom, int color);
 void DrawFrameRect(int left, int top, int right, int bottom, int color, int flags);
-uint16 GetDrawStringPlayerColor(PlayerID player);
 
 int GetStringWidth(const char *str);
 void LoadStringWidthTable(void);
--- a/network_client.c	Mon Aug 28 06:18:35 2006 +0000
+++ b/network_client.c	Mon Aug 28 06:21:48 2006 +0000
@@ -15,7 +15,6 @@
 #include "network_gamelist.h"
 #include "saveload.h"
 #include "command.h"
-#include "gfx.h"
 #include "window.h"
 #include "console.h"
 #include "variables.h"
--- a/network_server.c	Mon Aug 28 06:18:35 2006 +0000
+++ b/network_server.c	Mon Aug 28 06:21:48 2006 +0000
@@ -16,7 +16,6 @@
 #include "network_udp.h"
 #include "console.h"
 #include "command.h"
-#include "gfx.h"
 #include "saveload.h"
 #include "vehicle.h"
 #include "station.h"
--- a/player.h	Mon Aug 28 06:18:35 2006 +0000
+++ b/player.h	Mon Aug 28 06:21:48 2006 +0000
@@ -196,6 +196,8 @@
 	uint32 engine_renew_money;
 } Player;
 
+uint16 GetDrawStringPlayerColor(PlayerID player);
+
 void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
 void GetNameOfOwner(PlayerID owner, TileIndex tile);
 int64 CalculateCompanyValue(const Player* p);
--- a/players.c	Mon Aug 28 06:18:35 2006 +0000
+++ b/players.c	Mon Aug 28 06:21:48 2006 +0000
@@ -27,6 +27,17 @@
 #include "ai/ai.h"
 #include "date.h"
 
+
+uint16 GetDrawStringPlayerColor(PlayerID player)
+{
+	/* Get the color for DrawString-subroutines which matches the color of the
+	 * player
+	 */
+	if (player == OWNER_SPECTATOR || player == OWNER_SPECTATOR - 1) return 1;
+	return (_color_list[_player_colors[player]].window_color_1b) | IS_PALETTE_COLOR;
+}
+
+
 static const SpriteID cheeks_table[4] = {
 	0x325, 0x326,
 	0x390, 0x3B0,