diff --git a/.gitignore b/.gitignore index 8a829f67..de8c3647 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ __pycache__/ *.ipch *.gch *.pch +*.pyc # generated by CMAKE version.cpp \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 1edbbc5b..547bd7a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ include(scripts/async-logger.cmake) include(scripts/pugixml.cmake) include(scripts/json.cmake) include(scripts/cpr.cmake) -include(scripts/zydis.cmake) include(scripts/lua.cmake) include(scripts/imgui.cmake) message("\nFetching custom modules") @@ -52,10 +51,11 @@ target_include_directories(YimMenu PRIVATE "${json_SOURCE_DIR}/single_include" "${gtav_classes_SOURCE_DIR}" "${imgui_SOURCE_DIR}" + "${minhook_SOURCE_DIR}/src/hde" ) target_precompile_headers(YimMenu PRIVATE "${SRC_DIR}/common.hpp") -target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis lua_static) +target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr lua_static) # Warnings as errors set_property(TARGET YimMenu PROPERTY COMPILE_WARNING_AS_ERROR ON) @@ -65,3 +65,13 @@ add_compile_definitions(YimMenu "NOMINMAX" "WIN32_LEAN_AND_MEAN" ) + +# Optimizations +if(MSVC) + set(CMAKE_MODULE_LINKER_FLAGS + "${CMAKE_MODULE_LINKER_FLAGS} /LTCG /OPT:REF,ICF /GUARD:NO") + + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Ox /Oi /Ot /Oy /Ob3 /sdl- /GL /GF /GS- /Gw") + string(REPLACE "/Ob1" "/Ob3" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) +endif() diff --git a/CMakeSettings.json b/CMakeSettings.json index 68de1f1f..193e9988 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,26 +1,27 @@ -{ - "configurations": [ - { - "name": "x64-Debug", - "generator": "Ninja", - "configurationType": "Debug", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "" - }, - { - "name": "x64-Release", - "generator": "Ninja", - "configurationType": "RelWithDebInfo", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "" - } - ] +{ + "configurations": [ + { + "name": "x64-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "inheritEnvironments": [ "msvc_x64_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "" + }, + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [] + } + ] } \ No newline at end of file diff --git a/scripts/gtav-classes.cmake b/scripts/gtav-classes.cmake index ab9a7def..e3fa9f1d 100644 --- a/scripts/gtav-classes.cmake +++ b/scripts/gtav-classes.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( gtav_classes GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git - GIT_TAG eab95fba6d19ceeee0442158b6f5de6824ff7349 + GIT_TAG e8d8bdd2b3152253f6e1fde48720e4caeab19f83 GIT_PROGRESS TRUE CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/scripts/zydis.cmake b/scripts/zydis.cmake deleted file mode 100644 index 01150635..00000000 --- a/scripts/zydis.cmake +++ /dev/null @@ -1,15 +0,0 @@ -include(FetchContent) - -message("zydis") - -set(ZYDIS_BUILD_DOXYGEN OFF CACHE BOOL "Zydis Build Doxygen") -set(ZYDIS_FEATURE_ENCODER OFF CACHE BOOL "Zydis Feature Encoder") - -FetchContent_Declare( - zydis - GIT_REPOSITORY https://github.com/zyantific/zydis.git - GIT_TAG 8948d9a8f493330d27a0e7bbebf40f0391e45f1b - GIT_PROGRESS TRUE -) -FetchContent_MakeAvailable(zydis) -set_property(TARGET Zydis PROPERTY CXX_STANDARD 23) diff --git a/src/backend/commands/player/toxic/kick_from_interior.cpp b/src/backend/commands/player/toxic/kick_from_interior.cpp index 0250b51e..5a18af47 100644 --- a/src/backend/commands/player/toxic/kick_from_interior.cpp +++ b/src/backend/commands/player/toxic/kick_from_interior.cpp @@ -1,13 +1,8 @@ #include "backend/player_command.hpp" #include "core/scr_globals.hpp" #include "fiber_pool.hpp" -#include "gta/net_object_mgr.hpp" -#include "gta/script_handler.hpp" -#include "hooking.hpp" -#include "natives.hpp" #include "pointers.hpp" #include "services/script_connection/script_connection_service.hpp" -#include "util/scripts.hpp" #include