Removed ThemeWML border image keys

These were rendered unnecessary by 781276709d, which changed border rendering to use the terrain engine.
This also removes display::draw_border, which used the keys.
This commit is contained in:
Charles Dang 2017-04-25 19:49:08 +11:00
parent 5effd5338a
commit d4529dfc1e
5 changed files with 2 additions and 152 deletions

View file

@ -9,26 +9,6 @@
# in the terrains directory and should ommit the 'terrain/' prefix
# and the '.png' suffix
tile_image = "off-map/alpha.png"
corner_image_top_left = "terrain/off-map/fade_corner_top_left.png"
corner_image_bottom_left = "terrain/off-map/fade_corner_bottom_left.png"
# odd means the corner is on a tile with an odd x value,
# the tile is the ingame tile not the odd in C++
corner_image_top_right_odd = "terrain/off-map/fade_corner_top_right_odd.png"
corner_image_top_right_even = "terrain/off-map/fade_corner_top_right_even.png"
corner_image_bottom_right_odd = "terrain/off-map/fade_corner_bottom_right_odd.png"
corner_image_bottom_right_even = "terrain/off-map/fade_corner_bottom_right_even.png"
border_image_left = "terrain/off-map/fade_border_left.png"
border_image_right = "terrain/off-map/fade_border_right.png"
border_image_top_odd = "terrain/off-map/fade_border_top_odd.png"
border_image_top_even = "terrain/off-map/fade_border_top_even.png"
border_image_bottom_odd = "terrain/off-map/fade_border_bottom_odd.png"
border_image_bottom_even = "terrain/off-map/fade_border_bottom_even.png"
[/main_map_border]
#enddef

View file

@ -1750,70 +1750,6 @@ void display::announce(const std::string& message, const color_t& color, int lif
font::add_floating_label(flabel);
}
void display::draw_border(const map_location& loc, const int xpos, const int ypos)
{
/**
* at the moment the border must be between 0.0 and 0.5
* and the image should always be prepared for a 0.5 border.
* This way this code doesn't need modifications for other border sizes.
*/
// First handle the corners :
if(loc.x == -1 && loc.y == -1) { // top left corner
drawing_buffer_add(LAYER_BORDER, loc, xpos + zoom_/4, ypos,
image::get_image(theme_.border().corner_image_top_left, image::SCALED_TO_ZOOM));
} else if(loc.x == get_map().w() && loc.y == -1) { // top right corner
// We use the map idea of odd and even, and map coords are internal coords + 1
if(loc.x%2 == 0) {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos + zoom_/2,
image::get_image(theme_.border().corner_image_top_right_odd, image::SCALED_TO_ZOOM));
} else {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos,
image::get_image(theme_.border().corner_image_top_right_even, image::SCALED_TO_ZOOM));
}
} else if(loc.x == -1 && loc.y == get_map().h()) { // bottom left corner
drawing_buffer_add(LAYER_BORDER, loc, xpos + zoom_/4, ypos,
image::get_image(theme_.border().corner_image_bottom_left, image::SCALED_TO_ZOOM));
} else if(loc.x == get_map().w() && loc.y == get_map().h()) { // bottom right corner
// We use the map idea of odd and even, and map coords are internal coords + 1
if(loc.x%2 == 1) {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos,
image::get_image(theme_.border().corner_image_bottom_right_even, image::SCALED_TO_ZOOM));
} else {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos,
image::get_image(theme_.border().corner_image_bottom_right_odd, image::SCALED_TO_ZOOM));
}
// Now handle the sides:
} else if(loc.x == -1) { // left side
drawing_buffer_add(LAYER_BORDER, loc, xpos + zoom_/4, ypos,
image::get_image(theme_.border().border_image_left, image::SCALED_TO_ZOOM));
} else if(loc.x == get_map().w()) { // right side
drawing_buffer_add(LAYER_BORDER, loc, xpos + zoom_/4, ypos,
image::get_image(theme_.border().border_image_right, image::SCALED_TO_ZOOM));
} else if(loc.y == -1) { // top side
// We use the map idea of odd and even, and map coords are internal coords + 1
if(loc.x%2 == 1) {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos,
image::get_image(theme_.border().border_image_top_even, image::SCALED_TO_ZOOM));
} else {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos + zoom_/2,
image::get_image(theme_.border().border_image_top_odd, image::SCALED_TO_ZOOM));
}
} else if(loc.y == get_map().h()) { // bottom side
// We use the map idea of odd and even, and map coords are internal coords + 1
if(loc.x%2 == 1) {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos,
image::get_image(theme_.border().border_image_bottom_even, image::SCALED_TO_ZOOM));
} else {
drawing_buffer_add(LAYER_BORDER, loc, xpos, ypos + zoom_/2,
image::get_image(theme_.border().border_image_bottom_odd, image::SCALED_TO_ZOOM));
}
}
}
void display::draw_minimap()
{
const SDL_Rect& area = minimap_area();
@ -2553,10 +2489,6 @@ void display::draw_invalidated() {
}
draw_hex(loc);
drawn_hexes_+=1;
// If the tile is at the border, we start to blend it
/*if(!on_map) {
draw_border(loc, xpos, ypos);
}*/
}
invalidated_hexes_ += invalidated_.size();

View file

@ -690,19 +690,6 @@ protected:
*/
virtual void draw_sidebar() {}
/**
* Draws the border tile overlay.
* The routine determines by itself which border it is on
* and draws an overlay accordingly. The definition of the
* border is stored in the 'main_map_border' part of the theme.
*
* @param loc the map location of the tile
* @param xpos the on-screen pixels x coordinate of the tile
* @param ypos the on-screen pixels y coordinate of the tile
*/
virtual void draw_border(const map_location& loc,
const int xpos, const int ypos);
void draw_minimap();
enum TERRAIN_TYPE { BACKGROUND, FOREGROUND};

View file

@ -295,19 +295,7 @@ theme::object::object(const config& cfg) :
theme::border_t::border_t() :
size(0.0),
background_image(),
tile_image(),
corner_image_top_left(),
corner_image_bottom_left(),
corner_image_top_right_odd(),
corner_image_top_right_even(),
corner_image_bottom_right_odd(),
corner_image_bottom_right_even(),
border_image_left(),
border_image_right(),
border_image_top_odd(),
border_image_top_even(),
border_image_bottom_odd(),
border_image_bottom_even()
tile_image()
{
}
@ -315,25 +303,7 @@ theme::border_t::border_t(const config& cfg) :
size(cfg["border_size"].to_double()),
background_image(cfg["background_image"]),
tile_image(cfg["tile_image"]),
corner_image_top_left(cfg["corner_image_top_left"]),
corner_image_bottom_left(cfg["corner_image_bottom_left"]),
corner_image_top_right_odd(cfg["corner_image_top_right_odd"]),
corner_image_top_right_even(cfg["corner_image_top_right_even"]),
corner_image_bottom_right_odd(cfg["corner_image_bottom_right_odd"]),
corner_image_bottom_right_even(cfg["corner_image_bottom_right_even"]),
border_image_left(cfg["border_image_left"]),
border_image_right(cfg["border_image_right"]),
border_image_top_odd(cfg["border_image_top_odd"]),
border_image_top_even(cfg["border_image_top_even"]),
border_image_bottom_odd(cfg["border_image_bottom_odd"]),
border_image_bottom_even(cfg["border_image_bottom_even"])
tile_image(cfg["tile_image"])
{
VALIDATE(size >= 0.0 && size <= 0.5, _("border_size should be between 0.0 and 0.5."));
}

View file

@ -85,25 +85,6 @@ class theme
std::string background_image;
std::string tile_image;
std::string corner_image_top_left;
std::string corner_image_bottom_left;
std::string corner_image_top_right_odd;
std::string corner_image_top_right_even;
std::string corner_image_bottom_right_odd;
std::string corner_image_bottom_right_even;
std::string border_image_left;
std::string border_image_right;
std::string border_image_top_odd;
std::string border_image_top_even;
std::string border_image_bottom_odd;
std::string border_image_bottom_even;
};
public: