forked from 0ad/0ad
olsner
09f47d6820
- g_Terrain and g_Camera totally eradicated as globals, is now m_Terrain of CWorld and m_Camera of CGameView - terrainMain.cpp is almost completely empty with functionality moved into the relevant core classes - Miscellaneous global functions moved into Core Classes (mostly GameView) This was SVN commit r865.
52 lines
1.5 KiB
C++
Executable File
52 lines
1.5 KiB
C++
Executable File
#ifndef _MAPREADER_H
|
|
#define _MAPREADER_H
|
|
|
|
#include "MapIO.h"
|
|
#include "CStr.h"
|
|
#include "LightEnv.h"
|
|
#include "FileUnpacker.h"
|
|
|
|
class CObjectEntry;
|
|
class CTerrain;
|
|
class CUnitManager;
|
|
class CLightEnv;
|
|
|
|
class CMapReader : public CMapIO
|
|
{
|
|
public:
|
|
// constructor
|
|
CMapReader();
|
|
// LoadMap: try to load the map from given file; reinitialise the scene to new data if successful
|
|
void LoadMap(const char* filename, CTerrain *pTerrain, CUnitManager *pUnitMan, CLightEnv *pLightEnv);
|
|
|
|
private:
|
|
// UnpackMap: unpack the given data from the raw data stream into local variables
|
|
void UnpackMap(CFileUnpacker& unpacker);
|
|
// UnpackTerrain: unpack the terrain from the input stream
|
|
void UnpackTerrain(CFileUnpacker& unpacker);
|
|
// UnpackObjects: unpack world objects from the input stream
|
|
void UnpackObjects(CFileUnpacker& unpacker);
|
|
// UnpackObjects: unpack lighting parameters from the input stream
|
|
void UnpackLightEnv(CFileUnpacker& unpacker);
|
|
|
|
// ApplyData: take all the input data, and rebuild the scene from it
|
|
void ApplyData(CFileUnpacker& unpacker, CTerrain *pTerrain, CUnitManager *pUnitMan, CLightEnv *pLightEnv);
|
|
|
|
// size of map
|
|
u32 m_MapSize;
|
|
// heightmap for map
|
|
std::vector<u16> m_Heightmap;
|
|
// list of terrain textures used by map
|
|
std::vector<Handle> m_TerrainTextures;
|
|
// tile descriptions for each tile
|
|
std::vector<STileDesc> m_Tiles;
|
|
// list of object types used by map
|
|
std::vector<CObjectEntry*> m_ObjectTypes;
|
|
// descriptions for each objects
|
|
std::vector<SObjectDesc> m_Objects;
|
|
// lightenv stored in file
|
|
CLightEnv m_LightEnv;
|
|
};
|
|
|
|
#endif
|