The Battle for Wesnoth  1.13.10+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 "gui/dialogs/loading_screen.hpp"
#include "image.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "preferences/game.hpp"
#include "serialization/string_utils.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::string > get_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)
#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 197 of file builder.cpp.

References a, b, 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 407 of file builder.cpp.

References utils::split().

Referenced by terrain_builder::load_images().

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

Definition at line 1102 of file builder.cpp.

References h.

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

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

Definition at line 394 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