The Battle for Wesnoth  1.19.0-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...
 
static int scale_to_map_zoom (int val)
 

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 42 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 32 of file label.cpp.

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

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

◆ scale_to_map_zoom()

static int scale_to_map_zoom ( int  val)
static

Definition at line 520 of file label.cpp.

References display::get_zoom_factor().

Referenced by terrain_label::recalculate().