(svn r8300) -Codechange: Add a prototype for DrawPlayerIcon to players.h and include that

instead of using externs. Also move DrawPlayerIcon from graph_gui.cpp to
players.cpp.
This commit is contained in:
maedhros 2007-01-21 11:49:18 +00:00
parent 501cd51c15
commit 7a7562d8e2
7 changed files with 10 additions and 10 deletions

View File

@ -216,11 +216,6 @@ static void DrawGraph(const GraphDrawer *gw)
/* GRAPH LEGEND */
/****************/
void DrawPlayerIcon(PlayerID p, int x, int y)
{
DrawSprite(0x2EB, PLAYER_SPRITE_COLOR(p), x, y);
}
static void GraphLegendWndProc(Window *w, WindowEvent *e)
{
const Player* p;

View File

@ -538,8 +538,6 @@ static void UpdatePlayerMenuHeight(Window *w)
}
}
extern void DrawPlayerIcon(PlayerID pid, int x, int y);
static void PlayerMenuWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {

View File

@ -1788,8 +1788,6 @@ static const Widget _cheat_widgets[] = {
{ WIDGETS_END},
};
extern void DrawPlayerIcon(PlayerID pid, int x, int y);
static void CheatsWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {

View File

@ -262,6 +262,8 @@ static inline bool IsInteractivePlayer(PlayerID pi)
return pi == _local_player;
}
void DrawPlayerIcon(PlayerID p, int x, int y);
/* Validate functions for rail building */
static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}

View File

@ -60,6 +60,11 @@ uint16 GetDrawStringPlayerColor(PlayerID player)
return (_colour_gradient[_player_colors[player]][4]) | IS_PALETTE_COLOR;
}
void DrawPlayerIcon(PlayerID p, int x, int y)
{
DrawSprite(SPR_PLAYER_ICON, PLAYER_SPRITE_COLOR(p), x, y);
}
static const SpriteID cheeks_table[4] = {
0x325, 0x326,

View File

@ -120,6 +120,9 @@ enum Sprites {
/* Manager face sprites */
SPR_GRADIENT = 874, // background gradient behind manager face
/* Icon showing player colour. */
SPR_PLAYER_ICON = 747,
/* is itself no foundation sprite, because tileh 0 has no foundation */
SPR_FOUNDATION_BASE = 989,

View File

@ -30,7 +30,6 @@ static const Widget _town_authority_widgets[] = {
};
extern const byte _town_action_costs[8];
extern void DrawPlayerIcon(PlayerID pid, int x, int y);
/** Get a list of available actions to do at a town.
* @param *nump if not NULL add put the number of available actions in it