TrinityCore
Loading...
Searching...
No Matches
IntermediateValues.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _INTERMEDIATE_VALUES_H
19#define _INTERMEDIATE_VALUES_H
20
21#include "TerrainBuilder.h"
22#include <Recast.h>
23#include <utility>
24
25namespace MMAP
26{
27 // this class gathers all debug info holding and output
29 {
30 rcHeightfield* heightfield;
31 rcCompactHeightfield* compactHeightfield;
32 rcContourSet* contours;
33 rcPolyMesh* polyMesh;
34 rcPolyMeshDetail* polyMeshDetail;
35
37 contours(nullptr), polyMesh(nullptr), polyMeshDetail(nullptr) {}
38
40
42 heightfield(std::exchange(other.heightfield, nullptr)),
43 compactHeightfield(std::exchange(other.compactHeightfield, nullptr)),
44 contours(std::exchange(other.contours, nullptr)),
45 polyMesh(std::exchange(other.polyMesh, nullptr)),
46 polyMeshDetail(std::exchange(other.polyMeshDetail, nullptr))
47 {
48 }
49
51
53
55 {
56 if (this != std::addressof(other))
57 {
58 heightfield = std::exchange(other.heightfield, nullptr);
59 compactHeightfield = std::exchange(other.compactHeightfield, nullptr);
60 contours = std::exchange(other.contours, nullptr);
61 polyMesh = std::exchange(other.polyMesh, nullptr);
62 polyMeshDetail = std::exchange(other.polyMeshDetail, nullptr);
63 }
64 return *this;
65 }
66
67 void writeIV(boost::filesystem::path const& outputDirectory, std::string_view fileNameSuffix, uint32 mapID, uint32 tileX, uint32 tileY);
68
69 static void debugWrite(FILE* file, rcHeightfield const* mesh);
70 static void debugWrite(FILE* file, rcCompactHeightfield const* chf);
71 static void debugWrite(FILE* file, rcContourSet const* cs);
72 static void debugWrite(FILE* file, rcPolyMesh const* mesh);
73 static void debugWrite(FILE* file, rcPolyMeshDetail const* mesh);
74
75 void generateObjFile(boost::filesystem::path const& outputDirectory, std::string_view fileNameSuffix, uint32 mapID, uint32 tileX, uint32 tileY, MeshData const& meshData);
76 };
77}
78#endif
uint32_t uint32
Definition Define.h:154
rcCompactHeightfield * compactHeightfield
IntermediateValues(IntermediateValues const &)=delete
IntermediateValues & operator=(IntermediateValues const &)=delete
IntermediateValues(IntermediateValues &&other) noexcept
IntermediateValues & operator=(IntermediateValues &&other) noexcept
static void debugWrite(FILE *file, rcHeightfield const *mesh)
rcPolyMeshDetail * polyMeshDetail
void generateObjFile(boost::filesystem::path const &outputDirectory, std::string_view fileNameSuffix, uint32 mapID, uint32 tileX, uint32 tileY, MeshData const &meshData)
void writeIV(boost::filesystem::path const &outputDirectory, std::string_view fileNameSuffix, uint32 mapID, uint32 tileX, uint32 tileY)