[Gameplay] Reduce loom cost
[0ad.git] / source / graphics / MapIO.h
blob21516280fb9112debb47b9247337bc52cd0627e9
1 /* Copyright (C) 2021 Wildfire Games.
2 * This file is part of 0 A.D.
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.
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.
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/>.
18 #ifndef INCLUDED_MAPIO
19 #define INCLUDED_MAPIO
21 #include "lib/file/vfs/vfs_path.h"
22 #include "lib/os_path.h"
23 #include "lib/status.h"
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);
29 class CMapIO
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 };
37 #pragma pack(push, 1)
38 // Description of a tile for I/O purposes.
39 struct STileDesc
41 // Index into the texture array of first texture on tile.
42 u16 m_Tex1Index;
43 // Index into the texture array of second texture; (0xFFFF) if none.
44 u16 m_Tex2Index;
45 u32 m_Priority;
47 #pragma pack(pop)
50 #endif