The Battle for Wesnoth  1.17.12+dev
Macros | Enumerations | Functions | Variables
display.cpp File Reference

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

#include "arrow.hpp"
#include "color.hpp"
#include "cursor.hpp"
#include "display.hpp"
#include "draw.hpp"
#include "draw_manager.hpp"
#include "fake_unit_manager.hpp"
#include "filesystem.hpp"
#include "font/sdl_ttf_compat.hpp"
#include "font/text.hpp"
#include "preferences/game.hpp"
#include "gettext.hpp"
#include "gui/dialogs/loading_screen.hpp"
#include "halo.hpp"
#include "hotkey/command_executor.hpp"
#include "language.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 "show_dialog.hpp"
#include "synced_context.hpp"
#include "team.hpp"
#include "terrain/builder.hpp"
#include "time_of_day.hpp"
#include "tooltips.hpp"
#include "tod_manager.hpp"
#include "units/unit.hpp"
#include "units/animation_component.hpp"
#include "units/drawer.hpp"
#include "units/orb_status.hpp"
#include "video.hpp"
#include "whiteboard/manager.hpp"
#include <boost/algorithm/string/trim.hpp>
#include <SDL2/SDL_image.h>
#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.

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())
 

Enumerations

enum  
 

Functions

static int get_zoom_levels_index (unsigned int zoom_level)
 
static unsigned calculate_fps (unsigned 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)

◆ DefaultZoom

#define DefaultZoom   (game_config::tile_size)

Definition at line 85 of file display.cpp.

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

◆ ERR_DP

#define ERR_DP   LOG_STREAM(err, log_display)

◆ final_zoom_index

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

Definition at line 84 of file display.cpp.

Referenced by display::set_zoom().

◆ LOG_DP

#define LOG_DP   LOG_STREAM(info, log_display)

◆ MaxZoom

#define MaxZoom   (zoom_levels.back())

◆ MinZoom

#define MinZoom   (zoom_levels.front())

◆ SmallZoom

#define SmallZoom   (DefaultZoom / 2)

Definition at line 86 of file display.cpp.

◆ WRN_DP

#define WRN_DP   LOG_STREAM(warn, log_display)

Definition at line 78 of file display.cpp.

Referenced by display::screenshot().

◆ zoom_levels

#define zoom_levels   (game_config::zoom_levels)

Definition at line 83 of file display.cpp.

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 1220 of file display.cpp.

Function Documentation

◆ calculate_fps()

static unsigned calculate_fps ( unsigned  frametime)
static

Definition at line 1323 of file display.cpp.

Referenced by display::update_fps_label().

◆ get_zoom_levels_index()

static int get_zoom_levels_index ( unsigned int  zoom_level)
static

Definition at line 99 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")
static