Pyrogenesis
13997
|
Base class for (relatively) simple drawing of data onto terrain tiles, intended for debugging purposes and for the Atlas editor (hence not trying to be very efficient). More...
#include <TerrainOverlay.h>
Protected Member Functions | |
TerrainOverlay (const CSimContext &simContext, int priority=100) | |
Construct the object and register it with the global list of terrain overlays. More... | |
virtual void | StartRender () |
Override to perform processing at the start of the overlay rendering, before the ProcessTile calls. More... | |
virtual void | EndRender () |
Override to perform processing at the end of the overlay rendering, after the ProcessTile calls. More... | |
virtual void | GetTileExtents (ssize_t &min_i_inclusive, ssize_t &min_j_inclusive, ssize_t &max_i_inclusive, ssize_t &max_j_inclusive) |
Override to limit the range over which ProcessTile will be called. More... | |
virtual void | ProcessTile (ssize_t i, ssize_t j)=0 |
Override to perform processing of each tile. More... | |
void | RenderTile (const CColor &colour, bool draw_hidden) |
Draw a filled quad on top of the current tile. More... | |
void | RenderTile (const CColor &colour, bool draw_hidden, ssize_t i, ssize_t j) |
Draw a filled quad on top of the given tile. More... | |
void | RenderTileOutline (const CColor &colour, int line_width, bool draw_hidden) |
Draw an outlined quad on top of the current tile. More... | |
void | RenderTileOutline (const CColor &colour, int line_width, bool draw_hidden, ssize_t i, ssize_t j) |
Draw an outlined quad on top of the given tile. More... | |
![]() | |
ITerrainOverlay (int priority) | |
Private Member Functions | |
virtual void | RenderBeforeWater () |
Private Attributes | |
ssize_t | m_i |
ssize_t | m_j |
CTerrain * | m_Terrain |
Additional Inherited Members | |
![]() | |
virtual | ~ITerrainOverlay () |
virtual void | RenderAfterWater () |
![]() | |
static void | RenderOverlaysBeforeWater () |
Draw all ITerrainOverlay objects that exist and that should be drawn before water. More... | |
static void | RenderOverlaysAfterWater () |
Draw all ITerrainOverlay objects that exist and that should be drawn after water. More... | |
Base class for (relatively) simple drawing of data onto terrain tiles, intended for debugging purposes and for the Atlas editor (hence not trying to be very efficient).
To start drawing a terrain overlay, first create a subclass of TerrainOverlay. Override the method GetTileExtents if you want to change the range over which it is drawn. Override ProcessTile to do your processing for each tile, which should call RenderTile and RenderTileOutline as appropriate.
Definition at line 76 of file TerrainOverlay.h.
|
protected |
Construct the object and register it with the global list of terrain overlays.
The priority parameter controls the order in which overlays are drawn, if several exist - they are processed in order of increasing priority, so later ones draw on top of earlier ones. Most should use the default of 100. Numbers from 200 are used by Atlas.
priority | controls the order of drawing |
Definition at line 110 of file TerrainOverlay.cpp.
|
protectedvirtual |
Override to perform processing at the end of the overlay rendering, after the ProcessTile calls.
Reimplemented in PathfinderOverlay.
Definition at line 119 of file TerrainOverlay.cpp.
|
protectedvirtual |
Override to limit the range over which ProcessTile will be called.
Defaults to the size of the map.
min_i_inclusive | [output] smallest i coordinate, in tile-space units (1 unit per tile, +i is world-space +x and game-space East) |
min_j_inclusive | [output] smallest j coordinate (+j is world-space +z and game-space North) |
max_i_inclusive | [output] largest i coordinate |
max_j_inclusive | [output] largest j coordinate |
Definition at line 123 of file TerrainOverlay.cpp.
Override to perform processing of each tile.
Typically calls RenderTile and/or RenderTileOutline.
i | i coordinate of tile being processed |
j | j coordinate of tile being processed |
Implemented in PathfinderOverlay, and TerritoryOverlay.
|
privatevirtual |
Reimplemented from ITerrainOverlay.
Definition at line 132 of file TerrainOverlay.cpp.
|
protected |
Draw a filled quad on top of the current tile.
colour | colour to draw. May be transparent (alpha < 1) |
draw_hidden | true if hidden tiles (i.e. those behind other tiles) should be drawn |
Definition at line 183 of file TerrainOverlay.cpp.
|
protected |
Draw a filled quad on top of the given tile.
Definition at line 188 of file TerrainOverlay.cpp.
|
protected |
Draw an outlined quad on top of the current tile.
colour | colour to draw. May be transparent (alpha < 1) |
line_width | width of lines in pixels. 1 is a sensible value |
draw_hidden | true if hidden tiles (i.e. those behind other tiles) should be drawn |
Definition at line 239 of file TerrainOverlay.cpp.
|
protected |
Draw an outlined quad on top of the given tile.
Definition at line 244 of file TerrainOverlay.cpp.
|
protectedvirtual |
Override to perform processing at the start of the overlay rendering, before the ProcessTile calls.
Reimplemented in PathfinderOverlay, and TerritoryOverlay.
Definition at line 115 of file TerrainOverlay.cpp.
|
private |
Definition at line 163 of file TerrainOverlay.h.
|
private |
Definition at line 163 of file TerrainOverlay.h.
|
private |
Definition at line 165 of file TerrainOverlay.h.