annotate Engine/LOD.h @ 2542:bacf9809126a

.
author a.parshin
date Sun, 10 May 2015 02:04:52 +0200
parents 68cdef6879a0
children d87bfbd3bb3b
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #pragma once
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2 #include <stdio.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3 #include <memory.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4 #include <cstdint>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6 #include "Engine/Graphics/Texture.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
7
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8 class Sprite;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11 #define MAX_LOD_TEXTURES 1000
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
12 #define MAX_LOD_SPRITES 1500
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
13
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 /* 354 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 enum TEXTURE_TYPE
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 TEXTURE_DEFAULT = 0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 TEXTURE_24BIT_PALETTE = 0x1,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 TEXTURE_16BIT_PALETTE = 0x2,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 namespace LOD
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 struct FileHeader
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 //----- (004617B6) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 inline FileHeader()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 memset(pSignature, 0, 4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 memset(LodVersion, 0, 80);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 memset(LodDescription, 0, 80);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 memset(array_0000B0, 0, 28);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34 memset(array_0000CC, 0, 52);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 pSignature[0] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 LodVersion[0] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 LodDescription[0] = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 LODSize = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 dword_0000A8 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 uNumIndices = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44 char pSignature[4];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 char LodVersion[80];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
46 //char field_C[32];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 //char field_2C[40];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
48 char LodDescription[80];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
49 int LODSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
50 int dword_0000A8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
51 unsigned int uNumIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
52 char array_0000B0[28];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
53 char array_0000CC[52];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
59 struct Directory
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
60 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
61 Directory();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
62
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
63 char pFilename[15];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
64 char field_F;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
65 unsigned int uOfsetFromSubindicesStart;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
66 unsigned int uDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
67 int dword_000018;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
68 unsigned __int16 uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
69 __int16 word_00001E;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
70 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
71 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
72
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
73
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
74 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
75 struct File
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
76 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
77 File();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
78 virtual ~File();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
79 void *LoadRaw(const char *pContainer, int a3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
80 FILE *FindContainer(const char *pContainerName, bool bLinearSearch);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
81 bool DoesContainerExist(const char *pContainer);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
82 int CalcIndexFast(int startIndex, int maxIndex, const char *pContainerName);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
83 bool LoadHeader(const char *pFilename, bool bWriting);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
84 int LoadSubIndices(const char *pContainer);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
85 void AllocSubIndicesAndIO(unsigned int uNumSubIndices, unsigned int uBufferSize);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
86 void FreeSubIndexAndIO();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
87 bool AppendDirectory(LOD::Directory *pDir, const void *pData);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
88 void ResetSubIndices();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
89 void Close();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
90
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
91 FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
92 char pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
93 bool isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
94 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
95 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
96 struct FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
97 struct Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
98 char pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
99 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
100 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
101 unsigned int uNumSubDirs;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
102 struct Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
103 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
104 FILE *pOutputFileHandle;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
105 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
106 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
107 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
108
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
109
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
110
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
111
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
112
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
113
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
114 /* 6 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
115 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
116 struct LODWriteableFile: public LOD::File
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
117 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
118 bool LoadFile(const char *pFilename, bool bWriting);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
119 unsigned int Write(const LOD::Directory *pDir, const void *pDirData, int a4);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
120 void CloseWriteFile();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
121 int CreateTempFile();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
122 int FixDirectoryOffsets();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
123 bool _4621A7();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
124 int CreateNewLod(LOD::FileHeader *pHeader, LOD::Directory *pDir, const char *Source);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
125
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
126 /*FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
127 char pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
128 unsigned int isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
129 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
130 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
131 struct LOD::FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
132 struct LOD::Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
133 unsigned __int8 pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
134 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
135 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
136 unsigned int uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
137 struct LOD::Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
138 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
139 FILE *pOutputFileHandle;*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
140 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
141 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
142
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
143
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
144
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
145
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
146 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
147 struct LODFile_IconsBitmaps: public LOD::File
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
148 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
149 LODFile_IconsBitmaps();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
150 virtual ~LODFile_IconsBitmaps();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
151 void SyncLoadedFilesCount();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
152 unsigned int FindTextureByName(const char *pName);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
153 bool Load(const char *pFilename, const char *pFolderName);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
154 void ReleaseAll();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
155 unsigned int LoadTexture(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
156 struct Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
157 int LoadTextureFromLOD(struct Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
158 int ReloadTexture(struct Texture *pDst, const char *pContainer, int mode);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
159 void ReleaseHardwareTextures();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
160 void ReleaseLostHardwareTextures();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
161 void _410423_move_textures_to_device();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
162 int _410522(struct Texture *pDst, const char *pContainer, unsigned int uTextureType);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
163 void SetupPalettes(unsigned int uTargetRBits, unsigned int uTargetGBits, unsigned int uTargetBBits);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
164 void ReleaseAll2();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
165 void RemoveTexturesPackFromTextureList();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
166 void RemoveTexturesFromTextureList();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
167 void _inlined_sub0();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
168 void _inlined_sub1();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
169 void _inlined_sub2();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
170
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
171 inline int LoadDummyTexture()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
172 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
173 for (unsigned int i = 0; i < uNumLoadedFiles; ++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
174 if (!strcmp(pTextures[i].pName, "pending"))
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
175 return i;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
176 return LoadTextureFromLOD(&pTextures[uNumLoadedFiles], "pending", TEXTURE_16BIT_PALETTE);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
177 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
178
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
179 Texture *GetTexture(int idx);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
180
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
181
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
182 /*FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
183 unsigned __int8 pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
184 unsigned int isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
185 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
186 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
187 struct LOD::FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
188 struct LOD::Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
189 unsigned __int8 pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
190 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
191 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
192 unsigned int uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
193 struct LOD::Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
194 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
195 FILE *pOutputFileHandle;*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
196 Texture pTextures[MAX_LOD_TEXTURES];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
197 unsigned int uNumLoadedFiles;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
198 int dword_11B80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
199 int dword_11B84;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
200 int dword_11B88;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
201 int uTextureRedBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
202 int uTextureGreenBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
203 int uTextureBlueBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
204 int uNumPrevLoadedFiles;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
205 int uTexturePacksCount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
206 int pFacesLock;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
207 int dword_011BA4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
208 //int can_load_hardware_sprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
209 struct IDirectDrawSurface **pHardwareSurfaces;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
210 struct IDirect3DTexture2 **pHardwareTextures;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
211 char *ptr_011BB4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
212 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
213 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
214
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
215
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
216
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
217
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
218
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
219
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
220 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
221 struct LODSprite
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
222 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
223 //----- (0046244C) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
224 inline LODSprite()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
225 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
226 uHeight = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
227 uPaletteId = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
228 word_1A = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
229 pSpriteLines = nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
230 pDecompressedBytes = nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
231 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
232 ~LODSprite();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
233
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
234 void Release();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
235 int DrawSprite_sw(struct RenderBillboardTransform_local0 *a2, char a3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
236 int _4AD2D1(struct RenderBillboardTransform_local0 *a2, int a3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
237
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
238 char pName[12]; //0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
239 int uSpriteSize; //C
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
240 __int16 uWidth; //10
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
241 __int16 uHeight; //12
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
242 __int16 uPaletteId; //14
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
243 __int16 word_16; //16
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
244 __int16 uTexturePitch; //18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
245 __int16 word_1A; //1a
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
246 int uDecompressedSize; //1c
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
247 struct LODSprite_stru0 *pSpriteLines; //20
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
248 void *pDecompressedBytes; //24
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
249 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
250 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
251
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
252 /* 15 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
253 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
254 struct LODFile_Sprites: public LOD::File
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
255 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
256 LODFile_Sprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
257 virtual ~LODFile_Sprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
258
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
259 void DeleteSomeSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
260 void DeleteSpritesRange(int uStartIndex, int uStopIndex);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
261 int _461397();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
262 void DeleteSomeOtherSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
263 int LoadSpriteFromFile(LODSprite *pSpriteHeader, const char *pContainer);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
264 bool LoadSprites(const char *pFilename);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
265 int LoadSprite(const char *pContainerName, unsigned int uPaletteID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
266 void ReleaseLostHardwareSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
267 void ReleaseAll();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
268 void MoveSpritesToVideoMemory();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
269 void _inlined_sub0();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
270 void _inlined_sub1();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
271
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
272
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
273 /*FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
274 unsigned __int8 pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
275 unsigned int isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
276 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
277 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
278 struct LOD::FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
279 struct LOD::Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
280 unsigned __int8 pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
281 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
282 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
283 unsigned int uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
284 struct LOD::Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
285 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
286 FILE *pOutputFileHandle;*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
287 struct LODSprite pSpriteHeaders[MAX_LOD_SPRITES];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
288 signed int uNumLoadedSprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
289 int field_ECA0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
290 int field_ECA4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
291 int field_ECA8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
292 //int can_load_hardware_sprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
293 Sprite *pHardwareSprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
294 int field_ECB4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
295 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
296 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
297
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
298 /* 17 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
299 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
300 struct LODSprite_stru0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
301 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
302 int16_t a1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
303 int16_t a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
304 char* pos;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
305 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
306 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
307
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
308
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
309
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
310
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
311 extern LODFile_IconsBitmaps *pEvents_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
312
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
313 extern LODFile_IconsBitmaps *pIcons_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
314 extern LODFile_IconsBitmaps *pIcons_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
315 extern LODFile_IconsBitmaps *pIcons_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
316
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
317 extern LODFile_IconsBitmaps *pBitmaps_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
318 extern LODFile_IconsBitmaps *pBitmaps_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
319 extern LODFile_IconsBitmaps *pBitmaps_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
320
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
321 extern LODFile_Sprites *pSprites_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
322 extern LODFile_Sprites *pSprites_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
323 extern LODFile_Sprites *pSprites_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
324
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
325 extern LODWriteableFile *pNew_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
326 extern LODWriteableFile *pGames_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
327
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
328
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
329
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
330
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
331 extern int _6A0CA4_lod_binary_search; // weak
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
332 extern int _6A0CA8_lod_unused; // weak