Pyrogenesis
13997
|
Maintains the LOS (fog-of-war / shroud-of-darkness) texture, used for rendering and for the minimap. More...
#include <LOSTexture.h>
Public Member Functions | |
CLOSTexture (CSimulation2 &simulation) | |
~CLOSTexture () | |
void | MakeDirty () |
Marks the LOS texture as needing recomputation. More... | |
void | BindTexture (int unit) |
Recomputes the LOS texture if necessary, and binds it to the requested texture unit. More... | |
GLuint | GetTexture () |
Recomputes the LOS texture if necessary, and returns the texture handle. More... | |
void | InterpolateLOS () |
GLuint | GetTextureSmooth () |
const CMatrix3D & | GetTextureMatrix () |
Returns a matrix to map (x,y,z) world coordinates onto (u,v) LOS texture coordinates, in the form expected by glLoadMatrixf. More... | |
const float * | GetMinimapTextureMatrix () |
Returns a matrix to map (0,0)-(1,1) texture coordinates onto LOS texture coordinates, in the form expected by glLoadMatrixf. More... | |
Private Member Functions | |
NONCOPYABLE (CLOSTexture) | |
void | DeleteTexture () |
void | ConstructTexture (int unit) |
void | RecomputeTexture (int unit) |
size_t | GetBitmapSize (size_t w, size_t h) |
void | GenerateBitmap (ICmpRangeManager::CLosQuerier los, u8 *losData, size_t w, size_t h) |
Private Attributes | |
CSimulation2 & | m_Simulation |
bool | m_Dirty |
GLuint | m_Texture |
GLuint | m_TextureSmooth1 |
GLuint | m_TextureSmooth2 |
bool | whichTex |
GLuint | m_smoothFbo |
CShaderTechniquePtr | m_smoothShader |
ssize_t | m_MapSize |
GLsizei | m_TextureSize |
CMatrix3D | m_TextureMatrix |
CMatrix3D | m_MinimapTextureMatrix |
Friends | |
class | TestLOSTexture |
Maintains the LOS (fog-of-war / shroud-of-darkness) texture, used for rendering and for the minimap.
Definition at line 32 of file LOSTexture.h.
CLOSTexture::CLOSTexture | ( | CSimulation2 & | simulation | ) |
Definition at line 53 of file LOSTexture.cpp.
CLOSTexture::~CLOSTexture | ( | ) |
Definition at line 73 of file LOSTexture.cpp.
void CLOSTexture::BindTexture | ( | int | unit | ) |
Recomputes the LOS texture if necessary, and binds it to the requested texture unit.
Also switches the current active texture unit, and enables texturing on it. The texture is in 8-bit ALPHA format.
Definition at line 95 of file LOSTexture.cpp.
|
private |
Definition at line 196 of file LOSTexture.cpp.
|
private |
Definition at line 79 of file LOSTexture.cpp.
|
private |
Definition at line 317 of file LOSTexture.cpp.
|
private |
Definition at line 312 of file LOSTexture.cpp.
const float * CLOSTexture::GetMinimapTextureMatrix | ( | ) |
Returns a matrix to map (0,0)-(1,1) texture coordinates onto LOS texture coordinates, in the form expected by glLoadMatrixf.
This must only be called after BindTexture.
Definition at line 190 of file LOSTexture.cpp.
GLuint CLOSTexture::GetTexture | ( | ) |
Recomputes the LOS texture if necessary, and returns the texture handle.
Also potentially switches the current active texture unit, and enables texturing on it. The texture is in 8-bit ALPHA format.
Definition at line 173 of file LOSTexture.cpp.
const CMatrix3D & CLOSTexture::GetTextureMatrix | ( | ) |
Returns a matrix to map (x,y,z) world coordinates onto (u,v) LOS texture coordinates, in the form expected by glLoadMatrixf.
This must only be called after BindTexture.
Definition at line 184 of file LOSTexture.cpp.
GLuint CLOSTexture::GetTextureSmooth | ( | ) |
Definition at line 106 of file LOSTexture.cpp.
void CLOSTexture::InterpolateLOS | ( | ) |
Definition at line 114 of file LOSTexture.cpp.
void CLOSTexture::MakeDirty | ( | ) |
Marks the LOS texture as needing recomputation.
Call this after each simulation update, to ensure responsive updates.
Definition at line 90 of file LOSTexture.cpp.
|
private |
|
private |
Definition at line 270 of file LOSTexture.cpp.
|
friend |
Definition at line 35 of file LOSTexture.h.
|
private |
Definition at line 89 of file LOSTexture.h.
|
private |
Definition at line 99 of file LOSTexture.h.
|
private |
Definition at line 103 of file LOSTexture.h.
|
private |
Definition at line 87 of file LOSTexture.h.
|
private |
Definition at line 96 of file LOSTexture.h.
|
private |
Definition at line 97 of file LOSTexture.h.
|
private |
Definition at line 91 of file LOSTexture.h.
|
private |
Definition at line 102 of file LOSTexture.h.
|
private |
Definition at line 100 of file LOSTexture.h.
|
private |
Definition at line 92 of file LOSTexture.h.
|
private |
Definition at line 92 of file LOSTexture.h.
|
private |
Definition at line 94 of file LOSTexture.h.