Render grid above foreground terrain.

Experiment to see if we get used to it. Still not perfect but much
more consistent.
This commit is contained in:
Ali El Gariani 2010-05-31 21:38:44 +00:00
parent 7c331caf27
commit daa4b91f0d
8 changed files with 16 additions and 6 deletions

View file

@ -110,6 +110,7 @@ Version 1.9.0-svn:
* Most sidebar tooltips have now a category indication
* Tooltips of ellipsed text are grouped in the last visible item's tooltip
* Increase a little tooltip's opacity
* Render grid above foreground terrain
* WML Engine:
* Deprecated [set_variable]'s random key, use rand instead
* Renamed [unit][status] healable to unhealable so it can default to 'no'

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

View file

@ -93,7 +93,8 @@
footprint_teleport_exit="footsteps/teleport-out.png"
terrain_mask_image="terrain/alphamask.png"
grid_image="terrain/grid.png"
grid_image_top="terrain/grid-top.png"
grid_image_bottom="terrain/grid-bottom.png"
unreachable_image="terrain/darken.png"
observer_image="misc/eye.png"

View file

@ -1943,8 +1943,10 @@ void display::draw_hex(const map_location& loc) {
// Draw the grid, if that's been enabled
if(grid_ && on_map && !off_map_tile) {
drawing_buffer_add(LAYER_TERRAIN_TMP_BG, loc, tblit(xpos, ypos,
image::get_image(game_config::grid_image, image::SCALED_TO_HEX)));
drawing_buffer_add(LAYER_GRID_TOP, loc, tblit(xpos, ypos,
image::get_image(game_config::grid_image_top, image::SCALED_TO_HEX)));
drawing_buffer_add(LAYER_GRID_BOTTOM, loc, tblit(xpos, ypos,
image::get_image(game_config::grid_image_bottom, image::SCALED_TO_HEX)));
}
}

View file

@ -662,6 +662,7 @@ public:
* Layer for the terrain drawn behind the
* unit.
*/
LAYER_GRID_TOP,
LAYER_TERRAIN_TMP_BG, /**<
* Layer which holds stuff that needs to be
* sorted out further, but under units.
@ -673,6 +674,7 @@ public:
* Layer for the terrain drawn in front of
* the unit.
*/
LAYER_GRID_BOTTOM,
LAYER_UNIT_MOVE_DEFAULT=LAYER_UNIT_FIRST+60/**<default layer for drawing moving units */,
LAYER_UNIT_FG = LAYER_UNIT_FIRST+80, /**<
* Used for the ellipse in front of the

View file

@ -59,7 +59,8 @@ namespace game_config
title_tip_x = 0, title_tip_width = 0, title_tip_padding = 0;
std::string terrain_mask_image = "terrain/alphamask.png";
std::string grid_image = "terrain/grid.png";
std::string grid_image_top = "terrain/grid-top.png";
std::string grid_image_bottom = "terrain/grid-bottom.png";
std::string unreachable_image = "terrain/darken.png"; /**< overlay image for unreachable tiles. */
std::string linger_image = "terrain/darken-linger.png"; /**< overlay image for tiles in linger mode. */
@ -193,7 +194,8 @@ namespace game_config
foot_teleport_exit = v["footprint_teleport_exit"].str();
terrain_mask_image = v["terrain_mask_image"].str();
grid_image = v["grid_image"].str();
grid_image_top = v["grid_image_top"].str();
grid_image_bottom = v["grid_image_bottom"].str();
unreachable_image = v["unreachable_image"].str();
observer_image = v["observer_image"].str();

View file

@ -68,7 +68,9 @@ namespace game_config
moved_ball_image, unmoved_ball_image, partmoved_ball_image,
enemy_ball_image, ally_ball_image, energy_image,
flag_image, flag_icon_image,
terrain_mask_image, grid_image, unreachable_image, linger_image,
terrain_mask_image,
grid_image_top, grid_image_bottom,
unreachable_image, linger_image,
observer_image, tod_bright_image, tod_dark_image,
checked_menu_image, unchecked_menu_image, wml_menu_image, level_image,
ellipsis_image, default_victory_music, default_defeat_music;