Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
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 (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, ssize_t i, ssize_t j)=0 |
Override to perform processing of each tile. More... | |
void | RenderTile (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CColor &color, bool drawHidden) |
Draw a filled quad on top of the current tile. More... | |
void | RenderTile (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CColor &color, bool drawHidden, ssize_t i, ssize_t j) |
Draw a filled quad on top of the given tile. More... | |
void | RenderTileOutline (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CColor &color, bool drawHidden) |
Draw an outlined quad on top of the current tile. More... | |
void | RenderTileOutline (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CColor &color, bool drawHidden, ssize_t i, ssize_t j) |
Draw an outlined quad on top of the given tile. More... | |
Protected Member Functions inherited from ITerrainOverlay | |
ITerrainOverlay (int priority) | |
Private Member Functions | |
void | RenderBeforeWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext) override |
Additional Inherited Members | |
Public Member Functions inherited from ITerrainOverlay | |
virtual | ~ITerrainOverlay () |
virtual void | RenderBeforeWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext) |
virtual void | RenderAfterWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup) |
Static Public Member Functions inherited from ITerrainOverlay | |
static void | RenderOverlaysBeforeWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext) |
Draw all ITerrainOverlay objects that exist and that should be drawn before water. More... | |
static void | RenderOverlaysAfterWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup) |
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.
|
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 |
|
protectedvirtual |
Override to perform processing at the end of the overlay rendering, after the ProcessTile calls.
|
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 |
|
protectedpure virtual |
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 |
|
overrideprivatevirtual |
Reimplemented from ITerrainOverlay.
|
protected |
Draw a filled quad on top of the current tile.
color | color to draw. May be transparent (alpha < 1) |
drawHidden | true if hidden tiles (i.e. those behind other tiles) should be drawn |
|
protected |
Draw a filled quad on top of the given tile.
|
protected |
Draw an outlined quad on top of the current tile.
color | color to draw. May be transparent (alpha < 1) |
lineWidth | width of lines in pixels. 1 is a sensible value |
drawHidden | true if hidden tiles (i.e. those behind other tiles) should be drawn |
|
protected |
Draw an outlined quad on top of the given tile.
|
protectedvirtual |
Override to perform processing at the start of the overlay rendering, before the ProcessTile calls.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |