summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-08-28 06:21:48 +0000
committertron <tron@openttd.org>2006-08-28 06:21:48 +0000
commit4e36c4a349543bf6599559ee36ddfda15c584a6b (patch)
treee401abd666512b3bae48f7f2f9aba66ba123e5cb
parent2930781beaf90dfbbf3338c983062a456d8965bd (diff)
downloadopenttd-4e36c4a349543bf6599559ee36ddfda15c584a6b.tar.xz
(svn r6183) Move GetDrawStringPlayerColor() out of gfx.[ch]
-rw-r--r--gfx.c10
-rw-r--r--gfx.h1
-rw-r--r--network_client.c1
-rw-r--r--network_server.c1
-rw-r--r--player.h2
-rw-r--r--players.c11
6 files changed, 14 insertions, 12 deletions
diff --git a/gfx.c b/gfx.c
index 09dddfe52..a6b1b4ec5 100644
--- a/gfx.c
+++ b/gfx.c
@@ -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 @@ void SortResolutions(int count)
{
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;
-}
diff --git a/gfx.h b/gfx.h
index cecec1d02..f1d6c2618 100644
--- a/gfx.h
+++ b/gfx.h
@@ -74,7 +74,6 @@ void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
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);
diff --git a/network_client.c b/network_client.c
index 0943d5f75..d804715a8 100644
--- a/network_client.c
+++ b/network_client.c
@@ -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"
diff --git a/network_server.c b/network_server.c
index 96e644cd6..79593247a 100644
--- a/network_server.c
+++ b/network_server.c
@@ -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"
diff --git a/player.h b/player.h
index 2d5f931b9..c7bd73dda 100644
--- a/player.h
+++ b/player.h
@@ -196,6 +196,8 @@ typedef struct Player {
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);
diff --git a/players.c b/players.c
index 041728e8a..90b041c89 100644
--- a/players.c
+++ b/players.c
@@ -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,