2499
|
1 #pragma once
|
|
2 #include <string>
|
|
3 #include "VectorTypes.h"
|
|
4 #include "OSAPI.h"
|
|
5 #include <array>
|
|
6 #include <assert.h>
|
|
7 #include "NZIArray.h"
|
|
8
|
|
9 //typedef char _UNKNOWN;
|
|
10 typedef unsigned int uint;
|
|
11
|
|
12
|
|
13 inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count)
|
|
14 {
|
|
15 unsigned __int32* p = (unsigned __int32 *)ptr;
|
|
16 for (int i = 0; i < count; i++)
|
|
17 *p++ = value;
|
|
18 }
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29
|
|
30 #if defined(__GNUC__)
|
|
31 typedef long long ll;
|
|
32 typedef unsigned long long ull;
|
|
33 #define __int64 long long
|
|
34 #define __int32 int
|
|
35 #define __int16 short
|
|
36 #define __int8 char
|
|
37 #define MAKELL(num) num ## LL
|
|
38 #define FMT_64 "ll"
|
|
39 #elif defined(_MSC_VER)
|
|
40 typedef __int64 ll;
|
|
41 typedef unsigned __int64 ull;
|
|
42 #define MAKELL(num) num ## i64
|
|
43 #define FMT_64 "I64"
|
|
44 #elif defined (__BORLANDC__)
|
|
45 typedef __int64 ll;
|
|
46 typedef unsigned __int64 ull;
|
|
47 #define MAKELL(num) num ## i64
|
|
48 #define FMT_64 "L"
|
|
49 #else
|
|
50 #error "unknown compiler"
|
|
51 #endif
|
|
52 typedef unsigned int uint;
|
|
53 typedef unsigned char uchar;
|
|
54 typedef unsigned short ushort;
|
|
55 typedef unsigned long ulong;
|
|
56
|
|
57 typedef char int8;
|
|
58 typedef signed char sint8;
|
|
59 typedef unsigned char uint8;
|
|
60 typedef short int16;
|
|
61 typedef signed short sint16;
|
|
62 typedef unsigned short uint16;
|
|
63 typedef int int32;
|
|
64 typedef signed int sint32;
|
|
65 typedef unsigned int uint32;
|
|
66 typedef ll int64;
|
|
67 typedef ll sint64;
|
|
68 typedef ull uint64;
|
|
69
|
|
70 // Partially defined types:
|
|
71 #define _BYTE uint8
|
|
72 #define _WORD uint16
|
|
73 #define _DWORD uint32
|
|
74 #define _QWORD uint64
|
|
75 #if !defined(_MSC_VER)
|
|
76 #define _LONGLONG __int128
|
|
77 #endif
|
|
78
|
|
79 #ifndef _WINDOWS_
|
|
80 typedef int8 BYTE;
|
|
81 typedef int16 WORD;
|
|
82 typedef int32 DWORD;
|
|
83 typedef int32 LONG;
|
|
84 #endif
|
|
85 typedef int64 QWORD;
|
|
86 #ifndef __cplusplus
|
|
87 typedef int bool; // we want to use bool in our C programs
|
|
88 #endif
|
|
89
|
|
90 // Some convenience macros to make partial accesses nicer
|
|
91 // first unsigned macros:
|
|
92 #ifdef HIBYTE
|
|
93 #undef HIBYTE
|
|
94 #endif // HIBYTE
|
|
95 #ifdef HIWORD
|
|
96 #undef HIWORD
|
|
97 #endif // HIWORD
|
|
98 #ifdef LOBYTE
|
|
99 #undef LOBYTE
|
|
100 #endif // LOBYTE
|
|
101 #ifdef LOWORD
|
|
102 #undef LOWORD
|
|
103 #endif // LOWORD
|
|
104
|
|
105 #define LOBYTE(x) (*((_BYTE*)&(x))) // low byte
|
|
106 #define LOWORD(x) (*((_WORD*)&(x))) // low word
|
|
107 #define LODWORD(x) (*((_DWORD*)&(x))) // low dword
|
|
108 #define HIBYTE(x) (*((_BYTE*)&(x)+1))
|
|
109 #define HIWORD(x) (*((_WORD*)&(x)+1))
|
|
110 #define HIDWORD(x) (*((_DWORD*)&(x)+1))
|
|
111 #define BYTEn(x, n) (*((_BYTE*)&(x)+n))
|
|
112 #define WORDn(x, n) (*((_WORD*)&(x)+n))
|
|
113 #define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0)
|
|
114 #define BYTE2(x) BYTEn(x, 2)
|
|
115 #define BYTE3(x) BYTEn(x, 3)
|
|
116 #define BYTE4(x) BYTEn(x, 4)
|
|
117 #define BYTE5(x) BYTEn(x, 5)
|
|
118 #define BYTE6(x) BYTEn(x, 6)
|
|
119 #define BYTE7(x) BYTEn(x, 7)
|
|
120 #define BYTE8(x) BYTEn(x, 8)
|
|
121 #define BYTE9(x) BYTEn(x, 9)
|
|
122 #define BYTE10(x) BYTEn(x, 10)
|
|
123 #define BYTE11(x) BYTEn(x, 11)
|
|
124 #define BYTE12(x) BYTEn(x, 12)
|
|
125 #define BYTE13(x) BYTEn(x, 13)
|
|
126 #define BYTE14(x) BYTEn(x, 14)
|
|
127 #define BYTE15(x) BYTEn(x, 15)
|
|
128 #define WORD1(x) WORDn(x, 1)
|
|
129 #define WORD2(x) WORDn(x, 2) // third word of the object, unsigned
|
|
130 #define WORD3(x) WORDn(x, 3)
|
|
131 #define WORD4(x) WORDn(x, 4)
|
|
132 #define WORD5(x) WORDn(x, 5)
|
|
133 #define WORD6(x) WORDn(x, 6)
|
|
134 #define WORD7(x) WORDn(x, 7)
|
|
135
|
|
136 // now signed macros (the same but with sign extension)
|
|
137 #define SLOBYTE(x) (*((int8*)&(x)))
|
|
138 #define SLOWORD(x) (*((int16*)&(x)))
|
|
139 #define SLODWORD(x) (*((int32*)&(x)))
|
|
140 #define SHIBYTE(x) (*((int8*)&(x)+1))
|
|
141 #define SHIWORD(x) (*((int16*)&(x)+1))
|
|
142 #define SHIDWORD(x) (*((int32*)&(x)+1))
|
|
143 #define SBYTEn(x, n) (*((int8*)&(x)+n))
|
|
144 #define SWORDn(x, n) (*((int16*)&(x)+n))
|
|
145 #define SBYTE1(x) SBYTEn(x, 1)
|
|
146 #define SBYTE2(x) SBYTEn(x, 2)
|
|
147 #define SBYTE3(x) SBYTEn(x, 3)
|
|
148 #define SBYTE4(x) SBYTEn(x, 4)
|
|
149 #define SBYTE5(x) SBYTEn(x, 5)
|
|
150 #define SBYTE6(x) SBYTEn(x, 6)
|
|
151 #define SBYTE7(x) SBYTEn(x, 7)
|
|
152 #define SBYTE8(x) SBYTEn(x, 8)
|
|
153 #define SBYTE9(x) SBYTEn(x, 9)
|
|
154 #define SBYTE10(x) SBYTEn(x, 10)
|
|
155 #define SBYTE11(x) SBYTEn(x, 11)
|
|
156 #define SBYTE12(x) SBYTEn(x, 12)
|
|
157 #define SBYTE13(x) SBYTEn(x, 13)
|
|
158 #define SBYTE14(x) SBYTEn(x, 14)
|
|
159 #define SBYTE15(x) SBYTEn(x, 15)
|
|
160 #define SWORD1(x) SWORDn(x, 1)
|
|
161 #define SWORD2(x) SWORDn(x, 2)
|
|
162 #define SWORD3(x) SWORDn(x, 3)
|
|
163 #define SWORD4(x) SWORDn(x, 4)
|
|
164 #define SWORD5(x) SWORDn(x, 5)
|
|
165 #define SWORD6(x) SWORDn(x, 6)
|
|
166 #define SWORD7(x) SWORDn(x, 7)
|
|
167
|
|
168
|
|
169
|
|
170 // Generate a reference to pair of operands
|
|
171 template<class T> int16 __PAIR__( int8 high, T low) { return ((( int16)high) << sizeof(high)*8) | uint8(low); }
|
|
172 template<class T> int32 __PAIR__( int16 high, T low) { return ((( int32)high) << sizeof(high)*8) | uint16(low); }
|
|
173 template<class T> int64 __PAIR__( int32 high, T low) { return ((( int64)high) << sizeof(high)*8) | uint32(low); }
|
|
174 template<class T> uint16 __PAIR__(uint8 high, T low) { return (((uint16)high) << sizeof(high)*8) | uint8(low); }
|
|
175 template<class T> uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high)*8) | uint16(low); }
|
|
176 template<class T> uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high)*8) | uint32(low); }
|
|
177
|
|
178 // rotate left
|
|
179 template<class T> T __ROL__(T value, uint count)
|
|
180 {
|
|
181 const uint nbits = sizeof(T) * 8;
|
|
182 count %= nbits;
|
|
183
|
|
184 T high = value >> (nbits - count);
|
|
185 value <<= count;
|
|
186 value |= high;
|
|
187 return value;
|
|
188 }
|
|
189
|
|
190 // rotate right
|
|
191 template<class T> T __ROR__(T value, uint count)
|
|
192 {
|
|
193 const uint nbits = sizeof(T) * 8;
|
|
194 count %= nbits;
|
|
195
|
|
196 T low = value << (nbits - count);
|
|
197 value >>= count;
|
|
198 value |= low;
|
|
199 return value;
|
|
200 }
|
|
201
|
|
202 // carry flag of left shift
|
|
203 template<class T> int8 __MKCSHL__(T value, uint count)
|
|
204 {
|
|
205 const uint nbits = sizeof(T) * 8;
|
|
206 count %= nbits;
|
|
207
|
|
208 return (value >> (nbits-count)) & 1;
|
|
209 }
|
|
210
|
|
211 // carry flag of right shift
|
|
212 template<class T> int8 __MKCSHR__(T value, uint count)
|
|
213 {
|
|
214 return (value >> (count-1)) & 1;
|
|
215 }
|
|
216
|
|
217 // sign flag
|
|
218 template<class T> int8 __SETS__(T x)
|
|
219 {
|
|
220 if ( sizeof(T) == 1 )
|
|
221 return int8(x) < 0;
|
|
222 if ( sizeof(T) == 2 )
|
|
223 return int16(x) < 0;
|
|
224 if ( sizeof(T) == 4 )
|
|
225 return int32(x) < 0;
|
|
226 return int64(x) < 0;
|
|
227 }
|
|
228
|
|
229 // overflow flag of subtraction (x-y)
|
|
230 template<class T, class U> int8 __OFSUB__(T x, U y)
|
|
231 {
|
|
232 if ( sizeof(T) < sizeof(U) )
|
|
233 {
|
|
234 U x2 = x;
|
|
235 int8 sx = __SETS__(x2);
|
|
236 return (sx ^ __SETS__(y)) & (sx ^ __SETS__(x2-y));
|
|
237 }
|
|
238 else
|
|
239 {
|
|
240 T y2 = y;
|
|
241 int8 sx = __SETS__(x);
|
|
242 return (sx ^ __SETS__(y2)) & (sx ^ __SETS__(x-y2));
|
|
243 }
|
|
244 }
|
|
245
|
|
246 // overflow flag of addition (x+y)
|
|
247 template<class T, class U> int8 __OFADD__(T x, U y)
|
|
248 {
|
|
249 if ( sizeof(T) < sizeof(U) )
|
|
250 {
|
|
251 U x2 = x;
|
|
252 int8 sx = __SETS__(x2);
|
|
253 return ((1 ^ sx) ^ __SETS__(y)) & (sx ^ __SETS__(x2+y));
|
|
254 }
|
|
255 else
|
|
256 {
|
|
257 T y2 = y;
|
|
258 int8 sx = __SETS__(x);
|
|
259 return ((1 ^ sx) ^ __SETS__(y2)) & (sx ^ __SETS__(x+y2));
|
|
260 }
|
|
261 }
|
|
262
|
|
263 // carry flag of subtraction (x-y)
|
|
264 template<class T, class U> int8 __CFSUB__(T x, U y)
|
|
265 {
|
|
266 int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U);
|
|
267 if ( size == 1 )
|
|
268 return uint8(x) < uint8(y);
|
|
269 if ( size == 2 )
|
|
270 return uint16(x) < uint16(y);
|
|
271 if ( size == 4 )
|
|
272 return uint32(x) < uint32(y);
|
|
273 return uint64(x) < uint64(y);
|
|
274 }
|
|
275
|
|
276 // carry flag of addition (x+y)
|
|
277 template<class T, class U> int8 __CFADD__(T x, U y)
|
|
278 {
|
|
279 int size = sizeof(T) > sizeof(U) ? sizeof(T) : sizeof(U);
|
|
280 if ( size == 1 )
|
|
281 return uint8(x) > uint8(x+y);
|
|
282 if ( size == 2 )
|
|
283 return uint16(x) > uint16(x+y);
|
|
284 if ( size == 4 )
|
|
285 return uint32(x) > uint32(x+y);
|
|
286 return uint64(x) > uint64(x+y);
|
|
287 }
|
|
288
|
|
289
|
|
290 //-------------------------------------------------------------------------
|
|
291 // Data declarations
|
|
292
|
|
293 extern int game_starting_year;
|
|
294 extern unsigned int game_viewport_width;
|
|
295 extern unsigned int game_viewport_height;
|
|
296 extern int game_viewport_x;
|
|
297 extern int game_viewport_y;
|
|
298 extern int game_viewport_z;
|
|
299 extern int game_viewport_w;
|
|
300
|
|
301 extern int pWindowList_at_506F50_minus1_indexing[1];
|
|
302 extern int dword_4C9890[10]; // weak
|
|
303 extern int dword_4C9920[16]; // weak
|
|
304 extern char byte_4D864C; // weak
|
|
305 extern float flt_4D86CC; // weak
|
|
306 extern int dword_4D86D8; // weak
|
|
307
|
|
308
|
|
309 extern float flt_4D84E8;
|
|
310
|
|
311 extern int pCurrentScreen; // 004E28F8
|
|
312 extern unsigned int uGammaPos;
|
|
313 extern std::array<int, 8> BtnTurnCoord;
|
|
314 extern std::array<__int16, 4> RightClickPortraitXmin;
|
|
315 extern std::array<__int16, 4> RightClickPortraitXmax;
|
|
316 //extern int pArmorSkills[5];
|
|
317 //extern int pWeaponSkills[9];
|
|
318 //extern int pMiscSkills[12];
|
|
319 //extern int pMagicSkills[9];
|
|
320 extern std::array<unsigned int, 4> pHealthBarPos;
|
|
321 extern std::array<unsigned int, 4> pManaBarPos;
|
|
322 //extern std::array<char, 80> _4E2B21_buff_spell_tooltip_colors;
|
|
323 extern std::array<char, 88> monster_popup_y_offsets; // weak
|
|
324 extern unsigned char hourglass_icon_idx; // weak
|
|
325
|
|
326
|
|
327 extern const char *format_4E2D80;
|
|
328 extern char format_4E2D90[8];
|
|
329 extern const char *format_4E2DE8; // idb
|
|
330 extern const char *Stat_string_format_2_column_text;
|
|
331 extern const char *Stat_string_format_2_column_less_100; // format text of resistance in Stats screen
|
|
332 extern const char *Stat_string_format_2_column_over_100;
|
|
333 extern int dword_4E455C; // weak
|
|
334 extern std::array<int, 6> dword_4E4560;
|
|
335 extern std::array<int, 6> dword_4E4578;
|
|
336 extern std::array<int, 6> dword_4E4590;
|
|
337 extern std::array<int, 6> dword_4E45A8;
|
|
338 extern std::array<float, 10> flt_4E4A80;
|
|
339
|
|
340 extern std::array< std::array<int, 2>, 14> pPartySpellbuffsUI_XYs;
|
|
341 extern std::array<unsigned char, 14> byte_4E5DD8; // weak
|
|
342 extern std::array<unsigned __int8, 14> pPartySpellbuffsUI_smthns;
|
|
343 extern std::array< std::array<int, 6>, 6> pNPCPortraits_x; // 004E5E50
|
|
344 extern std::array< std::array<int, 6>, 6> pNPCPortraits_y; // 004E5EE0
|
|
345 extern std::array<const char *, 11> pHouse_ExitPictures;
|
|
346 extern std::array<const char *, 11> _4E6BDC_loc_names;
|
|
347 extern std::array<__int16, 11> word_4E8152;
|
|
348 extern std::array< std::array<char, 14>, 7> byte_4E8168;
|
|
349 extern char _4E94D0_light_type; // weak
|
|
350 extern char _4E94D2_light_type; // weak
|
|
351 extern char _4E94D3_light_type; // weak
|
|
352 extern std::array<unsigned int, 2> saveload_dlg_xs;
|
|
353 extern std::array<unsigned int, 2> saveload_dlg_ys;
|
|
354 extern std::array<unsigned int, 2> saveload_dlg_zs;
|
|
355 extern std::array<unsigned int, 2> saveload_dlg_ws;
|
|
356 extern int dword_4E98BC_bApplicationActive; // weak
|
|
357 extern std::array<char*, 465> pTransitionStrings; // 4EB080
|
|
358 extern std::array<int, 9> dword_4EC268; // weak
|
|
359 extern std::array<int, 7> dword_4EC28C; // weak
|
|
360 extern std::array<const char*, 25> pPlayerPortraitsNames;
|
|
361
|
|
362 extern std::array< std::array<unsigned char, 25>, 48> byte_4ECF08;
|
|
363 extern std::array<std::array<unsigned char, 8>, 110> SoundSetAction; // weak
|
|
364 extern std::array<__int16, 4> pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
|
|
365 extern std::array< std::array<char, 37>, 36> byte_4ED970_skill_learn_ability_by_class_table;
|
|
366 extern std::array<unsigned int, 2> pHiredNPCsIconsOffsetsX;
|
|
367 extern std::array<unsigned int, 2> pHiredNPCsIconsOffsetsY;
|
|
368 extern std::array<int, 2> Party_Spec_Motion_status_ids; //dword_4EE07C
|
|
369 extern std::array<__int16, 101> word_4EE088_sound_ids; // weak
|
|
370 extern std::array<short, 28> word_4EE150;
|
|
371 extern int ScreenshotFileNumber; // dword_4EFA80
|
|
372 extern std::array<const char *, 19> off_4F03B8; // idb
|
|
373 extern __int16 word_4F0576[]; // weak
|
|
374
|
|
375 extern std::array<int, 32> guild_mambership_flags;
|
|
376 extern std::array<__int16, 49> word_4F0754;
|
|
377 extern std::array<__int16, 54> _4F0882_evt_VAR_PlayerItemInHands_vals;
|
|
378 extern std::array<unsigned short, 6> pMaxLevelPerTrainingHallType;
|
|
379 extern std::array<int, 11> price_for_membership; // weak
|
|
380 extern std::array<__int16, 32> word_4F0F30; // weak
|
|
381 extern std::array<int, 500> ai_array_4F5E68;
|
|
382 extern std::array<int, 500> ai_array_4F6638_actor_ids;
|
|
383 extern std::array<int, 500> ai_near_actors_targets_pid;
|
|
384 extern int ai_arrays_size; // weak
|
|
385 extern std::array<int, 500> ai_near_actors_distances;
|
|
386 extern std::array<unsigned int, 500> ai_near_actors_ids;
|
|
387 extern std::array<int, 182> dword_4F8580; // weak
|
|
388 extern int dword_4FA9B0[]; // weak
|
|
389 extern int dword_4FA9B4[]; // weak
|
|
390
|
|
391 extern char byte_4FAA24; // weak
|
|
392 //extern HWND dword_4FAA28; // idb
|
|
393
|
|
394 extern std::array<unsigned int, 480> pSRZBufferLineOffsets;
|
|
395 extern int areWeLoadingTexture; // weak
|
|
396 extern std::array<char, 777> books_num_items_per_page; // weak
|
|
397 extern int lloyds_beacon_spell_id; // dword_506338
|
|
398 extern int lloyds_beacon_sound_id; // dword_50633C
|
|
399 extern signed int sRecoveryTime; // idb
|
|
400 extern unsigned int uRequiredMana; // idb
|
|
401 extern int _506348_current_lloyd_playerid; // weak
|
|
402 extern __int64 lloyds_beacon_spell_level; // qword_506350
|
|
403 extern char byte_506360; // weak
|
|
404 extern int dword_506364; // weak
|
|
405 //extern Texture *dword_50640C[]; // weak
|
|
406 extern unsigned int uExitCancelTextureId;
|
|
407 extern int books_page_number; // number for page in books(íîìåð ñòðàíèöû â êíèãàõ)
|
|
408 extern int books_primary_item_per_page; // number primary item in book page(íîìåð íà÷àëüíîé çàïèñè íà ñòðàíèöå)
|
|
409 extern int Autonotes_Instructors_page_flag; // dword_50652C
|
|
410 extern int Autonotes_Misc_page_flag; //dword_506530
|
|
411 extern int Book_PageBtn6_flag; //dword_506534
|
|
412 extern int Book_PageBtn5_flag; //dword_506538
|
|
413 extern int Book_PageBtn4_flag; //dword_50653C
|
|
414 extern int Book_PageBtn3_flag; //dword_506540
|
|
415 extern int BtnDown_flag; //BtnDown_flag
|
|
416 extern int BtnUp_flag; //BtnUp_flag
|
|
417 extern int quick_spell_at_page; // weak
|
|
418 extern char byte_506550; // weak
|
|
419 extern std::array<const char *, 5> aMoonPhaseNames;
|
|
420 extern int _506568_autonote_type; // 506568
|
|
421 extern char bRecallingBeacon; // weak
|
|
422 extern int uLastPointedObjectID; // weak
|
|
423 //extern unsigned __int8 bMonsterInfoUI_bDollInitialized;
|
|
424 extern std::array<const char *, 44> aSpellNames;
|
|
425 extern int pMainScreenNum; // weak
|
|
426 extern int dword_506980_uW; // weak
|
|
427 extern int dword_506984_uZ; // weak
|
|
428 extern int dword_506988_uY; // weak
|
|
429 extern int dword_50698C_uX; // weak
|
|
430 extern int uGameMenuUI_CurentlySelectedKeyIdx; // 506E68
|
|
431 extern std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C
|
|
432 extern std::array<unsigned int, 28> pPrevVirtualCidesMapping;
|
|
433 extern int KeyboardPageNum; // weak
|
|
434 extern int uRestUI_FoodRequiredToRest;
|
|
435 extern int dword_506F14; // weak
|
|
436 extern int _506F18_num_minutes_to_sleep; // weak
|
|
437 extern int dword_506F1C; // weak
|
|
438 extern std::array<int, 20> pVisibleWindowsIdxs; // weak
|
|
439 extern int uNumVisibleWindows;
|
|
440 extern char bFlashHistoryBook; // weak
|
|
441 extern char bFlashAutonotesBook; // weak
|
|
442 extern char bFlashQuestBook; // weak
|
|
443 extern int uTextureID_PlayerBuff_PainReflection; // weak
|
|
444 extern int uTextureID_PlayerBuff_Hammerhands; // weak
|
|
445 extern int uTextureID_PlayerBuff_Preservation; // weak
|
|
446 extern int uTextureID_PlayerBuff_Bless; // weak
|
|
447 extern int uTextureID_Btn_QuickReference; // weak
|
|
448 extern int uTextureID_Compas; // dword_5079B4
|
|
449 extern int dword_5079C8; // weak
|
|
450 extern int dword_5079CC; // weak
|
|
451 extern int dword_5079D0; // weak
|
|
452 extern int uTextureID_Minimap_Loop; // dword_5079D8
|
|
453 extern struct GUIButton *pBtn_ZoomOut; // idb
|
|
454 extern struct GUIButton *pBtn_ZoomIn; // idb
|
|
455 extern unsigned int uGameUIFontShadow;
|
|
456 extern unsigned int uGameUIFontMain;
|
|
457 extern int dword_507B00_spell_info_to_draw_in_popup; // weak
|
|
458 extern std::array<const char *, 12> aMonthNames;
|
|
459 extern std::array<const char *, 7> aDayNames;
|
|
460 extern std::array<const char *, 9> aSpellSchoolNames;
|
|
461 extern std::array<const char *, 7> aAttributeNames;
|
|
462 extern unsigned int uActiveCharacter;
|
|
463 extern int dword_507BF0_is_there_popup_onscreen; // weak
|
|
464 extern int awards_scroll_bar_created; // weak
|
|
465 extern int dword_507CC0_activ_ch; // weak
|
|
466 extern __int64 GameUI_RightPanel_BookFlashTimer; // weak
|
|
467 extern int _507CD4_RestUI_hourglass_anim_controller; // weak
|
|
468 extern bool OpenedTelekinesis; // weak
|
|
469 extern std::array<int, 50> dword_50B570; // weak
|
|
470 extern std::array<int, 50> dword_50B638; // weak
|
|
471 extern struct stru367 PortalFace;
|
|
472 extern std::array<int, 100> dword_50BC10; // weak
|
|
473 extern std::array<int, 100> dword_50BDA0; // weak
|
|
474 extern std::array<int, 100> _50BF30_actors_in_viewport_ids; // weak
|
|
475 extern char town_portal_caster_id; // weak
|
|
476 extern int some_active_character; // weak
|
|
477 extern std::array<unsigned int, 5> pIconIDs_Turn;
|
|
478 extern unsigned int uIconID_TurnStop;
|
|
479 extern unsigned int uIconID_TurnHour;
|
|
480 extern int uIconID_CharacterFrame; // idb
|
|
481 extern unsigned int uIconID_TurnStart;
|
|
482 extern int dword_50C994; // weak
|
|
483 extern int dword_50C998_turnbased_icon_1A; // weak
|
|
484 extern int uSpriteID_Spell11; // idb
|
|
485 extern bool _50C9A0_IsEnchantingInProgress; // weak
|
|
486 extern int _50C9A8_item_enchantment_timer; // weak
|
|
487 extern int _50C9D0_AfterEnchClickEventId; // weak
|
|
488 extern int _50C9D4_AfterEnchClickEventSecondParam; // weak
|
|
489 extern int _50C9D8_AfterEnchClickEventTimeout; // weak
|
|
490 extern int dword_50C9DC; // weak
|
|
491 extern struct NPCData *ptr_50C9E0;
|
|
492 //extern int dword_50C9E8; // idb
|
|
493 //extern int dword_50C9EC[]; // 50C9EC
|
|
494 extern int dword_50CDC8;
|
|
495 extern Vec3_int_ layingitem_vel_50FDFC;
|
|
496 extern char pStartingMapName[32]; // idb
|
|
497 extern std::array<unsigned __int8, 5> IsPlayerWearingWatersuit;
|
|
498 extern std::array<char, 54> party_has_equipment;
|
|
499 extern std::array<char, 17> byte_5111F6_OwnedArtifacts;
|
|
500 extern std::array<unsigned int, 16> papredoll_dbrds;
|
|
501
|
|
502 extern int bRingsShownInCharScreen; // weak
|
|
503
|
|
504 extern unsigned int uNumBlueFacesInBLVMinimap;
|
|
505 extern std::array<unsigned __int16, 50> pBlueFacesInBLVMinimapIDs;
|
|
506 extern std::array<int, 14> pTextureIDs_PartyBuffIcons;
|
|
507 extern unsigned int uIconIdx_FlySpell;
|
|
508 extern unsigned int uIconIdx_WaterWalk;
|
|
509 extern int dword_576E28; // weak
|
|
510 extern int _576E2C_current_minimap_zoom; // weak
|
|
511 extern __int64 _5773B8_event_timer; // weak
|
|
512
|
|
513 extern int dword_591084; // weak
|
|
514 extern struct Actor *pDialogue_SpeakingActor;
|
|
515 extern unsigned int uDialogueType;
|
|
516 extern signed int sDialogue_SpeakingActorNPC_ID;
|
|
517 extern struct LevelDecoration *_591094_decoration;
|
|
518 extern std::array<char, 200> sHouseName; // idb
|
|
519 extern int uCurrentHouse_Animation; // weak
|
|
520 extern char *dword_591164_teleport_map_name; // idb
|
|
521 extern int dword_591168_teleport_speedz; // weak
|
|
522 extern int dword_59116C_teleport_directionx; // weak
|
|
523 extern int dword_591170_teleport_directiony; // weak
|
|
524 extern int dword_591174_teleportz; // weak
|
|
525 extern int dword_591178_teleporty; // weak
|
|
526 extern int dword_59117C_teleportx; // weak
|
|
527 extern std::array<std::array<char, 100>, 6> byte_591180; // idb
|
|
528 extern std::array<struct NPCData *, 7> HouseNPCData; //0this array size temporarily increased to 60 from 6 to work aroud house overflow
|
|
529 extern GUIButton* HouseNPCPortraitsButtonsList[6];
|
|
530 extern struct Texture *pTexture_591428;
|
|
531 extern struct Texture *pTexture_outside; // idb
|
|
532 extern struct Texture *pTexture_Dialogue_Background;
|
|
533 extern std::array<char, 2000> byte_5B0938;
|
|
534 extern int EvtTargetObj; // weak
|
|
535 extern int _unused_5B5924_is_travel_ui_drawn; // 005B5924
|
|
536 extern int _5B65A8_npcdata_uflags_or_other; // weak
|
|
537 extern int _5B65AC_npcdata_fame_or_other; // weak
|
|
538 extern int _5B65B0_npcdata_rep_or_other; // weak
|
|
539 extern int _5B65B4_npcdata_loword_house_or_other; // weak
|
|
540 extern int _5B65B8_npcdata_hiword_house_or_other; // weak
|
|
541 extern int dword_5B65BC; // weak
|
|
542 extern int dword_5B65C0; // weak
|
|
543 extern int dword_5B65C4_cancelEventProcessing; // weak
|
|
544 extern int MapsLongTimers_count; // dword_5B65C8
|
|
545 extern int npcIdToDismissAfterDialogue; // weak
|
|
546 extern int dword_5B65D0_dialogue_actor_npc_id; // weak
|
|
547 extern int dword_5C3418; // weak
|
|
548 extern int dword_5C341C; // weak
|
|
549 //extern std::array<char, 777> byte_5C3427; // weak
|
|
550 extern std::array<char, 200> GameUI_Footer_TimedString;
|
|
551 extern std::array<char, 200> pFooterString;
|
|
552 extern unsigned int GameUI_Footer_TimeLeft;
|
|
553 extern int bForceDrawFooter; // weak
|
|
554 extern int _5C35C0_force_party_death; // weak
|
|
555 extern int bDialogueUI_InitializeActor_NPC_ID; // weak
|
|
556 extern char *p2DEventsTXT_Raw;
|
|
557
|
|
558 extern int dword_5C35D4; // weak
|
|
559 extern std::array<const char *, 2> aAMPMNames;
|
|
560 extern char byte_5C45AF[]; // weak
|
|
561 extern std::array<char, 10000> pTmpBuf3;
|
|
562 extern std::array<char, 4096> pFinalMessage; // idb
|
|
563 extern std::array<char, 2000> pTmpBuf;
|
|
564 extern std::array<char, 2000> pTmpBuf2;
|
|
565 extern std::array<char, 100> Journal_limitation_factor; // weak
|
|
566 extern int ui_current_text_color; // weak
|
|
567 extern __int64 qword_5C6DF0; // weak
|
|
568 extern int dword_5C6DF8; // weak
|
|
569 extern std::array<char, 104> item__getname_buffer; // idb
|
|
570 extern std::array<char *, 36> pClassDescriptions;
|
|
571 extern std::array<char *, 7> pAttributeDescriptions;
|
|
572 extern std::array<char *, 38> pGrandSkillDesc;
|
|
573 extern std::array<char *, 38> pMasterSkillDesc;
|
|
574 extern std::array<char *, 38> pExpertSkillDesc;
|
|
575 extern std::array<char *, 38> pNormalSkillDesc;
|
|
576 extern std::array<char *, 38> pSkillDesc;
|
|
577 extern char *pHealthPointsAttributeDescription;
|
|
578 extern char *pSpellPointsAttributeDescription;
|
|
579 extern char *pArmourClassAttributeDescription;
|
|
580 extern char *pPlayerConditionAttributeDescription; // idb
|
|
581 extern char *pFastSpellAttributeDescription;
|
|
582 extern char *pPlayerAgeAttributeDescription;
|
|
583 extern char *pPlayerLevelAttributeDescription;
|
|
584 extern char *pPlayerExperienceAttributeDescription;
|
|
585 extern char *pAttackBonusAttributeDescription;
|
|
586 extern char *pAttackDamageAttributeDescription;
|
|
587 extern char *pMissleBonusAttributeDescription;
|
|
588 extern char *pMissleDamageAttributeDescription;
|
|
589 extern char *pFireResistanceAttributeDescription;
|
|
590 extern char *pAirResistanceAttributeDescription;
|
|
591 extern char *pWaterResistanceAttributeDescription;
|
|
592 extern char *pEarthResistanceAttributeDescription;
|
|
593 extern char *pMindResistanceAttributeDescription;
|
|
594 extern char *pBodyResistanceAttributeDescription;
|
|
595 extern char *pSkillPointsAttributeDescription;
|
|
596 extern char *pClassTXT_Raw;
|
|
597 extern char *pStatsTXT_Raw;
|
|
598 extern char *pSkillDescTXT_Raw;
|
|
599 extern struct FactionTable *pFactionTable;
|
|
600 //extern std::array<char, 777> byte_5C8D1A; // weak
|
|
601
|
|
602 extern std::array<char, 777> byte_5E4C15; // weak
|
|
603 extern std::array<const char *, 14> pSomeItemsNames;
|
|
604
|
|
605 extern char *pMonstersTXT_Raw;
|
|
606 extern char *pMonsterPlacementTXT_Raw;
|
|
607 extern char *pSpellsTXT_Raw;
|
|
608 extern char *pMapStatsTXT_Raw;
|
|
609 extern char *pHostileTXT_Raw;
|
|
610 extern char *pPotionsTXT_Raw;
|
|
611 extern char *pPotionNotesTXT_Raw;
|
|
612
|
|
613 extern std::array<int, 777> _6807B8_level_decorations_ids; // idb
|
|
614 extern int _6807E0_num_decorations_with_sounds_6807B8; // weak
|
|
615 extern std::array<int, 3000> event_triggers; // 6807E8
|
|
616 extern size_t num_event_triggers; // 6836C8
|
|
617 extern std::array<int, 64> dword_69B010;
|
|
618 extern float flt_69B138_dist; // weak
|
|
619 extern char byte_69BD41_unused; // weak
|
|
620 extern unsigned int uTextureID_x_u;
|
|
621 extern unsigned int uTextureID_LS_saveU;
|
|
622 extern unsigned int uTextureID_LS_loadU;
|
|
623 extern unsigned int uTextureID_AR_DN_DN;
|
|
624 extern unsigned int uTextureID_AR_UP_DN;
|
|
625 extern unsigned int uTextureID_LS_;
|
|
626 extern unsigned int uTextureID_x_d;
|
|
627 extern unsigned int uTextureID_save_up;
|
|
628 extern unsigned int uTextureID_load_up;
|
|
629 extern unsigned int uTextureID_loadsave;
|
|
630 extern int pSaveListPosition; // weak
|
|
631 extern unsigned int uLoadGameUI_SelectedSlot;
|
|
632 extern HWND hInsertCDWindow; // idb
|
|
633 extern char cMM7GameCDDriveLetter; // idb
|
|
634 extern enum MENU_STATE sCurrentMenuID;
|
|
635 extern unsigned int uGameState;
|
|
636 extern int uDefaultTravelTime_ByFoot; // weak
|
|
637 extern int day_attrib; // weak
|
|
638 extern int day_fogrange_1; // weak
|
|
639 extern int day_fogrange_2; // weak
|
|
640 extern struct TileTable *pTileTable; // idb
|
|
641 extern int outdoor_grid_band_1; // idb
|
|
642 extern int outdoor_grid_band_2; // idb
|
|
643 extern int outdoor_grid_band_3; // idb
|
|
644 extern std::array<char, 777> pDefaultSkyTexture; // idb
|
|
645 extern std::array<char, 16> byte_6BE124_cfg_textures_DefaultGroundTexture; // idb
|
|
646 extern int _6BE134_odm_main_tile_group; // weak
|
|
647 extern int dword_6BE138; // weak
|
|
648 extern int dword_6BE13C_uCurrentlyLoadedLocationID; // weak
|
|
649 extern float fWalkSpeedMultiplier; // weak
|
|
650 extern float fBackwardWalkSpeedMultiplier; // weak
|
|
651 extern float fTurnSpeedMultiplier; // weak
|
|
652 extern float flt_6BE150_look_up_down_dangle; // weak
|
|
653 //extern char pMM7WindowClassName[]; // idb
|
|
654 //extern HINSTANCE hInstance; // idb
|
|
655 //extern char *pCmdLine;
|
|
656 //extern HWND hWnd; // idb
|
|
657 extern char pCurrentMapName[32]; // idb
|
|
658 extern unsigned int uLevelMapStatsID;
|
|
659
|
|
660 extern bool FORCE_16_BITS; // related to GAME_SETTINGS_INVALID_RESOLUTION
|
|
661 #define GAME_SETTINGS_0001 0x0001
|
|
662 #define GAME_SETTINGS_INVALID_RESOLUTION 0x0002
|
|
663 #define GAME_SETTINGS_NO_INTRO 0x0004
|
|
664 #define GAME_SETTINGS_NO_LOGO 0x0008
|
|
665 #define GAME_SETTINGS_NO_SOUND 0x0010
|
|
666 #define GAME_SETTINGS_NO_WALK_SOUND 0x0020
|
|
667 #define GAME_SETTINGS_NO_HOUSE_ANIM 0x0040
|
|
668 #define GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME 0x0080
|
|
669 #define GAME_SETTINGS_APP_INACTIVE 0x0100
|
|
670 #define GAME_SETTINGS_0200_EVENT_TIMER 0x0200
|
|
671 #define GAME_SETTINGS_0400_MISC_TIMER 0x0400
|
|
672 #define GAME_SETTINGS_0800 0x0800
|
|
673 #define GAME_SETTINGS_1000 0x1000
|
|
674 #define GAME_SETTINGS_2000 0x2000
|
|
675 #define GAME_SETTINGS_4000 0x4000
|
|
676 extern int dword_6BE364_game_settings_1; // GAME_SETTINGS_*
|
|
677
|
|
678 #define DEBUG_SETTINGS_RUN_IN_WIDOW 0x0001
|
|
679 #define DEBUG_SETTINGS_0002_SHOW_FR 0x0002
|
|
680 #define DEBUG_SETTINGS_NO_ACTORS 0x0004
|
|
681 #define DEBUG_SETTINGS_NO_DECORATIONS 0x0008
|
|
682 #define DEBUG_SETTINGS_NO_DAMAGE 0x0010
|
|
683 extern int dword_6BE368_debug_settings_2; // DEBUG_SETTINGS_*
|
|
684
|
|
685 extern unsigned __int8 bCanLoadFromCD;
|
|
686 extern int bShowDamage; // idb
|
|
687 extern unsigned int bAlwaysRun;
|
|
688 extern unsigned int bFlipOnExit;
|
|
689 extern unsigned int uTurnSpeed;
|
|
690 extern float flt_6BE3A0; // weak
|
|
691 extern float flt_6BE3A4_debug_recmod1;
|
|
692 extern float flt_6BE3A8_debug_recmod2;
|
|
693 extern float flt_6BE3AC_debug_recmod1_x_1_6;
|
|
694 extern std::array<char, 20> byte_6BE3B0; // idb
|
|
695 extern char bUnderwater; // weak
|
|
696 extern char bNoNPCHiring; // weak
|
|
697 extern unsigned int bNoVideo;
|
|
698 extern bool bNoIntro;
|
|
699 extern bool bNoLogo;
|
|
700 extern bool bNoCD;
|
|
701 extern bool bNoSound;
|
|
702 extern std::array<int, 100> dword_720020_zvalues;
|
|
703 extern std::array<int, 299> dword_7201B0_zvalues;
|
|
704 extern int uTextureID_720980; // weak
|
|
705 extern std::array<__int16, 104> word_7209A0_intercepts_ys_plus_ys;
|
|
706 extern std::array<__int16, 104> word_720A70_intercepts_xs_plus_xs;
|
|
707 extern std::array<__int16, 104> word_720B40_intercepts_zs;
|
|
708 extern std::array<__int16, 102> word_720C10_intercepts_xs;
|
|
709 extern std::array<__int16, 777> word_720CE0_ys; // idb
|
|
710 extern std::array<__int16, 777> word_720DB0_xs; // idb
|
|
711 extern std::array<int, 20> dword_720E80;
|
|
712 extern std::array<int, 20> dword_720ED0;
|
|
713 extern std::array<int, 20> ceiling_height_level;
|
|
714 extern std::array<__int16, 104> odm_floor_face_vert_coord_Y; // word_720F70
|
|
715 extern std::array<__int16, 104> odm_floor_face_vert_coord_X; // word_721040
|
|
716 extern std::array<int, 20> current_Face_id; // dword_721110
|
|
717 extern std::array<int, 20> current_BModel_id; // dword_721160
|
|
718 extern std::array<int, 20> odm_floor_level; // idb dword_7211B0
|
|
719 extern int blv_prev_party_x; // weak
|
|
720 extern int blv_prev_party_z; // weak
|
|
721 extern int blv_prev_party_y; // weak
|
|
722 extern char *dword_722F10; // idb
|
|
723 extern std::array<const char *, 513> pQuestTable;
|
|
724 extern char *dword_723718_autonote_related; // idb
|
|
725 extern std::array<const char *, 82> pScrolls;
|
|
726 extern int dword_7241C8; // weak
|
|
727
|
|
728 extern std::array<const char *, 59> aNPCProfessionNames;
|
|
729 extern char *pAwardsTXT_Raw;
|
|
730 extern char *pScrollsTXT_Raw;
|
|
731 extern char *pMerchantsTXT_Raw;
|
|
732 extern std::array<const char *, 7> pMerchantsBuyPhrases;
|
|
733 extern std::array<const char *, 7> pMerchantsSellPhrases;
|
|
734 extern std::array<const char *, 7> pMerchantsRepairPhrases;
|
|
735 extern std::array<const char *, 7> pMerchantsIdentifyPhrases;
|
|
736 extern char *pTransitionsTXT_Raw;
|
|
737 extern char *pAutonoteTXT_Raw;
|
|
738 extern char *pQuestsTXT_Raw;
|
|
739 extern unsigned int uNumTerrainNormals;
|
|
740 extern struct Vec3_float_ *pTerrainNormals;
|
|
741 extern std::array<unsigned short, 128 * 128 * 2> pTerrainNormalIndices;
|
|
742 extern std::array<unsigned int, 128 * 128 * 2> pTerrainSomeOtherData;
|
|
743 extern int dword_A74C88; // weak
|
|
744 extern unsigned int uPlayerCreationUI_SkySliderPos;
|
|
745 extern int uPlayerCreationUI_ArrowAnim;
|
|
746 extern unsigned int uPlayerCreationUI_SelectedCharacter;
|
|
747 extern int dword_A74CDC; // weak
|
|
748 extern struct Texture *pTexture_PlayerFaceMask;
|
|
749 extern struct Texture *pTexture_PlayerFaceEradicated;
|
|
750 extern struct Texture *pTexture_PlayerFaceDead;
|
|
751 extern std::array< std::array<struct Texture *, 56>, 4> pTextures_PlayerFaces;
|
|
752 extern __int64 _A750D8_player_speech_timer; // qword_A750D8
|
|
753 extern enum PlayerSpeech PlayerSpeechID;
|
|
754 extern int uSpeakingCharacter; // weak
|
|
755 extern std::array<const char *, 36> pClassNames;
|
|
756 extern std::array<const char *, 19> aCharacterConditionNames;
|
|
757 extern std::array<const char *, 38> pSkillNames;
|
|
758 extern char byte_AE5B91; // weak
|
|
759 extern std::array<int, 32> dword_F1B430; // weak
|
|
760 extern std::array<int, 4> player_levels;
|
|
761 extern std::array<__int16, 6> weapons_Ypos; // word_F8B158
|
|
762 extern struct Texture *ShopTexture; // idb
|
|
763 extern std::array<struct Texture *, 12> ItemsInShopTexture;
|
|
764 extern __int16 bountyHunting_monster_id_for_hunting; // weak
|
|
765 extern const char *bountyHunting_text; // idb
|
|
766 extern int contract_approved; // weak
|
|
767 extern int dword_F8B1AC_award_bit_number; // idb
|
|
768 extern int dword_F8B1B0_MasteryBeingTaught; // weak
|
|
769 extern int gold_transaction_amount; // F8B1B4
|
|
770 extern std::array<char *, 4> pShopOptions;
|
|
771 extern int dword_F8B1D8; // weak
|
|
772 extern int dword_F8B1E0; // weak
|
|
773 extern int dword_F8B1E4; // weak
|
|
774 extern const char *current_npc_text; // 0xF8B1E8
|
|
775 extern char dialogue_show_profession_details; // weak
|
|
776 extern std::array<char, 777> byte_F8B1EF; // weak
|
|
777 extern std::array<char, 4> byte_F8B1F0;
|
|
778
|
|
779 extern int bGameoverLoop; // weak
|
|
780 extern std::array<__int16, 104> intersect_face_vertex_coords_list_a; // word_F8BC48
|
|
781 extern std::array<__int16, 104> intersect_face_vertex_coords_list_b; // word_F8BD18
|
|
782 extern bool wizard_eye;
|
|
783 extern bool change_seasons;
|
|
784 extern bool all_magic;
|
|
785 extern bool debug_information;
|
|
786 extern bool show_picked_face;
|
|
787 extern bool draw_portals_loops;
|
|
788 extern bool new_speed;
|
|
789 extern bool bSnow;
|
|
790 extern bool draw_terrain_dist_mist;
|