annotate Engine/LOD.h @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents dd36326a9994
children
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);
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2572
diff changeset
156 struct Texture_MM7 *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT);
dd36326a9994 More texture refactoring
a.parshin
parents: 2572
diff changeset
157 int LoadTextureFromLOD(struct Texture_MM7 *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType);
dd36326a9994 More texture refactoring
a.parshin
parents: 2572
diff changeset
158 int ReloadTexture(struct Texture_MM7 *pDst, const char *pContainer, int mode);
2499
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();
2575
a76d408c5132 DrawTranslucent -> DrawTextureGrayShade
a.parshin
parents: 2574
diff changeset
162 int PlacementLoadTexture(struct Texture_MM7 *pDst, const char *pContainer, unsigned int uTextureType);
2499
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
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
171 int LoadDummyTexture();
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
172
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2572
diff changeset
173 Texture_MM7 *GetTexture(int idx);
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
174
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
175
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
176 /*FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
177 unsigned __int8 pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
178 unsigned int isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
179 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
180 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
181 struct LOD::FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
182 struct LOD::Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
183 unsigned __int8 pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
184 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
185 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
186 unsigned int uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
187 struct LOD::Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
188 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
189 FILE *pOutputFileHandle;*/
2574
dd36326a9994 More texture refactoring
a.parshin
parents: 2572
diff changeset
190 Texture_MM7 pTextures[MAX_LOD_TEXTURES];
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
191 unsigned int uNumLoadedFiles;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
192 int dword_11B80;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
193 int dword_11B84;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
194 int dword_11B88;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
195 int uTextureRedBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
196 int uTextureGreenBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
197 int uTextureBlueBits;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
198 int uNumPrevLoadedFiles;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
199 int uTexturePacksCount;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
200 int pFacesLock;
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2499
diff changeset
201 int _011BA4_debug_paletted_pixels_uncompressed;
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
202 //int can_load_hardware_sprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
203 struct IDirectDrawSurface **pHardwareSurfaces;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
204 struct IDirect3DTexture2 **pHardwareTextures;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
205 char *ptr_011BB4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
206 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
207 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
208
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
209
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
210
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
211
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
212
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
213
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
214 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
215 struct LODSprite
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
216 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
217 //----- (0046244C) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
218 inline LODSprite()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
219 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
220 uHeight = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
221 uPaletteId = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
222 word_1A = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
223 pSpriteLines = nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
224 pDecompressedBytes = nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
225 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
226 ~LODSprite();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
227
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
228 void Release();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
229 int DrawSprite_sw(struct RenderBillboardTransform_local0 *a2, char a3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
230 int _4AD2D1(struct RenderBillboardTransform_local0 *a2, int a3);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
231
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
232 char pName[12]; //0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
233 int uSpriteSize; //C
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
234 __int16 uWidth; //10
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
235 __int16 uHeight; //12
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
236 __int16 uPaletteId; //14
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
237 __int16 word_16; //16
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
238 __int16 uTexturePitch; //18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
239 __int16 word_1A; //1a
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
240 int uDecompressedSize; //1c
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
241 struct LODSprite_stru0 *pSpriteLines; //20
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
242 void *pDecompressedBytes; //24
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
243 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
244 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
245
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
246 /* 15 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
247 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
248 struct LODFile_Sprites: public LOD::File
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
249 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
250 LODFile_Sprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
251 virtual ~LODFile_Sprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
252
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
253 void DeleteSomeSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
254 void DeleteSpritesRange(int uStartIndex, int uStopIndex);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
255 int _461397();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
256 void DeleteSomeOtherSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
257 int LoadSpriteFromFile(LODSprite *pSpriteHeader, const char *pContainer);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
258 bool LoadSprites(const char *pFilename);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
259 int LoadSprite(const char *pContainerName, unsigned int uPaletteID);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
260 void ReleaseLostHardwareSprites();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
261 void ReleaseAll();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
262 void MoveSpritesToVideoMemory();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
263 void _inlined_sub0();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
264 void _inlined_sub1();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
265
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
266
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
267 /*FILE *pFile;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
268 unsigned __int8 pLODName[256];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
269 unsigned int isFileOpened;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
270 unsigned __int8 *pIOBuffer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
271 unsigned int uIOBufferSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
272 struct LOD::FileHeader header;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
273 struct LOD::Directory *pRoot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
274 unsigned __int8 pContainerName[16];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
275 unsigned int uCurrentIndexDir;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
276 unsigned int uLODDataSize;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
277 unsigned int uNumSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
278 struct LOD::Directory *pSubIndices;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
279 unsigned int uOffsetToSubIndex;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
280 FILE *pOutputFileHandle;*/
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
281 struct LODSprite pSpriteHeaders[MAX_LOD_SPRITES];
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
282 signed int uNumLoadedSprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
283 int field_ECA0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
284 int field_ECA4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
285 int field_ECA8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
286 //int can_load_hardware_sprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
287 Sprite *pHardwareSprites;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
288 int field_ECB4;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
289 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
290 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
291
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
292 /* 17 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
293 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
294 struct LODSprite_stru0
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
295 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
296 int16_t a1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
297 int16_t a2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
298 char* pos;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
299 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
300 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
301
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
302
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
303
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
304
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
305 extern LODFile_IconsBitmaps *pEvents_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
306
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
307 extern LODFile_IconsBitmaps *pIcons_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
308 extern LODFile_IconsBitmaps *pIcons_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
309 extern LODFile_IconsBitmaps *pIcons_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
310
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
311 extern LODFile_IconsBitmaps *pBitmaps_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
312 extern LODFile_IconsBitmaps *pBitmaps_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
313 extern LODFile_IconsBitmaps *pBitmaps_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
314
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
315 extern LODFile_Sprites *pSprites_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
316 extern LODFile_Sprites *pSprites_LOD_mm6;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
317 extern LODFile_Sprites *pSprites_LOD_mm8;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
318
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
319 extern LODWriteableFile *pNew_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
320 extern LODWriteableFile *pGames_LOD;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
321
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
322
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
323
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
324
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
325 extern int _6A0CA4_lod_binary_search; // weak
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
326 extern int _6A0CA8_lod_unused; // weak