TrinityCore
Loading...
Searching...
No Matches
vmapexport.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 VMAPEXPORT_H
19#define VMAPEXPORT_H
20
21#include "Define.h"
22#include <atomic>
23#include <memory>
24#include <string>
25
26// flags of each spawn
33
34// flags of each model
35enum class ModelFlags : uint32
36{
37 None = 0x0,
38 IsM2 = 0x1
39};
40
41struct WMODoodadData;
42
43extern const char * szWorkDirWmo;
44
45uint32 GenerateUniqueObjectId(uint32 clientId, uint16 clientDoodadId, bool isWmo);
46
48{
50 {
53 OkNoCollision, // has no data by itself but its WMO doodads do
54 Failed
55 };
56
57 std::atomic<ExtractionState> State;
58 std::unique_ptr<WMODoodadData> Doodads;
59
60 void Wait()
61 {
62 State.wait(InProgress);
63 }
64
65 void Fail()
66 {
67 State.store(Failed);
68 State.notify_all();
69 }
70
72 {
73 State.store(state);
74 State.notify_all();
75 }
76
77 bool HasCollision() const { return State.load(std::memory_order::relaxed) == Ok; }
78};
79
80std::pair<ExtractedModelData*, bool> BeginModelExtraction(std::string const& outputName);
81
82ExtractedModelData const* ExtractSingleWmo(std::string& fname);
83ExtractedModelData const* ExtractSingleModel(std::string& fname);
84
86
87bool IsLiquidIgnored(uint32 liquidTypeId);
88
89#endif
uint8_t uint8
Definition Define.h:156
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
std::atomic< ExtractionState > State
Definition vmapexport.h:57
bool HasCollision() const
Definition vmapexport.h:77
std::unique_ptr< WMODoodadData > Doodads
Definition vmapexport.h:58
void Complete(ExtractionState state=Ok)
Definition vmapexport.h:71
ModelFlags
Definition vmapexport.h:36
ExtractedModelData const * ExtractSingleModel(std::string &fname)
bool IsLiquidIgnored(uint32 liquidTypeId)
void ExtractGameobjectModels()
uint32 GenerateUniqueObjectId(uint32 clientId, uint16 clientDoodadId, bool isWmo)
ModelInstanceFlags
Definition vmapexport.h:28
@ MOD_PATH_ONLY
Definition vmapexport.h:31
@ MOD_PARENT_SPAWN
Definition vmapexport.h:30
@ MOD_HAS_BOUND
Definition vmapexport.h:29
const char * szWorkDirWmo
ExtractedModelData const * ExtractSingleWmo(std::string &fname)
std::pair< ExtractedModelData *, bool > BeginModelExtraction(std::string const &outputName)