Pyrogenesis  trunk
MapWriter.h
Go to the documentation of this file.
1 /* Copyright (C) 2017 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 <vector>
22 #include <list>
23 #include "MapIO.h"
24 #include "ps/CStr.h"
25 #include "ps/FileIo.h"
26 
27 
28 class CLightEnv;
29 class CTerrain;
30 class CCamera;
31 class CCinemaManager;
32 class CPostprocManager;
33 class CTriggerManager;
34 class WaterManager;
35 class SkyManager;
36 class CSimulation2;
37 struct MapTrigger;
38 struct MapTriggerGroup;
39 class XMLWriter_File;
40 
41 class CMapWriter : public CMapIO
42 {
43 public:
44  // constructor
45  CMapWriter();
46  // SaveMap: try to save the current map to the given file
47  void SaveMap(const VfsPath& pathname, CTerrain* pTerr,
48  WaterManager* pWaterMan, SkyManager* pSkyMan,
49  CLightEnv* pLightEnv, CCamera* pCamera,
50  CCinemaManager* pCinema, CPostprocManager* pPostproc,
51  CSimulation2* pSimulation2);
52 
53 private:
54  // PackMap: pack the current world into a raw data stream
55  void PackMap(CFilePacker& packer, CTerrain* pTerrain);
56  // PackTerrain: pack the terrain onto the end of the data stream
57  void PackTerrain(CFilePacker& packer, CTerrain* pTerrain);
58 
59  // EnumTerrainTextures: build lists of textures used by map, and indices into this list
60  // for each tile on the terrain
61  void EnumTerrainTextures(CTerrain* pTerrain, std::vector<CStr>& textures,
62  std::vector<STileDesc>& tileIndices);
63 
64  // WriteXML: output some other data (entities, etc) in XML format
65  void WriteXML(const VfsPath& pathname, WaterManager* pWaterMan,
66  SkyManager* pSkyMan, CLightEnv* pLightEnv, CCamera* pCamera,
67  CPostprocManager* pPostproc,
68  CSimulation2* pSimulation2);
69 };
70 
71 #endif
void SaveMap(const VfsPath &pathname, CTerrain *pTerr, WaterManager *pWaterMan, SkyManager *pSkyMan, CLightEnv *pLightEnv, CCamera *pCamera, CCinemaManager *pCinema, CPostprocManager *pPostproc, CSimulation2 *pSimulation2)
Definition: MapWriter.cpp:57
Definition: Terrain.h:51
Definition: MapWriter.h:41
helper class for writing binary files.
Definition: FileIo.h:52
Public API for simulation system.
Definition: Simulation2.h:47
void PackTerrain(CFilePacker &packer, CTerrain *pTerrain)
Definition: MapWriter.cpp:159
void WriteXML(const VfsPath &pathname, WaterManager *pWaterMan, SkyManager *pSkyMan, CLightEnv *pLightEnv, CCamera *pCamera, CPostprocManager *pPostproc, CSimulation2 *pSimulation2)
Definition: MapWriter.cpp:186
void EnumTerrainTextures(CTerrain *pTerrain, std::vector< CStr > &textures, std::vector< STileDesc > &tileIndices)
Definition: MapWriter.cpp:101
Definition: path.h:77
Definition: XMLWriter.h:112
Definition: Camera.h:39
Class for in game playing of cinematics.
Definition: CinemaManager.h:34
Definition: PostprocManager.h:24
Definition: MapIO.h:21
Class CLightEnv: description of a lighting environment - contains all the necessary parameters for re...
Definition: LightEnv.h:36
void PackMap(CFilePacker &packer, CTerrain *pTerrain)
Definition: MapWriter.cpp:150
CMapWriter()
Definition: MapWriter.cpp:51
Class WaterManager: Maintain rendering-related water settings and textures Anything that affects game...
Definition: WaterManager.h:43
Class SkyManager: Maintain sky settings and textures, and render the sky.
Definition: SkyManager.h:30