comparison Engine/Graphics/Texture.h @ 2496:5abd8fc8f1c6

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