mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-06 22:37:22 +00:00
(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:
parent
501cd51c15
commit
7a7562d8e2
@ -216,11 +216,6 @@ static void DrawGraph(const GraphDrawer *gw)
|
|||||||
/* GRAPH LEGEND */
|
/* 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)
|
static void GraphLegendWndProc(Window *w, WindowEvent *e)
|
||||||
{
|
{
|
||||||
const Player* p;
|
const Player* p;
|
||||||
|
@ -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)
|
static void PlayerMenuWndProc(Window *w, WindowEvent *e)
|
||||||
{
|
{
|
||||||
switch (e->event) {
|
switch (e->event) {
|
||||||
|
@ -1788,8 +1788,6 @@ static const Widget _cheat_widgets[] = {
|
|||||||
{ WIDGETS_END},
|
{ WIDGETS_END},
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void DrawPlayerIcon(PlayerID pid, int x, int y);
|
|
||||||
|
|
||||||
static void CheatsWndProc(Window *w, WindowEvent *e)
|
static void CheatsWndProc(Window *w, WindowEvent *e)
|
||||||
{
|
{
|
||||||
switch (e->event) {
|
switch (e->event) {
|
||||||
|
@ -262,6 +262,8 @@ static inline bool IsInteractivePlayer(PlayerID pi)
|
|||||||
return pi == _local_player;
|
return pi == _local_player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawPlayerIcon(PlayerID p, int x, int y);
|
||||||
|
|
||||||
/* Validate functions for rail building */
|
/* Validate functions for rail building */
|
||||||
static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
|
static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
|
||||||
|
|
||||||
|
@ -60,6 +60,11 @@ uint16 GetDrawStringPlayerColor(PlayerID player)
|
|||||||
return (_colour_gradient[_player_colors[player]][4]) | IS_PALETTE_COLOR;
|
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] = {
|
static const SpriteID cheeks_table[4] = {
|
||||||
0x325, 0x326,
|
0x325, 0x326,
|
||||||
|
@ -120,6 +120,9 @@ enum Sprites {
|
|||||||
/* Manager face sprites */
|
/* Manager face sprites */
|
||||||
SPR_GRADIENT = 874, // background gradient behind manager face
|
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 */
|
/* is itself no foundation sprite, because tileh 0 has no foundation */
|
||||||
SPR_FOUNDATION_BASE = 989,
|
SPR_FOUNDATION_BASE = 989,
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ static const Widget _town_authority_widgets[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern const byte _town_action_costs[8];
|
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.
|
/** 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
|
* @param *nump if not NULL add put the number of available actions in it
|
||||||
|
Loading…
Reference in New Issue
Block a user