The Battle for Wesnoth  1.15.1+dev
Functions
label.cpp File Reference
#include "map/label.hpp"
#include "color.hpp"
#include "display.hpp"
#include "floating_label.hpp"
#include "formula/string_utils.hpp"
#include "game_board.hpp"
#include "game_data.hpp"
#include "resources.hpp"
#include "tooltips.hpp"
Include dependency graph for label.cpp:

Go to the source code of this file.

Functions

bool is_shrouded (const display *disp, const map_location &loc)
 Our definition of map labels being obscured is if the tile is obscured, or the tile below is obscured. More...
 
bool is_fogged (const display *disp, const map_location &loc)
 Rather simple test for a hex being fogged. More...
 

Function Documentation

◆ is_fogged()

bool is_fogged ( const display disp,
const map_location loc 
)
inline

Rather simple test for a hex being fogged.

This only exists because is_shrouded() does. (The code looks nicer if the test for being fogged looks similar to the test for being shrouded.)

Definition at line 41 of file label.cpp.

References display::fogged().

Referenced by terrain_label::hidden().

◆ is_shrouded()

bool is_shrouded ( const display disp,
const map_location loc 
)
inline

Our definition of map labels being obscured is if the tile is obscured, or the tile below is obscured.

This is because in the case where the tile itself is visible, but the tile below is obscured, the bottom half of the tile will still be shrouded, and the label being drawn looks weird.

Definition at line 31 of file label.cpp.

References map_location::get_direction(), display::shrouded(), and map_location::SOUTH.

Referenced by game_display::draw_hex(), and terrain_label::hidden().