Pyrogenesis trunk
MapWriter.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_MAPWRITER
19#define INCLUDED_MAPWRITER
20
21#include "MapIO.h"
22#include "ps/CStr.h"
23#include "ps/FileIo.h"
24
25#include <vector>
26
27
28class CLightEnv;
29class CTerrain;
30class CCamera;
31class CCinemaManager;
33class WaterManager;
34class SkyManager;
35class CSimulation2;
36struct MapTrigger;
37
38class CMapWriter : public CMapIO
39{
40public:
41 // constructor
42 CMapWriter();
43 // SaveMap: try to save the current map to the given file
44 void SaveMap(const VfsPath& pathname, CTerrain* pTerr,
45 WaterManager* pWaterMan, SkyManager* pSkyMan,
46 CLightEnv* pLightEnv, CCamera* pCamera,
47 CCinemaManager* pCinema, CPostprocManager* pPostproc,
48 CSimulation2* pSimulation2);
49
50private:
51 // PackMap: pack the current world into a raw data stream
52 void PackMap(CFilePacker& packer, CTerrain* pTerrain);
53 // PackTerrain: pack the terrain onto the end of the data stream
54 void PackTerrain(CFilePacker& packer, CTerrain* pTerrain);
55
56 // EnumTerrainTextures: build lists of textures used by map, and indices into this list
57 // for each tile on the terrain
58 void EnumTerrainTextures(CTerrain* pTerrain, std::vector<CStr>& textures,
59 std::vector<STileDesc>& tileIndices);
60
61 // WriteXML: output some other data (entities, etc) in XML format
62 void WriteXML(const VfsPath& pathname, WaterManager* pWaterMan,
63 SkyManager* pSkyMan, CLightEnv* pLightEnv, CCamera* pCamera,
64 CPostprocManager* pPostproc,
65 CSimulation2* pSimulation2);
66};
67
68#endif
Definition: Camera.h:42
Class for in game playing of cinematics.
Definition: CinemaManager.h:29
helper class for writing binary files.
Definition: FileIo.h:53
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for re...
Definition: LightEnv.h:37
Definition: MapIO.h:30
Definition: MapWriter.h:39
void PackMap(CFilePacker &packer, CTerrain *pTerrain)
Definition: MapWriter.cpp:152
void SaveMap(const VfsPath &pathname, CTerrain *pTerr, WaterManager *pWaterMan, SkyManager *pSkyMan, CLightEnv *pLightEnv, CCamera *pCamera, CCinemaManager *pCinema, CPostprocManager *pPostproc, CSimulation2 *pSimulation2)
Definition: MapWriter.cpp:59
void PackTerrain(CFilePacker &packer, CTerrain *pTerrain)
Definition: MapWriter.cpp:161
void EnumTerrainTextures(CTerrain *pTerrain, std::vector< CStr > &textures, std::vector< STileDesc > &tileIndices)
Definition: MapWriter.cpp:103
void WriteXML(const VfsPath &pathname, WaterManager *pWaterMan, SkyManager *pSkyMan, CLightEnv *pLightEnv, CCamera *pCamera, CPostprocManager *pPostproc, CSimulation2 *pSimulation2)
Definition: MapWriter.cpp:188
CMapWriter()
Definition: MapWriter.cpp:53
Definition: PostprocManager.h:32
Public API for simulation system.
Definition: Simulation2.h:47
Definition: Terrain.h:52
Definition: path.h:80
Class SkyManager: Maintain sky settings and textures, and render the sky.
Definition: SkyManager.h:38
Class WaterManager: Maintain rendering-related water settings and textures Anything that affects game...
Definition: WaterManager.h:48