The Battle for Wesnoth  1.15.0+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 "cursor.hpp"
#include "display.hpp"
#include "fake_unit_manager.hpp"
#include "font/sdl_ttf.hpp"
#include "font/text.hpp"
#include "preferences/game.hpp"
#include "gettext.hpp"
#include "halo.hpp"
#include "hotkey/command_executor.hpp"
#include "language.hpp"
#include "log.hpp"
#include "font/marked-up_text.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 "color.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 "whiteboard/manager.hpp"
#include "show_dialog.hpp"
#include "gui/dialogs/loading_screen.hpp"
#include <SDL2/SDL_image.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <iomanip>
#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 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  {
  MAX_BORDER = 3, BITS_FOR_LAYER_GROUP = 4, BITS_FOR_Y = 10, BITS_FOR_X_PARITY = 1,
  BITS_FOR_LAYER = 8, BITS_FOR_X_OVER_2 = 9
}
 

Functions

static const std::string & get_direction (std::size_t n)
 
static unsigned calculate_fps (unsigned frametime)
 
static void draw_panel (CVideo &video, const theme::panel &panel, std::vector< std::shared_ptr< gui::button >> &)
 
static void draw_label (CVideo &video, surface target, const theme::label &label)
 
static void draw_background (surface screen, const SDL_Rect &area, const std::string &image)
 

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 76 of file display.cpp.

Referenced by display::render_image(), display::set_default_zoom(), and display::set_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 75 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 77 of file display.cpp.

◆ zoom_levels

#define zoom_levels   (game_config::zoom_levels)

Definition at line 74 of file display.cpp.

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_BORDER 
BITS_FOR_LAYER_GROUP 
BITS_FOR_Y 
BITS_FOR_X_PARITY 
BITS_FOR_LAYER 
BITS_FOR_X_OVER_2 

Definition at line 1204 of file display.cpp.

Function Documentation

◆ calculate_fps()

static unsigned calculate_fps ( unsigned  frametime)
static

Definition at line 1327 of file display.cpp.

Referenced by display::update_display().

◆ draw_background()

static void draw_background ( surface  screen,
const SDL_Rect &  area,
const std::string &  image 
)
static

◆ draw_label()

static void draw_label ( CVideo video,
surface  target,
const theme::label label 
)
static

◆ draw_panel()

static void draw_panel ( CVideo video,
const theme::panel panel,
std::vector< std::shared_ptr< gui::button >> &   
)
static

◆ get_direction()

static const std::string& get_direction ( std::size_t  n)
static

Variable Documentation

◆ log_display

lg::log_domain log_display("display")
static