Mercurial > mm7
annotate Engine/Graphics/Texture.h @ 2559:6ab1273bc507
.
author | Ritor1 |
---|---|
date | Thu, 14 May 2015 19:16:08 +0600 |
parents | c674d547cc7c |
children | d87bfbd3bb3b |
rev | line source |
---|---|
2496 | 1 #pragma once |
2 #include <stdio.h> | |
2518 | 3 #include <array> |
2496 | 4 |
5 | |
6 | |
7 /* 194 */ | |
8 #pragma pack(push, 1) | |
9 struct RGBTexture | |
10 { | |
11 RGBTexture(); | |
12 void Release(); | |
13 int LoadPCXFile(const char *Filename, unsigned int a3); | |
14 unsigned int LoadFromFILE(FILE *pFile, unsigned int mode, unsigned int bCloseFile); | |
15 int DecodePCX(char *pPcx, unsigned __int16 *pOutPixels, unsigned int uNumPixels); | |
16 int Load(const char *pContainer, int mode); | |
17 int Reload(const char *pContainer); | |
18 | |
19 char pName[16]; | |
20 unsigned int uNumPixels; | |
21 unsigned __int16 uWidth; | |
22 unsigned __int16 uHeight; | |
23 __int16 field_18; | |
24 __int16 field_1A; | |
25 __int16 field_1C; | |
26 __int16 field_1E; | |
27 int _allocation_flags; // & 1 - malloc, else custom allocator | |
28 unsigned __int16 *pPixels; | |
2518 | 29 |
30 struct ID3D11ShaderResourceView *d3d11_srv; | |
31 struct D3D11_TEXTURE2D_DESC *d3d11_desc; | |
2496 | 32 }; |
33 #pragma pack(pop) | |
34 | |
35 | |
36 | |
37 #pragma pack(push, 1) | |
38 struct Texture | |
39 { | |
40 Texture(); | |
41 void Release(); | |
42 void *UnzipPalette(); | |
43 | |
44 char pName[16]; | |
45 unsigned int uSizeOfMaxLevelOfDetail; | |
46 unsigned int uTextureSize; | |
47 unsigned __int16 uTextureWidth; | |
48 unsigned __int16 uTextureHeight; | |
49 __int16 uWidthLn2; | |
50 __int16 uHeightLn2; | |
51 __int16 uWidthMinus1; | |
52 __int16 uHeightMinus1; | |
53 short palette_id1; | |
54 short palette_id2; | |
55 unsigned int uDecompressedSize; | |
56 int pBits; | |
57 unsigned __int8 *pLevelOfDetail0_prolly_alpha_mask; | |
58 unsigned __int8 *pLevelOfDetail1; | |
2524 | 59 /*unsigned __int8 *pLevelOfDetail2;*/ struct ID3D11ShaderResourceView *d3d11_srv; // replace ol SW stuff with new fields to keep data integrity |
60 /*unsigned __int8 *pLevelOfDetail3;*/ struct D3D11_TEXTURE2D_DESC *d3d11_desc; | |
2496 | 61 unsigned __int16 *pPalette16; |
62 unsigned __int8 *pPalette24; | |
63 }; | |
64 #pragma pack(pop) | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 /* 323 */ | |
83 enum TEXTURE_FRAME_TABLE_FLAGS | |
84 { | |
85 TEXTURE_FRAME_TABLE_MORE_FRAMES = 0x1, | |
86 TEXTURE_FRAME_TABLE_FIRST = 0x2, | |
87 }; | |
88 | |
89 | |
90 | |
91 /* 41 */ | |
92 #pragma pack(push, 1) | |
93 struct TextureFrame | |
94 { | |
95 char pTextureName[12]; | |
96 __int16 uTextureID; | |
97 __int16 uAnimTime; | |
98 __int16 uAnimLength; | |
99 __int16 uFlags; | |
100 }; | |
101 #pragma pack(pop) | |
102 | |
103 /* 40 */ | |
104 #pragma pack(push, 1) | |
105 struct TextureFrameTable | |
106 { | |
107 //----- (0044D4C9) -------------------------------------------------------- | |
108 inline TextureFrameTable() | |
109 { | |
110 pTextures = 0; | |
111 sNumTextures = 0; | |
112 } | |
113 int FromFileTxt(const char *Args); | |
114 void ToFile(); | |
115 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8); | |
116 void LoadAnimationSequenceAndPalettes(signed int uIconID); | |
117 int GetFrameTexture(int uFrameID, int time); | |
118 signed int FindTextureByName(const char *Str2); | |
119 | |
120 | |
121 signed int sNumTextures; | |
122 struct TextureFrame *pTextures; | |
123 }; | |
124 #pragma pack(pop) | |
125 | |
126 extern struct TextureFrameTable *pTextureFrameTable; | |
127 | |
128 | |
129 | |
130 extern std::array<struct RGBTexture, 45> pSavegameThumbnails; | |
131 extern std::array<struct Texture *, 2> pTexture_LloydBeacons; | |
132 extern struct Texture *pTexture_50635C; | |
133 extern struct Texture *pTex_book_button8_off; | |
134 extern struct Texture *pTex_book_button8_on; | |
135 extern struct Texture *pTex_book_button7_off; | |
136 extern struct Texture *pTex_book_button7_on; | |
137 extern struct Texture *pTex_book_button6_off; | |
138 extern struct Texture *pTex_book_button6_on; | |
139 extern struct Texture *pTex_book_button5_off; | |
140 extern struct Texture *pTex_book_button5_on; | |
141 extern struct Texture *pTex_book_button4_off; | |
142 extern struct Texture *pTex_book_button4_on; | |
143 extern struct Texture *pTex_book_button3_off; | |
144 extern struct Texture *pTex_book_button3_on; | |
145 extern struct Texture *pTex_book_button2_off; | |
146 extern struct Texture *pTex_book_button1_off; | |
147 extern struct Texture *pTex_book_button2_on; | |
148 extern struct Texture *pTex_book_button1_on; | |
149 extern std::array<struct Texture *, 6> pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit | |
150 | |
151 extern std::array<struct Texture *, 12> SBPageCSpellsTextureList; | |
152 extern std::array<struct Texture *, 12> SBPageSSpellsTextureList; | |
153 extern struct Texture *pSBQuickSpellBtnTextr; | |
154 extern struct Texture *pSpellBookClickCloseBtnTextr; | |
155 extern struct Texture *pSBClickQuickSpellBtnTextr; | |
156 extern struct Texture *pSpellBookCloseBtnTextr; | |
157 extern std::array<std::array<struct Texture *, 2>, 9> pTextures_tabs; | |
158 extern struct Texture *pTexture_mapbordr; // idb | |
159 extern struct Texture *pTexture_pagemask; // idb | |
160 extern std::array<struct Texture *, 9> pSpellBookPagesTextr; | |
161 extern struct Texture *pSpellBookPagesTextr_9; | |
162 extern struct Texture *pSpellBookPagesTextr_10; | |
163 extern struct Texture *pSpellBookPagesTextr_11; | |
164 extern struct Texture *pSpellBookPagesTextr_12; | |
165 extern struct Texture *pSpellBookPagesTextr_13; | |
166 extern struct Texture *pTexture_AutonotesBook; | |
167 extern struct Texture *pTexture_CurrentBook; | |
168 extern struct Texture *pTex_moon_new; | |
169 extern struct Texture *pTex_moon_4; | |
170 extern struct Texture *pTex_moon_2; | |
171 extern struct Texture *pTex_moon_2_2; | |
172 extern struct Texture *pTex_moon_ful; | |
173 | |
174 | |
175 | |
176 extern RGBTexture stru_506E40; // weak | |
177 | |
178 | |
179 extern int uTextureID_RestUI_restb4; // weak | |
180 extern int uTextureID_RestUI_restexit; // weak | |
181 extern int uTextureID_RestUI_restb3; // weak | |
182 extern int uTextureID_RestUI_restb1; // weak | |
183 extern int uTextureID_RestUI_restb2; // weak | |
184 extern int uTextureID_RestUI_restmain; // weak | |
185 extern unsigned int uTextureID_Leather; | |
186 extern int uTextureID_ar_dn_dn; // weak | |
187 extern int uTextureID_ar_dn_up; // weak | |
188 extern int uTextureID_ar_up_dn; // weak | |
189 extern int uTextureID_ar_up_up; // weak | |
190 | |
191 | |
192 extern int uTextureID_507698; // weak | |
193 extern int uTextureID_50769C; // weak | |
194 extern int uTextureID_5076A0; // weak | |
195 extern int uTextureID_5076A4; // weak | |
196 extern int uTextureID_5076A8; // weak | |
197 extern int uTextureID_5076AC; // weak | |
198 extern int uTextureID_5076B0; // weak | |
199 extern int uTextureID_5076B4; // weak | |
200 extern int uTextureID_Parchment; // weak | |
201 extern unsigned int uTextureID_mhp_yel; | |
202 extern unsigned int uTextureID_mhp_red; | |
203 extern unsigned int uTextureID_mhp_grn; | |
204 extern unsigned int uTextureID_mhp_capr; | |
205 extern unsigned int uTextureID_mhp_capl; | |
206 extern unsigned int uTextureID_mhp_bd; | |
207 extern unsigned int uTextureID_BUTTDESC2; | |
208 extern unsigned int uTextureID_x_x_u; | |
209 extern unsigned int uTextureID_BUTTMAKE2; | |
210 extern unsigned int uTextureID_BUTTMAKE; | |
211 extern unsigned int uTextureID_BUTTYES2; | |
212 extern unsigned int uTextureID_x_ok_u; | |
213 extern std::array<struct Texture *, 22> pPlayerPortraits; | |
214 extern std::array<struct Texture *, 9> pTexture_IC_KNIGHT; | |
215 extern struct Texture *pTexture_MAKESKY; | |
216 extern struct Texture *pTexture_MAKETOP; | |
217 extern std::array<struct Texture *, 20> pTextures_arrowr; | |
218 extern std::array<struct Texture *, 20> pTextures_arrowl; | |
219 extern struct Texture *pTexture_presleft; | |
220 extern struct Texture *pTexture_pressrigh; | |
221 extern struct Texture *pTexture_buttminu; | |
222 extern struct Texture *pTexture_buttplus; | |
223 extern unsigned int uTextureID_Quit1; | |
224 extern unsigned int uTextureID_Resume1; | |
225 extern unsigned int uTextureID_Controls1; | |
226 extern unsigned int uTextureID_Save1; | |
227 extern unsigned int uTextureID_Load1; | |
228 extern unsigned int uTextureID_New1; | |
229 extern unsigned int uTextureID_Options; | |
230 | |
231 | |
232 extern unsigned int uTextureID_ib_td5_A; | |
233 extern unsigned int uTextureID_ib_td4_A; | |
234 extern unsigned int uTextureID_ib_td3_A; | |
235 extern unsigned int uTextureID_ib_td2_A; | |
236 extern unsigned int uTextureID_ib_td1_A; | |
237 extern int uTextureID_CharacterUI_InventoryBackground; // weak | |
238 extern int uTextureID_50795C; // weak | |
239 | |
240 | |
241 extern unsigned int uTextureID_Btn_GameSettings; | |
242 | |
243 | |
244 extern unsigned int uTextureID_Btn_Rest; | |
245 extern unsigned int uTextureID_Btn_CastSpell; | |
246 extern unsigned int uTextureID_Btn_ZoomIn; | |
247 extern unsigned int uTextureID_Btn_ZoomOut; | |
248 extern unsigned int uTextureID_FONTPAL; | |
249 extern unsigned int uTextureID_Btn_NPCRight; | |
250 extern unsigned int uTextureID_Btn_NPCLeft; | |
251 extern std::array<unsigned int, 8> pTextureIDs_pMapDirs; | |
252 | |
253 | |
254 extern unsigned int uTextureID_BarRed; | |
255 extern unsigned int uTextureID_BarYellow; | |
256 extern unsigned int uTextureID_BarGreen; | |
257 extern unsigned int uTextureID_BarBlue; | |
258 | |
259 | |
260 extern unsigned int uTextureID_right_panel; // weak | |
261 | |
262 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
263 extern struct RGBTexture *pTexture_StatusBar; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
264 extern struct RGBTexture *pTexture_LeftFrame; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
265 extern struct RGBTexture *pTexture_TopFrame; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
266 extern struct RGBTexture *pTexture_BottomFrame; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
267 extern struct RGBTexture *pTexture_RightFrame; |
2496 | 268 |
269 | |
270 extern unsigned int uTextureID_right_panel_loop; // weak | |
271 | |
272 | |
273 extern struct Texture *pTexture_Leather; | |
274 extern struct Texture *pTexture_RestUI_CurrentSkyFrame; // idb | |
275 extern struct Texture *pTexture_RestUI_CurrentHourglassFrame; // idb | |
276 | |
277 | |
278 extern std::array<unsigned int, 5> uTextureID_Optkb; | |
279 | |
280 extern unsigned int optvid_base_texture_id; | |
281 extern unsigned int bloodsplats_texture_id; | |
282 extern unsigned int us_colored_lights_texture_id; | |
283 extern unsigned int tinting_texture_id; | |
284 extern unsigned int uTextureID_507C20; // weak | |
285 extern unsigned int uTextureID_507C24; // weak | |
286 extern std::array<unsigned int, 10> pTextureIDs_GammaPositions; | |
287 extern unsigned int not_available_bloodsplats_texture_id; | |
288 extern unsigned int not_available_us_colored_lights_texture_id; | |
289 extern unsigned int not_available_tinting_texture_id; | |
290 | |
291 | |
292 struct OptionsMenuSkin | |
293 { | |
294 OptionsMenuSkin(); | |
295 void Relaease(); | |
296 | |
297 unsigned int uTextureID_Background; // 507C60 | |
298 unsigned int uTextureID_TurnSpeed[3]; // 507C64 | |
299 unsigned int uTextureID_ArrowLeft; // 507C70 | |
300 unsigned int uTextureID_ArrowRight; // 507C74 | |
301 unsigned int uTextureID_unused_0; // 507C78 | |
302 unsigned int uTextureID_unused_1; // 507C7C | |
303 unsigned int uTextureID_unused_2; // 507C80 | |
304 unsigned int uTextureID_FlipOnExit; // 507C84 | |
305 unsigned int uTextureID_SoundLevels[10]; // 507C88 | |
306 unsigned int uTextureID_AlwaysRun; // 507CB0 | |
307 unsigned int uTextureID_WalkSound; // 507CB4 | |
308 unsigned int uTextureID_ShowDamage; // 507CB8 | |
309 }; | |
310 extern OptionsMenuSkin options_menu_skin; // 507C60 | |
311 | |
312 | |
313 extern unsigned int uTextureID_detaliz_close_button; // weak | |
314 extern unsigned int uTextureID_MAGNIF_B; // weak | |
315 extern unsigned int uTextureID_BACKDOLL; // weak | |
316 extern unsigned int uTextureID_BACKHAND; // weak | |
317 | |
318 | |
319 extern struct Texture pTex_F7CE30; | |
320 | |
321 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2524
diff
changeset
|
322 extern struct RGBTexture stru_5773C4; // idb |
2496 | 323 |
324 extern struct stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h | |
325 extern struct stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h | |
326 | |
327 | |
328 | |
329 | |
330 | |
331 | |
332 | |
333 | |
334 | |
335 struct stru355 | |
336 { | |
337 int field_0; | |
338 int field_4; | |
339 int field_8; | |
340 int field_C; | |
341 int field_10; | |
342 int field_14; | |
343 int field_18; | |
344 int field_1C; | |
345 }; | |
346 | |
347 /* 390 */ | |
348 #pragma pack(push, 1) | |
349 struct stru350 | |
350 { | |
351 stru350 *_450DDE(); | |
352 bool _450DF1(const struct stru355 *p1, const struct stru355 *p2); | |
353 unsigned int _450F55(int a2); | |
354 int _450FB1(int a2); | |
355 int sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch, | |
356 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, | |
357 int a9, int a10); | |
358 | |
359 struct stru355 field_0; | |
360 struct stru355 field_20; | |
361 int field_40; | |
362 int field_44; | |
363 int field_48; | |
364 int field_4C; | |
365 int field_50; | |
366 int field_54; | |
367 int field_58; | |
368 int field_5C; | |
369 }; | |
370 #pragma pack(pop) | |
371 |