diff --git a/projectfiles/CodeBlocks/wesnoth.cbp b/projectfiles/CodeBlocks/wesnoth.cbp
index e0375f62ee154..a410a410ba3bb 100644
--- a/projectfiles/CodeBlocks/wesnoth.cbp
+++ b/projectfiles/CodeBlocks/wesnoth.cbp
@@ -260,8 +260,8 @@
-
-
+
+
diff --git a/source_lists/libwesnoth b/source_lists/libwesnoth
index c9b44606ffff8..2716334c42d92 100644
--- a/source_lists/libwesnoth
+++ b/source_lists/libwesnoth
@@ -3,7 +3,7 @@ cursor.cpp
desktop/clipboard.cpp
display.cpp
display_context.cpp
-drawing_buffer.cpp
+drawing_queue.cpp
events.cpp
floating_label.cpp
font/font_config.cpp
diff --git a/src/arrow.cpp b/src/arrow.cpp
index 9b1b28b6ddb8e..0c7b227aa5cde 100644
--- a/src/arrow.cpp
+++ b/src/arrow.cpp
@@ -32,7 +32,7 @@ static lg::log_domain log_arrows("arrows");
#define SCREEN (static_cast(resources::screen))
arrow::arrow(bool hidden)
- : layer_(drawing_buffer::LAYER_ARROWS)
+ : layer_(drawing_queue::LAYER_ARROWS)
, color_("red")
, style_(STYLE_STANDARD)
, path_()
diff --git a/src/arrow.hpp b/src/arrow.hpp
index ef051149f33b6..2f39ed55bd8bc 100644
--- a/src/arrow.hpp
+++ b/src/arrow.hpp
@@ -90,7 +90,7 @@ class arrow {
*/
virtual void update_symbols();
- drawing_buffer::drawing_layer layer_;
+ drawing_queue::layer layer_;
std::string color_;
/// represents the subdirectory that holds images for this arrow style
diff --git a/src/display.cpp b/src/display.cpp
index f3c5ff064d8a5..c43b6255e3553 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -206,7 +206,7 @@ display::display(const display_context* dc,
, animate_water_(true)
, flags_()
, activeTeam_(0)
- , drawing_buffer_()
+ , drawing_queue_()
, map_screenshot_(false)
, reach_map_()
, reach_map_old_()
@@ -1385,7 +1385,7 @@ static void draw_background(const SDL_Rect& area, const std::string& image)
}
void display::draw_text_in_hex(const map_location& loc,
- const drawing_buffer::drawing_layer layer, const std::string& text,
+ const drawing_queue::layer layer, const std::string& text,
size_t font_size, color_t color, double x_in_hex, double y_in_hex)
{
if (text.empty()) return;
@@ -1401,12 +1401,12 @@ void display::draw_text_in_hex(const map_location& loc,
for (int dy=-1; dy <= 1; ++dy) {
for (int dx=-1; dx <= 1; ++dx) {
if (dx!=0 || dy!=0) {
- drawing_buffer_add(layer, loc, x + dx, y + dy, back_surf);
+ drawing_queue_add(layer, loc, x + dx, y + dy, back_surf);
}
}
}
- drawing_buffer_add(layer, loc, x, y, text_surf);
+ drawing_queue_add(layer, loc, x, y, text_surf);
}
void display::select_hex(map_location hex)
@@ -2722,13 +2722,13 @@ void display::draw(bool update, bool force)
* draw_invalidated() also invalidates the halos, so also needs to be
* ran if invalidated_.empty() == true.
*/
- //drawing_buffer_.set_clip_rect(map_area());
+ //drawing_queue_.set_clip_rect(map_area());
if(!invalidated_.empty() || preferences::show_haloes()) {
draw_invalidated();
invalidated_.clear();
}
- //drawing_buffer_.render_buffer();
+ //drawing_queue_.render_buffer();
post_commit();
draw_sidebar();
@@ -3006,10 +3006,10 @@ void display::draw_hex(const map_location& loc)
// tod may differ from tod if hex is illuminated.
const std::string& tod_hex_mask = tod.image_mask;
if(tod_hex_mask1 != nullptr || tod_hex_mask2 != nullptr) {
- drawing_buffer_add(drawing_buffer::LAYER_TERRAIN_FG, loc, xpos, ypos, tod_hex_mask1);
- drawing_buffer_add(drawing_buffer::LAYER_TERRAIN_FG, loc, xpos, ypos, tod_hex_mask2);
+ drawing_queue_add(drawing_queue::LAYER_TERRAIN_FG, loc, xpos, ypos, tod_hex_mask1);
+ drawing_queue_add(drawing_queue::LAYER_TERRAIN_FG, loc, xpos, ypos, tod_hex_mask2);
} else if(!tod_hex_mask.empty()) {
- drawing_buffer_add(drawing_buffer::LAYER_TERRAIN_FG, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_TERRAIN_FG, loc, xpos, ypos,
image::get_image(tod_hex_mask,image::SCALED_TO_HEX));
}
#endif
@@ -3041,8 +3041,8 @@ void display::draw_hex(const map_location& loc)
if (draw_num_of_bitmaps_) {
off_y -= text->h / 2;
}
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
}
if(draw_terrain_codes_ && (game_config::debug || !shrouded(loc))) {
@@ -3059,8 +3059,8 @@ void display::draw_hex(const map_location& loc)
} else if (draw_num_of_bitmaps_ && !draw_coordinates_) {
off_y -= text->h / 2;
}
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
}
if(draw_num_of_bitmaps_) {
@@ -3078,13 +3078,13 @@ void display::draw_hex(const map_location& loc)
if (draw_terrain_codes_) {
off_y += text->h / 2;
}
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
- drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, bg);
+ drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, off_x, off_y, text);
}
}
if(debug_foreground) {
- drawing_buffer_add(drawing_buffer::LAYER_UNIT_DEFAULT, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_UNIT_DEFAULT, loc, xpos, ypos,
image::get_image("terrain/foreground.png", image_type));
}
#endif
diff --git a/src/display.hpp b/src/display.hpp
index e175b605df062..4d92f03923590 100644
--- a/src/display.hpp
+++ b/src/display.hpp
@@ -50,7 +50,7 @@ namespace wb {
#include "animated.hpp"
#include "display_context.hpp"
-#include "drawing_buffer.hpp"
+#include "drawing_queue.hpp"
#include "filter_context.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
@@ -819,7 +819,7 @@ class display : public filter_context, public video2::draw_layering
* The font size is adjusted to the zoom factor.
*/
void draw_text_in_hex(const map_location& loc,
- const drawing_buffer::drawing_layer layer, const std::string& text, size_t font_size,
+ const drawing_queue::layer layer, const std::string& text, size_t font_size,
color_t color, double x_in_hex=0.5, double y_in_hex=0.5);
protected:
@@ -827,12 +827,12 @@ class display : public filter_context, public video2::draw_layering
//TODO sort
size_t activeTeam_;
- drawing_buffer drawing_buffer_;
+ drawing_queue drawing_queue_;
public:
- drawing_buffer& get_drawing_buffer()
+ drawing_queue& get_drawing_queue()
{
- return drawing_buffer_;
+ return drawing_queue_;
}
/**
@@ -843,14 +843,14 @@ class display : public filter_context, public video2::draw_layering
* drawing order.
*/
- void drawing_buffer_add(const drawing_buffer::drawing_layer,
+ void drawing_queue_add(const drawing_queue::layer,
const map_location&, int, int, const surface&,
const SDL_Rect &clip = SDL_Rect())
{
UNUSED(clip);
}
- void drawing_buffer_add(const drawing_buffer::drawing_layer,
+ void drawing_queue_add(const drawing_queue::layer,
const map_location&, int, int,
const std::vector&,
const SDL_Rect &clip = SDL_Rect())
diff --git a/src/drawing_buffer.cpp b/src/drawing_queue.cpp
similarity index 94%
rename from src/drawing_buffer.cpp
rename to src/drawing_queue.cpp
index db5d98e3d6db9..ecc75777064f6 100644
--- a/src/drawing_buffer.cpp
+++ b/src/drawing_queue.cpp
@@ -12,7 +12,7 @@
See the COPYING file for more details.
*/
-#include "drawing_buffer.hpp"
+#include "drawing_queue.hpp"
#include "display.hpp"
#include "sdl/surface.hpp"
@@ -45,7 +45,7 @@ enum {
} // end anon namespace
-drawing_buffer::buffer_key::layer_group_array drawing_buffer::buffer_key::layer_groups {{
+drawing_queue::buffer_key::layer_group_array drawing_queue::buffer_key::layer_groups {{
LAYER_TERRAIN_BG,
LAYER_UNIT_FIRST,
LAYER_UNIT_MOVE_DEFAULT,
@@ -53,7 +53,7 @@ drawing_buffer::buffer_key::layer_group_array drawing_buffer::buffer_key::layer_
LAYER_REACHMAP
}};
-drawing_buffer::buffer_key::buffer_key(const map_location &loc, drawing_layer layer)
+drawing_queue::buffer_key::buffer_key(const map_location &loc, layer layer)
: key_(0)
{
// Start with the index of last group entry...
@@ -85,7 +85,7 @@ drawing_buffer::buffer_key::buffer_key(const map_location &loc, drawing_layer la
key_ |= (static_cast(layer) << SHIFT_LAYER) | static_cast(loc.x + MAX_BORDER) / 2;
}
-void drawing_buffer::render_buffer()
+void drawing_queue::render_buffer()
{
// std::list::sort() is a stable sort
buffer_.sort();
diff --git a/src/drawing_buffer.hpp b/src/drawing_queue.hpp
similarity index 95%
rename from src/drawing_buffer.hpp
rename to src/drawing_queue.hpp
index b6f00333fd4a0..835cdd4f41ea0 100644
--- a/src/drawing_buffer.hpp
+++ b/src/drawing_queue.hpp
@@ -23,10 +23,10 @@
#include
#include
-class drawing_buffer
+class drawing_queue
{
public:
- drawing_buffer()
+ drawing_queue()
: buffer_()
{
}
@@ -44,7 +44,7 @@ class drawing_buffer
/**
* The various map rendering layers. This controls the internal rendering order.
*/
- enum drawing_layer {
+ enum layer {
/** Layer for the terrain drawn behind units. */
LAYER_TERRAIN_BG,
@@ -151,7 +151,7 @@ class drawing_buffer
class buffer_key
{
public:
- buffer_key(const map_location& loc, drawing_layer layer);
+ buffer_key(const map_location& loc, layer layer);
bool operator<(const buffer_key& rhs) const
{
@@ -161,7 +161,7 @@ class drawing_buffer
private:
unsigned int key_;
- using layer_group_array = const std::array;
+ using layer_group_array = const std::array;
// The drawing is done per layer_group, with the range per group being [low, high].
// FIXME: better documentation.
@@ -172,7 +172,7 @@ class drawing_buffer
class blit_helper
{
public:
- blit_helper(const drawing_layer layer,
+ blit_helper(const layer layer,
const map_location& loc,
const int x,
const int y,
@@ -186,7 +186,7 @@ class drawing_buffer
{
}
- blit_helper(const drawing_layer layer,
+ blit_helper(const layer layer,
const map_location& loc,
const int x,
const int y,
diff --git a/src/editor/editor_display.cpp b/src/editor/editor_display.cpp
index f5ac4323a6ac7..ff0a5f1c7ccdf 100644
--- a/src/editor/editor_display.cpp
+++ b/src/editor/editor_display.cpp
@@ -115,13 +115,13 @@ void editor_display::draw_hex(const map_location& loc)
display::draw_hex(loc);
if (map().on_board_with_border(loc)) {
if (map().in_selection(loc)) {
- //drawing_buffer_add(drawing_buffer::LAYER_FOG_SHROUD, loc, xpos, ypos,
+ //drawing_queue_add(drawing_queue::LAYER_FOG_SHROUD, loc, xpos, ypos,
// image::get_texture("editor/selection-overlay.png"));
}
if (brush_locations_.find(loc) != brush_locations_.end()) {
static const image::locator brush(game_config::images::editor_brush);
- //drawing_buffer_add(drawing_buffer::LAYER_SELECTED_HEX, loc, xpos, ypos,
+ //drawing_queue_add(drawing_queue::LAYER_SELECTED_HEX, loc, xpos, ypos,
// image::get_texture(brush));
}
}
diff --git a/src/game_display.cpp b/src/game_display.cpp
index 4958094421dd3..ab05fc2acd4ff 100644
--- a/src/game_display.cpp
+++ b/src/game_display.cpp
@@ -332,30 +332,30 @@ void game_display::draw_hex(const map_location& loc)
#if 0
if(on_map && loc == mouseoverHex_) {
- drawing_buffer::drawing_layer hex_top_layer = drawing_buffer::LAYER_MOUSEOVER_BOTTOM;
+ drawing_queue::layer hex_top_layer = drawing_queue::LAYER_MOUSEOVER_BOTTOM;
const unit *u = resources::gameboard->get_visible_unit(loc, dc_->teams()[viewing_team()] );
if( u != nullptr ) {
- hex_top_layer = drawing_buffer::LAYER_MOUSEOVER_TOP;
+ hex_top_layer = drawing_queue::LAYER_MOUSEOVER_TOP;
}
if(u == nullptr) {
- drawing_buffer_add( hex_top_layer, loc, xpos, ypos,
+ drawing_queue_add( hex_top_layer, loc, xpos, ypos,
image::get_image("misc/hover-hex-top.png~RC(magenta>gold)", image::SCALED_TO_HEX));
- drawing_buffer_add(drawing_buffer::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
image::get_image("misc/hover-hex-bottom.png~RC(magenta>gold)", image::SCALED_TO_HEX));
} else if(dc_->teams()[currentTeam_].is_enemy(u->side())) {
- drawing_buffer_add( hex_top_layer, loc, xpos, ypos,
+ drawing_queue_add( hex_top_layer, loc, xpos, ypos,
image::get_image("misc/hover-hex-enemy-top.png~RC(magenta>red)", image::SCALED_TO_HEX));
- drawing_buffer_add(drawing_buffer::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
image::get_image("misc/hover-hex-enemy-bottom.png~RC(magenta>red)", image::SCALED_TO_HEX));
} else if(dc_->teams()[currentTeam_].side() == u->side()) {
- drawing_buffer_add( hex_top_layer, loc, xpos, ypos,
+ drawing_queue_add( hex_top_layer, loc, xpos, ypos,
image::get_image("misc/hover-hex-top.png~RC(magenta>green)", image::SCALED_TO_HEX));
- drawing_buffer_add(drawing_buffer::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
image::get_image("misc/hover-hex-bottom.png~RC(magenta>green)", image::SCALED_TO_HEX));
} else {
- drawing_buffer_add( hex_top_layer, loc, xpos, ypos,
+ drawing_queue_add( hex_top_layer, loc, xpos, ypos,
image::get_image("misc/hover-hex-top.png~RC(magenta>lightblue)", image::SCALED_TO_HEX));
- drawing_buffer_add(drawing_buffer::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOUSEOVER_BOTTOM, loc, xpos, ypos,
image::get_image("misc/hover-hex-bottom.png~RC(magenta>lightblue)", image::SCALED_TO_HEX));
}
}
@@ -381,7 +381,7 @@ void game_display::draw_hex(const map_location& loc)
{
std::vector footstepImages = footsteps_images(loc, route_, dc_);
if (!footstepImages.empty()) {
- drawing_buffer_add(drawing_buffer::LAYER_FOOTSTEPS, loc, xpos, ypos, footsteps_images(loc, route_, dc_));
+ drawing_queue_add(drawing_queue::LAYER_FOOTSTEPS, loc, xpos, ypos, footsteps_images(loc, route_, dc_));
}
}
}
@@ -431,7 +431,7 @@ void game_display::draw_hex(const map_location& loc)
int debugH = debugHighlights_[loc];
if (debugH) {
std::string txt = std::to_string(debugH);
- draw_text_in_hex(loc, drawing_buffer::LAYER_MOVE_INFO, txt, 18, font::BAD_COLOR);
+ draw_text_in_hex(loc, drawing_queue::LAYER_MOVE_INFO, txt, 18, font::BAD_COLOR);
}
}
@@ -501,22 +501,22 @@ void game_display::draw_movement_info(const map_location& loc)
// simple mark (no turn point) use smaller font
int def_font = w->second.turns > 0 ? 18 : 16;
- draw_text_in_hex(loc, drawing_buffer::LAYER_MOVE_INFO, def_text.str(), def_font, color);
+ draw_text_in_hex(loc, drawing_queue::LAYER_MOVE_INFO, def_text.str(), def_font, color);
int xpos = get_location_x(loc);
int ypos = get_location_y(loc);
if (w->second.invisible) {
- drawing_buffer_add(drawing_buffer::LAYER_MOVE_INFO, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOVE_INFO, loc, xpos, ypos,
image::get_image("misc/hidden.png", image::SCALED_TO_HEX));
}
if (w->second.zoc) {
- drawing_buffer_add(drawing_buffer::LAYER_MOVE_INFO, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOVE_INFO, loc, xpos, ypos,
image::get_image("misc/zoc.png", image::SCALED_TO_HEX));
}
if (w->second.capture) {
- drawing_buffer_add(drawing_buffer::LAYER_MOVE_INFO, loc, xpos, ypos,
+ drawing_queue_add(drawing_queue::LAYER_MOVE_INFO, loc, xpos, ypos,
image::get_image("misc/capture.png", image::SCALED_TO_HEX));
}
@@ -524,7 +524,7 @@ void game_display::draw_movement_info(const map_location& loc)
if (w->second.turns > 1 || (w->second.turns == 1 && loc != route_.steps.back())) {
std::stringstream turns_text;
turns_text << w->second.turns;
- draw_text_in_hex(loc, drawing_buffer::LAYER_MOVE_INFO, turns_text.str(), 17, font::NORMAL_COLOR, 0.5,0.8);
+ draw_text_in_hex(loc, drawing_queue::LAYER_MOVE_INFO, turns_text.str(), 17, font::NORMAL_COLOR, 0.5,0.8);
}
// The hex is full now, so skip the "show enemy moves"
@@ -547,7 +547,7 @@ void game_display::draw_movement_info(const map_location& loc)
// use small font
int def_font = 16;
- draw_text_in_hex(loc, drawing_buffer::LAYER_MOVE_INFO, def_text.str(), def_font, color);
+ draw_text_in_hex(loc, drawing_queue::LAYER_MOVE_INFO, def_text.str(), def_font, color);
}
}
@@ -555,7 +555,7 @@ void game_display::draw_movement_info(const map_location& loc)
reach_map::iterator reach = reach_map_.find(loc);
if(reach != reach_map_.end() && reach->second > 1) {
const std::string num = std::to_string(reach->second);
- draw_text_in_hex(loc, drawing_buffer::LAYER_MOVE_INFO, num, 16, font::YELLOW_COLOR);
+ draw_text_in_hex(loc, drawing_queue::LAYER_MOVE_INFO, num, 16, font::YELLOW_COLOR);
}
}
}
diff --git a/src/units/animation.cpp b/src/units/animation.cpp
index 57e0571f6c4af..9c21facbf0cd0 100644
--- a/src/units/animation.cpp
+++ b/src/units/animation.cpp
@@ -543,7 +543,7 @@ void unit_animation::fill_initial_animations(std::vector& animat
animations.push_back(base);
animations.back().event_ = { "movement" };
animations.back().unit_anim_.override(0, 200,
- particle::NO_CYCLE, "", "", {0,0,0}, "0~1:200", std::to_string(drawing_buffer::LAYER_UNIT_MOVE_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST));
+ particle::NO_CYCLE, "", "", {0,0,0}, "0~1:200", std::to_string(drawing_queue::LAYER_UNIT_MOVE_DEFAULT - drawing_queue::LAYER_UNIT_FIRST));
animations.push_back(base);
animations.back().event_ = { "defend" };
@@ -557,7 +557,7 @@ void unit_animation::fill_initial_animations(std::vector& animat
animations.push_back(base);
animations.back().event_ = { "attack" };
- animations.back().unit_anim_.override(-150, 300, particle::NO_CYCLE, "", "", {0,0,0}, "0~0.6:150,0.6~0:150", std::to_string(drawing_buffer::LAYER_UNIT_MOVE_DEFAULT-drawing_buffer::LAYER_UNIT_FIRST));
+ animations.back().unit_anim_.override(-150, 300, particle::NO_CYCLE, "", "", {0,0,0}, "0~0.6:150,0.6~0:150", std::to_string(drawing_queue::LAYER_UNIT_MOVE_DEFAULT-drawing_queue::LAYER_UNIT_FIRST));
animations.back().primary_attack_filter_.push_back(config());
animations.back().primary_attack_filter_.back()["range"] = "melee";
@@ -606,7 +606,7 @@ void unit_animation::fill_initial_animations(std::vector& animat
static void add_simple_anim(std::vector& animations,
const config& cfg, char const* tag_name, char const* apply_to,
- drawing_buffer::drawing_layer layer = drawing_buffer::LAYER_UNIT_DEFAULT,
+ drawing_queue::layer layer = drawing_queue::LAYER_UNIT_DEFAULT,
bool offscreen = true)
{
for(const animation_branch& ab : prepare_animation(cfg, tag_name)) {
@@ -619,7 +619,7 @@ static void add_simple_anim(std::vector& animations,
}
config::attribute_value& v = anim["layer"];
- if(v.empty()) v = layer - drawing_buffer::LAYER_UNIT_FIRST;
+ if(v.empty()) v = layer - drawing_queue::LAYER_UNIT_FIRST;
animations.push_back(unit_animation(anim));
}
@@ -631,15 +631,15 @@ void unit_animation::add_anims( std::vector & animations, const
animations.push_back(unit_animation(ab.merge()));
}
- const int default_layer = drawing_buffer::LAYER_UNIT_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST;
- const int move_layer = drawing_buffer::LAYER_UNIT_MOVE_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST;
- const int missile_layer = drawing_buffer::LAYER_UNIT_MISSILE_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST;
+ const int default_layer = drawing_queue::LAYER_UNIT_DEFAULT - drawing_queue::LAYER_UNIT_FIRST;
+ const int move_layer = drawing_queue::LAYER_UNIT_MOVE_DEFAULT - drawing_queue::LAYER_UNIT_FIRST;
+ const int missile_layer = drawing_queue::LAYER_UNIT_MISSILE_DEFAULT - drawing_queue::LAYER_UNIT_FIRST;
add_simple_anim(animations, cfg, "resistance_anim", "resistance");
add_simple_anim(animations, cfg, "leading_anim", "leading");
add_simple_anim(animations, cfg, "recruit_anim", "recruited");
add_simple_anim(animations, cfg, "recruiting_anim", "recruiting");
- add_simple_anim(animations, cfg, "idle_anim", "idling", drawing_buffer::LAYER_UNIT_DEFAULT, false);
+ add_simple_anim(animations, cfg, "idle_anim", "idling", drawing_queue::LAYER_UNIT_DEFAULT, false);
add_simple_anim(animations, cfg, "levelin_anim", "levelin");
add_simple_anim(animations, cfg, "levelout_anim", "levelout");
@@ -735,7 +735,7 @@ void unit_animation::add_anims( std::vector & animations, const
animations.back().sub_anims_["_poison_sound"].add_frame(1,frame_builder().sound(game_config::sounds::status::poisoned),true);
}
- add_simple_anim(animations, cfg, "pre_movement_anim", "pre_movement", drawing_buffer::LAYER_UNIT_MOVE_DEFAULT);
+ add_simple_anim(animations, cfg, "pre_movement_anim", "pre_movement", drawing_queue::LAYER_UNIT_MOVE_DEFAULT);
for(const animation_branch& ab : prepare_animation(cfg, "movement_anim")) {
config anim = ab.merge();
@@ -752,7 +752,7 @@ void unit_animation::add_anims( std::vector & animations, const
animations.push_back(unit_animation(anim));
}
- add_simple_anim(animations, cfg, "post_movement_anim", "post_movement", drawing_buffer::LAYER_UNIT_MOVE_DEFAULT);
+ add_simple_anim(animations, cfg, "post_movement_anim", "post_movement", drawing_queue::LAYER_UNIT_MOVE_DEFAULT);
for(const animation_branch& ab : prepare_animation(cfg, "defend")) {
config anim = ab.merge();
@@ -798,8 +798,8 @@ void unit_animation::add_anims( std::vector & animations, const
}
}
- add_simple_anim(animations, cfg, "draw_weapon_anim", "draw_weapon", drawing_buffer::LAYER_UNIT_MOVE_DEFAULT);
- add_simple_anim(animations, cfg, "sheath_weapon_anim", "sheath_weapon", drawing_buffer::LAYER_UNIT_MOVE_DEFAULT);
+ add_simple_anim(animations, cfg, "draw_weapon_anim", "draw_weapon", drawing_queue::LAYER_UNIT_MOVE_DEFAULT);
+ add_simple_anim(animations, cfg, "sheath_weapon_anim", "sheath_weapon", drawing_queue::LAYER_UNIT_MOVE_DEFAULT);
for(const animation_branch& ab : prepare_animation(cfg, "attack_anim")) {
config anim = ab.merge();
diff --git a/src/units/drawer.cpp b/src/units/drawer.cpp
index c2c9bab17e945..aadb7a3c7b75a 100644
--- a/src/units/drawer.cpp
+++ b/src/units/drawer.cpp
@@ -232,16 +232,16 @@ void unit_drawer::redraw_unit(const unit & u) const
}
if(ellipse_back != nullptr) {
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_BG, loc,
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_FIRST, loc,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_BG, loc,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_FIRST, loc,
// xsrc, ysrc +adjusted_params.y-ellipse_floating, ellipse_back);
disp.render_scaled_to_zoom(ellipse_back, xsrc, ysrc + adjusted_params.y - ellipse_floating);
}
if(ellipse_front != nullptr) {
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_FG, loc,
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_FIRST, loc,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_FG, loc,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_FIRST, loc,
// xsrc, ysrc +adjusted_params.y-ellipse_floating, ellipse_front);
disp.render_scaled_to_zoom(ellipse_front, xsrc, ysrc + adjusted_params.y - ellipse_floating);
@@ -318,7 +318,7 @@ void unit_drawer::redraw_unit(const unit & u) const
if(orb_img != nullptr) {
texture orb(image::get_texture(*orb_img));
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_BAR,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_BAR,
// loc, xsrc + xoff, ysrc + yoff + adjusted_params.y, orb);
disp.render_scaled_to_zoom(orb, xsrc + xoff, ysrc + yoff + adjusted_params.y);
}
@@ -359,7 +359,7 @@ void unit_drawer::redraw_unit(const unit & u) const
//if(bar_alpha != ftofxp(1.0)) {
// crown = adjust_surface_alpha(crown, bar_alpha);
//}
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_BAR,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_BAR,
// loc, xsrc+xoff, ysrc+yoff+adjusted_params.y, crown);
disp.render_scaled_to_zoom(crown, xsrc + xoff, ysrc + yoff + adjusted_params.y);
}
@@ -368,7 +368,7 @@ void unit_drawer::redraw_unit(const unit & u) const
for(const auto& ov : u.overlays()) {
const texture ov_img(image::get_texture(ov));
if(ov_img != nullptr) {
- //disp.drawing_buffer_add(drawing_buffer::LAYER_UNIT_BAR,
+ //disp.drawing_queue_add(drawing_queue::LAYER_UNIT_BAR,
// loc, xsrc+xoff, ysrc+yoff+adjusted_params.y, ov_img);
disp.render_scaled_to_zoom(ov_img, xsrc + xoff, ysrc + yoff + adjusted_params.y);
}
diff --git a/src/units/frame.cpp b/src/units/frame.cpp
index 433cef84cd583..3eb05e4e859f2 100644
--- a/src/units/frame.cpp
+++ b/src/units/frame.cpp
@@ -38,7 +38,7 @@ frame_parameters::frame_parameters()
, auto_vflip(boost::logic::indeterminate)
, auto_hflip(boost::logic::indeterminate)
, primary_frame(boost::logic::indeterminate)
- , drawing_layer(drawing_buffer::LAYER_UNIT_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST)
+ , layer(drawing_queue::LAYER_UNIT_DEFAULT - drawing_queue::LAYER_UNIT_FIRST)
{}
frame_builder::frame_builder()
@@ -46,7 +46,7 @@ frame_builder::frame_builder()
, auto_vflip_(boost::logic::indeterminate)
, auto_hflip_(boost::logic::indeterminate)
, primary_frame_(boost::logic::indeterminate)
- , drawing_layer_(std::to_string(drawing_buffer::LAYER_UNIT_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST))
+ , layer_(std::to_string(drawing_queue::LAYER_UNIT_DEFAULT - drawing_queue::LAYER_UNIT_FIRST))
{}
frame_builder::frame_builder(const config& cfg,const std::string& frame_string)
@@ -71,7 +71,7 @@ frame_builder::frame_builder(const config& cfg,const std::string& frame_string)
, auto_vflip_(boost::logic::indeterminate)
, auto_hflip_(boost::logic::indeterminate)
, primary_frame_(boost::logic::indeterminate)
- , drawing_layer_(cfg[frame_string + "layer"])
+ , layer_(cfg[frame_string + "layer"])
{
if(!cfg.has_attribute(frame_string + "auto_vflip")) {
auto_vflip_ = boost::logic::indeterminate;
@@ -233,9 +233,9 @@ frame_builder& frame_builder::primary_frame(const bool primary_frame)
return *this;
}
-frame_builder& frame_builder::drawing_layer(const std::string& drawing_layer)
+frame_builder& frame_builder::layer(const std::string& layer)
{
- drawing_layer_=drawing_layer;
+ layer_=layer;
return *this;
}
@@ -263,7 +263,7 @@ frame_parsed_parameters::frame_parsed_parameters(const frame_builder& builder, i
, auto_vflip_(builder.auto_vflip_)
, auto_hflip_(builder.auto_hflip_)
, primary_frame_(builder.primary_frame_)
- , drawing_layer_(builder.drawing_layer_,duration_)
+ , layer_(builder.layer_,duration_)
{}
bool frame_parsed_parameters::does_not_change() const
@@ -282,7 +282,7 @@ bool frame_parsed_parameters::does_not_change() const
y_.does_not_change() &&
directional_x_.does_not_change() &&
directional_y_.does_not_change() &&
- drawing_layer_.does_not_change();
+ layer_.does_not_change();
}
bool frame_parsed_parameters::need_update() const
@@ -316,7 +316,7 @@ const frame_parameters frame_parsed_parameters::parameters(int current_time) con
result.auto_vflip = auto_vflip_;
result.auto_hflip = auto_hflip_;
result.primary_frame = primary_frame_;
- result.drawing_layer = drawing_layer_.get_current_element(current_time,drawing_buffer::LAYER_UNIT_DEFAULT-drawing_buffer::LAYER_UNIT_FIRST);
+ result.layer = layer_.get_current_element(current_time,drawing_queue::LAYER_UNIT_DEFAULT-drawing_queue::LAYER_UNIT_FIRST);
return result;
}
@@ -348,9 +348,9 @@ void frame_parsed_parameters::override(int duration,
}
if(!layer.empty()) {
- drawing_layer_ = progressive_int(layer,duration);
+ layer_ = progressive_int(layer,duration);
} else if(duration != duration_){
- drawing_layer_ = progressive_int(drawing_layer_.get_original(),duration);
+ layer_ = progressive_int(layer_.get_original(),duration);
}
if(!modifiers.empty()) {
@@ -468,8 +468,8 @@ std::vector frame_parsed_parameters::debug_strings() const
v.emplace_back("primary_frame=" + utils::bool_string(primary_frame_));
}
- if(!drawing_layer_.get_original().empty()) {
- v.emplace_back("drawing_layer=" + drawing_layer_.get_original());
+ if(!layer_.get_original().empty()) {
+ v.emplace_back("layer=" + layer_.get_original());
}
return v;
@@ -599,7 +599,7 @@ void unit_frame::redraw(const int frame_time, bool on_start_time, bool in_scope_
SDL_Rect srcrect {0, 0, surf->w, submerge_height};
- //drawing_buffer_add(drawing_layer, loc, x, y, surf, srcrect);
+ //drawing_queue_add(layer, loc, x, y, surf, srcrect);
if(submerge_height != surf->h) {
//the lower part will be transparent
@@ -612,7 +612,7 @@ void unit_frame::redraw(const int frame_time, bool on_start_time, bool in_scope_
srcrect.h = surf->h-submerge_height;
y += submerge_height;
- //drawing_buffer_add(drawing_layer, loc, x, y, surf, srcrect);
+ //drawing_queue_add(layer, loc, x, y, surf, srcrect);
}
}
#endif
@@ -928,10 +928,10 @@ const frame_parameters unit_frame::merge_parameters(int current_time, const fram
assert(engine_val.directional_y == 0);
result.directional_y = current_val.directional_y ? current_val.directional_y : animation_val.directional_y;
- assert(engine_val.drawing_layer == drawing_buffer::LAYER_UNIT_DEFAULT - drawing_buffer::LAYER_UNIT_FIRST);
- result.drawing_layer = current_val.drawing_layer != drawing_buffer::LAYER_UNIT_DEFAULT-drawing_buffer::LAYER_UNIT_FIRST
- ? current_val.drawing_layer
- : animation_val.drawing_layer;
+ assert(engine_val.layer == drawing_queue::LAYER_UNIT_DEFAULT - drawing_queue::LAYER_UNIT_FIRST);
+ result.layer = current_val.layer != drawing_queue::LAYER_UNIT_DEFAULT-drawing_queue::LAYER_UNIT_FIRST
+ ? current_val.layer
+ : animation_val.layer;
/** The engine provides us with a default value to compare to. Update if different */
result.auto_hflip = engine_val.auto_hflip;
diff --git a/src/units/frame.hpp b/src/units/frame.hpp
index b8c96ef44fa76..32fe091624bfa 100644
--- a/src/units/frame.hpp
+++ b/src/units/frame.hpp
@@ -66,7 +66,7 @@ struct frame_parameters
boost::tribool auto_hflip;
boost::tribool primary_frame;
- int drawing_layer;
+ int layer;
};
/**
@@ -97,7 +97,7 @@ class frame_builder
frame_builder& auto_vflip(const bool auto_vflip);
frame_builder& auto_hflip(const bool auto_hflip);
frame_builder& primary_frame(const bool primary_frame);
- frame_builder& drawing_layer(const std::string& drawing_layer);
+ frame_builder& layer(const std::string& layer);
private:
friend class frame_parsed_parameters;
@@ -130,7 +130,7 @@ class frame_builder
boost::tribool auto_hflip_;
boost::tribool primary_frame_;
- std::string drawing_layer_;
+ std::string layer_;
};
/**
@@ -192,7 +192,7 @@ class frame_parsed_parameters
boost::tribool auto_hflip_;
boost::tribool primary_frame_;
- progressive_int drawing_layer_;
+ progressive_int layer_;
};
/** Describes a unit's animation sequence. */
diff --git a/src/whiteboard/attack.cpp b/src/whiteboard/attack.cpp
index aae090195479f..8d1698cc19e89 100644
--- a/src/whiteboard/attack.cpp
+++ b/src/whiteboard/attack.cpp
@@ -192,7 +192,7 @@ void attack::draw_hex(const map_location& hex)
{
//@todo: replace this by either the use of transparency + LAYER_ATTACK_INDICATOR,
//or a dedicated layer
- const drawing_buffer::drawing_layer layer = drawing_buffer::LAYER_FOOTSTEPS;
+ const drawing_queue::layer layer = drawing_queue::LAYER_FOOTSTEPS;
//calculate direction (valid for both hexes)
std::string direction_text = map_location::write_direction(
@@ -203,7 +203,7 @@ void attack::draw_hex(const map_location& hex)
int xpos = resources::screen->get_location_x(get_dest_hex());
int ypos = resources::screen->get_location_y(get_dest_hex());
- resources::screen->drawing_buffer_add(layer, get_dest_hex(), xpos, ypos,
+ resources::screen->drawing_queue_add(layer, get_dest_hex(), xpos, ypos,
image::get_image("whiteboard/attack-indicator-src-" + direction_text + ".png"));
}
else if (hex == target_hex_) //add symbol to defender hex
@@ -211,7 +211,7 @@ void attack::draw_hex(const map_location& hex)
//int xpos = resources::screen->get_location_x(target_hex_);
//int ypos = resources::screen->get_location_y(target_hex_);
- //resources::screen->drawing_buffer_add(layer, target_hex_, xpos, ypos,
+ //resources::screen->drawing_queue_add(layer, target_hex_, xpos, ypos,
// image::get_texture("whiteboard/attack-indicator-dst-" + direction_text + ".png"));
}
}
diff --git a/src/whiteboard/manager.cpp b/src/whiteboard/manager.cpp
index 9cfd83b3cbf00..7e4c963b37f57 100644
--- a/src/whiteboard/manager.cpp
+++ b/src/whiteboard/manager.cpp
@@ -462,7 +462,7 @@ static void draw_numbers(map_location const& hex, side_actions::numbers_t number
color_t color = team::get_side_color(static_cast(team_numbers[i]+1));
const double x_in_hex = x_origin + x_offset;
const double y_in_hex = y_origin + y_offset;
- resources::screen->draw_text_in_hex(hex, drawing_buffer::LAYER_ACTIONS_NUMBERING,
+ resources::screen->draw_text_in_hex(hex, drawing_queue::LAYER_ACTIONS_NUMBERING,
number_text, font_size, color, x_in_hex, y_in_hex);
x_offset += x_offset_base;
y_offset += y_offset_base;
diff --git a/src/whiteboard/move.cpp b/src/whiteboard/move.cpp
index ed34f7405f84e..653500dc5bdcb 100644
--- a/src/whiteboard/move.cpp
+++ b/src/whiteboard/move.cpp
@@ -391,7 +391,7 @@ void move::draw_hex(map_location const& hex)
{
std::stringstream turn_text;
turn_text << turn_number_;
- resources::screen->draw_text_in_hex(hex, drawing_buffer::LAYER_MOVE_INFO, turn_text.str(), 17, font::NORMAL_COLOR, 0.5,0.8);
+ resources::screen->draw_text_in_hex(hex, drawing_queue::LAYER_MOVE_INFO, turn_text.str(), 17, font::NORMAL_COLOR, 0.5,0.8);
}
}
diff --git a/src/whiteboard/recall.cpp b/src/whiteboard/recall.cpp
index 4aef3e777595c..666affdee5427 100644
--- a/src/whiteboard/recall.cpp
+++ b/src/whiteboard/recall.cpp
@@ -191,7 +191,7 @@ void recall::draw_hex(map_location const& hex)
}
size_t font_size = 16;
color_t color {255, 0, 0}; //red
- resources::screen->draw_text_in_hex(hex, drawing_buffer::LAYER_ACTIONS_NUMBERING,
+ resources::screen->draw_text_in_hex(hex, drawing_queue::LAYER_ACTIONS_NUMBERING,
number_text.str(), font_size, color, x_offset, y_offset);
}
}
diff --git a/src/whiteboard/recruit.cpp b/src/whiteboard/recruit.cpp
index 3b35b5ac78c57..67edf4a9c88cd 100644
--- a/src/whiteboard/recruit.cpp
+++ b/src/whiteboard/recruit.cpp
@@ -155,7 +155,7 @@ void recruit::draw_hex(map_location const& hex)
number_text << font::unicode_minus << cost_;
size_t font_size = 16;
color_t color {255, 0, 0}; //red
- resources::screen->draw_text_in_hex(hex, drawing_buffer::LAYER_ACTIONS_NUMBERING,
+ resources::screen->draw_text_in_hex(hex, drawing_queue::LAYER_ACTIONS_NUMBERING,
number_text.str(), font_size, color, x_offset, y_offset);
}
}
diff --git a/src/whiteboard/suppose_dead.cpp b/src/whiteboard/suppose_dead.cpp
index 45a33bc277257..9c85c66e55a78 100644
--- a/src/whiteboard/suppose_dead.cpp
+++ b/src/whiteboard/suppose_dead.cpp
@@ -138,11 +138,11 @@ void suppose_dead::draw_hex(const map_location& hex)
if(hex == loc_) //add symbol to hex
{
//@todo: Possibly use a different layer
- //const drawing_buffer::drawing_layer layer = drawing_buffer::LAYER_ARROWS;
+ //const drawing_queue::layer layer = drawing_queue::LAYER_ARROWS;
//int xpos = resources::screen->get_location_x(loc_);
//int ypos = resources::screen->get_location_y(loc_);
- //resources::screen->drawing_buffer_add(layer, loc_, xpos, ypos,
+ //resources::screen->drawing_queue_add(layer, loc_, xpos, ypos,
// image::get_texture("whiteboard/suppose_dead.png"));
}
}