41 #define NUM_EDGE_TILES 2
48 #define NUM_CORNER_TILES 4
52 #define SPECENUM_NAME extrastyle_id
53 #define SPECENUM_VALUE0 ESTYLE_ROAD_ALL_SEPARATE
54 #define SPECENUM_VALUE0NAME "RoadAllSeparate"
55 #define SPECENUM_VALUE1 ESTYLE_ROAD_PARITY_COMBINED
56 #define SPECENUM_VALUE1NAME "RoadParityCombined"
57 #define SPECENUM_VALUE2 ESTYLE_ROAD_ALL_COMBINED
58 #define SPECENUM_VALUE2NAME "RoadAllCombined"
59 #define SPECENUM_VALUE3 ESTYLE_RIVER
60 #define SPECENUM_VALUE3NAME "River"
61 #define SPECENUM_VALUE4 ESTYLE_SINGLE1
62 #define SPECENUM_VALUE4NAME "Single1"
63 #define SPECENUM_VALUE5 ESTYLE_SINGLE2
64 #define SPECENUM_VALUE5NAME "Single2"
65 #define SPECENUM_VALUE6 ESTYLE_3LAYER
66 #define SPECENUM_VALUE6NAME "3Layer"
67 #define SPECENUM_VALUE7 ESTYLE_CARDINALS
68 #define SPECENUM_VALUE7NAME "Cardinals"
69 #define SPECENUM_COUNT ESTYLE_COUNT
70 #include "specenum_gen.h"
73 #define MAX_INDEX_CARDINAL 64
74 #define MAX_INDEX_HALF 16
75 #define MAX_INDEX_VALID 256
78 #define NUM_TILES_DIGITS 10
84 #define SPECENUM_NAME mapview_layer
85 #define SPECENUM_VALUE0 LAYER_BACKGROUND
86 #define SPECENUM_VALUE0NAME "Background"
88 #define SPECENUM_VALUE1 LAYER_TERRAIN1
89 #define SPECENUM_VALUE1NAME "Terrain1"
90 #define SPECENUM_VALUE2 LAYER_DARKNESS
91 #define SPECENUM_VALUE2NAME "Darkness"
92 #define SPECENUM_VALUE3 LAYER_TERRAIN2
93 #define SPECENUM_VALUE3NAME "Terrain2"
94 #define SPECENUM_VALUE4 LAYER_TERRAIN3
95 #define SPECENUM_VALUE4NAME "Terrain3"
96 #define SPECENUM_VALUE5 LAYER_WATER
97 #define SPECENUM_VALUE5NAME "Water"
98 #define SPECENUM_VALUE6 LAYER_ROADS
99 #define SPECENUM_VALUE6NAME "Roads"
100 #define SPECENUM_VALUE7 LAYER_SPECIAL1
101 #define SPECENUM_VALUE7NAME "Special1"
102 #define SPECENUM_VALUE8 LAYER_GRID1
103 #define SPECENUM_VALUE8NAME "Grid1"
104 #define SPECENUM_VALUE9 LAYER_CITY1
105 #define SPECENUM_VALUE9NAME "City1"
106 #define SPECENUM_VALUE10 LAYER_SPECIAL2
107 #define SPECENUM_VALUE10NAME "Special2"
108 #define SPECENUM_VALUE11 LAYER_FOG
109 #define SPECENUM_VALUE11NAME "Fog"
110 #define SPECENUM_VALUE12 LAYER_UNIT
111 #define SPECENUM_VALUE12NAME "Unit"
112 #define SPECENUM_VALUE13 LAYER_SPECIAL3
113 #define SPECENUM_VALUE13NAME "Special3"
114 #define SPECENUM_VALUE14 LAYER_BASE_FLAGS
115 #define SPECENUM_VALUE14NAME "BaseFlags"
116 #define SPECENUM_VALUE15 LAYER_CITY2
117 #define SPECENUM_VALUE15NAME "City2"
118 #define SPECENUM_VALUE16 LAYER_GRID2
119 #define SPECENUM_VALUE16NAME "Grid2"
120 #define SPECENUM_VALUE17 LAYER_OVERLAYS
121 #define SPECENUM_VALUE17NAME "Overlays"
122 #define SPECENUM_VALUE18 LAYER_TILELABEL
123 #define SPECENUM_VALUE18NAME "TileLabel"
124 #define SPECENUM_VALUE19 LAYER_CITYBAR
125 #define SPECENUM_VALUE19NAME "CityBar"
126 #define SPECENUM_VALUE20 LAYER_FOCUS_UNIT
127 #define SPECENUM_VALUE20NAME "FocusUnit"
128 #define SPECENUM_VALUE21 LAYER_GOTO
129 #define SPECENUM_VALUE21NAME "Goto"
130 #define SPECENUM_VALUE22 LAYER_WORKERTASK
131 #define SPECENUM_VALUE22NAME "WorkerTask"
132 #define SPECENUM_VALUE23 LAYER_EDITOR
133 #define SPECENUM_VALUE23NAME "Editor"
134 #define SPECENUM_VALUE24 LAYER_INFRAWORK
135 #define SPECENUM_VALUE24NAME "InfraWork"
136 #define SPECENUM_COUNT LAYER_COUNT
137 #include "specenum_gen.h"
139 #define TERRAIN_LAYER_COUNT 3
171 virtual std::vector<drawn_sprite>
245 const city *pcity)
const;
247 QPixmap *
load_sprite(
const QStringList &possible_names,
248 bool required =
false,
bool verbose =
true)
const;
A layer when drawing the map.
virtual ~layer()=default
Destructor.
virtual void reset_ruleset()
Resets cached data that depends on the ruleset.
mapview_layer type() const
virtual void free_player(int player_id)
Frees data initialized by initialize_player.
virtual void initialize_city_style(const citystyle &style, int index)
Initializes data for a city style.
virtual std::vector< drawn_sprite > fill_sprite_array(const tile *ptile, const tile_edge *pedge, const tile_corner *pcorner, const unit *punit) const
Returns the list of sprites drawn by this layer somewhere on the map.
virtual void initialize_player(const player *player)
Initializes data specific to one player.
QPixmap * load_sprite(const QStringList &possible_names, bool required=false, bool verbose=true) const
Shortcut to load a sprite from the tileset.
bool do_draw_unit(const tile *ptile, const unit *punit) const
Whether a unit should be drawn.
virtual void initialize_extra(const extra_type *extra, const QString &tag, extrastyle_id style)
Initializes extra-specific data.
bool solid_background(const tile *ptile, const unit *punit, const city *pcity) const
Whether a solid background should be drawn on a tile instead of its terrain.
struct tileset * tileset() const
virtual void initialize_terrain(const terrain *terrain)
Initializes terrain-specific data.
layer(struct tileset *ts, mapview_layer layer)
Constructor.
virtual void load_sprites()
Loads all sprites that do not depend on the ruleset.