From 8bb1cf2b7c688f194658941e455a5dbcf4848d1a Mon Sep 17 00:00:00 2001 From: theTwister <6237734+twist84@users.noreply.github.com> Date: Fri, 10 Jan 2025 01:51:24 +0000 Subject: [PATCH] Moved `s_datum_header` to `cseries` Updated `c_window_manager` Updated `s_level_globals` Updated `s_object_render_data` Updated `s_havok_proxy_datum ` Mapped `objects_information` (WIP) Updated certain pragma warnings --- .../ai/actor_dynamic_firing_position.hpp | 1 - game/source/ai/ai_dialogue.hpp | 1 - game/source/ai/ai_flocks.hpp | 1 - game/source/ai/cl_engine.hpp | 1 - game/source/ai/formations.hpp | 1 - game/source/ai/joint_behavior.hpp | 1 - game/source/ai/objectives.hpp | 1 - game/source/ai/props.hpp | 1 - game/source/ai/squad_patrol.hpp | 1 - game/source/ai/swarms.hpp | 1 - ...cache_file_tag_resource_location_table.hpp | 1 - game/source/cache/cache_files.hpp | 21 +++----------- game/source/camera/director.hpp | 1 - game/source/camera/observer.hpp | 1 - game/source/cseries/cseries.hpp | 6 ++++ game/source/cutscene/recorded_animations.hpp | 1 - game/source/devices/devices.hpp | 1 - game/source/effects/beams.hpp | 1 - game/source/effects/contrails.hpp | 1 - game/source/effects/decals.hpp | 1 - game/source/effects/effects.hpp | 1 - game/source/effects/light_volumes.hpp | 1 - game/source/effects/particle.hpp | 1 - game/source/effects/particle_emitter.hpp | 1 - game/source/effects/particle_location.hpp | 1 - game/source/effects/particle_system.hpp | 1 - game/source/effects/screen_effect.hpp | 1 - game/source/game/game.hpp | 1 - game/source/game/game_globals.hpp | 1 - game/source/game/player_mapping.hpp | 1 - game/source/gpu_particle/beam_gpu.hpp | 1 - game/source/gpu_particle/contrail_gpu.hpp | 1 - game/source/gpu_particle/light_volume_gpu.hpp | 1 - game/source/gpu_particle/particle_block.hpp | 1 - game/source/hs/hs.cpp | 1 + game/source/hs/hs.hpp | 2 +- game/source/hs/hs_function.hpp | 14 +++------- game/source/hs/hs_runtime.hpp | 1 - game/source/hs/hs_scenario_definitions.hpp | 6 +--- game/source/hs/object_lists.hpp | 2 +- game/source/interface/chud/chud.hpp | 1 - .../user_interface_window_manager.hpp | 28 ++++++++++++++----- game/source/main/levels.cpp | 10 +++---- game/source/main/levels.hpp | 10 ++----- game/source/memory/data.hpp | 6 ---- game/source/memory/hashtable.hpp | 12 ++------ game/source/memory/thread_local.hpp | 2 +- ...etwork_messages_simulation_synchronous.hpp | 5 +--- game/source/networking/tools/network_blf.hpp | 6 +--- game/source/objects/lights.hpp | 1 - .../objects/object_activation_regions.hpp | 1 - game/source/objects/object_recycling.hpp | 1 - game/source/objects/objects.hpp | 27 +++++++++--------- game/source/objects/watch_window.cpp | 1 - game/source/objects/widgets/antenna.hpp | 1 - game/source/objects/widgets/cloth.hpp | 1 - game/source/objects/widgets/leaf_system.hpp | 1 - game/source/objects/widgets/muffins.hpp | 1 - game/source/objects/widgets/widgets.hpp | 1 - game/source/physics/breakable_surfaces.hpp | 1 - game/source/physics/havok_proxies.hpp | 5 ++-- game/source/physics/impacts.hpp | 1 - game/source/physics/ragdolls.hpp | 1 - .../render/render_objects_static_lighting.hpp | 1 - game/source/render/render_shield_cache.hpp | 1 - .../simulation_gamestate_entities.hpp | 1 - game/source/sound/game_sound.hpp | 1 - .../tag_resource_cache_inverse_page_table.hpp | 2 +- 68 files changed, 69 insertions(+), 146 deletions(-) diff --git a/game/source/ai/actor_dynamic_firing_position.hpp b/game/source/ai/actor_dynamic_firing_position.hpp index b184cc1b4..7c15b36cf 100644 --- a/game/source/ai/actor_dynamic_firing_position.hpp +++ b/game/source/ai/actor_dynamic_firing_position.hpp @@ -3,7 +3,6 @@ #include "ai/actors.hpp" #include "ai/sector.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct firing_position_definition { diff --git a/game/source/ai/ai_dialogue.hpp b/game/source/ai/ai_dialogue.hpp index 20a47686d..5c070f4f2 100644 --- a/game/source/ai/ai_dialogue.hpp +++ b/game/source/ai/ai_dialogue.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct vocalization_records : s_datum_header diff --git a/game/source/ai/ai_flocks.hpp b/game/source/ai/ai_flocks.hpp index 1def4c77b..baf732213 100644 --- a/game/source/ai/ai_flocks.hpp +++ b/game/source/ai/ai_flocks.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct flock_datum : s_datum_header diff --git a/game/source/ai/cl_engine.hpp b/game/source/ai/cl_engine.hpp index 9c5675b6d..5a9946829 100644 --- a/game/source/ai/cl_engine.hpp +++ b/game/source/ai/cl_engine.hpp @@ -2,7 +2,6 @@ #include "ai/actors.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" // #TODO: confirm the following enum diff --git a/game/source/ai/formations.hpp b/game/source/ai/formations.hpp index ccc068d58..118959d69 100644 --- a/game/source/ai/formations.hpp +++ b/game/source/ai/formations.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct formation_datum : s_datum_header diff --git a/game/source/ai/joint_behavior.hpp b/game/source/ai/joint_behavior.hpp index e60e7b30d..3ba8c597e 100644 --- a/game/source/ai/joint_behavior.hpp +++ b/game/source/ai/joint_behavior.hpp @@ -4,7 +4,6 @@ #include "ai/ai_actions.hpp" #include "ai/sector.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct invitation_data { diff --git a/game/source/ai/objectives.hpp b/game/source/ai/objectives.hpp index 491beea5c..7988a2591 100644 --- a/game/source/ai/objectives.hpp +++ b/game/source/ai/objectives.hpp @@ -2,7 +2,6 @@ #include "ai/clump.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "tag_files/tag_groups.hpp" struct s_objective_datum : diff --git a/game/source/ai/props.hpp b/game/source/ai/props.hpp index 39430ea0f..0142ea8ac 100644 --- a/game/source/ai/props.hpp +++ b/game/source/ai/props.hpp @@ -2,7 +2,6 @@ #include "ai/joint_behavior.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct prop_ref_datum : s_datum_header diff --git a/game/source/ai/squad_patrol.hpp b/game/source/ai/squad_patrol.hpp index 3fe99a696..748bb73bc 100644 --- a/game/source/ai/squad_patrol.hpp +++ b/game/source/ai/squad_patrol.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct squad_patrol_datum : s_datum_header diff --git a/game/source/ai/swarms.hpp b/game/source/ai/swarms.hpp index b21ee9b7e..9fa7ba994 100644 --- a/game/source/ai/swarms.hpp +++ b/game/source/ai/swarms.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct swarm_datum : s_datum_header diff --git a/game/source/cache/cache_file_tag_resource_location_table.hpp b/game/source/cache/cache_file_tag_resource_location_table.hpp index 3d6697372..a8cc790f0 100644 --- a/game/source/cache/cache_file_tag_resource_location_table.hpp +++ b/game/source/cache/cache_file_tag_resource_location_table.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "tag_files/files_windows.hpp" #include "tag_files/tag_groups.hpp" diff --git a/game/source/cache/cache_files.hpp b/game/source/cache/cache_files.hpp index b94fb77db..942ba72e5 100644 --- a/game/source/cache/cache_files.hpp +++ b/game/source/cache/cache_files.hpp @@ -45,10 +45,7 @@ const long k_cache_file_version = 18; #pragma pack(push, 4) union s_cache_file_header { -#pragma warning(push) -#pragma warning(disable : 4200) - byte base[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte base[]; struct { @@ -147,10 +144,7 @@ static_assert(sizeof(cache_address) == 0x4); union cache_file_tag_instance { -#pragma warning(push) -#pragma warning(disable : 4200) - byte base[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte base[]; struct { @@ -166,11 +160,7 @@ union cache_file_tag_instance s_cache_file_tag_group tag_group; -#pragma warning(push) -#pragma warning(disable : 4200) - dword dependencies[]; -#pragma warning(pop) - + __pragma(warning(disable : 4200)) dword dependencies[]; }; char const* get_name() @@ -232,10 +222,7 @@ static_assert(sizeof(s_cache_file_reports) == 0x8); union s_cache_file_section_header { -#pragma warning(push) -#pragma warning(disable : 4200) - byte base[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte base[]; struct { diff --git a/game/source/camera/director.hpp b/game/source/camera/director.hpp index e1cea1b7f..f74eb3e5b 100644 --- a/game/source/camera/director.hpp +++ b/game/source/camera/director.hpp @@ -9,7 +9,6 @@ #include "camera/observer.hpp" #include "camera/orbiting_camera.hpp" #include "camera/static_camera.hpp" -#include "memory/data.hpp" enum e_director_mode { diff --git a/game/source/camera/observer.hpp b/game/source/camera/observer.hpp index 7731ed1ff..15c9a4912 100644 --- a/game/source/camera/observer.hpp +++ b/game/source/camera/observer.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #define OBSERVER_SIGNATURE 'rad!' diff --git a/game/source/cseries/cseries.hpp b/game/source/cseries/cseries.hpp index 286f4ea7b..07e843a2d 100644 --- a/game/source/cseries/cseries.hpp +++ b/game/source/cseries/cseries.hpp @@ -144,6 +144,12 @@ static_assert(sizeof(real) == 0x4); typedef char utf8; +struct s_datum_header +{ + short identifier; +}; +static_assert(sizeof(s_datum_header) == 0x2); + #define SIZEOF_BITS(value) 8 * sizeof(value) const long CHAR_BYTES = sizeof(char); diff --git a/game/source/cutscene/recorded_animations.hpp b/game/source/cutscene/recorded_animations.hpp index 1d8505f5a..dd89e84bb 100644 --- a/game/source/cutscene/recorded_animations.hpp +++ b/game/source/cutscene/recorded_animations.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "units/units.hpp" struct direction_playback_controller diff --git a/game/source/devices/devices.hpp b/game/source/devices/devices.hpp index 0969710b5..ab7f93776 100644 --- a/game/source/devices/devices.hpp +++ b/game/source/devices/devices.hpp @@ -2,7 +2,6 @@ #include "animations/mixing_board/channels/animation_channel.hpp" #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "objects/objects.hpp" struct device_group_datum : diff --git a/game/source/effects/beams.hpp b/game/source/effects/beams.hpp index 4c0737b94..b61ab2811 100644 --- a/game/source/effects/beams.hpp +++ b/game/source/effects/beams.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" enum e_effect_pass; diff --git a/game/source/effects/contrails.hpp b/game/source/effects/contrails.hpp index b7969c140..e1fcfe38e 100644 --- a/game/source/effects/contrails.hpp +++ b/game/source/effects/contrails.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" enum e_effect_pass; diff --git a/game/source/effects/decals.hpp b/game/source/effects/decals.hpp index d53e7652f..652ef5d20 100644 --- a/game/source/effects/decals.hpp +++ b/game/source/effects/decals.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "multithreading/message_queue.hpp" struct s_game_non_bsp_zone_set; diff --git a/game/source/effects/effects.hpp b/game/source/effects/effects.hpp index 1ddbdd4dd..d0b0dbfef 100644 --- a/game/source/effects/effects.hpp +++ b/game/source/effects/effects.hpp @@ -12,7 +12,6 @@ #include "effects/player_effects.hpp" #include "effects/screen_effect.hpp" #include "effects/vision_mode.hpp" -#include "memory/data.hpp" #include "objects/damage_owner.hpp" #include "objects/damage_reporting.hpp" diff --git a/game/source/effects/light_volumes.hpp b/game/source/effects/light_volumes.hpp index d68bbc2e4..c8417f3d2 100644 --- a/game/source/effects/light_volumes.hpp +++ b/game/source/effects/light_volumes.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" enum e_effect_pass; diff --git a/game/source/effects/particle.hpp b/game/source/effects/particle.hpp index 2683aea55..5024b0fba 100644 --- a/game/source/effects/particle.hpp +++ b/game/source/effects/particle.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_particle : s_datum_header diff --git a/game/source/effects/particle_emitter.hpp b/game/source/effects/particle_emitter.hpp index c52bc48ee..349054c17 100644 --- a/game/source/effects/particle_emitter.hpp +++ b/game/source/effects/particle_emitter.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_particle_emitter : s_datum_header diff --git a/game/source/effects/particle_location.hpp b/game/source/effects/particle_location.hpp index 47a21644a..365569bde 100644 --- a/game/source/effects/particle_location.hpp +++ b/game/source/effects/particle_location.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_particle_location : s_datum_header diff --git a/game/source/effects/particle_system.hpp b/game/source/effects/particle_system.hpp index 6461d4059..14c6965d7 100644 --- a/game/source/effects/particle_system.hpp +++ b/game/source/effects/particle_system.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" enum e_effect_pass; diff --git a/game/source/effects/screen_effect.hpp b/game/source/effects/screen_effect.hpp index 930df32d6..3d1f89bab 100644 --- a/game/source/effects/screen_effect.hpp +++ b/game/source/effects/screen_effect.hpp @@ -2,7 +2,6 @@ #include "cseries/cseries.hpp" #include "math/function_definitions.hpp" -#include "memory/data.hpp" #include "tag_files/tag_groups.hpp" struct s_screen_effect_datum : diff --git a/game/source/game/game.hpp b/game/source/game/game.hpp index 22224a1ea..90ba07b40 100644 --- a/game/source/game/game.hpp +++ b/game/source/game/game.hpp @@ -10,7 +10,6 @@ #include "game/player_mapping.hpp" #include "game/players.hpp" #include "game/survival_mode.hpp" -#include "memory/data.hpp" #include "render/render_visibility_collection.hpp" #include "saved_games/game_state.hpp" #include "shell/shell.hpp" diff --git a/game/source/game/game_globals.hpp b/game/source/game/game_globals.hpp index 704b51702..026f00d18 100644 --- a/game/source/game/game_globals.hpp +++ b/game/source/game/game_globals.hpp @@ -10,7 +10,6 @@ #include "game/materials.hpp" #include "game/materials_definitions.hpp" #include "math/function_definitions.hpp" -#include "memory/data.hpp" #include "render/render_visibility_collection.hpp" #include "sound/sound_definitions.hpp" #include "tag_files/tag_groups.hpp" diff --git a/game/source/game/player_mapping.hpp b/game/source/game/player_mapping.hpp index 1a9cf3c3f..e4b3a1feb 100644 --- a/game/source/game/player_mapping.hpp +++ b/game/source/game/player_mapping.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "shell/shell.hpp" struct s_player_mapping_globals diff --git a/game/source/gpu_particle/beam_gpu.hpp b/game/source/gpu_particle/beam_gpu.hpp index b2f84e99c..426dd6992 100644 --- a/game/source/gpu_particle/beam_gpu.hpp +++ b/game/source/gpu_particle/beam_gpu.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_beam_gpu : s_datum_header diff --git a/game/source/gpu_particle/contrail_gpu.hpp b/game/source/gpu_particle/contrail_gpu.hpp index 8526e94f7..0439bea7a 100644 --- a/game/source/gpu_particle/contrail_gpu.hpp +++ b/game/source/gpu_particle/contrail_gpu.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_contrail_gpu : s_datum_header diff --git a/game/source/gpu_particle/light_volume_gpu.hpp b/game/source/gpu_particle/light_volume_gpu.hpp index 41771c889..76f421b78 100644 --- a/game/source/gpu_particle/light_volume_gpu.hpp +++ b/game/source/gpu_particle/light_volume_gpu.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_light_volume_gpu : s_datum_header diff --git a/game/source/gpu_particle/particle_block.hpp b/game/source/gpu_particle/particle_block.hpp index d54068fa6..f7495e34c 100644 --- a/game/source/gpu_particle/particle_block.hpp +++ b/game/source/gpu_particle/particle_block.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct c_particle_emitter_gpu : s_datum_header diff --git a/game/source/hs/hs.cpp b/game/source/hs/hs.cpp index 92290f71c..fa486f004 100644 --- a/game/source/hs/hs.cpp +++ b/game/source/hs/hs.cpp @@ -9,6 +9,7 @@ #include "hs/hs_globals_external.hpp" #include "hs/hs_runtime.hpp" #include "hs/hs_scenario_definitions.hpp" +#include "memory/data.hpp" #include "objects/objects.hpp" #include "scenario/scenario.hpp" #include "shell/shell.hpp" diff --git a/game/source/hs/hs.hpp b/game/source/hs/hs.hpp index 4022b2033..9b9628599 100644 --- a/game/source/hs/hs.hpp +++ b/game/source/hs/hs.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #define HS_TYPE_IS_TAG_REFERENCE(_hs_type) ((_hs_type) >= _hs_type_effect && (_hs_type) <= _hs_type_bink_definition) #define HS_TYPE_IS_ENUM(_hs_type) ((_hs_type) >= _hs_type_game_difficulty && (_hs_type) <= _hs_type_secondary_skull) @@ -146,6 +145,7 @@ struct hs_function_definition_debug; struct hs_global_external; struct hs_global_external_debug; struct s_tag_block; +struct s_data_array; extern bool const _hs_type_boolean_default; extern real const _hs_type_real_default; diff --git a/game/source/hs/hs_function.hpp b/game/source/hs/hs_function.hpp index 2ce844299..bbec913db 100644 --- a/game/source/hs/hs_function.hpp +++ b/game/source/hs/hs_function.hpp @@ -15,14 +15,11 @@ struct hs_function_definition char const* parameters; short formal_parameter_count; -#pragma warning(push) -#pragma warning(disable : 4200) union { - c_enum formal_parameters_[]; - short formal_parameters[]; + __pragma(warning(disable : 4200)) c_enum formal_parameters_[]; + __pragma(warning(disable : 4200)) short formal_parameters[]; }; -#pragma warning(pop) }; static_assert(sizeof(hs_function_definition) == 0x10); @@ -39,14 +36,11 @@ struct hs_function_definition_debug char const* parameters; short formal_parameter_count; -#pragma warning(push) -#pragma warning(disable : 4200) union { - c_enum formal_parameters_[]; - short formal_parameters[]; + __pragma(warning(disable : 4200)) c_enum formal_parameters_[]; + __pragma(warning(disable : 4200)) short formal_parameters[]; }; -#pragma warning(pop) }; static_assert(sizeof(hs_function_definition_debug) == 0x20); diff --git a/game/source/hs/hs_runtime.hpp b/game/source/hs/hs_runtime.hpp index ff0f14e27..2fc631795 100644 --- a/game/source/hs/hs_runtime.hpp +++ b/game/source/hs/hs_runtime.hpp @@ -2,7 +2,6 @@ #include "cseries/cseries.hpp" #include "hs/hs.hpp" -#include "memory/data.hpp" #include "scenario/scenario_trigger_volumes.hpp" enum e_hs_thread_type diff --git a/game/source/hs/hs_scenario_definitions.hpp b/game/source/hs/hs_scenario_definitions.hpp index c43bddbf1..b2679d2c8 100644 --- a/game/source/hs/hs_scenario_definitions.hpp +++ b/game/source/hs/hs_scenario_definitions.hpp @@ -1,7 +1,6 @@ #pragma once #include "hs/hs.hpp" -#include "memory/data.hpp" #include "tag_files/tag_groups.hpp" struct hs_tag_reference @@ -54,10 +53,7 @@ enum hs_source_file_flags struct hs_string_data_definition { -#pragma warning(push) -#pragma warning(disable : 4200) - byte data[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte data[]; }; enum e_hs_syntax_node_flags diff --git a/game/source/hs/object_lists.hpp b/game/source/hs/object_lists.hpp index 3c7343287..e50c676eb 100644 --- a/game/source/hs/object_lists.hpp +++ b/game/source/hs/object_lists.hpp @@ -1,6 +1,6 @@ #pragma once -#include "memory/data.hpp" +#include "cseries/cseries.hpp" struct object_list_header_datum : s_datum_header diff --git a/game/source/interface/chud/chud.hpp b/game/source/interface/chud/chud.hpp index 6c9273b01..daf793efd 100644 --- a/game/source/interface/chud/chud.hpp +++ b/game/source/interface/chud/chud.hpp @@ -2,7 +2,6 @@ #include "cseries/cseries.hpp" #include "interface/chud/chud_globals_definitions.hpp" -#include "memory/data.hpp" struct chud_widget_datum : s_datum_header diff --git a/game/source/interface/user_interface_window_manager.hpp b/game/source/interface/user_interface_window_manager.hpp index 449bce42b..2009ff076 100644 --- a/game/source/interface/user_interface_window_manager.hpp +++ b/game/source/interface/user_interface_window_manager.hpp @@ -16,15 +16,29 @@ struct s_event_record; enum e_window_index; struct c_window_manager { + enum + { + k_maximum_number_of_channels_per_render_window = 10 + }; + + struct s_screen_handle_datum : + s_datum_header + { + c_gui_screen_widget* screen; + }; + s_data_array* m_active_screens; - dword __time4; - c_gui_screen_widget* m_screen_array[5][10]; + dword m_last_milliseconds; + c_gui_screen_widget* m_screen_array[5][k_maximum_number_of_channels_per_render_window]; c_synchronized_long m_current_channel_count[5]; - rectangle2d m_window_bounds[5]; - long __unknown10C[4]; - long __unknown11C; - long __unknown120; - long __unknown124; + rectangle2d m_last_known_viewport_bounds[5]; + long m_had_ui_frames_ago[4]; + long m_hs_thread_index; + real m_fade_amount; + bool m_fade_in; + bool m_fade_out_and_quit_campaign; + bool __unknown126; + byte __unknown127; c_gui_screen_widget* allocate_codeless_screen(long screen_name); c_gui_screen_widget* allocate_named_screen(long screen_name); diff --git a/game/source/main/levels.cpp b/game/source/main/levels.cpp index f565d2270..bbea106e3 100644 --- a/game/source/main/levels.cpp +++ b/game/source/main/levels.cpp @@ -66,7 +66,7 @@ void __cdecl levels_add_map_from_scripting(long map_id, char const* scenario_pat { //HOOK_INVOKE(, levels_add_map_from_scripting, map_id, scenario_path); - if (g_level_globals.__unknownA14) + if (g_level_globals.need_to_enumerate_dvd) { if (!levels_enumeration_in_progress()) levels_begin_dvd_enumeration(); @@ -137,7 +137,7 @@ void __cdecl levels_add_fake_map_from_scripting(char const* scenario_path) void __cdecl levels_add_multiplayer_map_from_scripting(long map_id, char const* scenario_path) { - if (g_level_globals.__unknownA14) + if (g_level_globals.need_to_enumerate_dvd) { if (!levels_enumeration_in_progress()) levels_begin_dvd_enumeration(); @@ -391,7 +391,7 @@ bool __cdecl levels_begin_dvd_enumeration() if (g_level_globals.enumeration_task != NONE) { - g_level_globals.__unknownA14 = false; + g_level_globals.need_to_enumerate_dvd = false; return true; } } @@ -739,8 +739,8 @@ void __cdecl levels_initialize() csnzprintf(g_level_globals.mainmenu_level.scenario_file, sizeof(g_level_globals.mainmenu_level.scenario_file), "%s%s", cache_files_map_directory(), "mainmenu"); g_level_globals.initialized = true; - g_level_globals.controller_mask = 0; - g_level_globals.__unknownA14 = true; + g_level_globals.preorder_unlock_controller_mask = 0; + g_level_globals.need_to_enumerate_dvd = true; g_level_globals.checksum = NONE; levels_begin_dvd_enumeration(); diff --git a/game/source/main/levels.hpp b/game/source/main/levels.hpp index fe65b5a4e..3380973c4 100644 --- a/game/source/main/levels.hpp +++ b/game/source/main/levels.hpp @@ -72,17 +72,13 @@ struct s_level_globals c_smart_data_array campaign_insertions; c_smart_data_array multiplayer_levels; s_level_datum mainmenu_level; - long enumeration_task; s_find_file_data enumeration_task_data; c_synchronized_long enumeration_result; - bool __unknownA14; - bool __unknownA15; - + bool need_to_enumerate_dvd; + bool need_to_enumerate_dlc; bool initialized; - byte controller_mask; - - // checksum = fast_checksum(header.hash, sizeof(s_network_http_request_hash), fast_checksum_new()); + byte preorder_unlock_controller_mask; dword checksum; }; static_assert(sizeof(s_level_globals) == 0xA1C); diff --git a/game/source/memory/data.hpp b/game/source/memory/data.hpp index 72a7b06a3..3f7abe95d 100644 --- a/game/source/memory/data.hpp +++ b/game/source/memory/data.hpp @@ -21,12 +21,6 @@ enum #define BUILD_DATUM_INDEX(IDENTIFIER, ABSOLUTE_INDEX) ((IDENTIFIER << 16) | ABSOLUTE_INDEX) #define DATA_ARRAY_GET_DATA(DATA) ((DATA)->data) -struct s_datum_header -{ - short identifier; -}; -static_assert(sizeof(s_datum_header) == 0x2); - enum { _data_array_can_disconnect_bit = 0, diff --git a/game/source/memory/hashtable.hpp b/game/source/memory/hashtable.hpp index 13600f942..62ba70438 100644 --- a/game/source/memory/hashtable.hpp +++ b/game/source/memory/hashtable.hpp @@ -29,11 +29,7 @@ struct s_hash_table_bucket void const* key; dword hash; s_hash_table_bucket* next; - -#pragma warning(push) -#pragma warning(disable : 4200) - byte user_data[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte user_data[]; }; static_assert(sizeof(s_hash_table_bucket) == 0xC); @@ -52,11 +48,7 @@ struct s_hash_table c_allocation_base* allocation; s_hash_table_bucket* free_list_elements; s_hash_table_bucket* free_list; - -#pragma warning(push) -#pragma warning(disable : 4200) - s_hash_table_bucket* data[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) s_hash_table_bucket* data[]; }; static_assert(sizeof(s_hash_table) == 0x40); diff --git a/game/source/memory/thread_local.hpp b/game/source/memory/thread_local.hpp index 5977b0756..1787f34b3 100644 --- a/game/source/memory/thread_local.hpp +++ b/game/source/memory/thread_local.hpp @@ -725,7 +725,7 @@ struct s_thread_local_storage // name: "OBJ: Render Data" // type: "Render" - // size: 0x2000 + // size: 0x2000, sizeof(s_object_render_data) * 2048 s_object_render_data* g_object_render_data; // name: "damage globals" diff --git a/game/source/networking/messages/network_messages_simulation_synchronous.hpp b/game/source/networking/messages/network_messages_simulation_synchronous.hpp index 864c2235a..b7fd30b67 100644 --- a/game/source/networking/messages/network_messages_simulation_synchronous.hpp +++ b/game/source/networking/messages/network_messages_simulation_synchronous.hpp @@ -49,10 +49,7 @@ struct s_network_message_synchronous_gamestate dword chunk_offset_next_update_compressed_checksum; long chunk_size; dword decompressed_checksum; -#pragma warning(push) -#pragma warning(disable : 4200) - byte chunk_data[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) byte chunk_data[]; }; static_assert(sizeof(s_network_message_synchronous_gamestate) == 0x10); diff --git a/game/source/networking/tools/network_blf.hpp b/game/source/networking/tools/network_blf.hpp index 6c8045118..497dcab4f 100644 --- a/game/source/networking/tools/network_blf.hpp +++ b/game/source/networking/tools/network_blf.hpp @@ -472,11 +472,7 @@ struct s_blf_chunk_map_image byte type; long buffer_size; - -#pragma warning(push) -#pragma warning(disable : 4200) - char buffer[]; -#pragma warning(pop) + __pragma(warning(disable : 4200)) char buffer[]; }; static_assert(sizeof(s_blf_chunk_map_image) == sizeof(s_blf_header) + 0x8); diff --git a/game/source/objects/lights.hpp b/game/source/objects/lights.hpp index b58cc1204..c0413f5b3 100644 --- a/game/source/objects/lights.hpp +++ b/game/source/objects/lights.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct light_datum : s_datum_header diff --git a/game/source/objects/object_activation_regions.hpp b/game/source/objects/object_activation_regions.hpp index eb97c0914..a4c8fbb44 100644 --- a/game/source/objects/object_activation_regions.hpp +++ b/game/source/objects/object_activation_regions.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_object_activation_region : s_datum_header diff --git a/game/source/objects/object_recycling.hpp b/game/source/objects/object_recycling.hpp index 10acdb224..e0d1471d8 100644 --- a/game/source/objects/object_recycling.hpp +++ b/game/source/objects/object_recycling.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_recycling_volumes { diff --git a/game/source/objects/objects.hpp b/game/source/objects/objects.hpp index c85e5f34e..6f4a740a1 100644 --- a/game/source/objects/objects.hpp +++ b/game/source/objects/objects.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" #include "objects/damage.hpp" #include "objects/damage_owner.hpp" #include "objects/lights.hpp" @@ -405,9 +404,9 @@ static_assert(sizeof(s_object_cluster_payload) == 0x14); struct s_object_render_data { - byte __data[0x2000]; + long cached_render_state_index; }; -static_assert(sizeof(s_object_render_data) == 0x2000); +static_assert(sizeof(s_object_render_data) == sizeof(long)); struct s_object_globals { @@ -443,16 +442,18 @@ static_assert(sizeof(s_object_render_thread_message) == 0x8); struct objects_information { - short __unknown0; - short __unknown2; - short __unknown4; - short __unknown6; - real __unknown8; - real __unknownC; - long __unknown10; - long __unknown14; - long __unknown18; - long __unknown1C; + short object_count; + short free_object_count; + short active_object_count; + short active_garbage_count; + real used_memory; + real contiguous_free_memory; + + // unsure of these names + long collideable_object_actual_count; + long collideable_object_maximum_count; + long noncollideable_object_actual_count; + long noncollideable_object_maximum_count; }; static_assert(sizeof(objects_information) == 0x20); diff --git a/game/source/objects/watch_window.cpp b/game/source/objects/watch_window.cpp index be42db803..bb77e2ee0 100644 --- a/game/source/objects/watch_window.cpp +++ b/game/source/objects/watch_window.cpp @@ -1,7 +1,6 @@ #include "objects/watch_window.hpp" #include "cache/cache_files.hpp" -#include "memory/data.hpp" #include "memory/module.hpp" #include "memory/thread_local.hpp" #include "objects/object_types.hpp" diff --git a/game/source/objects/widgets/antenna.hpp b/game/source/objects/widgets/antenna.hpp index 10a20579f..b3a24ea87 100644 --- a/game/source/objects/widgets/antenna.hpp +++ b/game/source/objects/widgets/antenna.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct antenna_vertex_datum { diff --git a/game/source/objects/widgets/cloth.hpp b/game/source/objects/widgets/cloth.hpp index 96adf604b..17d3a36b2 100644 --- a/game/source/objects/widgets/cloth.hpp +++ b/game/source/objects/widgets/cloth.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct cloth_vertex { diff --git a/game/source/objects/widgets/leaf_system.hpp b/game/source/objects/widgets/leaf_system.hpp index 650ba251c..18c062237 100644 --- a/game/source/objects/widgets/leaf_system.hpp +++ b/game/source/objects/widgets/leaf_system.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_leaf { diff --git a/game/source/objects/widgets/muffins.hpp b/game/source/objects/widgets/muffins.hpp index 0db532386..6e349e9f0 100644 --- a/game/source/objects/widgets/muffins.hpp +++ b/game/source/objects/widgets/muffins.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_muffin_datum : s_datum_header diff --git a/game/source/objects/widgets/widgets.hpp b/game/source/objects/widgets/widgets.hpp index 0204c5ebe..de7c3d786 100644 --- a/game/source/objects/widgets/widgets.hpp +++ b/game/source/objects/widgets/widgets.hpp @@ -5,7 +5,6 @@ #include "objects/widgets/cloth.hpp" #include "objects/widgets/leaf_system.hpp" #include "objects/widgets/muffins.hpp" -#include "memory/data.hpp" struct widget_datum : s_datum_header diff --git a/game/source/physics/breakable_surfaces.hpp b/game/source/physics/breakable_surfaces.hpp index 97e210a1d..f0b80b5d5 100644 --- a/game/source/physics/breakable_surfaces.hpp +++ b/game/source/physics/breakable_surfaces.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_breakable_surface_globals { diff --git a/game/source/physics/havok_proxies.hpp b/game/source/physics/havok_proxies.hpp index 6133e4ce3..744e86dbf 100644 --- a/game/source/physics/havok_proxies.hpp +++ b/game/source/physics/havok_proxies.hpp @@ -1,16 +1,15 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct hkRigidBody; struct s_havok_proxy_datum : s_datum_header { hkRigidBody* rigid_body; - real_matrix4x3 matrix; + real_matrix4x3 transform; long object_index; - dword __time40; + long creation_time; }; static_assert(sizeof(s_havok_proxy_datum) == 0x44); diff --git a/game/source/physics/impacts.hpp b/game/source/physics/impacts.hpp index 83e0e3197..af3de1396 100644 --- a/game/source/physics/impacts.hpp +++ b/game/source/physics/impacts.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_impact_globals { diff --git a/game/source/physics/ragdolls.hpp b/game/source/physics/ragdolls.hpp index 9653058b6..2aba79117 100644 --- a/game/source/physics/ragdolls.hpp +++ b/game/source/physics/ragdolls.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_ragdoll_datum : s_datum_header diff --git a/game/source/render/render_objects_static_lighting.hpp b/game/source/render/render_objects_static_lighting.hpp index 61e86d018..be935e16b 100644 --- a/game/source/render/render_objects_static_lighting.hpp +++ b/game/source/render/render_objects_static_lighting.hpp @@ -2,7 +2,6 @@ #include "cseries/cseries.hpp" #include "effects/effects.hpp" -#include "memory/data.hpp" #include "rasterizer/rasterizer_text.hpp" struct s_cubemap_sample diff --git a/game/source/render/render_shield_cache.hpp b/game/source/render/render_shield_cache.hpp index 30baaa726..f61b71b9c 100644 --- a/game/source/render/render_shield_cache.hpp +++ b/game/source/render/render_shield_cache.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct shield_render_cache_message : s_datum_header diff --git a/game/source/simulation/simulation_gamestate_entities.hpp b/game/source/simulation/simulation_gamestate_entities.hpp index 0be36e50a..b6c8955cf 100644 --- a/game/source/simulation/simulation_gamestate_entities.hpp +++ b/game/source/simulation/simulation_gamestate_entities.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct s_simulation_gamestate_entity : s_datum_header diff --git a/game/source/sound/game_sound.hpp b/game/source/sound/game_sound.hpp index ccd6a0031..bc95fe5ab 100644 --- a/game/source/sound/game_sound.hpp +++ b/game/source/sound/game_sound.hpp @@ -1,7 +1,6 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" struct game_looping_sound_datum : s_datum_header diff --git a/game/source/tag_files/tag_resource_cache_inverse_page_table.hpp b/game/source/tag_files/tag_resource_cache_inverse_page_table.hpp index 266c54a79..e78dab26d 100644 --- a/game/source/tag_files/tag_resource_cache_inverse_page_table.hpp +++ b/game/source/tag_files/tag_resource_cache_inverse_page_table.hpp @@ -1,8 +1,8 @@ #pragma once #include "cseries/cseries.hpp" -#include "memory/data.hpp" +struct s_data_array; struct c_tag_resource_inverse_page_table { struct s_page_resource_reference_range :