The class terrain_builder is constructed from a config object, and a gamemap object. More...
#include <builder.hpp>
Classes | |
struct | building_rule |
The in-memory representation of a [terrain_graphics] WML rule. More... | |
struct | rule_image |
Each terrain_graphics rule is associated a set of images, which are applied on the terrain if the rule matches. More... | |
struct | rule_image_variant |
An image variant. More... | |
struct | terrain_constraint |
The in-memory representation of a [tile] WML rule inside of a [terrain_graphics] WML rule. More... | |
struct | tile |
Represents a tile of the game map, with all associated builder-specific parameters: flags, images attached to this tile, etc. More... | |
class | tilemap |
The map of "tile" structures corresponding to the level map. More... | |
Public Types | |
enum | TERRAIN_TYPE { BACKGROUND, FOREGROUND } |
Used as a parameter for the get_terrain_at function. More... | |
typedef std::vector< animated < image::locator > > | imagelist |
A shorthand typedef for a list of animated image locators, the base data type returned by the get_terrain_at method. More... | |
typedef std::vector< rule_image > | rule_imagelist |
A shorthand notation for a vector of rule_images. More... | |
Public Member Functions | |
terrain_builder (const config &level, const gamemap *map, const std::string &offmap_image) | |
Constructor for the terrain_builder class. More... | |
const gamemap & | map () const |
void | reload_map () |
Updates internals that cache map size. More... | |
void | change_map (const gamemap *m) |
const imagelist * | get_terrain_at (const map_location &loc, const std::string &tod, TERRAIN_TYPE const terrain_type) |
Returns a vector of strings representing the images to load & blit together to get the built content for this tile. More... | |
bool | update_animation (const map_location &loc) |
Updates the animation at a given tile. More... | |
void | rebuild_terrain (const map_location &loc) |
Performs a "quick-rebuild" of the terrain in a given location. More... | |
void | rebuild_all () |
Performs a complete rebuild of the list of terrain graphics attached to a map. More... | |
void | rebuild_cache_all () |
tile * | get_tile (const map_location &loc) |
Static Public Member Functions | |
static void | set_terrain_rules_cfg (const config &cfg) |
Set the config where we will parse the global terrain rules. More... | |
Static Public Attributes | |
static const int | UNITPOS = 36 + 18 |
The position of unit graphics in a tile. More... | |
static const unsigned int | DUMMY_HASH = 0 |
Private Types | |
typedef std::vector < terrain_constraint > | constraint_set |
The list of constraints attached to a terrain_graphics WML rule. More... | |
typedef std::multiset < building_rule > | building_ruleset |
A set of building rules. More... | |
typedef std::multimap< int, map_location > | anchormap |
typedef std::map < t_translation::t_terrain, std::vector< map_location > > | terrain_by_type_map |
Shorthand typedef for a map associating a list of locations to a terrain type. More... | |
Private Member Functions | |
bool | load_images (building_rule &rule) |
Load images and tests for validity of a rule. More... | |
bool | start_animation (building_rule &rule) |
Starts the animation on a rule. More... | |
void | rotate (terrain_constraint &constraint, int angle) |
"Rotates" a constraint from a rule. More... | |
void | replace_rotate_tokens (std::string &s, int angle, const std::vector< std::string > &replacement) |
Replaces, in a given string, rotation tokens with their values. More... | |
void | replace_rotate_tokens (rule_image &image, int angle, const std::vector< std::string > &replacement) |
Replaces, in a given rule_image, rotation tokens with their values. More... | |
void | replace_rotate_tokens (rule_image_variant &variant, int angle, const std::vector< std::string > &replacement) |
Replaces, in a given rule_variant_image, rotation tokens with their values. More... | |
void | replace_rotate_tokens (rule_imagelist &list, int angle, const std::vector< std::string > &replacement) |
Replaces, in a given rule_imagelist, rotation tokens with their values. More... | |
void | replace_rotate_tokens (building_rule &rule, int angle, const std::vector< std::string > &replacement) |
Replaces, in a given building_rule, rotation tokens with their values. More... | |
void | rotate_rule (building_rule &rule, int angle, const std::vector< std::string > &angle_name) |
Rotates a template rule to a given angle. More... | |
void | add_images_from_config (rule_imagelist &images, const config &cfg, bool global, int dx=0, int dy=0) |
Parses a "config" object, which should contains [image] children, and adds the corresponding parsed rule_images to a rule_imagelist. More... | |
terrain_constraint & | add_constraints (constraint_set &constraints, const map_location &loc, const t_translation::t_match &type, const config &global_images) |
Creates a rule constraint object which matches a given list of terrains, and adds it to the list of constraints of a rule. More... | |
void | add_constraints (constraint_set &constraints, const map_location &loc, const config &cfg, const config &global_images) |
Creates a rule constraint object from a config object and adds it to the list of constraints of a rule. More... | |
void | parse_mapstring (const std::string &mapstring, struct building_rule &br, anchormap &anchors, const config &global_images) |
Parses a map string (the map= element of a [terrain_graphics] rule, and adds constraints from this map to a building_rule. More... | |
void | add_rule (building_ruleset &rules, building_rule &rule) |
Adds a rule to a ruleset. More... | |
void | add_rotated_rules (building_ruleset &rules, building_rule &tpl, const std::string &rotations) |
Adds a set of rules to a ruleset, from a template rule which spans 6 rotations (or less if some of the rotated rules are invalid). More... | |
void | parse_config (const config &cfg, bool local=true) |
Parses a configuration object containing [terrain_graphics] rules, and fills the building_rules_ member of the current class according to those. More... | |
void | parse_global_config (const config &cfg) |
void | add_off_map_rule (const std::string &image) |
Adds a builder rule for the _off^_usr tile, this tile only has 1 image. More... | |
void | flush_local_rules () |
bool | terrain_matches (const t_translation::t_terrain &tcode, const t_translation::t_list &terrains) const |
Checks whether a terrain code matches a given list of terrain codes. More... | |
bool | terrain_matches (const t_translation::t_terrain &tcode, const t_translation::t_match &terrain) const |
Checks whether a terrain code matches a given list of terrain tcodes. More... | |
bool | rule_matches (const building_rule &rule, const map_location &loc, const terrain_constraint *type_checked) const |
Checks whether a rule matches a given location in the map. More... | |
void | apply_rule (const building_rule &rule, const map_location &loc) |
Applies a rule at a given location: applies the result of a matching rule at a given location: attachs the images corresponding to the rule, and sets the flags corresponding to the rule. More... | |
void | build_terrains () |
Calculates the list of terrains, and fills the tile_map_ member, from the gamemap and the building_rules_. More... | |
Private Attributes | |
const int | tilewidth_ |
The tile width used when using basex and basey. More... | |
const gamemap * | map_ |
A pointer to the gamemap class used in the current level. More... | |
tilemap | tile_map_ |
The tile_map_ for the current level, which is filled by the build_terrains_ method to contain "tiles" representing images attached to each tile. More... | |
terrain_by_type_map | terrain_by_type_ |
A map representing all locations whose terrain is of a given type. More... | |
Static Private Attributes | |
static building_ruleset | building_rules_ |
Parsed terrain rules. More... | |
static const config * | rules_cfg_ = nullptr |
Config used to parse global terrain rules. More... | |
The class terrain_builder is constructed from a config object, and a gamemap object.
On construction, it parses the configuration and extracts the list of [terrain_graphics] rules. Each terrain_graphics rule attaches one or more images to a specific terrain pattern. It then applies the rules loaded from the configuration to the current map, and calculates the list of images that must be associated to each hex of the map.
The get_terrain_at method can then be used to obtain the list of images necessary to draw the terrain on a given tile.
Definition at line 43 of file builder.hpp.
|
private |
Definition at line 677 of file builder.hpp.
|
private |
A set of building rules.
In-memory representation of the whole set of [terrain_graphics] rules.
Definition at line 485 of file builder.hpp.
|
private |
The list of constraints attached to a terrain_graphics WML rule.
Definition at line 363 of file builder.hpp.
typedef std::vector<animated<image::locator> > terrain_builder::imagelist |
A shorthand typedef for a list of animated image locators, the base data type returned by the get_terrain_at method.
Definition at line 70 of file builder.hpp.
typedef std::vector<rule_image> terrain_builder::rule_imagelist |
A shorthand notation for a vector of rule_images.
Definition at line 245 of file builder.hpp.
|
private |
Shorthand typedef for a map associating a list of locations to a terrain type.
Definition at line 805 of file builder.hpp.
Used as a parameter for the get_terrain_at function.
Enumerator | |
---|---|
BACKGROUND |
Represents terrains which are to be drawn behind unit sprites. |
FOREGROUND |
Represents terrains which are to be drawn in front of them. |
Definition at line 47 of file builder.hpp.
terrain_builder::terrain_builder | ( | const config & | level, |
const gamemap * | map, | ||
const std::string & | offmap_image | ||
) |
Constructor for the terrain_builder class.
level | A level (scenario)-specific configuration file, containing scenario-specific [terrain_graphics] rules. |
map | A properly-initialized gamemap object representing the current terrain map. |
offmap_image | The filename of the image which will be used as off map image (see add_off_map_rule()). This image automatically gets the 'terrain/' prefix and '.png' suffix |
Definition at line 238 of file builder.cpp.
References add_off_map_rule(), build_terrains(), building_rules_, flush_local_rules(), parse_config(), parse_global_config(), image::precache_file_existence(), and rules_cfg_.
|
private |
Creates a rule constraint object which matches a given list of terrains, and adds it to the list of constraints of a rule.
constraints | The constraint set to which to add the constraint. |
loc | The location of the constraint |
type | The list of terrains this constraint will match |
global_images | A configuration object containing [image] tags describing rule-global images. |
Definition at line 726 of file builder.cpp.
References add_images_from_config(), c, terrain_builder::terrain_constraint::images, t_translation::t_match::terrain, terrain_builder::terrain_constraint::terrain_types_match, tilewidth_, map_location::x, and map_location::y.
Referenced by add_constraints(), parse_config(), and parse_mapstring().
|
private |
Creates a rule constraint object from a config object and adds it to the list of constraints of a rule.
constraints | The constraint set to which to add the constraint. |
loc | The location of the constraint |
cfg | The config object describing this constraint. Usually, a [tile] child of a [terrain_graphics] rule. |
global_images | A configuration object containing [image] tags describing rule-global images. |
Definition at line 756 of file builder.cpp.
References add_constraints(), add_images_from_config(), terrain_builder::terrain_constraint::has_flag, terrain_builder::terrain_constraint::images, terrain_builder::terrain_constraint::no_draw, terrain_builder::terrain_constraint::no_flag, terrain_builder::terrain_constraint::set_flag, utils::square_parenthetical_split(), and t_translation::WILDCARD.
|
private |
Parses a "config" object, which should contains [image] children, and adds the corresponding parsed rule_images to a rule_imagelist.
images | The rule_imagelist into which to add the parsed images. |
cfg | The WML configuration object to parse |
global | Whether those [image]s elements belong to a [terrain_graphics] element, or to a [tile] child. Set to true if those belong to a [terrain_graphics] element. |
dx | The X coordinate of the constraint those images apply to, relative to the start of the rule. Only meaningful if global is set to false. |
dy | The Y coordinate of the constraint those images apply to. |
Definition at line 677 of file builder.cpp.
References base_, config::child_range(), utils::split(), and tilewidth_.
Referenced by add_constraints().
|
private |
Adds a builder rule for the _off^_usr tile, this tile only has 1 image.
image | The filename of the image |
Definition at line 990 of file builder.cpp.
References config::add_child(), t_translation::OFF_MAP_USER, parse_global_config(), and t_translation::write_terrain_code().
Referenced by terrain_builder().
|
private |
Adds a set of rules to a ruleset, from a template rule which spans 6 rotations (or less if some of the rotated rules are invalid).
rules | The ruleset into which to add the rules. |
tpl | The template rule |
rotations | A comma-separated string containing the 6 values for replacing rotation template template strings(@Rn) |
Definition at line 842 of file builder.cpp.
References add_rule(), rotate_rule(), and utils::split().
Referenced by parse_config().
|
private |
Adds a rule to a ruleset.
Checks for validity before adding the rule.
rules | The ruleset into which to add the rules. |
rule | The rule to add. |
Definition at line 835 of file builder.cpp.
References load_images().
Referenced by add_rotated_rules().
|
private |
Applies a rule at a given location: applies the result of a matching rule at a given location: attachs the images corresponding to the rule, and sets the flags corresponding to the rule.
rule | The rule to apply |
loc | The location to which to apply the rule. |
Definition at line 1071 of file builder.cpp.
References terrain_builder::building_rule::constraints, game_config::images::flag, terrain_builder::tile::flags, terrain_builder::building_rule::get_hash(), get_noise(), terrain_builder::terrain_constraint::images, terrain_builder::tile::images, legacy_sum(), terrain_builder::terrain_constraint::loc, terrain_builder::terrain_constraint::no_draw, terrain_builder::tilemap::on_map(), terrain_builder::terrain_constraint::set_flag, and tile_map_.
Referenced by build_terrains().
|
private |
Calculates the list of terrains, and fills the tile_map_ member, from the gamemap and the building_rules_.
Definition at line 1130 of file builder.cpp.
References apply_rule(), building_rules_, gamemap::get_terrain(), gamemap::h(), itor, legacy_difference(), terrain_builder::terrain_constraint::loc, log_scope, map(), match(), rule_matches(), terrain_by_type_, terrain_matches(), terrain_builder::terrain_constraint::terrain_types_match, and gamemap::w().
Referenced by rebuild_all(), reload_map(), and terrain_builder().
Definition at line 300 of file builder.cpp.
References map_, and reload_map().
|
private |
Definition at line 273 of file builder.cpp.
References building_rules_, and i.
Referenced by terrain_builder().
const terrain_builder::imagelist * terrain_builder::get_terrain_at | ( | const map_location & | loc, |
const std::string & | tod, | ||
TERRAIN_TYPE const | terrain_type | ||
) |
Returns a vector of strings representing the images to load & blit together to get the built content for this tile.
loc | The location relative the the terrain map, where we ask for the image list |
tod | The string representing the current time-of day. Will be used if some images specify several time-of-day- related variants. |
terrain_type | BACKGROUND or FOREGROUND, depending on whether we ask for the terrain which is before, or after the unit sprite. |
Definition at line 306 of file builder.cpp.
References BACKGROUND, terrain_builder::tile::images_background, terrain_builder::tile::images_foreground, terrain_builder::tile::last_tod, terrain_builder::tilemap::on_map(), terrain_builder::tile::rebuild_cache(), and tile_map_.
terrain_builder::tile * terrain_builder::get_tile | ( | const map_location & | loc | ) |
Definition at line 1204 of file builder.cpp.
References terrain_builder::tilemap::on_map(), and tile_map_.
Referenced by events::console_handler::do_layers().
|
private |
Load images and tests for validity of a rule.
A rule is considered valid if all its images are present. This method is used, when building the ruleset, to only add rules which are valid to the ruleset.
rule | The rule to test for validity |
Definition at line 431 of file builder.cpp.
References animated< T, T_void_value >::add_frame(), terrain_builder::rule_image::center_x, terrain_builder::rule_image::center_y, terrain_builder::building_rule::constraints, animated< T, T_void_value >::get_frames_count(), get_variations(), terrain_builder::rule_image::global_image, image_exists(), terrain_builder::rule_image_variant::image_string, terrain_builder::rule_image_variant::images, terrain_builder::terrain_constraint::images, mp_ui_alerts::items, terrain_builder::terrain_constraint::loc, utils::split(), utils::square_parenthetical_split(), animated< T, T_void_value >::start_animation(), terrain_builder::rule_image::variants, and terrain_builder::rule_image_variant::variations.
Referenced by add_rule().
|
inline |
Definition at line 94 of file builder.hpp.
References map_.
Referenced by build_terrains(), parse_mapstring(), rebuild_cache_all(), rebuild_terrain(), reload_map(), and rule_matches().
Parses a configuration object containing [terrain_graphics] rules, and fills the building_rules_ member of the current class according to those.
cfg | The configuration object to parse. |
local | Mark the rules as local only. |
Definition at line 867 of file builder.cpp.
References add_constraints(), add_rotated_rules(), building_rules_, config::child_range(), terrain_builder::building_rule::constraints, game_config::images::flag, terrain_builder::terrain_constraint::has_flag, terrain_builder::building_rule::local, terrain_builder::building_rule::location_constraints, log_scope, terrain_builder::building_rule::modulo_constraints, terrain_builder::terrain_constraint::no_flag, parse_mapstring(), pos, terrain_builder::building_rule::precedence, terrain_builder::building_rule::probability, gui2::tloadscreen::progress(), terrain_builder::terrain_constraint::set_flag, utils::split(), map_location::valid(), t_translation::write_list(), WRN_NG, map_location::x, and map_location::y.
Referenced by parse_global_config(), and terrain_builder().
Definition at line 724 of file builder.hpp.
References parse_config().
Referenced by add_off_map_rule(), and terrain_builder().
|
private |
Parses a map string (the map= element of a [terrain_graphics] rule, and adds constraints from this map to a building_rule.
mapstring | The map vector to parse |
br | The building rule into which to add the extracted constraints |
anchors | A map where to put "anchors" extracted from the map. |
global_images | A config object representing the images defined as direct children of the [terrain_graphics] rule. |
Definition at line 788 of file builder.cpp.
References add_constraints(), t_translation::t_terrain::base, terrain_builder::building_rule::constraints, ERR_NG, map(), t_translation::NONE_TERRAIN, t_translation::t_terrain::overlay, t_translation::read_builder_map(), t_translation::STAR, t_translation::TB_DOT, t_translation::TB_STAR, gui2::terrain, and t_translation::write_terrain_code().
Referenced by parse_config().
void terrain_builder::rebuild_all | ( | ) |
Performs a complete rebuild of the list of terrain graphics attached to a map.
Should be called when a terrain is changed in the map.
Definition at line 385 of file builder.cpp.
References build_terrains(), terrain_builder::tilemap::reset(), terrain_by_type_, and tile_map_.
void terrain_builder::rebuild_cache_all | ( | ) |
Definition at line 264 of file builder.cpp.
References gamemap::h(), map(), tile_map_, and gamemap::w().
void terrain_builder::rebuild_terrain | ( | const map_location & | loc | ) |
Performs a "quick-rebuild" of the terrain in a given location.
The "quick-rebuild" is no proper rebuild: it only clears the terrain cache for a given location, and replaces it with a single, default image for this terrain.
loc | the location where to rebuild terrains |
Definition at line 353 of file builder.cpp.
References animated< T, T_void_value >::add_frame(), gamemap::get_terrain_info(), terrain_builder::tile::images_background, terrain_builder::tile::images_foreground, map(), terrain_type::minimap_image(), terrain_type::minimap_image_overlay(), terrain_builder::tilemap::on_map(), animated< T, T_void_value >::start_animation(), and tile_map_.
void terrain_builder::reload_map | ( | ) |
Updates internals that cache map size.
This should be called when the map size has changed.
Definition at line 293 of file builder.cpp.
References build_terrains(), h, map(), terrain_builder::tilemap::reload(), terrain_by_type_, and tile_map_.
Referenced by change_map().
|
private |
Replaces, in a given string, rotation tokens with their values.
s | the string in which to do the replacement |
angle | the angle for substituting the correct replacement. |
replacement | the replacement strings. |
Definition at line 575 of file builder.cpp.
Referenced by replace_rotate_tokens(), and rotate_rule().
|
private |
Replaces, in a given rule_image, rotation tokens with their values.
The actual substitution is done in all variants of the given image.
image | the rule_image in which to do the replacement. |
angle | the angle for substituting the correct replacement. |
replacement | the replacement strings. |
Definition at line 590 of file builder.cpp.
References replace_rotate_tokens(), and terrain_builder::rule_image::variants.
|
inlineprivate |
Replaces, in a given rule_variant_image, rotation tokens with their values.
The actual substitution is done in the "image_string" parameter of this rule_variant_image.
variant | the rule_variant_image in which to do the replacement. |
angle | the angle for substituting the correct replacement. |
replacement | the replacement strings. |
Definition at line 559 of file builder.hpp.
References terrain_builder::rule_image_variant::image_string, and replace_rotate_tokens().
|
private |
Replaces, in a given rule_imagelist, rotation tokens with their values.
The actual substitution is done in all rule_images contained in the rule_imagelist.
list | the rule_imagelist in which to do the replacement. |
angle | the angle for substituting the correct replacement. |
replacement | the replacement strings. |
Definition at line 598 of file builder.cpp.
References replace_rotate_tokens().
|
private |
Replaces, in a given building_rule, rotation tokens with their values.
The actual substitution is done in the rule_imagelists contained in all constraints of the building_rule, and in the flags (has_flag, set_flag and no_flag) contained in all constraints of the building_rule.
rule | the building_rule in which to do the replacement. |
angle | the angle for substituting the correct replacement. |
replacement | the replacement strings. |
Definition at line 606 of file builder.cpp.
References terrain_builder::building_rule::constraints, game_config::images::flag, terrain_builder::terrain_constraint::has_flag, terrain_builder::terrain_constraint::images, terrain_builder::terrain_constraint::no_flag, replace_rotate_tokens(), and terrain_builder::terrain_constraint::set_flag.
|
private |
"Rotates" a constraint from a rule.
Takes a template constraint from a template rule, and rotates to the given angle.
On a constraint, the relative position of each rule, and the "base" of each vertical images, are rotated according to the given angle.
Template terrain constraints are defined like normal terrain constraints, except that, flags, and image filenames, may contain template strings of the form
* <code>@Rn</code>, *
n being a number from 0 to 5. See the rotate_rule method for more info.
constraint | A template constraint to rotate |
angle | An int, from 0 to 5, representing the rotation angle. |
Definition at line 495 of file builder.cpp.
References terrain_builder::terrain_constraint::images, int(), itor, terrain_builder::terrain_constraint::loc, tilewidth_, map_location::x, and map_location::y.
Referenced by rotate_rule().
|
private |
Rotates a template rule to a given angle.
Template rules are defined like normal rules, except that:
* <code>@Rn</code>, n being a number from 0 to 5. *
A template rule will generate 6 rules, which are similar to the template, except that:
* @R0, @R1, @R2, @R3, @R4, @R5, *will be replaced by the corresponding r0, r1, r2, r3, r4, r5 variables given in the rotations= element.
* @R0, @R1, @R2 etc. *will be replaced by the corresponding r1, r2, r3, r4, r5, r0 (note the shift in indices).
Definition at line 627 of file builder.cpp.
References terrain_builder::building_rule::constraints, ERR_NG, legacy_sum_assign(), terrain_builder::terrain_constraint::loc, replace_rotate_tokens(), rotate(), map_location::x, and map_location::y.
Referenced by add_rotated_rules().
|
private |
Checks whether a rule matches a given location in the map.
rule | The rule to check. |
loc | The location in the map where we want to check whether the rule matches. |
type_checked | The constraint which we already know that its terrain types matches. |
Definition at line 1014 of file builder.cpp.
References terrain_builder::building_rule::constraints, terrain_builder::building_rule::get_hash(), get_noise(), terrain_builder::terrain_constraint::has_flag, legacy_sum(), terrain_builder::terrain_constraint::loc, terrain_builder::building_rule::location_constraints, map(), terrain_builder::building_rule::modulo_constraints, terrain_builder::terrain_constraint::no_flag, terrain_builder::tilemap::on_map(), terrain_builder::building_rule::probability, terrain_matches(), terrain_builder::terrain_constraint::terrain_types_match, tile_map_, map_location::valid(), map_location::x, and map_location::y.
Referenced by build_terrains().
Set the config where we will parse the global terrain rules.
This also flushes the terrain rules cache.
cfg | The main grame configuration object, where the [terrain_graphics] rule reside. |
Definition at line 284 of file builder.cpp.
References building_rules_, rules_cfg_, and swap().
Referenced by game_config_manager::load_game_config().
|
private |
Starts the animation on a rule.
rule | The rule on which ot start animations |
|
inlineprivate |
Checks whether a terrain code matches a given list of terrain codes.
tcode | The terrain to check |
terrains | The terrain list agains which to check the terrain. May contain the metacharacters
|
Definition at line 747 of file builder.hpp.
References t_translation::terrain_matches().
Referenced by build_terrains(), and rule_matches().
|
inlineprivate |
Checks whether a terrain code matches a given list of terrain tcodes.
tcode | The terrain code to check |
terrain | The terrain match structure which to check the terrain. See previous definition for more details. |
Definition at line 760 of file builder.hpp.
References t_translation::t_match::is_empty, and t_translation::terrain_matches().
bool terrain_builder::update_animation | ( | const map_location & | loc | ) |
Updates the animation at a given tile.
Returns true if something has changed, and must be redrawn.
loc | the location to update |
true | this tile must be redrawn. |
Definition at line 329 of file builder.cpp.
References terrain_builder::tile::images_background, terrain_builder::tile::images_foreground, animated< T, T_void_value >::need_update(), terrain_builder::tilemap::on_map(), tile_map_, and animated< T, T_void_value >::update_last_draw_time().
|
staticprivate |
Parsed terrain rules.
This file holds the terrain_builder implementation.
Cached between instances
Definition at line 813 of file builder.hpp.
Referenced by build_terrains(), flush_local_rules(), parse_config(), set_terrain_rules_cfg(), and terrain_builder().
|
static |
Definition at line 65 of file builder.hpp.
Referenced by terrain_builder::building_rule::get_hash().
|
private |
A pointer to the gamemap class used in the current level.
Definition at line 793 of file builder.hpp.
Referenced by change_map(), and map().
|
staticprivate |
Config used to parse global terrain rules.
Definition at line 816 of file builder.hpp.
Referenced by set_terrain_rules_cfg(), and terrain_builder().
|
private |
A map representing all locations whose terrain is of a given type.
Definition at line 810 of file builder.hpp.
Referenced by build_terrains(), rebuild_all(), and reload_map().
|
private |
The tile_map_ for the current level, which is filled by the build_terrains_ method to contain "tiles" representing images attached to each tile.
Definition at line 800 of file builder.hpp.
Referenced by apply_rule(), get_terrain_at(), get_tile(), rebuild_all(), rebuild_cache_all(), rebuild_terrain(), reload_map(), rule_matches(), and update_animation().
|
private |
The tile width used when using basex and basey.
This is not, necessarily, the tile width in pixels, this is totally arbitrary. However, it will be set to 72 for convenience.
Definition at line 358 of file builder.hpp.
Referenced by add_constraints(), add_images_from_config(), and rotate().
|
static |
The position of unit graphics in a tile.
Graphics whose y position is below this value are considered background for this tile; graphics whose y position is above this value are considered foreground.
Definition at line 63 of file builder.hpp.
Referenced by terrain_builder::rule_image::is_background().