The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
builder.cpp File Reference

Terrain builder. More...

#include "terrain/builder.hpp"
#include "game_preferences.hpp"
#include "image.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "serialization/string_utils.hpp"
#include "gui/dialogs/loadscreen.hpp"
Include dependency graph for builder.cpp:

Go to the source code of this file.

Macros

#define ERR_NG   LOG_STREAM(err, log_engine)
 
#define WRN_NG   LOG_STREAM(warn, log_engine)
 

Functions

static map_location legacy_negation (const map_location &me)
 These legacy map_location functions moved here from map_location. More...
 
static map_locationlegacy_sum_assign (map_location &me, const map_location &a)
 
static map_location legacy_sum (const map_location &me, const map_location &a)
 
static map_location legacy_difference (const map_location &me, const map_location &a)
 
static unsigned int get_noise (const map_location &loc, unsigned int index)
 
static bool image_exists (const std::string &name)
 
static std::vector< std::stringget_variations (const std::string &base, const std::string &variations)
 
static unsigned int hash_str (const std::string &str)
 

Variables

static lg::log_domain log_engine ("engine")
 

Detailed Description

Terrain builder.

Definition in file builder.cpp.

Macro Definition Documentation

#define ERR_NG   LOG_STREAM(err, log_engine)

Definition at line 30 of file builder.cpp.

Referenced by terrain_builder::parse_mapstring(), and terrain_builder::rotate_rule().

#define WRN_NG   LOG_STREAM(warn, log_engine)

Definition at line 31 of file builder.cpp.

Referenced by terrain_builder::parse_config().

Function Documentation

static unsigned int get_noise ( const map_location loc,
unsigned int  index 
)
static

Definition at line 191 of file builder.cpp.

References c, map_location::x, and map_location::y.

Referenced by terrain_builder::apply_rule(), and terrain_builder::rule_matches().

static std::vector<std::string> get_variations ( const std::string base,
const std::string variations 
)
static
Todo:
optimize this function

Definition at line 405 of file builder.cpp.

References pos, and utils::split().

Referenced by terrain_builder::load_images().

static unsigned int hash_str ( const std::string str)
static

Definition at line 1101 of file builder.cpp.

References h, and int().

Referenced by terrain_builder::building_rule::get_hash(), and config::hash().

static bool image_exists ( const std::string name)
static

Definition at line 392 of file builder.cpp.

References image::exists(), and image::precached_file_exists().

Referenced by terrain_builder::load_images().

static map_location legacy_difference ( const map_location me,
const map_location a 
)
static

Definition at line 76 of file builder.cpp.

References legacy_negation(), and legacy_sum().

Referenced by terrain_builder::build_terrains().

static map_location legacy_negation ( const map_location me)
static

These legacy map_location functions moved here from map_location.

?pp. We have refactored them out of everything but this class. Hopefully the end is near...

Adds an absolute location to a "delta" location This is not the mathematically correct behavior, it is neither commutative nor associative. Negative coordinates may give strange results. It is retained because terrain builder code relies in this broken behavior. Best avoid. map_location legacy_negation() const; map_location legacy_sum(const map_location &a) const; map_location& legacy_sum_assign(const map_location &a); map_location legacy_difference(const map_location &a) const;

Definition at line 51 of file builder.cpp.

References map_location::x, and map_location::y.

Referenced by legacy_difference().

static map_location legacy_sum ( const map_location me,
const map_location a 
)
static
static map_location& legacy_sum_assign ( map_location me,
const map_location a 
)
static

Definition at line 56 of file builder.cpp.

References map_location::x, and map_location::y.

Referenced by legacy_sum(), and terrain_builder::rotate_rule().

Variable Documentation

lg::log_domain log_engine("engine")
static