diff --git a/game/game.vcxproj b/game/game.vcxproj index 37d7e030c..e7b4f559c 100644 --- a/game/game.vcxproj +++ b/game/game.vcxproj @@ -702,6 +702,7 @@ copy /b $(ProjectDir)source\config\version.cpp +,, $(ProjectDir)source\config\ve + @@ -1419,6 +1420,7 @@ copy /b $(ProjectDir)source\config\version.cpp +,, $(ProjectDir)source\config\ve + diff --git a/game/game.vcxproj.filters b/game/game.vcxproj.filters index 41ea24aaf..c8b8a4967 100644 --- a/game/game.vcxproj.filters +++ b/game/game.vcxproj.filters @@ -1581,6 +1581,9 @@ Source Files + + Source Files + @@ -3728,6 +3731,9 @@ Header Files + + Header Files + diff --git a/game/source/ai/ai.cpp b/game/source/ai/ai.cpp index a4ddb8f79..82fc5c93a 100644 --- a/game/source/ai/ai.cpp +++ b/game/source/ai/ai.cpp @@ -10,9 +10,22 @@ //.text:01431360 ; //.text:014313B0 ; double __cdecl ai_danger_level(short) //.text:014314C0 ; -//.text:014314D0 ; void __cdecl ai_dispose() -//.text:01431500 ; void __cdecl ai_dispose_from_old_map() -//.text:01431570 ; void __cdecl ai_dispose_from_old_structure_bsp(dword) + +void __cdecl ai_dispose() +{ + INVOKE(0x014314D0, ai_dispose); +} + +void __cdecl ai_dispose_from_old_map() +{ + INVOKE(0x01431500, ai_dispose_from_old_map); +} + +void __cdecl ai_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x01431570, ai_dispose_from_old_structure_bsp, structure_bsp_mask); +} + //.text:01431670 ; bool __cdecl ai_enemies_attacking_players(long*, dword*) bool __cdecl ai_enemies_can_see_player(long* out_unit_index) @@ -117,9 +130,22 @@ void __cdecl ai_handle_bump(long object_index, long bump_object_index, vector3d //.text:01433E70 ; //.text:01433E80 ; //.text:01433E90 ; -//.text:01433EA0 ; void __cdecl ai_initialize() -//.text:01433F70 ; void __cdecl ai_initialize_for_new_map() -//.text:01434010 ; void __cdecl ai_initialize_for_new_structure_bsp(dword) + +void __cdecl ai_initialize() +{ + INVOKE(0x01433EA0, ai_initialize); +} + +void __cdecl ai_initialize_for_new_map() +{ + INVOKE(0x01433F70, ai_initialize_for_new_map); +} + +void __cdecl ai_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x01434010, ai_initialize_for_new_structure_bsp, structure_bsp_mask); +} + //.text:01434150 ; void __cdecl ai_initialize_for_saved_game(long) //.text:01434180 ; void __cdecl ai_place(long) //.text:014341B0 ; long __cdecl ai_release_inactive_squads(long, byte*, long, bool*, char*, long) diff --git a/game/source/ai/ai.hpp b/game/source/ai/ai.hpp index c3d831292..04f832a05 100644 --- a/game/source/ai/ai.hpp +++ b/game/source/ai/ai.hpp @@ -34,10 +34,16 @@ struct ai_globals_type }; static_assert(sizeof(ai_globals_type) == 0x688); +extern void __cdecl ai_dispose(); +extern void __cdecl ai_dispose_from_old_map(); +extern void __cdecl ai_dispose_from_old_structure_bsp(dword structure_bsp_mask); extern bool __cdecl ai_enemies_can_see_player(long* out_unit_index); extern void __cdecl ai_erase(long squad_index, bool delete_immediately); extern bool __cdecl ai_get_active_clusters(long a1, dword* a2, long a3); extern void __cdecl ai_globals_set_ai_active(bool ai_active); extern void __cdecl ai_handle_bump(long object_index, long bump_object_index, vector3d const* linear_velocity); +extern void __cdecl ai_initialize(); +extern void __cdecl ai_initialize_for_new_map(); +extern void __cdecl ai_initialize_for_new_structure_bsp(dword structure_bsp_mask); extern void __cdecl ai_update(); diff --git a/game/source/cutscene/cinematics.cpp b/game/source/cutscene/cinematics.cpp index de93a09cd..4dcc6e2d3 100644 --- a/game/source/cutscene/cinematics.cpp +++ b/game/source/cutscene/cinematics.cpp @@ -4,16 +4,129 @@ //bool g_cinematic_debugging_enable = false; //bool g_cinematic_render_enable = false; +void __cdecl cinematic_dispose() +{ + INVOKE(0x0067CE30, cinematic_dispose); +} + +void __cdecl cinematic_dispose_from_old_map() +{ + INVOKE(0x0067CE40, cinematic_dispose_from_old_map); +} + +void __cdecl cinematic_dispose_from_old_non_bsp_zone_set(s_game_non_bsp_zone_set const* non_bsp_zone_set) +{ + INVOKE(0x0067CE70, cinematic_dispose_from_old_non_bsp_zone_set, non_bsp_zone_set); +} + +void __cdecl cinematic_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x0067CE80, cinematic_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +//.text:0067CE90 ; + void __cdecl cinematic_game_pause_handler(bool paused) { INVOKE(0x0067CEC0, cinematic_game_pause_handler, paused); } +//.text:0067CF10 ; e_cinematic_channel_type __cdecl cinematic_get_channel_type() +//.text:0067CF60 ; s_cinematic_clip_global const* __cdecl cinematic_get_clip_planes(long*) +//.text:0067CF90 ; cinematic_get_debug_mode +//.text:0067CFA0 ; +//.text:0067CFE0 ; +//.text:0067D0A0 ; long __cdecl cinematic_get_early_exit() +//.text:0067D0C0 ; +//.text:0067D130 ; double __cdecl cinematic_get_letterbox_coverage() +//.text:0067D1C0 ; long __cdecl cinematic_get_scene_index(long, long) +//.text:0067D220 ; +//.text:0067D230 ; +//.text:0067D250 ; + bool __cdecl cinematic_in_progress() { return INVOKE(0x0067D270, cinematic_in_progress); } +void __cdecl cinematic_initialize() +{ + INVOKE(0x0067D2A0, cinematic_initialize); +} + +void __cdecl cinematic_initialize_for_new_map() +{ + INVOKE(0x0067D300, cinematic_initialize_for_new_map); +} + +void __cdecl cinematic_initialize_for_new_non_bsp_zone_set(s_game_non_bsp_zone_set const* non_bsp_zone_set) +{ + INVOKE(0x0067D400, cinematic_initialize_for_new_non_bsp_zone_set, non_bsp_zone_set); +} + +void __cdecl cinematic_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x0067D410, cinematic_initialize_for_new_structure_bsp, structure_bsp_mask); +} + +//.text:0067D420 ; +//.text:0067D480 ; void __cdecl cinematic_move_attached_objects(long, long, long, long) +//.text:0067D550 ; +//.text:0067D620 ; +//.text:0067D750 ; +//.text:0067D820 ; +//.text:0067D950 ; +//.text:0067DA30 ; void __cdecl cinematic_object_destroy_internal(long) +//.text:0067DAB0 ; +//.text:0067DB30 ; +//.text:0067DBC0 ; long __cdecl cinematic_object_try_and_get_by_index(long) +//.text:0067DC40 ; +//.text:0067DC60 ; void __cdecl cinematic_predict_shot(s_cinematic_scene*, long, long, c_tag_resource_collector*) + +void __cdecl cinematic_prepare_for_new_zone_set(dword a1, dword a2) +{ + INVOKE(0x0067DCE0, cinematic_prepare_for_new_zone_set, a1, a2); +} + +void __cdecl cinematic_prepare_for_non_bsp_zone_set_switch(s_game_non_bsp_zone_set const* a1, s_game_non_bsp_zone_set const* a2, c_scenario_resource_registry* resource_registry) +{ + INVOKE(0x0067DCF0, cinematic_prepare_for_non_bsp_zone_set_switch, a1, a2, resource_registry); +} + +//.text:0067DDF0 ; void __cdecl cinematic_print(char const*) +//.text:0067DE00 ; void __cdecl cinematic_render(bool, bool) +//.text:0067E4C0 ; bool __cdecl cinematic_reverts_when_skipped() +//.text:0067E4F0 ; +//.text:0067E590 ; +//.text:0067E5C0 ; +//.text:0067E610 ; +//.text:0067E640 ; void __cdecl cinematic_scripting_suppress_bsp_object_creation(bool) +//.text:0067E660 ; void __cdecl cinematic_set(long) +//.text:0067E680 ; void __cdecl cinematic_set_chud_objective(short) +//.text:0067E700 ; void __cdecl cinematic_set_chud_objective(long, short) +//.text:0067E7B0 ; void __cdecl cinematic_set_debug_mode(bool) +//.text:0067E7C0 ; void __cdecl cinematic_set_early_exit(long) +//.text:0067E7E0 ; void __cdecl cinematic_set_shot(long, long) +//.text:0067E810 ; void __cdecl cinematic_set_title(short) +//.text:0067E830 ; void __cdecl cinematic_set_title_delayed(short, real) +//.text:0067E8B0 ; void __cdecl cinematic_show_letterbox(bool) +//.text:0067E8D0 ; void __cdecl cinematic_show_letterbox_immediate(bool) +//.text:0067E920 ; +//.text:0067E950 ; +//.text:0067E970 ; +//.text:0067E990 ; void __cdecl cinematic_start() +//.text:0067EA10 ; void __cdecl cinematic_start_user_skip_fade_out() +//.text:0067EA60 ; void __cdecl cinematic_stop() +//.text:0067EAD0 ; bool __cdecl cinematic_suppressing_bsp_object_creation() +//.text:0067EAF0 ; long __cdecl cinematic_tag_reference_get_animation(long, long, long) +//.text:0067EB70 ; long __cdecl cinematic_tag_reference_get_bink(long) +//.text:0067EBB0 ; long __cdecl cinematic_tag_reference_get_cinematic(long) +//.text:0067EBD0 ; +//.text:0067EC60 ; long __cdecl cinematic_tag_reference_get_effect(long, long, long, long) +//.text:0067ED00 ; long __cdecl cinematic_tag_reference_get_music(long, long, long, long) +//.text:0067ED90 ; long __cdecl cinematic_tag_reference_get_music_looping(long, long, long, long) +//.text:0067EDA0 ; long __cdecl cinematic_tag_reference_get_scene(long) + void __cdecl cinematic_update() { return INVOKE(0x0067EDF0, cinematic_update); @@ -24,7 +137,19 @@ void __cdecl cinematics_game_tick() return INVOKE(0x0067F080, cinematics_game_tick); } -void __cdecl cinematic_debug_camera_control_update() +//.text:0067F0E0 ; +//.text:0067F140 ; +//.text:0067F160 ; +//.text:0067F170 ; +//.text:0067F1A0 ; +//.text:0067F1D0 ; + +void __cdecl draw_quad(short_rectangle2d* rect, dword color) +{ + return INVOKE(0x0067F200, draw_quad, rect, color); +} + +void cinematic_debug_camera_control_update() { //TLS_DATA_GET_VALUE_REFERENCE(cinematic_new_globals); // @@ -112,8 +237,3 @@ void __cdecl cinematic_debug_camera_control_update() //} } -void __cdecl draw_quad(short_rectangle2d* rect, dword color) -{ - return INVOKE(0x0067F200, draw_quad, rect, color); -} - diff --git a/game/source/cutscene/cinematics.hpp b/game/source/cutscene/cinematics.hpp index a7cef7cf4..deba31647 100644 --- a/game/source/cutscene/cinematics.hpp +++ b/game/source/cutscene/cinematics.hpp @@ -31,10 +31,24 @@ struct s_cinematic_light_globals }; static_assert(sizeof(s_cinematic_light_globals) == 0xB2C8); +struct s_game_non_bsp_zone_set; +struct c_scenario_resource_registry; + +extern void __cdecl cinematic_dispose(); +extern void __cdecl cinematic_dispose_from_old_map(); +extern void __cdecl cinematic_dispose_from_old_non_bsp_zone_set(s_game_non_bsp_zone_set const* non_bsp_zone_set); +extern void __cdecl cinematic_dispose_from_old_structure_bsp(dword structure_bsp_mask); extern void __cdecl cinematic_game_pause_handler(bool paused); extern bool __cdecl cinematic_in_progress(); +extern void __cdecl cinematic_initialize(); +extern void __cdecl cinematic_initialize_for_new_map(); +extern void __cdecl cinematic_initialize_for_new_non_bsp_zone_set(s_game_non_bsp_zone_set const* non_bsp_zone_set); +extern void __cdecl cinematic_initialize_for_new_structure_bsp(dword structure_bsp_mask); +extern void __cdecl cinematic_prepare_for_new_zone_set(dword a1, dword a2); +extern void __cdecl cinematic_prepare_for_non_bsp_zone_set_switch(s_game_non_bsp_zone_set const* a1, s_game_non_bsp_zone_set const* a2, c_scenario_resource_registry* resource_registry); extern void __cdecl cinematic_update(); extern void __cdecl cinematics_game_tick(); -extern void __cdecl cinematic_debug_camera_control_update(); extern void __cdecl draw_quad(short_rectangle2d* rect, dword color); +extern void cinematic_debug_camera_control_update(); + diff --git a/game/source/game/game.cpp b/game/source/game/game.cpp index cc1106438..35579bb1e 100644 --- a/game/source/game/game.cpp +++ b/game/source/game/game.cpp @@ -1,10 +1,12 @@ #include "game/game.hpp" +#include "ai/ai.hpp" #include "cache/cache_files_windows.hpp" #include "config/version.hpp" #include "cseries/async_xoverlapped.hpp" #include "cseries/cseries.hpp" #include "cseries/runtime_state.hpp" +#include "cutscene/cinematics.hpp" #include "cutscene/recorded_animations.hpp" #include "data_mining/data_mine_management.hpp" #include "editor/editor_stubs.hpp" @@ -19,6 +21,7 @@ #include "game/game_grief.hpp" #include "game/player_rumble.hpp" #include "game/player_training.hpp" +#include "game/players.hpp" #include "game/survival_mode.hpp" #include "hs/hs.hpp" #include "interface/chud/chud.hpp" @@ -44,7 +47,9 @@ #include "networking/tools/xbox_connection_manager.hpp" #include "networking/transport/transport.hpp" #include "objects/object_activation_regions.hpp" +#include "objects/object_broadphase.hpp" #include "objects/object_early_movers.hpp" +#include "objects/object_placement.hpp" #include "objects/object_scheduler.hpp" #include "objects/object_scripting.hpp" #include "objects/watch_window.hpp" @@ -52,6 +57,7 @@ #include "physics/breakable_surfaces.hpp" #include "physics/collision_debug.hpp" #include "physics/collision_usage.hpp" +#include "physics/havok.hpp" #include "physics/havok_proxies.hpp" #include "physics/point_physics.hpp" #include "profiler/profiler.hpp" @@ -64,6 +70,7 @@ #include "render/render_visibility.hpp" #include "render/views/hud_camera_view.hpp" #include "render/views/render_player_view.hpp" +#include "render_methods/render_method_submit.hpp" #include "saved_games/autosave_queue.hpp" #include "saved_games/determinism_debug_manager.hpp" #include "saved_games/saved_game_files.hpp" @@ -87,6 +94,7 @@ #include "tag_files/files_windows.hpp" #include "test/test_functions.hpp" #include "visibility/visibility_collection.hpp" +#include "visibility/visibility_portal_activation.hpp" HOOK_DECLARE(0x00530F80, game_finish); HOOK_DECLARE(0x00530CD0, game_dispose); @@ -2272,12 +2280,12 @@ s_game_system const g_game_systems[] }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(game_sound) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D92B0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D86D0, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D93D0, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D8700, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D9570, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D8750, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D92B0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D86D0, dispose), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D93D0, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D8700, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D9570, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(game_sound, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005D8750, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(game_sound_player_effects) @@ -2337,16 +2345,16 @@ s_game_system const g_game_systems[] }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(cinematic) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D2A0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE30, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D300, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE40, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067DCE0, prepare_for_new_zone_set), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D410, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE80, dispose_from_old_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067DCF0, prepare_for_non_bsp_zone_set_switch), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D400, initialize_for_new_non_bsp_zone_set), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE70, dispose_from_old_non_bsp_zone_set), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D2A0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE30, dispose), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D300, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE40, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, prepare_for_new_zone_set), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067DCE0, prepare_for_new_zone_set), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D410, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE80, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, prepare_for_non_bsp_zone_set_switch), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067DCF0, prepare_for_non_bsp_zone_set_switch), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, initialize_for_new_non_bsp_zone_set), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067D400, initialize_for_new_non_bsp_zone_set), + DECLARE_GAME_SYSTEM_MEMBER(cinematic, dispose_from_old_non_bsp_zone_set), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0067CE70, dispose_from_old_non_bsp_zone_set), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(closed_caption) @@ -2397,32 +2405,32 @@ s_game_system const g_game_systems[] }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(object_placement) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59E10, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D10, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59EB0, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D20, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B5A310, prepare_for_new_zone_set), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59FC0, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D30, dispose_from_old_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B5A470, prepare_for_non_bsp_zone_set_switch), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59E10, initialize), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D10, dispose), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59EB0, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D20, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, prepare_for_new_zone_set), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B5A310, prepare_for_new_zone_set), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59FC0, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B59D30, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(object_placement, prepare_for_non_bsp_zone_set_switch), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B5A470, prepare_for_non_bsp_zone_set_switch), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(havok) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5BB0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5550, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5DB0, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C55A0, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5E00, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C55C0, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(havok, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5BB0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(havok, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5550, dispose), + DECLARE_GAME_SYSTEM_MEMBER(havok, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5DB0, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(havok, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C55A0, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(havok, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C5E00, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(havok, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005C55C0, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(object_broadphase) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96EA0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E40, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96F20, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E50, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96F30, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E60, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96EA0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E40, dispose), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96F20, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E50, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96F30, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(object_broadphase, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00B96E60, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(havok_proxies) @@ -2433,30 +2441,30 @@ s_game_system const g_game_systems[] }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(player_positions) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBC0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BB90, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBD0, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBA0, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBE0, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBB0, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBC0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BB90, dispose), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBD0, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBA0, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBE0, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(player_positions, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x0053BBB0, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(ai) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01433EA0, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x014314D0, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01433F70, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01431500, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01434010, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01431570, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(ai, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01433EA0, initialize), + DECLARE_GAME_SYSTEM_MEMBER(ai, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x014314D0, dispose), + DECLARE_GAME_SYSTEM_MEMBER(ai, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01433F70, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(ai, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01431500, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(ai, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01434010, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(ai, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x01431570, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(portal_activation) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9E30, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CA0, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9E90, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CB0, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9EA0, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CC0, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9E30, initialize), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CA0, dispose), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9E90, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CB0, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9EA0, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(portal_activation, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x005F9CC0, dispose_from_old_structure_bsp), }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(scenario_interpolators) @@ -2502,12 +2510,12 @@ s_game_system const g_game_systems[] }, { DECLARE_GAME_SYSTEM_NAME_DEBUG_ONLY(render_state_cache) - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB20, initialize), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DAF0, dispose), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB30, initialize_for_new_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB00, dispose_from_old_map), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB40, initialize_for_new_structure_bsp), - DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB10, dispose_from_old_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, initialize), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB20, initialize), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, dispose), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DAF0, dispose), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, initialize_for_new_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB30, initialize_for_new_map), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, dispose_from_old_map), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB00, dispose_from_old_map), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, initialize_for_new_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB40, initialize_for_new_structure_bsp), + DECLARE_GAME_SYSTEM_MEMBER(render_state_cache, dispose_from_old_structure_bsp), //DECLARE_GAME_SYSTEM_MEMBER_ADDRESS(0x00A3DB10, dispose_from_old_structure_bsp), } }; diff --git a/game/source/game/players.cpp b/game/source/game/players.cpp index 7adf294c4..8d2b510e5 100644 --- a/game/source/game/players.cpp +++ b/game/source/game/players.cpp @@ -371,12 +371,37 @@ long __cdecl player_new(long player_array_index, game_player_options const* opti //.text:0053B8F0 ; void __cdecl player_notify_of_tracking_or_locking(long, long, short) //.text:0053BA10 ; void __cdecl player_notify_vehicle_ejection_finished(long) //.text:0053BA90 ; void __cdecl player_over_shield_screen_effect(long) -//.text:0053BB90 ; void __cdecl player_positions_dispose() -//.text:0053BBA0 ; void __cdecl player_positions_dispose_from_old_map() -//.text:0053BBB0 ; void __cdecl player_positions_dispose_from_old_structure_bsp(dword) -//.text:0053BBC0 ; void __cdecl player_positions_initialize() -//.text:0053BBD0 ; void __cdecl player_positions_initialize_for_new_map() -//.text:0053BBE0 ; void __cdecl player_positions_initialize_for_new_structure_bsp(dword) + +void __cdecl player_positions_dispose() +{ + INVOKE(0x0053BB90, player_positions_dispose); +} + +void __cdecl player_positions_dispose_from_old_map() +{ + INVOKE(0x0053BBA0, player_positions_dispose_from_old_map); +} + +void __cdecl player_positions_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x0053BBB0, player_positions_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +void __cdecl player_positions_initialize() +{ + INVOKE(0x0053BBC0, player_positions_initialize); +} + +void __cdecl player_positions_initialize_for_new_map() +{ + INVOKE(0x0053BBD0, player_positions_initialize_for_new_map); +} + +void __cdecl player_positions_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x0053BBE0, player_positions_initialize_for_new_structure_bsp, structure_bsp_mask); +} + //.text:0053BD90 ; void __cdecl player_prepare_action(long, s_player_action*) //.text:0053BFF0 ; //.text:0053C020 ; void __cdecl player_rejoined_game(long, game_player_options const*, bool) diff --git a/game/source/game/players.hpp b/game/source/game/players.hpp index 8b24863a2..3f607f711 100644 --- a/game/source/game/players.hpp +++ b/game/source/game/players.hpp @@ -818,6 +818,12 @@ extern long __cdecl player_index_from_unit_index(long unit_index); extern bool __cdecl player_interaction_exists(long player_index, dword object_mask, s_player_interaction const* interaction); extern bool __cdecl player_is_reading_terminal(); extern long __cdecl player_new(long player_array_index, game_player_options const* options, bool joined_in_progress); +extern void __cdecl player_positions_dispose(); +extern void __cdecl player_positions_dispose_from_old_map(); +extern void __cdecl player_positions_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl player_positions_initialize(); +extern void __cdecl player_positions_initialize_for_new_map(); +extern void __cdecl player_positions_initialize_for_new_structure_bsp(dword structure_bsp_mask); extern void __cdecl player_set_facing(long player_index, vector3d const* facing); extern void __cdecl player_set_unit_index(long player_index, long unit_index); extern bool __cdecl player_spawn(long player_index, real_point3d const* position, real const* facing); diff --git a/game/source/objects/object_broadphase.cpp b/game/source/objects/object_broadphase.cpp index f6fa72bfa..410a94d68 100644 --- a/game/source/objects/object_broadphase.cpp +++ b/game/source/objects/object_broadphase.cpp @@ -34,12 +34,37 @@ //.text:00B96C40 ; void __cdecl object_broadphase_add_object(long, s_object_cluster_payload const*) //.text:00B96C40 ; void __cdecl object_broadphase_add_object(long) //.text:00B96E00 ; -//.text:00B96E40 ; void __cdecl object_broadphase_dispose() -//.text:00B96E50 ; void __cdecl object_broadphase_dispose_from_old_map() -//.text:00B96E60 ; void __cdecl object_broadphase_dispose_from_old_structure_bsp(dword) -//.text:00B96EA0 ; void __cdecl object_broadphase_initialize() -//.text:00B96F20 ; void __cdecl object_broadphase_initialize_for_new_map() -//.text:00B96F30 ; void __cdecl object_broadphase_initialize_for_new_structure_bsp(dword) + +void __cdecl object_broadphase_dispose() +{ + INVOKE(0x00B96E40, object_broadphase_dispose); +} + +void __cdecl object_broadphase_dispose_from_old_map() +{ + INVOKE(0x00B96E50, object_broadphase_dispose_from_old_map); +} + +void __cdecl object_broadphase_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00B96E60, object_broadphase_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +void __cdecl object_broadphase_initialize() +{ + INVOKE(0x00B96EA0, object_broadphase_initialize); +} + +void __cdecl object_broadphase_initialize_for_new_map() +{ + INVOKE(0x00B96F20, object_broadphase_initialize_for_new_map); +} + +void __cdecl object_broadphase_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00B96F30, object_broadphase_initialize_for_new_structure_bsp, structure_bsp_mask); +} + //.text:00B97420 ; //.text:00B97510 ; bool __cdecl object_broadphase_ray_cast(s_collision_test_flags, dword, real_point3d const*, vector3d const*, long, long, long, collision_result*) //.text:00B97720 ; void __cdecl object_broadphase_remove_object(long) diff --git a/game/source/objects/object_broadphase.hpp b/game/source/objects/object_broadphase.hpp index 04e434cd8..d805a562f 100644 --- a/game/source/objects/object_broadphase.hpp +++ b/game/source/objects/object_broadphase.hpp @@ -8,5 +8,11 @@ struct s_object_broadphase }; static_assert(sizeof(s_object_broadphase) == 0x32450); +extern void __cdecl object_broadphase_dispose(); +extern void __cdecl object_broadphase_dispose_from_old_map(); +extern void __cdecl object_broadphase_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl object_broadphase_initialize(); +extern void __cdecl object_broadphase_initialize_for_new_map(); +extern void __cdecl object_broadphase_initialize_for_new_structure_bsp(dword structure_bsp_mask); extern void __cdecl object_broadphase_update_object(long object_index); diff --git a/game/source/objects/object_placement.cpp b/game/source/objects/object_placement.cpp index df88d3bd6..c42291b8a 100644 --- a/game/source/objects/object_placement.cpp +++ b/game/source/objects/object_placement.cpp @@ -22,13 +22,39 @@ void __cdecl object_placement_create_global_objects(e_game_mode game_mode, bool //.text:00B596C0 ; bool __cdecl object_placement_data_new_from_scenario_object(e_object_type, long, s_scenario_object const*, s_tag_block*, bool, bool, struct object_placement_data*) //.text:00B59CA0 ; void __cdecl object_placement_deactivate_on_zone_set_switch(long) -//.text:00B59D10 ; void __cdecl object_placement_dispose() -//.text:00B59D20 ; void __cdecl object_placement_dispose_from_old_map() -//.text:00B59D30 ; void __cdecl object_placement_dispose_from_old_structure_bsp(dword) + +void __cdecl object_placement_dispose() +{ + INVOKE(0x00B59D10, object_placement_dispose); +} + +void __cdecl object_placement_dispose_from_old_map() +{ + INVOKE(0x00B59D20, object_placement_dispose_from_old_map); +} + +void __cdecl object_placement_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00B59D30, object_placement_dispose_from_old_structure_bsp, structure_bsp_mask); +} + //.text:00B59D40 ; bool __cdecl object_placement_find_initial_location(dword, real_point3d const*, real, s_location*) -//.text:00B59E10 ; void __cdecl object_placement_initialize() -//.text:00B59EB0 ; void __cdecl object_placement_initialize_for_new_map() -//.text:00B59FC0 ; void __cdecl object_placement_initialize_for_new_structure_bsp(dword) + +void __cdecl object_placement_initialize() +{ + INVOKE(0x00B59E10, object_placement_initialize); +} + +void __cdecl object_placement_initialize_for_new_map() +{ + INVOKE(0x00B59EB0, object_placement_initialize_for_new_map); +} + +void __cdecl object_placement_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00B59FC0, object_placement_initialize_for_new_structure_bsp, structure_bsp_mask); +} + //.text:00B5A020 ; bool __cdecl object_placement_inside_structure_bsp(e_object_type, s_scenario_object const*) //.text:00B5A040 ; bool __cdecl object_placement_inside_structure_bsp_mask(dword, e_object_type, s_scenario_object const*) //.text:00B5A100 ; @@ -37,8 +63,17 @@ void __cdecl object_placement_create_global_objects(e_game_mode game_mode, bool //.text:00B5A200 ; void __cdecl object_placement_mark_object_on_delete(long) //.text:00B5A270 ; //.text:00B5A2C0 ; -//.text:00B5A310 ; void __cdecl object_placement_prepare_for_new_zone_set(dword, dword) -//.text:00B5A470 ; void __cdecl object_placement_prepare_for_designer_zone_set_switch(dword, dword, c_scenario_resource_registry*) + +void __cdecl object_placement_prepare_for_new_zone_set(dword a1, dword a2) +{ + INVOKE(0x00B5A310, object_placement_prepare_for_new_zone_set, a1, a2); +} + +void __cdecl object_placement_prepare_for_non_bsp_zone_set_switch(s_game_non_bsp_zone_set const* a1, s_game_non_bsp_zone_set const* a2, c_scenario_resource_registry* resource_registry) +{ + INVOKE(0x00B5A470, object_placement_prepare_for_non_bsp_zone_set_switch, a1, a2, resource_registry); +} + //.text:00B5A4E0 ; //.text:00B5A4F0 ; void __cdecl object_placement_reset_from_teleport(long) //.text:00B5A550 ; void __cdecl object_placement_restore(long) diff --git a/game/source/objects/object_placement.hpp b/game/source/objects/object_placement.hpp index 19aca8916..844c2bf71 100644 --- a/game/source/objects/object_placement.hpp +++ b/game/source/objects/object_placement.hpp @@ -18,7 +18,18 @@ enum e_object_placement_zone_set_create_mode k_object_placement_zone_set_create_mode_count }; +struct s_game_non_bsp_zone_set; +struct c_scenario_resource_registry; + extern bool __cdecl object_definition_can_be_placed(long object_definition_index, long model_variant_index); extern void __cdecl object_placement_create_active_zone_set_objects(e_object_placement_zone_set_create_mode create_mode); extern void __cdecl object_placement_create_global_objects(e_game_mode game_mode, bool a2); +extern void __cdecl object_placement_dispose(); +extern void __cdecl object_placement_dispose_from_old_map(); +extern void __cdecl object_placement_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl object_placement_initialize(); +extern void __cdecl object_placement_initialize_for_new_map(); +extern void __cdecl object_placement_initialize_for_new_structure_bsp(dword structure_bsp_mask); +extern void __cdecl object_placement_prepare_for_new_zone_set(dword a1, dword a2); +extern void __cdecl object_placement_prepare_for_non_bsp_zone_set_switch(s_game_non_bsp_zone_set const* a1, s_game_non_bsp_zone_set const* a2, c_scenario_resource_registry* resource_registry); diff --git a/game/source/physics/havok.cpp b/game/source/physics/havok.cpp index ca688c03e..047e74aee 100644 --- a/game/source/physics/havok.cpp +++ b/game/source/physics/havok.cpp @@ -69,10 +69,23 @@ void __cdecl havok_display_stats_printf(bool display_as_event, real_argb_color c terminal_printf(NULL, "%s", string.get_string()); } -//.text:005C5550 ; void __cdecl havok_dispose() +void __cdecl havok_dispose() +{ + INVOKE(0x005C5550, havok_dispose); +} + //.text:005C5590 ; -//.text:005C55A0 ; void __cdecl havok_dispose_from_old_map() -//.text:005C55C0 ; void __cdecl havok_dispose_from_old_structure_bsp(dword) + +void __cdecl havok_dispose_from_old_map() +{ + INVOKE(0x005C55A0, havok_dispose_from_old_map); +} + +void __cdecl havok_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005C55C0, havok_dispose_from_old_structure_bsp, structure_bsp_mask); +} + //.text:005C55D0 ; void __cdecl havok_dispose_from_old_structure_bsp_internal(dword) //.text:005C5700 ; void __cdecl havok_entity_post_update(hkEntity*) //.text:005C5AB0 ; @@ -84,11 +97,25 @@ void __cdecl havok_display_stats_printf(bool display_as_event, real_argb_color c //.text:005C5B60 ; c_environment_surface_shape const* __cdecl havok_get_environment_surface_shape(long) //.text:005C5B90 ; hkThreadMemory* __cdecl havok_get_render_thread_memory() //.text:005C5BA0 ; hkMonitorStream* __cdecl havok_get_render_thread_monitor_stream() -//.text:005C5BB0 ; void __cdecl havok_initialize() + +void __cdecl havok_initialize() +{ + INVOKE(0x005C5BB0, havok_initialize); +} + //.text:005C5CF0 ; void __cdecl havok_initialize_all_allocated_state(bool) //.text:005C5D40 ; void __cdecl havok_initialize_environment_rigid_bodies() -//.text:005C5DB0 ; void __cdecl havok_initialize_for_new_map() -//.text:005C5E00 ; void __cdecl havok_initialize_for_new_structure_bsp(dword) + +void __cdecl havok_initialize_for_new_map() +{ + INVOKE(0x005C5DB0, havok_initialize_for_new_map); +} + +void __cdecl havok_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005C5E00, havok_initialize_for_new_structure_bsp, structure_bsp_mask); +} + //.text:005C5E10 ; void __cdecl havok_initialize_for_new_structure_bsp_internal(dword) //.text:005C5EF0 ; void __cdecl havok_initialize_havok_world() //.text:005C6240 ; void __cdecl havok_initialize_object_rigid_bodies() diff --git a/game/source/physics/havok.hpp b/game/source/physics/havok.hpp index a31dff02f..a7b207934 100644 --- a/game/source/physics/havok.hpp +++ b/game/source/physics/havok.hpp @@ -135,6 +135,12 @@ extern void __cdecl havok_can_modify_state_allow(); extern void __cdecl havok_can_modify_state_disallow(); extern void __cdecl havok_display_stats(bool display_as_event); extern void __cdecl havok_display_stats_printf(bool display_as_event, real_argb_color const* color, char const* format, ...); +extern void __cdecl havok_dispose(); +extern void __cdecl havok_dispose_from_old_map(); +extern void __cdecl havok_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl havok_initialize(); +extern void __cdecl havok_initialize_for_new_map(); +extern void __cdecl havok_initialize_for_new_structure_bsp(dword structure_bsp_mask); extern void __cdecl havok_object_set_position(long object_index, bool a2, bool a3, bool a4); extern void __cdecl havok_prepare_fpu_for_update(); extern void __cdecl havok_restore_fpu_from_update(); diff --git a/game/source/render_methods/render_method_submit.cpp b/game/source/render_methods/render_method_submit.cpp index aaef85a1d..5ab440962 100644 --- a/game/source/render_methods/render_method_submit.cpp +++ b/game/source/render_methods/render_method_submit.cpp @@ -1,12 +1,41 @@ #include "render_methods/render_method_submit.hpp" -#include "cseries/cseries.hpp" - void __cdecl render_method_submit_invalidate_cache() { INVOKE(0x00A3D090, render_method_submit_invalidate_cache); }; +void __cdecl render_state_cache_dispose() +{ + INVOKE(0x00A3DAF0, render_state_cache_dispose); +} + +void __cdecl render_state_cache_dispose_from_old_map() +{ + INVOKE(0x00A3DB00, render_state_cache_dispose_from_old_map); +} + +void __cdecl render_state_cache_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00A3DB10, render_state_cache_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +void __cdecl render_state_cache_initialize() +{ + INVOKE(0x00A3DB20, render_state_cache_initialize); +} + +void __cdecl render_state_cache_initialize_for_new_map() +{ + INVOKE(0x00A3DB30, render_state_cache_initialize_for_new_map); +} + +void __cdecl render_state_cache_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x00A3DB40, render_state_cache_initialize_for_new_structure_bsp, structure_bsp_mask); +} + + char const* k_render_method_extern_names[k_render_method_extern_count] { "none", diff --git a/game/source/render_methods/render_method_submit.hpp b/game/source/render_methods/render_method_submit.hpp index 2988e6e58..f633deb13 100644 --- a/game/source/render_methods/render_method_submit.hpp +++ b/game/source/render_methods/render_method_submit.hpp @@ -1,5 +1,7 @@ #pragma once +#include "cseries/cseries.hpp" + enum e_render_method_extern { _render_method_extern_none = 0, @@ -60,4 +62,10 @@ enum e_render_method_extern extern char const* k_render_method_extern_names[k_render_method_extern_count]; extern void __cdecl render_method_submit_invalidate_cache(); +extern void __cdecl render_state_cache_dispose(); +extern void __cdecl render_state_cache_dispose_from_old_map(); +extern void __cdecl render_state_cache_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl render_state_cache_initialize(); +extern void __cdecl render_state_cache_initialize_for_new_map(); +extern void __cdecl render_state_cache_initialize_for_new_structure_bsp(dword structure_bsp_mask); diff --git a/game/source/sound/game_sound.cpp b/game/source/sound/game_sound.cpp index e2f38f7c6..1dd19bc58 100644 --- a/game/source/sound/game_sound.cpp +++ b/game/source/sound/game_sound.cpp @@ -1,12 +1,82 @@ #include "sound/game_sound.hpp" +//.text:005D7920 ; long __cdecl game_looping_sound_attachment_new(long, long, long, long) +//.text:005D79D0 ; void __cdecl game_looping_sound_delete(long, long) +//.text:005D7A00 ; +//.text:005D7A40 ; bool __cdecl game_looping_sound_get_source(long, s_sound_source*) +//.text:005D7F00 ; +//.text:005D7F60 ; long __cdecl game_portal_get_door_occluder_index(long, long) +//.text:005D7FA0 ; void __cdecl game_sound_calculate_azimuth_image(s_sound_listener const*, real_point3d const*, structure_bsp*, long, long, real, bool, s_sound_azimuth_image*) +//.text:005D8370 ; void __cdecl game_sound_clear(long) +//.text:005D8410 ; +//.text:005D85D0 ; void __cdecl game_sound_disable_at_game_finish() + +void __cdecl game_sound_dispose() +{ + INVOKE(0x005D86D0, game_sound_dispose); +} + +void __cdecl game_sound_dispose_from_old_map() +{ + INVOKE(0x005D8700, game_sound_dispose_from_old_map); +} + +void __cdecl game_sound_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005D8750, game_sound_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +//.text:005D8760 ; +//.text:005D8770 ; void __cdecl game_sound_fade_in_at_game_begin() +//.text:005D87E0 ; struct s_portal_reference __cdecl game_sound_find_closest_portal(real_point3d const*, s_cluster_reference, real*) +//.text:005D8950 ; +//.text:005D8B90 ; double __cdecl game_sound_get_cluster_distance(s_cluster_reference, s_cluster_reference) +//.text:005D8BD0 ; double __cdecl game_sound_get_door_occlusion(long, long) +//.text:005D8C50 ; +//.text:005D8CA0 ; +//.text:005D8D00 ; void __cdecl game_sound_get_object_velocity(long, vector3d*) +//.text:005D8DA0 ; +//.text:005D8DE0 ; +//.text:005D8E20 ; +//.text:005D8EC0 ; long __cdecl game_sound_impulse_new_internal(long, s_game_sound_impulse_internal_parameters const*) +//.text:005D9110 ; +//.text:005D9120 ; void __cdecl game_sound_scripted_impulses_update() + +void __cdecl game_sound_initialize() +{ + INVOKE(0x005D92B0, game_sound_initialize); +} + +void __cdecl game_sound_initialize_for_new_map() +{ + INVOKE(0x005D93D0, game_sound_initialize_for_new_map); +} + +void __cdecl game_sound_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005D9570, game_sound_initialize_for_new_structure_bsp, structure_bsp_mask); +} + +//.text:005D95F0 ; + void __cdecl game_sound_process_update_messages() { INVOKE(0x005D9630, game_sound_process_update_messages); } +//.text:005D9690 ; +//.text:005D9770 ; void __cdecl game_sound_reset_at_round_finish() +//.text:005D9780 ; void __cdecl game_sound_reset_scripted_dialog_timer() +//.text:005D97A0 ; void __cdecl game_sound_restore(long) +//.text:005D9A60 ; void __cdecl game_sound_set_door_occlusion(long, long, real) +//.text:005D9AE0 ; void __cdecl game_sound_set_lipsync_data(long, long, s_cache_file_sound_permutation const*, real) +//.text:005D9B50 ; + void __cdecl game_sound_update(real game_seconds_elapsed) { INVOKE(0x005D9BA0, game_sound_update, game_seconds_elapsed); } +//.text:005D9F20 ; void __cdecl game_sound_update_background_sound(s_cluster_reference const&, long, real_matrix4x3 const*, long, real, real) +//.text:005DAB20 ; void __cdecl game_sound_update_listeners(real) + diff --git a/game/source/sound/game_sound.hpp b/game/source/sound/game_sound.hpp index a6eb6d8e7..280e7f403 100644 --- a/game/source/sound/game_sound.hpp +++ b/game/source/sound/game_sound.hpp @@ -22,6 +22,12 @@ struct s_game_sound_impulse_datum }; static_assert(sizeof(s_game_sound_impulse_datum) == 0x200); +extern void __cdecl game_sound_dispose(); +extern void __cdecl game_sound_dispose_from_old_map(); +extern void __cdecl game_sound_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl game_sound_initialize(); +extern void __cdecl game_sound_initialize_for_new_map(); +extern void __cdecl game_sound_initialize_for_new_structure_bsp(dword structure_bsp_mask); extern void __cdecl game_sound_process_update_messages(); extern void __cdecl game_sound_update(real game_seconds_elapsed); diff --git a/game/source/visibility/visibility_portal_activation.cpp b/game/source/visibility/visibility_portal_activation.cpp new file mode 100644 index 000000000..07211b844 --- /dev/null +++ b/game/source/visibility/visibility_portal_activation.cpp @@ -0,0 +1,48 @@ +#include "visibility/visibility_portal_activation.hpp" + +//.text:005F9AF0 +//.text:005F9B10 ; +//.text:005F9B20 ; +//.text:005F9B30 ; void __cdecl __tls_set_g_active_portal_bitvectors_allocator(void*) +//.text:005F9B50 ; +//.text:005F9B90 ; +//.text:005F9BB0 ; +//.text:005F9BE0 ; +//.text:005F9C10 ; +//.text:005F9C20 ; void __cdecl portal_activation_clear_portals() +void __cdecl portal_activation_dispose() +{ + INVOKE(0x005F9CA0, portal_activation_dispose); +} + +void __cdecl portal_activation_dispose_from_old_map() +{ + INVOKE(0x005F9CB0, portal_activation_dispose_from_old_map); +} + +void __cdecl portal_activation_dispose_from_old_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005F9CC0, portal_activation_dispose_from_old_structure_bsp, structure_bsp_mask); +} + +//.text:005F9CD0 ; void __cdecl portal_activation_door_portal_search_for_doors() +void __cdecl portal_activation_initialize() +{ + INVOKE(0x005F9E30, portal_activation_initialize); +} + +void __cdecl portal_activation_initialize_for_new_map() +{ + INVOKE(0x005F9E90, portal_activation_initialize_for_new_map); +} + +void __cdecl portal_activation_initialize_for_new_structure_bsp(dword structure_bsp_mask) +{ + INVOKE(0x005F9EA0, portal_activation_initialize_for_new_structure_bsp, structure_bsp_mask); +} + +//.text:005FA040 ; +//.text:005FA090 ; void __cdecl portal_activation_set_portal_active(s_portal_reference, bool) +//.text:005FA0F0 ; void __cdecl portal_activation_update_machine_activity(long) +//.text:005FA130 ; + diff --git a/game/source/visibility/visibility_portal_activation.hpp b/game/source/visibility/visibility_portal_activation.hpp new file mode 100644 index 000000000..30fb8d6eb --- /dev/null +++ b/game/source/visibility/visibility_portal_activation.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include "cseries/cseries.hpp" + +extern void __cdecl portal_activation_dispose(); +extern void __cdecl portal_activation_dispose_from_old_map(); +extern void __cdecl portal_activation_dispose_from_old_structure_bsp(dword structure_bsp_mask); +extern void __cdecl portal_activation_initialize(); +extern void __cdecl portal_activation_initialize_for_new_map(); +extern void __cdecl portal_activation_initialize_for_new_structure_bsp(dword structure_bsp_mask); +