0ad/source/graphics/MapWriter.h
Ykkrosh 22dd4dd67b Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual
editing. Updated existing maps to newest format, so that they can still
work. Added undocumented _rewriteMaps() JS function. Also renamed _mem
to vmem, and reclassified its undocumentedness as unintentional, since
it's reasonably useful.
Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc
which don't care about progressiveness.
main.cpp: re-enabled vfs_display, since it doesn't crash now
Vector3D: stopped warning

This was SVN commit r2078.
2005-03-29 20:50:04 +00:00

45 lines
1.5 KiB
C++
Executable File

#ifndef _MAPWRITER_H
#define _MAPWRITER_H
#include <vector>
#include "MapIO.h"
#include "CStr.h"
#include "FilePacker.h"
class CLightEnv;
class CTerrain;
class CUnitManager;
class CMapWriter : public CMapIO
{
public:
// constructor
CMapWriter();
// SaveMap: try to save the current map to the given file
void SaveMap(const char* filename, CTerrain *pTerr, CLightEnv *pLightEnv, CUnitManager *pUnitMan);
// RewriteAllMaps: for use during development: load/save all maps, to
// update them to the newest format.
static void RewriteAllMaps(CTerrain *pTerrain, CUnitManager *pUnitMan, CLightEnv *pLightEnv);
private:
// PackMap: pack the current world into a raw data stream
void PackMap(CFilePacker& packer, CTerrain *pTerr, CLightEnv *pLightEnv, CUnitManager *pUnitMan);
// PackTerrain: pack the terrain onto the end of the data stream
void PackTerrain(CFilePacker& packer, CTerrain *pTerrain);
// PackObjects: pack world objects onto the end of the output data stream
void PackObjects(CFilePacker& packer, CUnitManager *pUnitMan);
// PackLightEnv: pack lighting parameters onto the end of the output data stream
void PackLightEnv(CFilePacker& packer, CLightEnv *pLightEnv);
// EnumTerrainTextures: build lists of textures used by map, and indices into this list
// for each tile on the terrain
void EnumTerrainTextures(CTerrain *pTerrain, std::vector<CStr>& textures,
std::vector<STileDesc>& tileIndices);
// WriteXML: output some other data (entities, etc) in XML format
void WriteXML(const char* filename, CUnitManager* pUnitMan);
};
#endif