2004-10-08 03:10:14 +02:00
|
|
|
#ifndef __H_MINIMAP_H__
|
|
|
|
#define __H_MINIMAP_H__
|
|
|
|
|
2005-10-19 19:16:34 +02:00
|
|
|
#include "gui/GUI.h"
|
|
|
|
#include "ps/Vector2D.h"
|
|
|
|
#include "maths/Vector3D.h"
|
|
|
|
#include "graphics/Camera.h"
|
2004-12-12 20:43:55 +01:00
|
|
|
class CTerrain;
|
|
|
|
class CUnitManager;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
2005-10-19 05:02:51 +02:00
|
|
|
extern bool g_TerrainModified;
|
|
|
|
|
2004-10-08 03:10:14 +02:00
|
|
|
class CMiniMap : public IGUIObject
|
|
|
|
{
|
|
|
|
GUI_OBJECT(CMiniMap)
|
|
|
|
public:
|
|
|
|
CMiniMap();
|
|
|
|
virtual ~CMiniMap();
|
|
|
|
protected:
|
|
|
|
virtual void Draw();
|
|
|
|
|
2005-10-20 17:27:39 +02:00
|
|
|
virtual void HandleMessage(const SGUIMessage &Message);
|
|
|
|
|
2005-10-19 05:02:51 +02:00
|
|
|
// create the minimap textures
|
|
|
|
void CreateTextures();
|
2004-10-08 03:10:14 +02:00
|
|
|
|
2005-10-19 05:02:51 +02:00
|
|
|
// rebuild the terrain texture map
|
|
|
|
void RebuildTerrainTexture();
|
2004-10-08 03:10:14 +02:00
|
|
|
|
2005-10-19 05:02:51 +02:00
|
|
|
// rebuild the LOS map
|
|
|
|
void RebuildLOSTexture();
|
2004-10-08 03:10:14 +02:00
|
|
|
|
|
|
|
// destroy and free any memory and textures
|
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
|
|
|
|
// calculate the relative heightmap space coordinates
|
|
|
|
// for a units world position
|
|
|
|
CVector2D GetMapSpaceCoords(CVector3D worldPos);
|
|
|
|
|
|
|
|
// the terrain we are mini-mapping
|
2005-10-19 19:16:34 +02:00
|
|
|
const CTerrain* m_Terrain;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
|
|
|
// the unit manager with unit positions
|
2005-10-19 19:16:34 +02:00
|
|
|
const CUnitManager* m_UnitManager;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
2005-10-19 19:16:34 +02:00
|
|
|
// not const: camera is moved by clicking on minimap
|
|
|
|
CCamera* m_Camera;
|
|
|
|
|
2005-10-19 05:02:51 +02:00
|
|
|
// minimap texture handles
|
|
|
|
u32 m_TerrainTexture;
|
|
|
|
u32 m_LOSTexture;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
|
|
|
// texture data
|
2005-10-19 05:02:51 +02:00
|
|
|
u32 *m_TerrainData;
|
|
|
|
u8 *m_LOSData;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
2005-10-19 19:42:37 +02:00
|
|
|
u32 m_Width, m_Height;
|
2004-10-08 03:10:14 +02:00
|
|
|
|
|
|
|
// map size
|
|
|
|
u32 m_MapSize;
|
|
|
|
|
|
|
|
// texture size
|
|
|
|
u32 m_TextureSize;
|
2005-10-19 19:16:34 +02:00
|
|
|
|
|
|
|
void DrawViewRect(); // split out of Draw
|
2004-10-08 03:10:14 +02:00
|
|
|
};
|
|
|
|
|
2004-11-07 22:30:47 +01:00
|
|
|
#endif
|