Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CMiniMapTexture Class Reference

#include <MiniMapTexture.h>

Collaboration diagram for CMiniMapTexture:

Classes

struct  CellIcon
 
struct  CellIconKey
 
struct  CellIconKeyEqual
 
struct  CellIconKeyHash
 
struct  Icon
 

Public Member Functions

 CMiniMapTexture (Renderer::Backend::IDevice *device, CSimulation2 &simulation)
 
 ~CMiniMapTexture ()
 
void Update (const float deltaRealTime)
 Marks the texture as dirty if it's old enough to redraw it on Render. More...
 
void Render (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, CLOSTexture &losTexture, CTerritoryTexture &territoryTexture)
 Redraws the texture if it's dirty. More...
 
const CTexturePtrGetTexture () const
 
bool IsFlipped () const
 
const std::vector< Icon > & GetIcons ()
 

Static Public Member Functions

static float GetShallowPassageHeight ()
 

Private Member Functions

 NONCOPYABLE (CMiniMapTexture)
 
void CreateTextures (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CTerrain &terrain)
 
void DestroyTextures ()
 
void RebuildTerrainTexture (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const CTerrain &terrain)
 
void RenderFinalTexture (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, CLOSTexture &losTexture, CTerritoryTexture &territoryTexture)
 
void UpdateAndUploadEntities (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const float entityRadius, const double &currentTime)
 
void DrawEntities (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, const float entityRadius)
 

Private Attributes

CSimulation2m_Simulation
 
bool m_TerrainTextureDirty = true
 
bool m_FinalTextureDirty = true
 
double m_LastFinalTextureUpdate = 0.0
 
bool m_Flipped = false
 
std::unique_ptr< Renderer::Backend::ITexturem_TerrainTexture
 
CTexturePtr m_FinalTexture
 
std::unique_ptr< Renderer::Backend::IFramebufferm_FinalTextureFramebuffer
 
std::unique_ptr< u32[]> m_TerrainData
 
ssize_t m_MapSize = 0
 
float m_ShallowPassageHeight = 0.0f
 
float m_WaterHeight = 0.0f
 
Renderer::Backend::IVertexInputLayoutm_QuadVertexInputLayout = nullptr
 
Renderer::Backend::IVertexInputLayoutm_EntitiesVertexInputLayout = nullptr
 
VertexIndexArray m_IndexArray
 
VertexArray m_VertexArray
 
VertexArray::Attribute m_AttributePos
 
VertexArray::Attribute m_AttributeColor
 
bool m_UseInstancing = false
 
VertexArray m_InstanceVertexArray
 
VertexArray::Attribute m_InstanceAttributePosition
 
CShaderTechniquePtr m_TerritoryTechnique
 
size_t m_EntitiesDrawn = 0
 
double m_PingDuration = 25.0
 
double m_HalfBlinkDuration = 0.0
 
double m_NextBlinkTime = 0.0
 
bool m_BlinkState = false
 
std::vector< Iconm_Icons
 
std::unordered_map< CellIconKey, std::vector< CellIcon >, CellIconKeyHash, CellIconKeyEqualm_IconsCache
 

Constructor & Destructor Documentation

◆ CMiniMapTexture()

CMiniMapTexture::CMiniMapTexture ( Renderer::Backend::IDevice device,
CSimulation2 simulation 
)

◆ ~CMiniMapTexture()

CMiniMapTexture::~CMiniMapTexture ( )

Member Function Documentation

◆ CreateTextures()

void CMiniMapTexture::CreateTextures ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
const CTerrain terrain 
)
private

◆ DestroyTextures()

void CMiniMapTexture::DestroyTextures ( )
private

◆ DrawEntities()

void CMiniMapTexture::DrawEntities ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
const float  entityRadius 
)
private

◆ GetIcons()

const std::vector< Icon > & CMiniMapTexture::GetIcons ( )
inline

◆ GetShallowPassageHeight()

float CMiniMapTexture::GetShallowPassageHeight ( )
static
Returns
The maximum height for unit passage in water.

◆ GetTexture()

const CTexturePtr & CMiniMapTexture::GetTexture ( ) const
inline

◆ IsFlipped()

bool CMiniMapTexture::IsFlipped ( ) const
inline

◆ NONCOPYABLE()

CMiniMapTexture::NONCOPYABLE ( CMiniMapTexture  )
private

◆ RebuildTerrainTexture()

void CMiniMapTexture::RebuildTerrainTexture ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
const CTerrain terrain 
)
private

◆ Render()

void CMiniMapTexture::Render ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
CLOSTexture losTexture,
CTerritoryTexture territoryTexture 
)

Redraws the texture if it's dirty.

◆ RenderFinalTexture()

void CMiniMapTexture::RenderFinalTexture ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
CLOSTexture losTexture,
CTerritoryTexture territoryTexture 
)
private

◆ Update()

void CMiniMapTexture::Update ( const float  deltaRealTime)

Marks the texture as dirty if it's old enough to redraw it on Render.

◆ UpdateAndUploadEntities()

void CMiniMapTexture::UpdateAndUploadEntities ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
const float  entityRadius,
const double &  currentTime 
)
private

Member Data Documentation

◆ m_AttributeColor

VertexArray::Attribute CMiniMapTexture::m_AttributeColor
private

◆ m_AttributePos

VertexArray::Attribute CMiniMapTexture::m_AttributePos
private

◆ m_BlinkState

bool CMiniMapTexture::m_BlinkState = false
private

◆ m_EntitiesDrawn

size_t CMiniMapTexture::m_EntitiesDrawn = 0
private

◆ m_EntitiesVertexInputLayout

Renderer::Backend::IVertexInputLayout* CMiniMapTexture::m_EntitiesVertexInputLayout = nullptr
private

◆ m_FinalTexture

CTexturePtr CMiniMapTexture::m_FinalTexture
private

◆ m_FinalTextureDirty

bool CMiniMapTexture::m_FinalTextureDirty = true
private

◆ m_FinalTextureFramebuffer

std::unique_ptr<Renderer::Backend::IFramebuffer> CMiniMapTexture::m_FinalTextureFramebuffer
private

◆ m_Flipped

bool CMiniMapTexture::m_Flipped = false
private

◆ m_HalfBlinkDuration

double CMiniMapTexture::m_HalfBlinkDuration = 0.0
private

◆ m_Icons

std::vector<Icon> CMiniMapTexture::m_Icons
private

◆ m_IconsCache

std::unordered_map<CellIconKey, std::vector<CellIcon>, CellIconKeyHash, CellIconKeyEqual> CMiniMapTexture::m_IconsCache
private

◆ m_IndexArray

VertexIndexArray CMiniMapTexture::m_IndexArray
private

◆ m_InstanceAttributePosition

VertexArray::Attribute CMiniMapTexture::m_InstanceAttributePosition
private

◆ m_InstanceVertexArray

VertexArray CMiniMapTexture::m_InstanceVertexArray
private

◆ m_LastFinalTextureUpdate

double CMiniMapTexture::m_LastFinalTextureUpdate = 0.0
private

◆ m_MapSize

ssize_t CMiniMapTexture::m_MapSize = 0
private

◆ m_NextBlinkTime

double CMiniMapTexture::m_NextBlinkTime = 0.0
private

◆ m_PingDuration

double CMiniMapTexture::m_PingDuration = 25.0
private

◆ m_QuadVertexInputLayout

Renderer::Backend::IVertexInputLayout* CMiniMapTexture::m_QuadVertexInputLayout = nullptr
private

◆ m_ShallowPassageHeight

float CMiniMapTexture::m_ShallowPassageHeight = 0.0f
private

◆ m_Simulation

CSimulation2& CMiniMapTexture::m_Simulation
private

◆ m_TerrainData

std::unique_ptr<u32[]> CMiniMapTexture::m_TerrainData
private

◆ m_TerrainTexture

std::unique_ptr<Renderer::Backend::ITexture> CMiniMapTexture::m_TerrainTexture
private

◆ m_TerrainTextureDirty

bool CMiniMapTexture::m_TerrainTextureDirty = true
private

◆ m_TerritoryTechnique

CShaderTechniquePtr CMiniMapTexture::m_TerritoryTechnique
private

◆ m_UseInstancing

bool CMiniMapTexture::m_UseInstancing = false
private

◆ m_VertexArray

VertexArray CMiniMapTexture::m_VertexArray
private

◆ m_WaterHeight

float CMiniMapTexture::m_WaterHeight = 0.0f
private

The documentation for this class was generated from the following files: