Display: always draw the map in the full window

This is a temporary measure that removes reliance on the theme map rect.
I need to ponder the best design to handle displaying the full map.
This commit is contained in:
Charles Dang 2018-03-24 14:36:40 +11:00
parent 5ece7ac5b7
commit 49d36e6eb4
4 changed files with 16 additions and 12 deletions

View file

@ -497,6 +497,11 @@ const SDL_Rect& display::map_area() const
return res;
}
const SDL_Rect display::map_outside_area() const
{
return map_screenshot_ ? max_map_area() : video_.screen_area();
}
bool display::outside_area(const SDL_Rect& area, const int x, const int y)
{
const int x_thresh = hex_size();
@ -616,6 +621,11 @@ const rect_of_hexes display::hexes_under_rect(const SDL_Rect& r) const
return res;
}
const rect_of_hexes display::get_visible_hexes() const
{
return hexes_under_rect(map_area());
}
bool display::team_valid() const
{
return currentTeam_ < dc_->teams().size();
@ -1551,7 +1561,7 @@ const map_labels& display::labels() const
return *map_labels_;
}
const SDL_Rect& display::get_clip_rect()
const SDL_Rect display::get_clip_rect()
{
return map_area();
}

View file

@ -298,10 +298,7 @@ public:
* Returns the available area for a map, this may differ from the above.
* This area will get the background area applied to it.
*/
const SDL_Rect& map_outside_area() const
{
return map_screenshot_ ? max_map_area() : theme_.main_map_location(video_.screen_area());
}
const SDL_Rect map_outside_area() const;
/** Check if the bbox of the hex at x,y has pixels outside the area rectangle. */
static bool outside_area(const SDL_Rect& area, const int x, const int y);
@ -383,10 +380,7 @@ public:
const rect_of_hexes hexes_under_rect(const SDL_Rect& r) const;
/** Returns the rectangular area of visible hexes */
const rect_of_hexes get_visible_hexes() const
{
return hexes_under_rect(map_area());
}
const rect_of_hexes get_visible_hexes() const;
/** Returns true if location (x,y) is covered in shroud. */
bool shrouded(const map_location& loc) const;
@ -864,7 +858,7 @@ protected:
* Get the clipping rectangle for drawing.
* Virtual since the editor might use a slightly different approach.
*/
virtual const SDL_Rect& get_clip_rect();
virtual const SDL_Rect get_clip_rect();
/** Draw the appropriate fog or shroud transition images for a specific hex. */
void draw_fog_shroud_transition_images(const map_location& loc, image::TYPE image_type);

View file

@ -99,7 +99,7 @@ void editor_display::draw_hex_overlays()
}
}
const SDL_Rect& editor_display::get_clip_rect()
const SDL_Rect editor_display::get_clip_rect()
{
return map_outside_area();
}

View file

@ -51,7 +51,7 @@ protected:
virtual void draw_hex_cursor(const map_location& loc) override;
virtual void draw_hex_overlays() override;
const SDL_Rect& get_clip_rect() override;
const SDL_Rect get_clip_rect() override;
std::set<map_location> brush_locations_;