Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/ObjectTypes/CMiniMap.h
Show All 27 Lines | |||||
class CMiniMap : public IGUIObject | class CMiniMap : public IGUIObject | ||||
{ | { | ||||
GUI_OBJECT(CMiniMap) | GUI_OBJECT(CMiniMap) | ||||
public: | public: | ||||
CMiniMap(CGUI& pGUI); | CMiniMap(CGUI& pGUI); | ||||
virtual ~CMiniMap(); | virtual ~CMiniMap(); | ||||
/** | |||||
* @return The maximum height for unit passage in water. | |||||
*/ | |||||
static float GetShallowPassageHeight(); | |||||
protected: | protected: | ||||
virtual void Draw(CCanvas2D& canvas); | virtual void Draw(CCanvas2D& canvas); | ||||
/** | /** | ||||
* @see IGUIObject#HandleMessage() | * @see IGUIObject#HandleMessage() | ||||
*/ | */ | ||||
virtual void HandleMessage(SGUIMessage& Message); | virtual void HandleMessage(SGUIMessage& Message); | ||||
/** | /** | ||||
* @see IGUIObject#IsMouseOver() | * @see IGUIObject#IsMouseOver() | ||||
*/ | */ | ||||
virtual bool IsMouseOver() const; | virtual bool IsMouseOver() const; | ||||
// create the minimap textures | private: | ||||
void CreateTextures(); | |||||
// rebuild the terrain texture map | |||||
void RebuildTerrainTexture(); | |||||
// destroy and free any memory and textures | |||||
void Destroy(); | |||||
void SetCameraPos(); | void SetCameraPos(); | ||||
bool FireWorldClickEvent(int button, int clicks); | bool FireWorldClickEvent(int button, int clicks); | ||||
static const CStr EventNameWorldClick; | static const CStr EventNameWorldClick; | ||||
// the terrain we are mini-mapping | |||||
const CTerrain* m_Terrain; | |||||
const CCamera* m_Camera; | const CCamera* m_Camera; | ||||
//Whether or not the mouse is currently down | //Whether or not the mouse is currently down | ||||
bool m_Clicking; | bool m_Clicking; | ||||
// minimap texture handles | |||||
GLuint m_TerrainTexture; | |||||
// texture data | |||||
u32* m_TerrainData; | |||||
// whether we need to regenerate the terrain texture | |||||
bool m_TerrainDirty; | |||||
// Whether to draw a black square around and under the minimap. | // Whether to draw a black square around and under the minimap. | ||||
CGUISimpleSetting<bool> m_Mask; | CGUISimpleSetting<bool> m_Mask; | ||||
ssize_t m_Width, m_Height; | ssize_t m_Width, m_Height; | ||||
// map size | // map size | ||||
ssize_t m_MapSize; | ssize_t m_MapSize; | ||||
// texture size | // texture size | ||||
GLsizei m_TextureSize; | GLsizei m_TextureSize; | ||||
// 1.f if map is circular or 1.414f if square (to shrink it inside the circle) | // 1.f if map is circular or 1.414f if square (to shrink it inside the circle) | ||||
float m_MapScale; | float m_MapScale; | ||||
// maximal water height to allow the passage of a unit (for underwater shallows). | |||||
float m_ShallowPassageHeight; | |||||
float m_WaterHeight; | |||||
void DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2) const; | void DrawTexture(CShaderProgramPtr shader, float coordMax, float angle, float x, float y, float x2, float y2) const; | ||||
void DrawViewRect(const CMatrix3D& transform) const; | void DrawViewRect(const CMatrix3D& transform) const; | ||||
void GetMouseWorldCoordinates(float& x, float& z) const; | void GetMouseWorldCoordinates(float& x, float& z) const; | ||||
float GetAngle() const; | float GetAngle() const; | ||||
Show All 14 Lines |
Wildfire Games · Phabricator