1
0
forked from 0ad/0ad
0ad/source/ps/World.h
Matei 0ed2815c8b Added initial version of LOS, and updated minimap to show both LOS and water.
LOS issues still outstanding:
- LOS looks ugly because of quad tesselation into 2 triangles
- Quad tesselation is unspecified by OpenGL (in fact using GL_QUADS on
LOS quads seemed to give different tesselations than it did for the
underlying terrain quads, but terrain rendering also used GL_QUADS).
This should be fixed once we decide on the quad tesselation issue.
- Units with traits.vision.permanent set are visible through FOW even if
you havent seen them before; this should only be true when you have seen
them before. But it gets even more complicated - if a permanent unit
seen through FOW dies or gets upgraded or something, perhaps you should
remember the old version. I'm not completely sure how to do this
(probably involves cloning its actor somehow).

This was SVN commit r2876.
2005-10-09 03:43:03 +00:00

65 lines
1.4 KiB
C++
Executable File

#ifndef _ps_World_H
#define _ps_World_H
#include "Terrain.h"
class CGame;
class CGameAttributes;
class CUnitManager;
class CEntityManager;
class CProjectileManager;
class CLOSManager;
class CWorld
{
CGame *m_pGame;
CTerrain m_Terrain;
// These all point to the respective g_* globals - the plan is to remove
// the globals and move them into CWorld members as soon as all code has
// been converted
CUnitManager &m_UnitManager;
CEntityManager &m_EntityManager;
CProjectileManager &m_ProjectileManager;
CLOSManager &m_LOSManager;
public:
CWorld(CGame *pGame);
~CWorld();
void RegisterInit(CGameAttributes *pGameAttributes);
/*
Initialize the World - load the map and all objects
*/
void Initialize(CGameAttributes *pGameAttributes);
// provided for JS _rewritemaps function
void RewriteMap();
inline CTerrain *GetTerrain()
{ return &m_Terrain; }
inline CUnitManager *GetUnitManager()
{ return &m_UnitManager; }
inline CEntityManager *GetEntityManager()
{ return &m_EntityManager; }
inline CProjectileManager *GetProjectileManager()
{ return &m_ProjectileManager; }
inline CLOSManager *GetLOSManager()
{ return &m_LOSManager; }
private:
// squelch "unable to generate" warnings
CWorld(const CWorld& rhs);
const CWorld& operator=(const CWorld& rhs);
};
#include "Game.h"
ERROR_SUBGROUP(Game, World);
ERROR_TYPE(Game_World, MapLoadFailed);
// rationale: see definition.
class CLightEnv;
extern CLightEnv g_LightEnv;
#endif