mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r6772) -Codechange: Do not abuse OWNER_SPECTATOR as the "owner" of the industry for
the minimap. This also saves us from having this huge _owner_colors table.
This commit is contained in:
parent
2dcdeb985d
commit
975442040d
2
map.h
2
map.h
@ -71,6 +71,8 @@ typedef enum Owner {
|
|||||||
OWNER_TOWN = 0x0F, // a town owns the tile
|
OWNER_TOWN = 0x0F, // a town owns the tile
|
||||||
OWNER_NONE = 0x10, // nobody owns the tile
|
OWNER_NONE = 0x10, // nobody owns the tile
|
||||||
OWNER_WATER = 0x11, // "water" owns the tile
|
OWNER_WATER = 0x11, // "water" owns the tile
|
||||||
|
OWNER_END = 0x12,
|
||||||
|
|
||||||
OWNER_SPECTATOR = 0xFF, // spectator in MP or in scenario editor
|
OWNER_SPECTATOR = 0xFF, // spectator in MP or in scenario editor
|
||||||
} Owner;
|
} Owner;
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ static inline uint32 GetSmallMapVegetationPixels(TileIndex tile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint32 _owner_colors[256];
|
static uint32 _owner_colors[OWNER_END + 1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the color a tile would be displayed with in the small map in mode "Owner".
|
* Return the color a tile would be displayed with in the small map in mode "Owner".
|
||||||
@ -520,7 +520,7 @@ static inline uint32 GetSmallMapOwnerPixels(TileIndex tile)
|
|||||||
Owner o;
|
Owner o;
|
||||||
|
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_INDUSTRY: o = OWNER_SPECTATOR; break;
|
case MP_INDUSTRY: o = OWNER_END; break;
|
||||||
case MP_HOUSE: o = OWNER_TOWN; break;
|
case MP_HOUSE: o = OWNER_TOWN; break;
|
||||||
default: o = GetTileOwner(tile); break;
|
default: o = GetTileOwner(tile); break;
|
||||||
}
|
}
|
||||||
@ -606,7 +606,7 @@ static void DrawSmallMap(DrawPixelInfo *dpi, Window *w, int type, bool show_town
|
|||||||
_owner_colors[OWNER_TOWN] = MKCOLOR(0xB4B4B4B4);
|
_owner_colors[OWNER_TOWN] = MKCOLOR(0xB4B4B4B4);
|
||||||
_owner_colors[OWNER_NONE] = MKCOLOR(0x54545454);
|
_owner_colors[OWNER_NONE] = MKCOLOR(0x54545454);
|
||||||
_owner_colors[OWNER_WATER] = MKCOLOR(0xCACACACA);
|
_owner_colors[OWNER_WATER] = MKCOLOR(0xCACACACA);
|
||||||
_owner_colors[OWNER_SPECTATOR] = MKCOLOR(0x20202020); /* industry */
|
_owner_colors[OWNER_END+1] = MKCOLOR(0x20202020); /* industry */
|
||||||
|
|
||||||
/* now fill with the player colors */
|
/* now fill with the player colors */
|
||||||
FOR_ALL_PLAYERS(p) {
|
FOR_ALL_PLAYERS(p) {
|
||||||
|
Loading…
Reference in New Issue
Block a user