The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
editor_display.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Tomasz Sniatowski <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef EDITOR_EDITOR_DISPLAY_HPP_INCLUDED
16 #define EDITOR_EDITOR_DISPLAY_HPP_INCLUDED
17 
18 #include "map/editor_map.hpp"
19 #include "display.hpp"
20 
21 namespace editor {
22 
24 
25 class editor_display : public display
26 {
27 public:
29  reports & reports_object,
30  const config& theme_cfg, const config& level);
31 
32  bool in_editor() const { return true; }
33 
34  void add_brush_loc(const map_location& hex);
35  void set_brush_locs(const std::set<map_location>& hexes);
36  void clear_brush_locs();
37  void remove_brush_loc(const map_location& hex);
38  const editor_map& map() const { return static_cast<const editor_map&>(get_map()); }
39  void rebuild_terrain(const map_location &loc);
40 
41 protected:
42  void pre_draw();
43  /**
44  * The editor uses different rules for terrain highlighting (e.g. selections)
45  */
47 
48  void draw_hex(const map_location& loc);
49 
50  const SDL_Rect& get_clip_rect();
51  void draw_sidebar();
52 
53  std::set<map_location> brush_locations_;
54 
55 };
56 
57 } //end namespace editor
58 #endif
TYPE
UNSCALED : image will be drawn "as is" without changing size, even in case of redraw SCALED_TO_ZOOM :...
Definition: image.hpp:208
GLint level
Definition: glew.h:1220
editor_display(const display_context *dc, CVideo &video, reports &reports_object, const config &theme_cfg, const config &level)
image::TYPE get_image_type(const map_location &loc)
The editor uses different rules for terrain highlighting (e.g.
void set_brush_locs(const std::set< map_location > &hexes)
Definition: video.hpp:58
void pre_draw()
Called near the beginning of each draw() call.
void draw_sidebar()
Called near the end of a draw operation, derived classes can use this to render a specific sidebar...
Unit and team statistics.
void draw_hex(const map_location &loc)
Redraws a single gamemap location.
void remove_brush_loc(const map_location &hex)
map_display and display: classes which take care of displaying the map and game-data on the screen...
Manage the empty-palette in the editor.
Definition: action.cpp:28
Encapsulates the map of the game.
Definition: location.hpp:38
This class adds extra editor-specific functionality to a normal gamemap.
Definition: editor_map.hpp:70
const display_context * get_dummy_display_context()
void rebuild_terrain(const map_location &loc)
const SDL_Rect & get_clip_rect()
Get the clipping rectangle for drawing.
std::set< map_location > brush_locations_
const gamemap & get_map() const
Definition: display.hpp:92
void add_brush_loc(const map_location &hex)
CVideo & video()
Gets the underlying screen object.
Definition: display.hpp:202
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
const editor_map & map() const