2152
|
1 #pragma once
|
|
2
|
|
3
|
|
4
|
|
5 //-------------------------------------------------------------------------
|
|
6 // Function declarations
|
|
7 void constructors();
|
|
8
|
|
9 void init_event_triggers();
|
|
10 void check_event_triggers();
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15 void ShowIntroVideo_and_LoadingScreen();
|
|
16 unsigned int GameOverMenu(void *ecx0);
|
|
17 int __fastcall SpawnRandomTreasure(struct MapInfo *a1, struct SpawnPointMM7 *a2);
|
|
18 void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, struct Vec3_int_ *pVelocity);
|
|
19
|
|
20 void MakeActorAIList_ODM();
|
|
21 int MakeActorAIList_BLV();
|
|
22 void UpdateActorAI();
|
|
23 bool __fastcall sub_4070EF_prolly_detect_player(unsigned int uObjID, unsigned int uObj2ID);
|
|
24 bool __fastcall sub_4075DB(int a1, int a2, int a3, struct BLVFace *face);
|
|
25 bool __fastcall sub_4077F1(int a1, int a2, int a3, struct ODMFace *face, struct BSPVertexBuffer *a5);
|
|
26 bool __fastcall sub_407A1C(int x, int z, int y, struct Vec3_int_ v); // idb
|
|
27 void InitializeActors();
|
|
28 void InitializeSpriteObjects();
|
|
29 int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6);
|
|
30 unsigned int SearchAliveActors(unsigned int *pTotalActors);
|
|
31 unsigned int SearchActorByMonsterID(unsigned int *pTotalActors, int uMonsterID);
|
|
32 unsigned int SearchActorByGroup(unsigned int *pTotalActors, unsigned int uGroup);
|
|
33 unsigned int SearchActorByID(unsigned int *pTotalActors, unsigned int a2);
|
|
34 void PrepareArcomage();
|
|
35 void DoBlt_Copy(unsigned __int16 *pPixels); // idb
|
|
36 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue);
|
|
37 void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue);
|
|
38 void __fastcall ZBuffer_DoFill2(int *pZBuffer, struct Texture *a2, int a3); // idb
|
|
39 void SetMoonPhaseNames();
|
|
40 int __fastcall sub_410D99_get_map_index(int a1);
|
|
41 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer);
|
|
42 void SetAttributeNames();
|
|
43 void uGameUIFontMain_initialize();
|
|
44 void uGameUIFontShadow_initialize();
|
|
45 void Inventory_ItemPopupAndAlchemy();
|
|
46 void UI_OnMouseRightClick(struct Vec2_int_ *_this);
|
|
47 void UI_OnMouseLeftClick(int *pXY); // idb
|
|
48 unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos);
|
|
49 unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels);
|
|
50 struct GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey); // idb
|
|
51 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall);
|
|
52 void DrawBuff_remaining_time_string(int uY, struct GUIWindow *window, __int64 remaining_time, struct GUIFont *Font);
|
|
53 bool UI_OnKeyDown(unsigned int vkKey);
|
|
54 void GameUI_DrawItemInfo(struct ItemGen* inspect_item); // idb
|
|
55 void MonsterPopup_Draw(unsigned int uActorID, struct GUIWindow *window);
|
|
56 void LoadActualSkyFrame();
|
|
57 void Sleep6Hours();
|
|
58 void ChestUI_WritePointedObjectStatusString();
|
|
59 void OnChestLeftClick();
|
|
60 void GameUI_WritePointedObjectStatusString();
|
|
61 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID); // idb
|
|
62 void OnGameViewportClick();
|
|
63 bool PauseGameDrawing();
|
|
64 void SetUserInterface(enum PartyAlignment alignment, bool bReplace);
|
|
65 void reset_some_strus_flt_2Cs();
|
|
66 int __fastcall GetPortalScreenCoord(unsigned int uFaceID);
|
|
67 bool PortalFrustrum(int pNumVertices, struct BspRenderer_PortalViewportData *a2, struct BspRenderer_PortalViewportData *near_portal, int uFaceID);
|
|
68 int ODM_NearClip(unsigned int uVertexID); // idb
|
|
69 int ODM_FarClip(unsigned int uNumVertices);
|
|
70 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID);
|
|
71 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6);
|
|
72 void _42ECB5_PlayerAttacksActor();
|
|
73 void InitializeTurnBasedAnimations(void *);
|
|
74 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9);
|
|
75 void __fastcall sub_42F960_create_object(int x, int y, int z); // idb
|
|
76 void CompactLayingItemsList();
|
|
77 void _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6);
|
|
78 void sub_42FBDD();
|
|
79 void CloseWindowBackground();
|
|
80 void ProcessInputActions();
|
|
81 void GameUI_MsgProc();
|
|
82 void back_to_game();
|
|
83 void GUI_MainMenuMessageProc();
|
|
84 double get_shading_dist_mist();
|
|
85 void area_of_effect__damage_evaluate();
|
|
86 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, struct Vec3_int_ *pPos, signed int a4);
|
|
87 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2); // idb
|
|
88 double __fastcall sub_43AE12(signed int a1);
|
|
89 int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4);
|
|
90 void ItemDamageFromActor(unsigned int uObjID, unsigned int uActorID, struct Vec3_int_ *pVelocity);
|
|
91 void ActorDamageFromMonster(signed int attacker_id, unsigned int actor_id, struct Vec3_int_ *pVelocity, signed int a4);
|
|
92 void CharacterUI_LoadPaperdollTextures();
|
|
93 int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder);
|
|
94 bool IsDwarfPresentInParty(bool b);
|
|
95 bool ShouldLoadTexturesForRaceAndGender(unsigned int _this);
|
|
96 void WetsuitOn(unsigned int uPlayerID); // idb
|
|
97 void WetsuitOff(unsigned int uPlayerID);
|
|
98 void __fastcall PrepareDrawLists_BLV();
|
|
99 void FindBillboardsLightLevels_BLV();
|
|
100 int __fastcall _43F55F_get_billboard_light_level(struct RenderBillboard *a1, int uBaseLightLevel);
|
|
101 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z);
|
|
102 void PrepareBspRenderList_BLV();
|
|
103 void PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID);
|
|
104 void PrepareActorRenderList_BLV();
|
|
105 void PrepareItemsRenderList_BLV();
|
|
106 void AddBspNodeToRenderList(unsigned int node_id);
|
|
107 void __fastcall sub_4406BC(unsigned int node_id, unsigned int uFirstNode); // idb
|
|
108 bool sub_44100D();
|
|
109 __int16 __fastcall sub_441A4E(int a1);
|
|
110 void DrawBook_Map_sub(unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074); // idb
|
|
111 void Initialize2DA();
|
|
112 void LoadLevel_InitializeLevelStr();
|
|
113 void OnMapLeave();
|
|
114 void OnMapLoad();
|
|
115 void Level_LoadEvtAndStr(const char *pLevelName);
|
|
116 const char *GetMapBookHintText();//sub_444564
|
|
117 char *GetEventHintString(unsigned int uEventID); // idb
|
|
118 int GetTravelTime();
|
|
119 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4);
|
|
120 unsigned int SkillToMastery(unsigned int skill_value);
|
|
121 unsigned int __fastcall GetSpellColor(signed int a1);
|
|
122 unsigned short * MakeScreenshot(signed int width, signed int height);
|
|
123 void SaveScreenshot(const char *pFilename);
|
|
124 void __fastcall LoadGame(unsigned int uSlot); // idb
|
|
125 void SaveGame(bool IsAutoSAve, bool NotSaveWorld);
|
|
126 void __fastcall DoSavegame(unsigned int uSlot); // idb
|
|
127 bool Initialize_GamesLOD_NewLOD();
|
|
128 void SaveNewGame();
|
|
129 void PrepareToLoadBLV(unsigned int bLoading);
|
|
130 void __fastcall PrepareToLoadODM(unsigned int bLoading, struct ODMRenderParams *a2);
|
|
131 void _461103_load_level_sub();
|
|
132 void MainMenu_Loop();
|
|
133 char sub_4637E0_is_there_popup_onscreen();
|
|
134 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
|
|
135 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen);
|
|
136 void Game_DeinitializeAndTerminate(int exitCode); // idb
|
|
137 void FinalInitialization();
|
|
138 char Is_out15odm_underwater();
|
|
139 void SetUnderwaterFog();
|
|
140 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box);
|
|
141 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue); // idb
|
|
142 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString);
|
|
143 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue);
|
|
144 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val);
|
|
145 bool __fastcall CheckMM7CD(char c);
|
|
146 void SecondaryInitialization();
|
|
147 void CreateAsyncMouse();
|
|
148 void CreateAsyncKeyboard();
|
|
149 void MM6_Initialize(const wchar_t *pIniFilename);
|
|
150 void MM7Initialization();
|
|
151 void SetCurrentMenuID(enum MENU_STATE); // idb
|
|
152 enum MENU_STATE GetCurrentMenuID();
|
|
153 void CreateMsgScrollWindow(signed int mscroll_id);
|
|
154 void free_book_subwindow();
|
|
155 void CreateScrollWindow();
|
|
156 void OnPaperdollLeftClick();
|
|
157 void OnPressSpace();
|
|
158 char __fastcall DoInteractionWithTopmostZObject(int a1, int a2);
|
|
159 void OracleDialogue();
|
|
160 void __fastcall ClickNPCTopic(signed int uMessageParam);
|
|
161 char * _4B254D_SkillMasteryTeacher(int _this);
|
|
162 const char *ContractSelectText(int pEventCode);
|
|
163 void SimpleHouseDialog();
|
|
164 void CreateButtonInColumn(int a1, unsigned int a2);
|
|
165 void FillAviableSkillsToTeach(int _this);
|
|
166 void sub_4B3E1E();
|
|
167 void DrawJoinGuildWindow(int pEventCode);
|
|
168 void __fastcall _4B3FE5_training_dialogue(int a4);
|
|
169 void NPCHireableDialogPrepare();
|
|
170 void _4B4224_UpdateNPCTopics(int _this);
|
|
171 void __fastcall DrawTextAtStatusBar(const char *Str, int a5);
|
|
172 __int64 GetExperienceRequiredForLevel(int a1);
|
|
173 void CheckBountyRespawnAndAward();
|
|
174 void Arena_SelectionFightLevel();
|
|
175 void ArenaFight();
|
|
176 void SpellBookGenerator();
|
|
177 void UI_CreateEndConversationButton();
|
|
178 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam);
|
|
179 int HouseDialogPressCloseBtn();
|
|
180 bool MerchandiseTest(ItemGen *item, int _2da_idx);
|
|
181 void UIShop_Buy_Identify_Repair();
|
|
182 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused);
|
|
183 void ODM_LoadAndInitialize(const char *pLevelFilename, struct ODMRenderParams *thisa);
|
|
184 unsigned int GetLevelFogColor();
|
|
185 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3);
|
|
186 int __fastcall GetActorTintColor(int max_dim, int min_dim, float distance, int a4, struct RenderBillboard *a5);
|
|
187 unsigned int WorldPosToGridCellX(int); // weak
|
|
188 unsigned int WorldPosToGridCellZ(int); // weak
|
|
189 int GridCellToWorldPosX(int); // weak
|
|
190 int GridCellToWorldPosZ(int); // weak
|
|
191 void sub_481ED9_MessWithODMRenderParams();
|
|
192 bool IsTerrainSlopeTooHigh(int pos_x, int pos_y);
|
|
193 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4);
|
|
194 void sub_487DA9();
|
|
195 double GetFogDensityByTime(struct OutdoorLocation *_this);
|
|
196 bool __fastcall HSV2RGB(float *a1, float *a2, float *a3, float a4, float a5, float a6);
|
|
197 void __fastcall RGB2HSV(float *a1, float *a2, float a3, float a4, float a5, float *a6);
|
|
198 signed int ReplaceHSV(unsigned int uColor, float a2, float gamma, float a4);
|
|
199 bool PlayerCreation_Choose4Skills();
|
|
200 int PlayerCreation_GetUnspentAttributePointCount();
|
|
201 void LoadPlayerPortraintsAndVoices();
|
|
202 void ReloadPlayerPortraits(int player_id, int face_id);
|
|
203 void sub_491E3A();
|
|
204 int CycleCharacter(bool backwards);
|
|
205 void __fastcall Rest(unsigned int uHoursToSleep);
|
|
206 void _493938_regenerate();
|
|
207 void init_summoned_item(struct stru351_summoned_item *_this, __int64 duration);
|
|
208 void _494035_timed_effects__water_walking_damage__etc();
|
|
209 unsigned int __fastcall _494820_training_time(unsigned int a1);
|
|
210 char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2);
|
|
211 const char *GetReputationString(signed int a1);
|
|
212 char *BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, struct ItemGen *a3, char *a4, int a5, __int64 *a6);
|
|
213 void PlayerCreationUI_Draw();
|
|
214 void PlayerCreationUI_Initialize();
|
|
215 void DeleteCCharFont();
|
|
216 bool PlayerCreationUI_Loop();
|
|
217 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim);
|
|
218 bool CheckTextureStages();
|
|
219 bool AreRenderSurfacesOk();
|
|
220 struct SoundHeader *FindSound_BinSearch(unsigned int uStart, unsigned int uEnd, const char *pName);
|
|
221 struct SoundData *LoadSound(const char *pSoundName, struct SoundData *pOutBuff, unsigned int uID);
|
|
222 int __fastcall sub_4AAEA6_transform(struct RenderVertexSoft *a1);
|
|
223 int __fastcall sub_4AB66C(int, int); // weak
|
|
224 int GetSoundStrengthByDistanceFromParty(int x, int y, int z);
|
|
225 struct _DIG_DRIVER *Audio_GetFirstHardwareDigitalDriver(void);
|
|
226 void PlayLevelMusic();
|
|
227 unsigned int __fastcall sub_4B0E07(unsigned int uFaceID); // idb
|
|
228 void sub_4B1447_party_fine(int a1, int a2, int a3);
|
|
229 void sub_4B1523(int *_this);
|
|
230 void ShowPopupShopItem();
|
|
231 void RestAndHeal(__int64 uNumMinutes); // idb
|
|
232 void GetHouseGoodbyeSpeech();
|
|
233 int __fastcall _46A6AC_spell_render(int a1, int a2, int a3);
|
|
234 int __fastcall _46A6AC_spell_render_d3d(int a1, int a2, int a3);
|
|
235 int __fastcall _46A89E_immolation_effect(int a1, int a2, int a3);
|
|
236 int sub_46A99B();
|
|
237 unsigned int GetGravityStrength();
|
|
238 void UpdateUserInput_and_MapSpecificStuff();
|
|
239 void BLV_UpdateUserInputAndOther();
|
|
240 void ODM_UpdateUserInputAndOther();
|
|
241 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2);
|
|
242 int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID);
|
|
243 int ODM_GetFloorLevel(int X, signed int Y, int Z, int, int *pOnWater, int *bmodel_pid, int bWaterWalk);
|
|
244 int GetCeilingHeight(int Party_X, signed int Party_Y, int Party_ZHeight, int pFaceID);
|
|
245 void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out);
|
|
246 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID);
|
|
247 void _46E0B2_collide_against_decorations();
|
|
248 void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2);
|
|
249 int _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb
|
|
250 int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0);
|
|
251 int collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
|
|
252 void __fastcall _46ED8A_collide_against_sprite_objects(unsigned int _this);
|
|
253 int _46EF01_collision_chech_player(int a1); // idb
|
|
254 int _46F04E_collide_against_portals();
|
|
255 void BLV_UpdateDoors();
|
|
256 void UpdateActors_BLV();
|
|
257 void UpdateActors_ODM();
|
|
258 void UpdateObjects();
|
|
259 int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
|
|
260 void BLV_ProcessPartyActions();
|
|
261 void ODM_ProcessPartyActions();
|
|
262 bool sub_47531C(int a1, int *a2, int pos_x, int pos_y, int pos_z, int dir_x, int dir_y, int dir_z, struct BLVFace *face, int a10);
|
|
263 bool sub_4754BF(int a1, int *a2, int X, int Y, int Z, int dir_x, int dir_y, int dir_z, struct BLVFace *face, int a10, int a11);
|
|
264 int sub_475665(struct BLVFace *face, int a2, __int16 a3);
|
|
265 bool __fastcall sub_4759C9(struct BLVFace *face, int a2, int a3, __int16 a4);
|
|
266 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, struct BLVFace *a4);
|
|
267 bool __fastcall sub_475F30(int *a1, struct BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
|
|
268 void sub_4452BB();
|
|
269 const char *GetProfessionActionText(int a1);
|
|
270 struct NPCData *__fastcall GetNPCData(signed int npcid);
|
|
271 struct NPCData * GetNewNPCData(signed int npcid, int* npc_indx);
|
|
272 int __fastcall GetGreetType(signed int SpeakingNPC_ID);
|
|
273 void DialogueEnding();
|
|
274 void PrepareHouse(enum HOUSE_ID house); // idb
|
|
275 bool EnterHouse(enum HOUSE_ID uHouseID);
|
|
276 bool sub_4465DF_check_season(int a1);
|
|
277 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive); // idb
|
|
278 int NPC_EventProcessor(int npc_event_id, int entry_line = 0);
|
|
279 void __fastcall sub_448518_npc_set_item(int npc, unsigned int item, int a3);
|
|
280 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename);
|
|
281 void __fastcall SetDecorationSprite(uint16_t uCog, bool bHide, const char *pFileName); // idb
|
|
282 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on);
|
|
283 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle);
|
|
284 void GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide); // idb
|
|
285 void OnTimer(int);
|
|
286 void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName);
|
|
287 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz);//sub_448DF8
|
|
288 void Door_switch_animation(unsigned int uDoorID, int a2); // idb: sub_449A49
|
|
289 bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2);
|
|
290 void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb
|
|
291 void ShowStatusBarString(const char *pString, unsigned int uNumSeconds);
|
|
292 void ShowNothingHereStatus();
|
|
293 int const_2();
|
|
294 bool TeleportToNWCDungeon();
|
|
295 void SpawnEncounter(struct MapInfo *pMapInfo, struct SpawnPointMM7 *spawn, int a3, int a4, int a5);
|
|
296 int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3);
|
|
297 int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6);
|
|
298 int __fastcall _45063B_spawn_some_monster(struct MapInfo *a1, int a2);
|
|
299 void RespawnGlobalDecorations();
|
|
300 bool __fastcall SpawnActor(unsigned int uMonsterID);
|
|
301 int GetAlertStatus();
|
|
302 int integer_sqrt(int val);
|
|
303 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb
|
|
304 inline int round_to_int(float x) { return (int)floor(x + 0.5f); }
|
|
305 inline void __fastcall memset32(void *ptr, unsigned __int32 value, int count)
|
|
306 {
|
|
307 unsigned __int32* p = (unsigned __int32 *)ptr;
|
|
308 for ( int i=0; i < count; i++ )
|
|
309 *p++ = value;
|
|
310 }
|
|
311
|
|
312
|
|
313 namespace zlib
|
|
314 {
|
|
315 int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen);
|
|
316 int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen);
|
|
317 }; |