TrinityCore
Loading...
Searching...
No Matches
wdt.cpp
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#define _CRT_SECURE_NO_DEPRECATE
19
20#include "wdt.h"
21
22u_map_fcc MPHDMagic = { {'D', 'H', 'P', 'M'} };
23u_map_fcc MAINMagic = { {'N', 'I', 'A', 'M'} };
24
26{
27 if (fcc != MPHDMagic.fcc)
28 return false;
29 return true;
30}
31
33{
34 if (fcc != MAINMagic.fcc)
35 return false;
36 return true;
37}
38
40{
41 mphd = 0;
42 main = 0;
43}
44
46{
47 free();
48}
49
51{
52 mphd = 0;
53 main = 0;
55}
56
58{
59 // Check parent
61 return false;
62
64 if (!mphd->prepareLoadedData())
65 return false;
66 main = (wdt_MAIN *)((uint8*)mphd + mphd->size+8);
67 if (!main->prepareLoadedData())
68 return false;
69 return true;
70}
uint8_t uint8
Definition Define.h:135
file_MVER * version
Definition loadlib.h:56
virtual void free()
Definition loadlib.cpp:76
virtual bool prepareLoadedData()
Definition loadlib.cpp:65
bool prepareLoadedData()
Definition wdt.cpp:57
wdt_MPHD * mphd
Definition wdt.h:72
~WDT_file()
Definition wdt.cpp:45
void free()
Definition wdt.cpp:50
wdt_MAIN * main
Definition wdt.h:73
WDT_file()
Definition wdt.cpp:39
Definition wdt.h:48
bool prepareLoadedData()
Definition wdt.cpp:32
uint32 fcc
Definition wdt.h:50
Definition wdt.h:29
uint32 size
Definition wdt.h:35
uint32 fcc
Definition wdt.h:31
bool prepareLoadedData()
Definition wdt.cpp:25
uint32 size
Definition loadlib.h:44
uint32 fcc
Definition loadlib.h:32
u_map_fcc MAINMagic
Definition wdt.cpp:23
u_map_fcc MPHDMagic
Definition wdt.cpp:22