Pyrogenesis  trunk
MapIO.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_MAPIO
19 #define INCLUDED_MAPIO
20 
21 #include "lib/file/vfs/vfs_path.h"
22 #include "lib/os_path.h"
23 #include "lib/status.h"
24 
25 // Opens the given texture file and stores it in a one-dimensional u16 vector.
26 Status LoadHeightmapImageVfs(const VfsPath& filepath, std::vector<u16>& heightmap);
27 Status LoadHeightmapImageOs(const OsPath& filepath, std::vector<u16>& heightmap);
28 
29 class CMapIO
30 {
31 public:
32  // Current file version given to saved maps.
33  enum { FILE_VERSION = 7 };
34  // Supported file read version - file with version less than this will be rejected.
35  enum { FILE_READ_VERSION = 7 };
36 
37 #pragma pack(push, 1)
38  // Description of a tile for I/O purposes.
39  struct STileDesc
40  {
41  // Index into the texture array of first texture on tile.
43  // Index into the texture array of second texture; (0xFFFF) if none.
46  };
47 #pragma pack(pop)
48 };
49 
50 #endif
Definition: MapIO.h:39
uint16_t u16
Definition: types.h:38
Status LoadHeightmapImageOs(const OsPath &filepath, std::vector< u16 > &heightmap)
Definition: MapIO.cpp:47
u32 m_Priority
Definition: MapIO.h:45
u16 m_Tex2Index
Definition: MapIO.h:44
Definition: MapIO.h:33
u16 m_Tex1Index
Definition: MapIO.h:42
Definition: MapIO.h:35
uint32_t u32
Definition: types.h:39
Definition: path.h:79
i64 Status
Error handling system.
Definition: status.h:169
Definition: MapIO.h:29
Status LoadHeightmapImageVfs(const VfsPath &filepath, std::vector< u16 > &heightmap)
Definition: MapIO.cpp:37