54 , delay_(cfg[
"delay"])
55 , autoscaled_(cfg[
"scaled"].to_bool())
56 , centered_(cfg[
"centered"].to_bool())
74 file_.empty() ? sdl::timage() : image::get_texture(
file_)
79 ri.
image.set_scale(xscale, yscale);
82 ri.
rect.x =
static_cast<int>(
x_*xscale) + dst_rect.x;
83 ri.
rect.y = static_cast<int>(
y_*yscale) + dst_rect.y;
103 static_cast<int>(ri.
image->w * xscale),
104 static_cast<int>(ri.
image->h * yscale)
108 ri.
rect.x =
static_cast<int>(
x_*xscale) + dst_rect.x;
109 ri.
rect.y = static_cast<int>(
y_*yscale) + dst_rect.y;
123 : scale_horizontally_(true)
124 , scale_vertically_(true)
125 , tile_horizontally_(false)
126 , tile_vertically_(false)
127 , keep_aspect_ratio_(true)
128 , is_base_layer_(false)
133 : scale_horizontally_(true)
134 , scale_vertically_(true)
135 , tile_horizontally_(false)
136 , tile_vertically_(false)
137 , keep_aspect_ratio_(true)
138 , is_base_layer_(false)
178 , text_block_loc_(
part::BLOCK_BOTTOM)
179 , title_alignment_(
part::TEXT_LEFT)
182 , background_layers_()
190 if(s.empty() !=
true) {
194 else if (s ==
"middle") {
203 if(s.empty() !=
true) {
207 else if(s ==
"center") {
224 bl.
set_file(cfg[
"background"].str());
258 text_ = cfg[
"story"].str();
273 music_ = cfg[
"music"].str();
276 sound_ = cfg[
"sound"].str();
286 if (key ==
"background_layer") {
290 else if(key ==
"image") {
294 else if(key ==
"if") {
306 bool elseif_flag =
false;
309 for (vconfig::child_list::const_iterator elseif = elseif_children.begin(); elseif != elseif_children.end(); ++elseif) {
311 if (elseif->has_child(
"then")) {
319 if (node.
has_child(
"else") && !elseif_flag) {
325 else if(key ==
"switch") {
328 bool case_not_found =
true;
331 if(j->first !=
"case")
continue;
334 const std::string var_expected_value = (j->second)[
"value"];
335 if(var_actual_value == var_expected_value) {
336 case_not_found =
false;
343 if(j->first !=
"else")
continue;
351 else if(key ==
"deprecated_message") {
356 else if(key ==
"wml_message") {
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
void set_keep_aspect_ratio(bool b)
Sets whether the aspect ratio should be preserved.
tformula< unsigned > x_
The x coordinate of the rectangle.
Storyscreen parts and floating images representation.
vconfig child(const std::string &key) const
Returns a child of *this whose key is key.
SDL_Rect rect
Corrected rectangle for rendering surf.
config get_parsed_config() const
all_children_iterator ordered_end() const
Center on the topmost edge of the screen.
static TEXT_ALIGNMENT string_title_align(const std::string &s)
surface scale_surface(const surface &surf, int w, int h)
render_input get_render_input(double xscale, double yscale, SDL_Rect &dst_rect) const
Gets a render_input object for use by the rendering code after applying any geometric transformations...
tformula< t_string > text_
The text to draw.
Definitions for the interface to Wesnoth Markup Language (WML).
void set_tile_vertically(bool b)
Sets whether the layer should be tiled vertically.
BLOCK_LOCATION text_block_loc_
void set_file(const std::string &str)
Sets the path to the image file.
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
child_list get_children(const std::string &key) const
Represents and contains information about image labels used in story screen parts.
void set_tile_horizontally(bool b)
Sets whether the layer should be tiled horizontally.
background_layer()
Constructor.
bool has_child(const std::string &key) const
Returns whether or not *this has a child whose key is key.
TEXT_ALIGNMENT title_alignment_
Templates and utility-routines for strings and numbers.
std::vector< background_layer > background_layers_
game_events::manager * game_events
Represents and contains information about a single storyscreen part.
std::vector< floating_image > floating_images_
void resolve_wml(const vconfig &cfg)
Takes care of initializing and branching properties.
Define conditionals for the game's events mechanism, a.k.a.
static BLOCK_LOCATION string_tblock_loc(const std::string &s)
std::stringstream & wml_error()
Use this logger to send errors due to deprecated WML.
void assign(const floating_image &fi)
Copy constructor and operator=() implementation details.
Define the game's event mechanism.
tformula< unsigned > y_
The y coordinate of the rectangle.
game_events::t_pump & pump()
bool conditional_passed(const vconfig &cond)
floating_image(const config &cfg)
WML-based constructor.
bool has_attribute(const std::string &key) const
part(const vconfig &part_cfg)
Constructs a storyscreen part from a managed WML node.
A variable-expanding proxy for the config class.
Standard logging facilities (interface).
std::vector< vconfig > child_list
void set_scale_horizontally(bool b)
Sets whether the layer should be scaled horizontally.
surface image
Surface, scaled if required.
A config object defines a single node in a WML file, with access to child nodes.
TEXT_ALIGNMENT
Currently used to indicate where the page title should be placed.
void set_scale_vertically(bool b)
Sets whether the layer should be scaled vertically.
void put_wml_message(const std::string &logger, const std::string &message, bool in_chat)
Helper function which determines whether a wml_message text can really be pushed into the wml_message...
GLsizei const GLcharARB ** string
bool has_attribute(const std::string &key) const
< Synonym for operator[]
all_children_iterator ordered_begin() const
In-order iteration over all children.
BLOCK_LOCATION
Currently used to indicate where the text block should be placed.