-
Notifications
You must be signed in to change notification settings - Fork 22
/
ModelInfo.h
120 lines (103 loc) · 1.92 KB
/
ModelInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#pragma once
#pragma pack(push, 1)
struct PaletteRpl
{
PaletteRpl(DWORD _dwPaletteID, BYTE _bOffset, BYTE _bLength)
{
dwPaletteID = _dwPaletteID;
bOffset = _bOffset;
bLength = _bLength;
}
PaletteRpl()
{
dwPaletteID = 0;
bOffset = 0;
bLength = 0;
}
DWORD dwPaletteID;
BYTE bOffset;
BYTE bLength;
};
#pragma pack(pop)
typedef std::list< PaletteRpl > PaletteRList;
#pragma pack(push, 1)
struct TextureRpl
{
TextureRpl(BYTE _bIndex, DWORD _dwOriginID, DWORD _dwTextureID)
{
bIndex = _bIndex;
dwOriginID = _dwOriginID;
dwTextureID = _dwTextureID;
}
TextureRpl()
{
bIndex = 0;
dwOriginID = 0;
dwTextureID = 0;
}
BYTE bIndex;
DWORD dwOriginID;
DWORD dwTextureID;
};
#pragma pack(pop)
typedef std::list< TextureRpl > TextureRList;
#pragma pack(push, 1)
struct ModelRpl
{
ModelRpl(BYTE _bIndex, DWORD _dwModelID)
{
bIndex = _bIndex;
dwModelID = _dwModelID;
}
ModelRpl()
{
bIndex = 0;
dwModelID = 0;
}
BYTE bIndex;
DWORD dwModelID;
};
#pragma pack(pop)
typedef std::list<ModelRpl> ModelRList;
struct ModelInfo
{
ModelInfo()
{
bUnknown = 0x11;
dwBasePalette = 0;
}
~ModelInfo()
{
ClearInfo();
}
void ClearInfo()
{
dwBasePalette = 0;
lPalettes.clear();
lTextures.clear();
lModels.clear();
}
void MergeData(ModelInfo* pSrc, DWORD dwLayer);
BinaryWriter *NetData();
BYTE bUnknown;
DWORD dwBasePalette;
PaletteRList lPalettes;
TextureRList lTextures;
ModelRList lModels;
inline void SetBasePalette(DWORD _dwBasePalette)
{
dwBasePalette = _dwBasePalette;
}
inline void ReplacePalette(DWORD dwPaletteID, BYTE bOffset, BYTE bLength)
{
lPalettes.push_back(PaletteRpl(dwPaletteID, bOffset, bLength));
}
inline void ReplaceTexture(BYTE bIndex, DWORD dwOriginID, DWORD dwTextureID)
{
lTextures.push_back(TextureRpl(bIndex, dwOriginID, dwTextureID));
}
inline void ReplaceModel(BYTE bIndex, DWORD dwModelID)
{
lModels.push_back(ModelRpl(bIndex, dwModelID));
}
};