TrinityCore
Loading...
Searching...
No Matches
wdtfile.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 WDTFILE_H
19#define WDTFILE_H
20
21#include "cascfile.h"
22#include <memory>
23#include <string>
24#include <vector>
25
26class ADTFile;
27
28#pragma pack(push, 1)
29namespace WDT
30{
42
43 struct MAIN
44 {
50 };
51
52 struct MAID
53 {
55 {
56 uint32 RootADT; // FileDataID of mapname_xx_yy.adt
57 uint32 Obj0ADT; // FileDataID of mapname_xx_yy_obj0.adt
58 uint32 Obj1ADT; // FileDataID of mapname_xx_yy_obj1.adt
59 uint32 Tex0ADT; // FileDataID of mapname_xx_yy_tex0.adt
60 uint32 LodADT; // FileDataID of mapname_xx_yy_lod.adt
61 uint32 MapTexture; // FileDataID of mapname_xx_yy.blp
62 uint32 MapTextureN; // FileDataID of mapname_xx_yy_n.blp
63 uint32 MinimapTexture; // FileDataID of mapxx_yy.blp
64 } Data[64][64];
65 };
66}
67#pragma pack(pop)
68
70{
71public:
72 WDTFile(uint32 fileDataId, std::string const& description, std::string mapName, bool cache);
74 bool init(uint32 mapId);
75
76 ADTFile* GetMap(int32 x, int32 y, bool createIfMissing);
77 void FreeADT(ADTFile* adt);
78private:
82 std::unique_ptr<WDT::MAID> _adtFileDataIds;
83 std::string _mapName;
84 std::vector<std::string> _wmoNames;
85 struct ADTCache
86 {
87 std::unique_ptr<ADTFile> file[64][64];
88 };
89 std::unique_ptr<ADTCache> _adtCache;
90};
91
92#endif
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
void FreeADT(ADTFile *adt)
Definition wdtfile.cpp:160
WDT::MAIN _adtInfo
Definition wdtfile.h:81
WDT::MPHD _header
Definition wdtfile.h:80
std::vector< std::string > _wmoNames
Definition wdtfile.h:84
bool init(uint32 mapId)
Definition wdtfile.cpp:40
ADTFile * GetMap(int32 x, int32 y, bool createIfMissing)
Definition wdtfile.cpp:133
CASCFile _file
Definition wdtfile.h:79
std::string _mapName
Definition wdtfile.h:83
std::unique_ptr< ADTCache > _adtCache
Definition wdtfile.h:89
std::unique_ptr< WDT::MAID > _adtFileDataIds
Definition wdtfile.h:82
Definition wdtfile.h:30
std::unique_ptr< ADTFile > file[64][64]
Definition wdtfile.h:87
struct WDT::MAID::SMAreaFileIDs Data[64][64]
struct WDT::MAIN::SMAreaInfo Data[64][64]
uint32 LgtFileDataID
Definition wdtfile.h:34
uint32 TexFileDataID
Definition wdtfile.h:38
uint32 OccFileDataID
Definition wdtfile.h:35
uint32 WdlFileDataID
Definition wdtfile.h:39
uint32 Flags
Definition wdtfile.h:33
uint32 MpvFileDataID
Definition wdtfile.h:37
uint32 Pd4FileDataID
Definition wdtfile.h:40
uint32 FogsFileDataID
Definition wdtfile.h:36