The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Public Attributes | List of all members
display::draw_helper Struct Reference

Helper for rendering the map by ordering draw operations. More...

#include <display.hpp>

Public Member Functions

bool operator< (const draw_helper &rhs) const
 

Public Attributes

const uint32_t key
 Controls the ordering of draw calls by layer and location. More...
 
std::function< void(const rect &)> do_draw
 Handles the actual drawing at this location. More...
 
rect dest
 The screen coordinates for the specified hex. More...
 

Detailed Description

Helper for rendering the map by ordering draw operations.

In order to render a hex properly, they need to be rendered per row. In this row several layers need to be drawn at the same time, mainly the unit and the background terrain. This is needed since both can spill into the next hex. The foreground terrain needs to be drawn before to avoid decapitating a unit.

In other words: for every layer for every row (starting from the top) for every hex in the row ...

this is modified to: for every layer group for every row (starting from the top) for every layer in the group for every hex in the row ...

Definition at line 898 of file display.hpp.

Member Function Documentation

◆ operator<()

bool display::draw_helper::operator< ( const draw_helper rhs) const
inline

Definition at line 909 of file display.hpp.

References key.

Member Data Documentation

◆ dest

rect display::draw_helper::dest

The screen coordinates for the specified hex.

This is passed to do_draw

Definition at line 907 of file display.hpp.

◆ do_draw

std::function<void(const rect&)> display::draw_helper::do_draw

Handles the actual drawing at this location.

Definition at line 904 of file display.hpp.

◆ key

const uint32_t display::draw_helper::key

Controls the ordering of draw calls by layer and location.

Definition at line 901 of file display.hpp.

Referenced by operator<().


The documentation for this struct was generated from the following file: