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 "units/orb_status.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>
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 | |
int | get_zoom_levels_index (unsigned int zoom_level) |
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") |
Routines to set up the display, scroll and zoom the map.
Definition in file display.cpp.
#define DBG_DP LOG_STREAM(debug, log_display) |
Definition at line 72 of file display.cpp.
Referenced by display::create_buttons(), display::draw_init(), draw_panel(), display::invalidate_all(), display::layout_buttons(), and display::screenshot().
#define DefaultZoom (game_config::tile_size) |
Definition at line 77 of file display.cpp.
Referenced by display::display(), display::render_image(), display::set_zoom(), and display::toggle_default_zoom().
#define ERR_DP LOG_STREAM(err, log_display) |
Definition at line 70 of file display.cpp.
Referenced by display::init_flags_for_side_internal(), display::refresh_report(), display::render_image(), display::screenshot(), display::scroll_to_tile(), and display::scroll_to_tiles().
#define final_zoom_index (static_cast<int>(zoom_levels.size()) - 1) |
Definition at line 76 of file display.cpp.
Referenced by display::set_zoom().
#define LOG_DP LOG_STREAM(info, log_display) |
Definition at line 71 of file display.cpp.
Referenced by display::init_flags_for_side_internal(), display::redraw_everything(), and display::set_zoom().
#define MaxZoom (zoom_levels.back()) |
Definition at line 80 of file display.cpp.
Referenced by display::bounds_check_position(), display::display(), get_zoom_levels_index(), display::set_zoom(), and display::zoom_at_max().
#define MinZoom (zoom_levels.front()) |
Definition at line 79 of file display.cpp.
Referenced by display::bounds_check_position(), get_zoom_levels_index(), display::set_zoom(), and display::zoom_at_min().
#define SmallZoom (DefaultZoom / 2) |
Definition at line 78 of file display.cpp.
#define zoom_levels (game_config::zoom_levels) |
Definition at line 75 of file display.cpp.
Referenced by display::display(), get_zoom_levels_index(), and display::set_zoom().
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 1234 of file display.cpp.
|
static |
Definition at line 1357 of file display.cpp.
Referenced by display::update_display().
|
static |
Definition at line 1494 of file display.cpp.
References sdl::create_rect(), sdl::fill_rectangle(), image::get_image(), h, sdl_blit(), and w.
Referenced by display::draw_init(), and gui::dialog_frame::get_layout().
|
static |
Definition at line 1434 of file display.cpp.
References tooltips::add_tooltip(), color_t::b, font::draw_text(), theme::label::font_rgb(), theme::label::font_rgb_set(), theme::label::font_size(), color_t::g, image::get_image(), theme::label::icon(), theme::object::location(), font::NORMAL_COLOR, color_t::r, scale_surface(), CVideo::screen_area(), sdl_blit(), and theme::label::text().
Referenced by display::draw_all_panels().
|
static |
Definition at line 1413 of file display.cpp.
References CVideo::blit_surface(), DBG_DP, theme::object::get_id(), image::get_image(), theme::panel::image(), theme::object::location(), CVideo::screen_area(), and tile_surface().
Referenced by display::draw_all_panels().
|
static |
Definition at line 960 of file display.cpp.
References n.
Referenced by map_location::get_direction(), display::get_fog_shroud_images(), and map_location::vector_difference_assign().
int get_zoom_levels_index | ( | unsigned int | zoom_level | ) |
Definition at line 95 of file display.cpp.
References MaxZoom, MinZoom, and zoom_levels.
Referenced by display::display(), and display::set_zoom().
|
static |