From c948305a9c212fad7a6bd827cc458edd4f695c7b Mon Sep 17 00:00:00 2001 From: Yimura <24669514+Yimura@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:08:37 +0200 Subject: [PATCH] feat: Switch to C++20 (#508) --- .gitmodules | 4 --- .../looped/hud/hud_transition_state.cpp | 2 +- BigBaseV2/src/common.hpp | 3 +- BigBaseV2/src/detour_hook.cc | 6 ++-- BigBaseV2/src/gta/array.hpp | 2 +- BigBaseV2/src/gta/sysMemAllocator.hpp | 2 +- BigBaseV2/src/gui.cpp | 2 +- .../hooks/native_hooks/gta_thread_kill.cpp | 2 +- .../hooks/native_hooks/gta_thread_start.cpp | 2 +- .../assign_physical_index.cpp | 4 +-- .../protections/increment_stat_event.cpp | 2 +- .../hooks/protections/receive_net_message.cpp | 4 +-- .../hooks/protections/received_clone_sync.cpp | 4 +-- .../src/hooks/protections/received_event.cpp | 12 +++---- .../protections/script_event_handler.cpp | 2 +- BigBaseV2/src/logger.hpp | 2 +- .../src/services/mobile/mobile_service.cpp | 2 +- .../src/services/vehicle/vehicle_service.cpp | 2 +- .../vehicle_helper/vehicle_helper.cpp | 14 ++++---- BigBaseV2/src/util/notify.hpp | 2 +- BigBaseV2/src/views/players/view_player.cpp | 2 +- BigBaseV2/src/views/self/view_mobile.cpp | 2 +- .../src/views/vehicle/view_fun_vehicle.cpp | 6 ++-- .../src/views/vehicle/view_spawn_vehicle.cpp | 2 +- BigBaseV2/src/views/vehicle/view_vehicle.cpp | 2 +- premake5.lua | 35 ++++--------------- vendor/fmtlib | 1 - 27 files changed, 48 insertions(+), 77 deletions(-) delete mode 160000 vendor/fmtlib diff --git a/.gitmodules b/.gitmodules index 3c65ef9a..559ae5df 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "vendor/fmtlib"] - path = vendor/fmtlib - url = https://github.com/fmtlib/fmt - ignore = dirty [submodule "vendor/json"] path = vendor/json url = https://github.com/nlohmann/json diff --git a/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp b/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp index ad54f75a..695f964f 100644 --- a/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp +++ b/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp @@ -111,7 +111,7 @@ namespace big if ((int)state > 0 && (int)std::size(transition_states)) { HUD::BEGIN_TEXT_COMMAND_BUSYSPINNER_ON("STRING"); - auto const spinner_text = fmt::format("{} | {}", transition_states[(int)state], state); + auto const spinner_text = std::format("{} | {}", transition_states[(int)state], static_cast(state)); HUD::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(spinner_text.c_str()); HUD::END_TEXT_COMMAND_BUSYSPINNER_ON(5); } diff --git a/BigBaseV2/src/common.hpp b/BigBaseV2/src/common.hpp index 286ea6f1..f1d792bd 100644 --- a/BigBaseV2/src/common.hpp +++ b/BigBaseV2/src/common.hpp @@ -45,8 +45,7 @@ #include #include -#define FMT_HEADER_ONLY -#include +#include #include #include "logger.hpp" diff --git a/BigBaseV2/src/detour_hook.cc b/BigBaseV2/src/detour_hook.cc index 2c858bc9..f887163b 100644 --- a/BigBaseV2/src/detour_hook.cc +++ b/BigBaseV2/src/detour_hook.cc @@ -13,7 +13,7 @@ namespace big { fix_hook_address(); if (auto status = MH_CreateHook(m_target, m_detour, &m_original); status != MH_OK) - throw std::runtime_error(fmt::format("Failed to create hook '{}' at 0x{:X} (error: {})", m_name, uintptr_t(m_target), MH_StatusToString(status))); + throw std::runtime_error(std::format("Failed to create hook '{}' at 0x{:X} (error: {})", m_name, uintptr_t(m_target), MH_StatusToString(status))); } detour_hook::~detour_hook() noexcept @@ -25,7 +25,7 @@ namespace big void detour_hook::enable() { if (auto status = MH_QueueEnableHook(m_target); status != MH_OK) - throw std::runtime_error(fmt::format("Failed to enable hook 0x{:X} ({})", uintptr_t(m_target), MH_StatusToString(status))); + throw std::runtime_error(std::format("Failed to enable hook 0x{:X} ({})", uintptr_t(m_target), MH_StatusToString(status))); } void detour_hook::disable() @@ -51,7 +51,7 @@ namespace big } __except (exp_handler(GetExceptionInformation(), m_name)) { [this]() { - throw std::runtime_error(fmt::format("Failed to fix hook address for '{}'", m_name)); + throw std::runtime_error(std::format("Failed to fix hook address for '{}'", m_name)); }(); } } diff --git a/BigBaseV2/src/gta/array.hpp b/BigBaseV2/src/gta/array.hpp index 74629bbe..6f3cc9ba 100644 --- a/BigBaseV2/src/gta/array.hpp +++ b/BigBaseV2/src/gta/array.hpp @@ -59,7 +59,7 @@ namespace rage m_size += size; auto i = old_capacity; - for (auto weapon_hash : value_array) + for (auto weapon_hash : array_value) { m_data[i] = weapon_hash; i++; diff --git a/BigBaseV2/src/gta/sysMemAllocator.hpp b/BigBaseV2/src/gta/sysMemAllocator.hpp index a63811b6..e671a5ef 100644 --- a/BigBaseV2/src/gta/sysMemAllocator.hpp +++ b/BigBaseV2/src/gta/sysMemAllocator.hpp @@ -43,7 +43,7 @@ namespace rage public: - static sysMemAllocator* sysMemAllocator::UpdateAllocatorValue() + static sysMemAllocator* UpdateAllocatorValue() { //B9 ? ? ? ? 48 8B 0C 01 45 33 C9 49 8B D2 48 auto g_gtaTlsEntry = *(sysMemAllocator**)(*(uintptr_t*)(__readgsqword(88)) + 0xC8); //This has been 0xC8 since 323, I'm not adding this signature to pointers... diff --git a/BigBaseV2/src/gui.cpp b/BigBaseV2/src/gui.cpp index ff5084ff..5a5135d1 100644 --- a/BigBaseV2/src/gui.cpp +++ b/BigBaseV2/src/gui.cpp @@ -123,7 +123,7 @@ namespace big void gui::script_func() { - g_notification_service->push("Welcome", fmt::format("Loaded YimMenu. Press {} to open", ImGui::key_names[g->settings.hotkeys.menu_toggle])); + g_notification_service->push("Welcome", std::format("Loaded YimMenu. Press {} to open", ImGui::key_names[g->settings.hotkeys.menu_toggle])); while (true) { g_gui.script_on_tick(); diff --git a/BigBaseV2/src/hooks/native_hooks/gta_thread_kill.cpp b/BigBaseV2/src/hooks/native_hooks/gta_thread_kill.cpp index 015eb133..ce5b22ad 100644 --- a/BigBaseV2/src/hooks/native_hooks/gta_thread_kill.cpp +++ b/BigBaseV2/src/hooks/native_hooks/gta_thread_kill.cpp @@ -10,7 +10,7 @@ namespace big if (g->notifications.gta_thread_kill.log) LOG(INFO) << "Script Thread '" << thread->m_name << "' terminated."; if (g->notifications.gta_thread_kill.notify) - g_notification_service->push("Script Thread Termination", fmt::format("Script Thread '{}' terminated.", thread->m_name)); + g_notification_service->push("Script Thread Termination", std::format("Script Thread '{}' terminated.", thread->m_name)); g_native_hooks->do_cleanup_for_thread(thread); diff --git a/BigBaseV2/src/hooks/native_hooks/gta_thread_start.cpp b/BigBaseV2/src/hooks/native_hooks/gta_thread_start.cpp index b0ad9b18..122c8724 100644 --- a/BigBaseV2/src/hooks/native_hooks/gta_thread_start.cpp +++ b/BigBaseV2/src/hooks/native_hooks/gta_thread_start.cpp @@ -12,7 +12,7 @@ namespace big if (g->notifications.gta_thread_kill.log) LOG(INFO) << "Script Thread '" << name << "' started."; if (g->notifications.gta_thread_kill.notify) - g_notification_service->push("Script Thread Startup", fmt::format("Script Thread '{}' started.", name)); + g_notification_service->push("Script Thread Startup", std::format("Script Thread '{}' started.", name)); } if (new_thread != nullptr) diff --git a/BigBaseV2/src/hooks/player_management/assign_physical_index.cpp b/BigBaseV2/src/hooks/player_management/assign_physical_index.cpp index 15dafc5f..dfd43ec5 100644 --- a/BigBaseV2/src/hooks/player_management/assign_physical_index.cpp +++ b/BigBaseV2/src/hooks/player_management/assign_physical_index.cpp @@ -21,7 +21,7 @@ namespace big << " with Rockstar ID: " << net_player_data->m_gamer_handle_2.m_rockstar_id; if (g->notifications.player_leave.notify) - g_notification_service->push("Player Left", fmt::format("{} freeing slot #{} with Rockstar ID: {}", net_player_data->m_name, player->m_player_id, net_player_data->m_gamer_handle_2.m_rockstar_id)); + g_notification_service->push("Player Left", std::format("{} freeing slot #{} with Rockstar ID: {}", net_player_data->m_name, player->m_player_id, net_player_data->m_gamer_handle_2.m_rockstar_id)); } return result; @@ -39,7 +39,7 @@ namespace big << " with Rockstar ID: " << net_player_data->m_gamer_handle_2.m_rockstar_id; if (g->notifications.player_join.notify) - g_notification_service->push("Player Joined", fmt::format("{} taking slot #{} with Rockstar ID: {}", net_player_data->m_name, player->m_player_id, net_player_data->m_gamer_handle_2.m_rockstar_id)); + g_notification_service->push("Player Joined", std::format("{} taking slot #{} with Rockstar ID: {}", net_player_data->m_name, player->m_player_id, net_player_data->m_gamer_handle_2.m_rockstar_id)); } return result; } diff --git a/BigBaseV2/src/hooks/protections/increment_stat_event.cpp b/BigBaseV2/src/hooks/protections/increment_stat_event.cpp index d555caf0..1978d7d9 100644 --- a/BigBaseV2/src/hooks/protections/increment_stat_event.cpp +++ b/BigBaseV2/src/hooks/protections/increment_stat_event.cpp @@ -16,7 +16,7 @@ namespace big case RAGE_JOAAT("MPPLY_TC_HATE"): case RAGE_JOAAT("MPPLY_VC_ANNOYINGME"): case RAGE_JOAAT("MPPLY_VC_HATE"): - const auto report = fmt::format("From: {}", sender->get_name()); + const auto report = std::format("From: {}", sender->get_name()); if (g->notifications.reports.log) LOG(INFO) << "Blocked report; " << report; diff --git a/BigBaseV2/src/hooks/protections/receive_net_message.cpp b/BigBaseV2/src/hooks/protections/receive_net_message.cpp index 64fa216e..a8ffaf25 100644 --- a/BigBaseV2/src/hooks/protections/receive_net_message.cpp +++ b/BigBaseV2/src/hooks/protections/receive_net_message.cpp @@ -49,7 +49,7 @@ namespace big { if (player->m_num_failed_transition_attempts++ == 20) { - g_notification_service->push_error("Protections", fmt::format("{} tried to OOM kick you!", player->get_name())); + g_notification_service->push_error("Protections", std::format("{} tried to OOM kick you!", player->get_name())); } return true; } @@ -83,7 +83,7 @@ namespace big } if (player && pl && player->id() != pl->id() && count == 1 && frame->m_msg_id == -1) { - g_notification_service->push_error("Warning!", fmt::format("{} breakup kicked {}!", player->get_name(), pl->get_name())); + g_notification_service->push_error("Warning!", std::format("{} breakup kicked {}!", player->get_name(), pl->get_name())); } break; } diff --git a/BigBaseV2/src/hooks/protections/received_clone_sync.cpp b/BigBaseV2/src/hooks/protections/received_clone_sync.cpp index e16c78fe..bda93e63 100644 --- a/BigBaseV2/src/hooks/protections/received_clone_sync.cpp +++ b/BigBaseV2/src/hooks/protections/received_clone_sync.cpp @@ -34,14 +34,14 @@ namespace big if (g->notifications.out_of_allowed_range_sync_type.log) LOG(WARNING) << "Out of range sync: " << "Type: " << sync_type << " Tree name: " << tree_name << " From: " << src->get_name(); if (g->notifications.out_of_allowed_range_sync_type.notify) - g_notification_service->push_warning(fmt::format("Out Of Allowed Sync Range from {}", src->get_name()), fmt::format("Type {} in sync tree {}", sync_type, tree_name)); + g_notification_service->push_warning(std::format("Out Of Allowed Sync Range from {}", src->get_name()), std::format("Type {} in sync tree {}", std::uint16_t(sync_type), tree_name)); } else if (net_obj->m_object_type != sync_type) { if (g->notifications.mismatch_sync_type.log) LOG(WARNING) << "Mismatch sync: " << "Type: " << sync_type << " Tree name: " << tree_name << " From: " << src->get_name(); if (g->notifications.mismatch_sync_type.notify) - g_notification_service->push_warning(fmt::format("Mismatch Sync from {}", src->get_name()), fmt::format("Type {} in sync tree {}", sync_type, tree_name)); + g_notification_service->push_warning(std::format("Mismatch Sync from {}", src->get_name()), std::format("Type {} in sync tree {}", std::uint16_t(sync_type), tree_name)); return SyncResponse::WrongOwner; } diff --git a/BigBaseV2/src/hooks/protections/received_event.cpp b/BigBaseV2/src/hooks/protections/received_event.cpp index c70d25a0..1a7b64e7 100644 --- a/BigBaseV2/src/hooks/protections/received_event.cpp +++ b/BigBaseV2/src/hooks/protections/received_event.cpp @@ -41,7 +41,7 @@ namespace big LOG(INFO) << "RECEIVED_EVENT_HANDLER : " << source_player->get_name() << " is voting to kick us."; if (g->notifications.received_event.kick_vote.notify) g_notification_service->push_warning("Kick Vote", - fmt::format("{} is voting to kick us.", source_player->get_name())); + std::format("{} is voting to kick us.", source_player->get_name())); } buffer->Seek(0); break; @@ -79,7 +79,7 @@ namespace big LOG(INFO) << "RECEIVED_EVENT_HANDLER : " << source_player->get_name() << " sent TASK_VEHICLE_TEMP_ACTION crash."; if (g->notifications.received_event.vehicle_temp_action.notify) g_notification_service->push_warning("Protection", - fmt::format("{} sent TASK_VEHICLE_TEMP_ACTION crash.", source_player->get_name())); + std::format("{} sent TASK_VEHICLE_TEMP_ACTION crash.", source_player->get_name())); return; } @@ -115,7 +115,7 @@ namespace big if (g->notifications.received_event.clear_ped_task.notify) g_notification_service->push_warning("Protection", - fmt::format("{} possible attempt at freezing entity.", source_player->get_name()) + std::format("{} possible attempt at freezing entity.", source_player->get_name()) ); return; @@ -140,7 +140,7 @@ namespace big if (g->notifications.received_event.report_cash_spawn.notify) g_notification_service->push_warning("Protection", - fmt::format("{} is spawning cash.", source_player->get_name()) + std::format("{} is spawning cash.", source_player->get_name()) ); } @@ -155,7 +155,7 @@ namespace big if (g->notifications.received_event.modder_detect.notify) g_notification_service->push_warning("Protection", - fmt::format("{} sent out a modder event.", source_player->get_name()) + std::format("{} sent out a modder event.", source_player->get_name()) ); break; @@ -169,7 +169,7 @@ namespace big if (g->notifications.received_event.request_control_event.notify) g_notification_service->push_warning("Protection", - fmt::format("Denied player control request from {}", source_player->get_name()) + std::format("Denied player control request from {}", source_player->get_name()) ); return; diff --git a/BigBaseV2/src/hooks/protections/script_event_handler.cpp b/BigBaseV2/src/hooks/protections/script_event_handler.cpp index aaa3d546..d47b521c 100644 --- a/BigBaseV2/src/hooks/protections/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/protections/script_event_handler.cpp @@ -10,7 +10,7 @@ namespace big if (should_notify) g_notification_service->push_warning("Script Event Protection", - fmt::format("From: {}\nEvent Type: {}", player_name.data(), protection_type.data()) + std::format("From: {}\nEvent Type: {}", player_name.data(), protection_type.data()) ); } diff --git a/BigBaseV2/src/logger.hpp b/BigBaseV2/src/logger.hpp index e5c7ace2..9b9bcb39 100644 --- a/BigBaseV2/src/logger.hpp +++ b/BigBaseV2/src/logger.hpp @@ -109,7 +109,7 @@ namespace big auto local_time = std::localtime(&time_t); m_file.move( - fmt::format( + std::format( "./backup/{:0>2}-{:0>2}-{}-{:0>2}-{:0>2}-{:0>2}_{}", local_time->tm_mon + 1, local_time->tm_mday, diff --git a/BigBaseV2/src/services/mobile/mobile_service.cpp b/BigBaseV2/src/services/mobile/mobile_service.cpp index fcbd32ce..2d4e4eb6 100644 --- a/BigBaseV2/src/services/mobile/mobile_service.cpp +++ b/BigBaseV2/src/services/mobile/mobile_service.cpp @@ -13,7 +13,7 @@ namespace big m_hash = *m_vehicle_idx.at(66).as(); m_state_bitfield = m_vehicle_idx.at(103).as(); - m_name = fmt::format( + m_name = std::format( "{} ({})", HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(m_hash)), m_plate diff --git a/BigBaseV2/src/services/vehicle/vehicle_service.cpp b/BigBaseV2/src/services/vehicle/vehicle_service.cpp index cdef338e..a7a452ae 100644 --- a/BigBaseV2/src/services/vehicle/vehicle_service.cpp +++ b/BigBaseV2/src/services/vehicle/vehicle_service.cpp @@ -245,7 +245,7 @@ namespace big void vehicle_service::set_active_profile(std::uint32_t hash, std::string share_code) { - if (auto& it = this->m_active_profiles.find(hash); it != this->m_active_profiles.end()) + if (const auto& it = this->m_active_profiles.find(hash); it != this->m_active_profiles.end()) it->second = share_code; else this->m_active_profiles.emplace(hash, share_code); diff --git a/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp b/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp index ed497044..a4f822da 100644 --- a/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp +++ b/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp @@ -177,8 +177,8 @@ namespace big return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("CMOD_WHE_B_0"); } if (mod >= mod_count / 2) - //return fmt::format("{} {}", HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("CHROME"), HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_MOD_TEXT_LABEL(vehicle, mod_slot, mod))).c_str(); //Bug with FMT library? Returns Chrome Chrome... - return fmt::format("Chrome {}", HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_MOD_TEXT_LABEL(vehicle, mod_slot, mod))).c_str(); + //return std::format("{} {}", HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("CHROME"), HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_MOD_TEXT_LABEL(vehicle, mod_slot, mod))).c_str(); //Bug with FMT library? Returns Chrome Chrome... + return std::format("Chrome {}", HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_MOD_TEXT_LABEL(vehicle, mod_slot, mod))).c_str(); else return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(VEHICLE::GET_MOD_TEXT_LABEL(vehicle, mod_slot, mod)); } @@ -186,17 +186,17 @@ namespace big switch (mod_slot) { case MOD_ARMOR: - return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(fmt::format("CMOD_ARM_{}", (mod + 1)).c_str()); + return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(std::format("CMOD_ARM_{}", (mod + 1)).c_str()); case MOD_BRAKES: - return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(fmt::format("CMOD_BRA_{}", (mod + 1)).c_str()); + return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(std::format("CMOD_BRA_{}", (mod + 1)).c_str()); case MOD_ENGINE: if (mod == -1) return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("CMOD_ARM_0"); - return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(fmt::format("CMOD_ENG_{}", (mod + 1)).c_str()); + return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(std::format("CMOD_ENG_{}", (mod + 1)).c_str()); case MOD_SUSPENSION: - return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(fmt::format("CMOD_SUS_{}", (mod + 1)).c_str()); + return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(std::format("CMOD_SUS_{}", (mod + 1)).c_str()); case MOD_TRANSMISSION: - return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(fmt::format("CMOD_GBX_{}", (mod + 1)).c_str()); + return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION(std::format("CMOD_GBX_{}", (mod + 1)).c_str()); } diff --git a/BigBaseV2/src/util/notify.hpp b/BigBaseV2/src/util/notify.hpp index 6213c87f..570e2936 100644 --- a/BigBaseV2/src/util/notify.hpp +++ b/BigBaseV2/src/util/notify.hpp @@ -50,7 +50,7 @@ namespace big::notify inline void player_joined(CNetGamePlayer* net_game_player) { above_map( - fmt::format("{} joined.", net_game_player->get_name()) + std::format("{} joined.", net_game_player->get_name()) ); } } \ No newline at end of file diff --git a/BigBaseV2/src/views/players/view_player.cpp b/BigBaseV2/src/views/players/view_player.cpp index 1da40b93..954694ca 100644 --- a/BigBaseV2/src/views/players/view_player.cpp +++ b/BigBaseV2/src/views/players/view_player.cpp @@ -11,7 +11,7 @@ namespace big { void view::view_player() { - std::string title = fmt::format("Player Options: {}", g_player_service->get_selected()->get_name()); + std::string title = std::format("Player Options: {}", g_player_service->get_selected()->get_name()); ImGui::Text(title.c_str()); ImGui::Checkbox("Spectate", &g->player.spectating); diff --git a/BigBaseV2/src/views/self/view_mobile.cpp b/BigBaseV2/src/views/self/view_mobile.cpp index e1db9365..75074b18 100644 --- a/BigBaseV2/src/views/self/view_mobile.cpp +++ b/BigBaseV2/src/views/self/view_mobile.cpp @@ -17,7 +17,7 @@ namespace big components::button("Mors Mutual Fix All Vehicles", [] { int amount_fixed = mobile::mors_mutual::fix_all(); g_notification_service->push("Mobile", - fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") + std::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") ); }); } diff --git a/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp index b7bff653..0625bc73 100644 --- a/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp @@ -87,7 +87,7 @@ namespace big { float auto_drive_speed_user_unit = vehicle::mps_to_speed(g->vehicle.auto_drive_speed, g->vehicle.speed_unit); if (ImGui::SliderFloat( - fmt::format("Top Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(), + std::format("Top Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(), &auto_drive_speed_user_unit, vehicle::mps_to_speed(0.f, g->vehicle.speed_unit), vehicle::mps_to_speed(150.f, g->vehicle.speed_unit), @@ -106,7 +106,7 @@ namespace big g->vehicle.auto_drive_style = (AutoDriveStyle)i; g_notification_service->push_warning( "Auto Drive", - fmt::format("Driving style set to {}.", driving_style_names[i]) + std::format("Driving style set to {}.", driving_style_names[i]) ); } @@ -221,7 +221,7 @@ namespace big float fly_speed_user_unit = vehicle::mps_to_speed(g->vehicle.fly.speed, g->vehicle.speed_unit); if (ImGui::SliderFloat( - fmt::format("Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(), + std::format("Speed({})", speed_unit_strings[(int)g->vehicle.speed_unit]).c_str(), &fly_speed_user_unit, vehicle::mps_to_speed(0.f, g->vehicle.speed_unit), vehicle::mps_to_speed(150.f, g->vehicle.speed_unit), diff --git a/BigBaseV2/src/views/vehicle/view_spawn_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_spawn_vehicle.cpp index 12e399d8..863c2331 100644 --- a/BigBaseV2/src/views/vehicle/view_spawn_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_spawn_vehicle.cpp @@ -80,7 +80,7 @@ namespace big { const auto& item = g_gta_data_service->vehicle_by_hash(veh_hash); - components::selectable(fmt::format("Current Vehicle [{}]", item.m_display_name), false, [] { + components::selectable(std::format("Current Vehicle [{}]", item.m_display_name), false, [] { if (self::veh) { Vector3 spawn_location = vehicle::get_spawn_location(g->spawn_vehicle.spawn_inside); diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index 9593ff2d..693041e0 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -11,7 +11,7 @@ namespace big components::button("MMI Fix All PV", [] { int amount_fixed = mobile::mors_mutual::fix_all(); g_notification_service->push("Mobile", - fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") + std::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") ); }); ImGui::SameLine(); diff --git a/premake5.lua b/premake5.lua index 2ee58bc9..29d29af5 100644 --- a/premake5.lua +++ b/premake5.lua @@ -10,7 +10,7 @@ workspace "BigBaseV2" outputdir = "%{cfg.buildcfg}" - CppVersion = "C++17" + CppVersion = "C++20" MsvcToolset = "v143" WindowsSdkVersion = "10.0" @@ -26,8 +26,8 @@ workspace "BigBaseV2" { "_CRT_SECURE_NO_WARNINGS", "NOMINMAX", - "WIN32_LEAN_AND_MEAN", - "_WIN32_WINNT=0x601" -- Support Windows 7 + "WIN32_LEAN_AND_MEAN" +-- "_WIN32_WINNT=0x601" -- Support Windows 7 } disablewarnings @@ -51,28 +51,6 @@ workspace "BigBaseV2" filter "not configurations:Debug" defines { "NDEBUG" } end - - project "fmtlib" - location "vendor/%{prj.name}" - kind "StaticLib" - language "C++" - - targetdir ("bin/lib/" .. outputdir) - objdir ("bin/lib/int/" .. outputdir .. "/%{prj.name}") - - files - { - "vendor/%{prj.name}/include/**.h", - "vendor/%{prj.name}/src/**.cc" - } - - includedirs - { - "vendor/%{prj.name}/include" - } - - DeclareMSVCOptions() - DeclareDebugOptions() project "g3log" location "vendor/%{prj.name}" @@ -87,8 +65,9 @@ workspace "BigBaseV2" "vendor/%{prj.name}/src" } - if(file_exists("vendor\\g3log\\src\\g3log\\generated_definitions.hpp") == false) then - file = io.open("vendor\\g3log\\src\\g3log\\generated_definitions.hpp", "w") + g3log_file = "vendor/g3log/src/g3log/generated_definitions.hpp" + if(file_exists(g3log_file) == false) then + file = io.open(g3log_file, "w") if(file == nil) then premake.error("Failed to locate vendor directories. Try doing git pull --recurse-submodules.") end @@ -224,7 +203,6 @@ workspace "BigBaseV2" includedirs { "%{prj.name}/src/", - "vendor/fmtlib/include", "vendor/g3log/src", "vendor/GTAV-Classes", "vendor/ImGui", @@ -240,7 +218,6 @@ workspace "BigBaseV2" links { - "fmtlib", "g3log", "ImGui", "MinHook", diff --git a/vendor/fmtlib b/vendor/fmtlib deleted file mode 160000 index a6fafe2f..00000000 --- a/vendor/fmtlib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a6fafe2f0191cd456d6df66a3071c35c087188a0