The Battle for Wesnoth  1.19.5+dev
Namespaces | Macros | Functions | Variables
display.cpp File Reference

Routines to set up the display, scroll and zoom the map. More...

#include "display.hpp"
#include "arrow.hpp"
#include "color.hpp"
#include "draw.hpp"
#include "draw_manager.hpp"
#include "fake_unit_manager.hpp"
#include "filesystem.hpp"
#include "floating_label.hpp"
#include "font/sdl_ttf_compat.hpp"
#include "font/text.hpp"
#include "global.hpp"
#include "gui/core/event/handler.hpp"
#include "preferences/preferences.hpp"
#include "halo.hpp"
#include "hotkey/command_executor.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "map/label.hpp"
#include "minimap.hpp"
#include "overlay.hpp"
#include "play_controller.hpp"
#include "reports.hpp"
#include "resources.hpp"
#include "synced_context.hpp"
#include "team.hpp"
#include "terrain/builder.hpp"
#include "time_of_day.hpp"
#include "tooltips.hpp"
#include "units/unit.hpp"
#include "units/animation_component.hpp"
#include "units/drawer.hpp"
#include "units/orb_status.hpp"
#include "utils/general.hpp"
#include "video.hpp"
#include "whiteboard/manager.hpp"
#include <boost/algorithm/string/trim.hpp>
#include <algorithm>
#include <array>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <utility>
Include dependency graph for display.cpp:

Go to the source code of this file.

Namespaces

 display_direction
 

Macros

#define ERR_DP   LOG_STREAM(err, log_display)
 
#define WRN_DP   LOG_STREAM(warn, log_display)
 
#define LOG_DP   LOG_STREAM(info, log_display)
 
#define DBG_DP   LOG_STREAM(debug, log_display)
 
#define zoom_levels   (game_config::zoom_levels)
 
#define final_zoom_index   (static_cast<int>(zoom_levels.size()) - 1)
 
#define DefaultZoom   (game_config::tile_size)
 
#define SmallZoom   (DefaultZoom / 2)
 
#define MinZoom   (zoom_levels.front())
 
#define MaxZoom   (zoom_levels.back())
 

Functions

static int get_zoom_levels_index (unsigned int zoom_level)
 
const std::string & display_direction::get_direction (std::size_t n)
 
static unsigned calculate_fps (std::chrono::milliseconds frametime)
 

Variables

static lg::log_domain log_display ("display")
 

Detailed Description

Routines to set up the display, scroll and zoom the map.

Definition in file display.cpp.

Macro Definition Documentation

◆ DBG_DP

#define DBG_DP   LOG_STREAM(debug, log_display)

Definition at line 82 of file display.cpp.

◆ DefaultZoom

#define DefaultZoom   (game_config::tile_size)

Definition at line 87 of file display.cpp.

◆ ERR_DP

#define ERR_DP   LOG_STREAM(err, log_display)

Definition at line 79 of file display.cpp.

◆ final_zoom_index

#define final_zoom_index   (static_cast<int>(zoom_levels.size()) - 1)

Definition at line 86 of file display.cpp.

◆ LOG_DP

#define LOG_DP   LOG_STREAM(info, log_display)

Definition at line 81 of file display.cpp.

◆ MaxZoom

#define MaxZoom   (zoom_levels.back())

Definition at line 90 of file display.cpp.

◆ MinZoom

#define MinZoom   (zoom_levels.front())

Definition at line 89 of file display.cpp.

◆ SmallZoom

#define SmallZoom   (DefaultZoom / 2)

Definition at line 88 of file display.cpp.

◆ WRN_DP

#define WRN_DP   LOG_STREAM(warn, log_display)

Definition at line 80 of file display.cpp.

◆ zoom_levels

#define zoom_levels   (game_config::zoom_levels)

Definition at line 85 of file display.cpp.

Function Documentation

◆ calculate_fps()

static unsigned calculate_fps ( std::chrono::milliseconds  frametime)
static

Definition at line 1292 of file display.cpp.

References s.

Referenced by display::update_fps_label().

◆ get_zoom_levels_index()

static int get_zoom_levels_index ( unsigned int  zoom_level)
static

Definition at line 101 of file display.cpp.

References MaxZoom, MinZoom, and zoom_levels.

Referenced by display::display(), and display::set_zoom().

Variable Documentation

◆ log_display

lg::log_domain log_display("display") ( "display"  )
static