From 6cba9d153f6431ff36bb765161dc3e62c6ad72c1 Mon Sep 17 00:00:00 2001 From: Berthalamew <40469582+Berthalamew@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:25:52 -0500 Subject: [PATCH] make load_proc member function const --- .../Engine/interface/screens/screen_4way_signin.cpp | 4 ++-- .../Blam/Engine/interface/screens/screen_4way_signin.h | 2 +- .../Engine/interface/screens/screen_brightness_menu.h | 8 ++++---- .../screens/screen_cartographer_account_manager.cpp | 2 +- .../screens/screen_cartographer_account_manager.h | 2 +- .../interface/screens/screen_cartographer_errors.cpp | 2 +- .../interface/screens/screen_cartographer_errors.h | 2 +- .../interface/screens/screen_cartographer_menus.cpp | 8 ++++---- .../interface/screens/screen_cartographer_menus.h | 10 +++++----- .../screens/screen_press_start_introduction.cpp | 2 +- .../screens/screen_press_start_introduction.h | 2 +- .../Blam/Engine/interface/screens/screen_settings.cpp | 2 +- xlive/Blam/Engine/interface/screens/screen_settings.h | 2 +- .../Engine/interface/screens/screen_squad_settings.cpp | 2 +- .../Engine/interface/screens/screen_squad_settings.h | 2 +- .../interface/screens/screen_virtual_keyboard.cpp | 2 +- .../Engine/interface/screens/screen_virtual_keyboard.h | 2 +- .../screens/screen_xbox_live_task_progress_dialog.cpp | 2 +- .../screens/screen_xbox_live_task_progress_dialog.h | 2 +- 19 files changed, 30 insertions(+), 30 deletions(-) diff --git a/xlive/Blam/Engine/interface/screens/screen_4way_signin.cpp b/xlive/Blam/Engine/interface/screens/screen_4way_signin.cpp index 600238dbb..7fb6f63d3 100644 --- a/xlive/Blam/Engine/interface/screens/screen_4way_signin.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_4way_signin.cpp @@ -377,7 +377,7 @@ void c_screen_4way_signin::initialize(s_screen_parameters* parameters) user_interface_squad_clear_match_playlist(); } -void* c_screen_4way_signin::load_proc() +const void* c_screen_4way_signin::load_proc(void) const { switch (this->m_call_context) { @@ -403,7 +403,7 @@ void* c_screen_4way_signin::load_proc() default: DISPLAY_ASSERT("unreachable"); } - return nullptr; + return NULL; } bool __cdecl user_interface_mainmenu_sign_out_controller_callback(e_controller_index controller_index) diff --git a/xlive/Blam/Engine/interface/screens/screen_4way_signin.h b/xlive/Blam/Engine/interface/screens/screen_4way_signin.h index 7d492f0a5..57ecebc4a 100644 --- a/xlive/Blam/Engine/interface/screens/screen_4way_signin.h +++ b/xlive/Blam/Engine/interface/screens/screen_4way_signin.h @@ -41,6 +41,6 @@ class c_screen_4way_signin : protected c_screen_widget virtual void update() override; virtual bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_4way_signin, 0xA60); \ No newline at end of file diff --git a/xlive/Blam/Engine/interface/screens/screen_brightness_menu.h b/xlive/Blam/Engine/interface/screens/screen_brightness_menu.h index 63d9041cc..f0634fb62 100644 --- a/xlive/Blam/Engine/interface/screens/screen_brightness_menu.h +++ b/xlive/Blam/Engine/interface/screens/screen_brightness_menu.h @@ -260,9 +260,9 @@ class c_brightness_menu : protected c_screen_with_menu INVOKE_VFPTR_FN(_get_vfptr_table, 37, void(class_type::**)(s_screen_state*), state); } - virtual void* load_proc() override + virtual const void* load_proc(void) const override { - return INVOKE_VFPTR_FN(_get_vfptr_table, 38, void*(class_type::**)()); + return INVOKE_VFPTR_FN(_get_vfptr_table, 38, const void*(class_type::**)() const); } virtual bool overlay_effect_is_disabled() override @@ -282,9 +282,9 @@ class c_brightness_menu : protected c_screen_with_menu private: // reserved name template - static T _get_vfptr_table(DWORD idx) + static const T _get_vfptr_table(DWORD idx) { - return reinterpret_cast(&Memory::GetAddress(0x4D7ABC)[idx]); + return reinterpret_cast(&Memory::GetAddress(0x4D7ABC)[idx]); } }; diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.cpp b/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.cpp index dde5ce9b1..5befb78e9 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.cpp @@ -602,7 +602,7 @@ void c_cartographer_account_manager_menu::post_initialize(void) return c_screen_with_menu::post_initialize(); } -void* c_cartographer_account_manager_menu::load_proc(void) +const void* c_cartographer_account_manager_menu::load_proc(void) const { return c_cartographer_account_manager_menu::load_default_context; } diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.h b/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.h index 0a38a07d3..409467967 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.h +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_account_manager.h @@ -117,7 +117,7 @@ class c_cartographer_account_manager_menu : protected c_screen_with_menu virtual void pre_destroy(void) override; virtual void initialize(s_screen_parameters* screen_parameters) override; virtual void post_initialize(void) override; - virtual void* load_proc(void) override; + const virtual const void* load_proc(void) const override; }; // ASSERT_STRUCT_SIZE(c_cartographer_account_manager_menu, 3396); diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.cpp b/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.cpp index 712dffacb..a7ca8c76c 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.cpp @@ -220,7 +220,7 @@ void c_cartographer_error_menu::initialize(s_screen_parameters* screen_parameter } } -void* c_cartographer_error_menu::load_proc() +const void* c_cartographer_error_menu::load_proc(void) const { return c_cartographer_error_menu::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.h b/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.h index e526bcbd5..fae08408b 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.h +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_errors.h @@ -63,7 +63,7 @@ class c_cartographer_error_menu : protected c_screen_widget virtual void pre_destroy() override; virtual bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* screen_parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; private: }; diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.cpp b/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.cpp index 730e82ed2..a1b1644f6 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.cpp @@ -309,7 +309,7 @@ void c_cartographer_guide_menu::initialize(s_screen_parameters* screen_parameter } } -void* c_cartographer_guide_menu::load_proc() +const void* c_cartographer_guide_menu::load_proc(void) const { return c_cartographer_guide_menu::load; } @@ -383,7 +383,7 @@ void* c_cartographer_credits_menu::load(s_screen_parameters* parameters) return credits_menu; } -void* c_cartographer_credits_menu::load_proc() +const void* c_cartographer_credits_menu::load_proc(void) const { return c_cartographer_credits_menu::load; } @@ -564,7 +564,7 @@ void c_cartographer_update_menu::update() c_screen_with_menu::update(); } -void* c_cartographer_update_menu::load_proc() +const void* c_cartographer_update_menu::load_proc(void) const { return c_cartographer_update_menu::load; } @@ -679,7 +679,7 @@ c_cartographer_update_notice_menu::c_cartographer_update_notice_menu(e_user_inte { } -void* c_cartographer_update_notice_menu::load_proc() +const void* c_cartographer_update_notice_menu::load_proc(void) const { return c_cartographer_update_notice_menu::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.h b/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.h index 5a41d41ec..bb536a8d4 100644 --- a/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.h +++ b/xlive/Blam/Engine/interface/screens/screen_cartographer_menus.h @@ -2,7 +2,7 @@ // miscellaneous cartographer menus -#include "interface/user_interface_widget.h" +#include "interface/user_interface.h" #include "interface/user_interface_widget_list.h" #include "interface/user_interface_widget_list_item.h" #include "interface/user_interface_widget_window.h" @@ -61,7 +61,7 @@ class c_cartographer_guide_menu : public c_screen_with_menu virtual ~c_cartographer_guide_menu() = default; virtual void initialize(s_screen_parameters* screen_parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; @@ -96,7 +96,7 @@ class c_cartographer_credits_menu : public c_screen_with_menu // c_cartographer_credits_menu virtual functions virtual ~c_cartographer_credits_menu() = default; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; virtual void initialize(s_screen_parameters* screen_parameters) override; }; @@ -141,7 +141,7 @@ class c_cartographer_update_menu : public c_screen_with_menu virtual ~c_cartographer_update_menu() = default; virtual void update() override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; virtual void initialize(s_screen_parameters* screen_parameters) override; }; @@ -178,7 +178,7 @@ class c_cartographer_update_notice_menu : public c_screen_with_menu // c_cartographer_update_notice_menu virtual functions. virtual ~c_cartographer_update_notice_menu() = default; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; virtual void initialize(s_screen_parameters* screen_parameters) override; }; diff --git a/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.cpp b/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.cpp index 0acf4228d..589bc3c42 100644 --- a/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.cpp @@ -44,7 +44,7 @@ void c_screen_press_start_introduction::sub_60EBC2(int32 a1) INVOKE_TYPE(0x23F011, 0x0, void(__thiscall*)(c_screen_press_start_introduction*, int32), this, a1); } -void* c_screen_press_start_introduction::load_proc() +const void* c_screen_press_start_introduction::load_proc(void) const { return &c_screen_press_start_introduction::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.h b/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.h index da2eb628d..071da14aa 100644 --- a/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.h +++ b/xlive/Blam/Engine/interface/screens/screen_press_start_introduction.h @@ -29,6 +29,6 @@ class c_screen_press_start_introduction : protected c_screen_widget bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* parameters) override; virtual void sub_60EBC2(int32 a1) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_press_start_introduction, 0xB8C); \ No newline at end of file diff --git a/xlive/Blam/Engine/interface/screens/screen_settings.cpp b/xlive/Blam/Engine/interface/screens/screen_settings.cpp index d561f72e0..fd82e6db9 100644 --- a/xlive/Blam/Engine/interface/screens/screen_settings.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_settings.cpp @@ -358,7 +358,7 @@ void c_screen_settings::post_initialize_button_keys() } -void* c_screen_settings::load_proc() +const void* c_screen_settings::load_proc(void) const { return &c_screen_settings::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_settings.h b/xlive/Blam/Engine/interface/screens/screen_settings.h index ebcb58693..4eb91d8ad 100644 --- a/xlive/Blam/Engine/interface/screens/screen_settings.h +++ b/xlive/Blam/Engine/interface/screens/screen_settings.h @@ -61,6 +61,6 @@ class c_screen_settings : protected c_screen_with_menu virtual ~c_screen_settings() = default; virtual void post_initialize_button_keys() override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_settings, 0xEC8); diff --git a/xlive/Blam/Engine/interface/screens/screen_squad_settings.cpp b/xlive/Blam/Engine/interface/screens/screen_squad_settings.cpp index ef1564407..f313b016f 100644 --- a/xlive/Blam/Engine/interface/screens/screen_squad_settings.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_squad_settings.cpp @@ -687,7 +687,7 @@ void* c_screen_squad_settings::load(s_screen_parameters* parameters) } -void* c_screen_squad_settings::load_proc() +const void* c_screen_squad_settings::load_proc(void) const { return &c_screen_squad_settings::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_squad_settings.h b/xlive/Blam/Engine/interface/screens/screen_squad_settings.h index 83b0649fe..e54f7a68f 100644 --- a/xlive/Blam/Engine/interface/screens/screen_squad_settings.h +++ b/xlive/Blam/Engine/interface/screens/screen_squad_settings.h @@ -64,6 +64,6 @@ class c_screen_squad_settings : protected c_screen_widget virtual void update() override; virtual bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_squad_settings, 0xEC4); diff --git a/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.cpp b/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.cpp index d33ea0146..55f422da9 100644 --- a/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.cpp @@ -145,7 +145,7 @@ void c_screen_virtual_keyboard::initialize(s_screen_parameters* parameters) update_custom_labels(old_context); } -void* c_screen_virtual_keyboard::load_proc() +const void* c_screen_virtual_keyboard::load_proc(void) const { return &c_screen_virtual_keyboard::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.h b/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.h index 6ff65cbcc..36f6862d5 100644 --- a/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.h +++ b/xlive/Blam/Engine/interface/screens/screen_virtual_keyboard.h @@ -155,7 +155,7 @@ class c_screen_virtual_keyboard : protected c_screen_widget virtual void render_widget(rectangle2d* viewport_bounds) override; virtual bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_virtual_keyboard, 0x3B80); diff --git a/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.cpp b/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.cpp index 994788613..130ed9021 100644 --- a/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.cpp +++ b/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.cpp @@ -78,7 +78,7 @@ void c_screen_xbox_live_task_progress_dialog::initialize(s_screen_parameters* pa this->setup_children(); } -void* c_screen_xbox_live_task_progress_dialog::load_proc() +const void* c_screen_xbox_live_task_progress_dialog::load_proc(void) const { return &c_screen_xbox_live_task_progress_dialog::load; } diff --git a/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.h b/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.h index ed500f948..054e2fe6f 100644 --- a/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.h +++ b/xlive/Blam/Engine/interface/screens/screen_xbox_live_task_progress_dialog.h @@ -43,6 +43,6 @@ class c_screen_xbox_live_task_progress_dialog : c_screen_widget virtual void update() override; virtual bool handle_event(s_event_record* event) override; virtual void initialize(s_screen_parameters* parameters) override; - virtual void* load_proc() override; + virtual const void* load_proc(void) const override; }; ASSERT_STRUCT_SIZE(c_screen_xbox_live_task_progress_dialog, 0xA70); \ No newline at end of file