Fixed release config

This commit is contained in:
Grinch_ 2020-12-17 23:33:23 +06:00
parent 79040ef9c1
commit e458cbc95e
6 changed files with 94 additions and 20 deletions

14
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

59
.vscode/settings.json vendored
View File

@ -6,6 +6,63 @@
"filesystem": "cpp", "filesystem": "cpp",
"xlocale": "cpp", "xlocale": "cpp",
"xstring": "cpp", "xstring": "cpp",
"xutility": "cpp" "xutility": "cpp",
"ostream": "cpp",
"algorithm": "cpp",
"array": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"new": "cpp",
"numeric": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"valarray": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xfunctional": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xmemory0": "cpp",
"xstddef": "cpp",
"xtr1common": "cpp",
"xtree": "cpp"
} }
} }

View File

@ -116,10 +116,10 @@ include_directories(
# Compile definitions # Compile definitions
################################################################################ ################################################################################
target_compile_definitions(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:GTASARelease>:" "$<$<CONFIG:Release>:"
"_NDEBUG" "_NDEBUG"
">" ">"
"$<$<CONFIG:GTASAzDebug>:" "$<$<CONFIG:Debug>:"
"_DEBUG" "_DEBUG"
">" ">"
"_CRT_SECURE_NO_WARNINGS;" "_CRT_SECURE_NO_WARNINGS;"
@ -141,12 +141,12 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
################################################################################ ################################################################################
if(MSVC) if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:GTASARelease>: $<$<CONFIG:Release>:
/O2; /O2;
/Oi; /Oi;
/Gy /Gy
> >
$<$<CONFIG:GTASAzDebug>: $<$<CONFIG:Debug>:
/Od /Od
> >
/std:c++latest; /std:c++latest;
@ -197,13 +197,15 @@ if(MSVC)
) )
source_file_compile_options(external/imgui/imgui_widgets.cpp ${FILE_CL_OPTIONS}) source_file_compile_options(external/imgui/imgui_widgets.cpp ${FILE_CL_OPTIONS})
target_link_options(${PROJECT_NAME} PRIVATE target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:GTASARelease>: $<$<CONFIG:Release>:
/SAFESEH:NO; /SAFESEH:NO;
/OPT:REF; /OPT:REF;
/LTCG; /LTCG;
/OPT:ICF /OPT:ICF
> >
/DEBUG:FULL; $<$<CONFIG:Debug>:
/DEBUG:FULL;
>
/SUBSYSTEM:WINDOWS /SUBSYSTEM:WINDOWS
) )
endif() endif()
@ -215,8 +217,8 @@ add_custom_command_if(
TARGET ${PROJECT_NAME} TARGET ${PROJECT_NAME}
PRE_BUILD PRE_BUILD
COMMANDS COMMANDS
COMMAND $<CONFIG:GTASARelease> taskkill /f /fi "imagename eq gta_sa.exe" COMMAND $<CONFIG:Release> taskkill /f /fi "imagename eq gta_sa.exe"
COMMAND $<CONFIG:GTASAzDebug> taskkill /f /fi "imagename eq gta_sa.exe" COMMAND $<CONFIG:Debug> taskkill /f /fi "imagename eq gta_sa.exe"
) )
################################################################################ ################################################################################

View File

@ -51,11 +51,11 @@ CheatMenu::CheatMenu()
Globals::menu_size.x = config.GetValue<float>("window.sizeX", screen::GetScreenWidth() / 4.0f); Globals::menu_size.x = config.GetValue<float>("window.sizeX", screen::GetScreenWidth() / 4.0f);
Globals::menu_size.y = config.GetValue<float>("window.sizeY", screen::GetScreenHeight() / 1.2f); Globals::menu_size.y = config.GetValue<float>("window.sizeY", screen::GetScreenHeight() / 1.2f);
srand(CTimer::m_snTimeInMilliseconds); srand(CTimer::m_snTimeInMilliseconds);
}; };
Events::processScriptsEvent += [this] Events::processScriptsEvent += [this]
{ {
if (Globals::init_done && !FrontEndMenuManager.m_bMenuActive && CTimer::m_snTimeInMilliseconds - Globals::last_key_timer > 250) if (Globals::init_done && !FrontEndMenuManager.m_bMenuActive && CTimer::m_snTimeInMilliseconds - Globals::last_key_timer > 250)
{ {
if (Ui::HotKeyPressed(hotkey::menu_open)) if (Ui::HotKeyPressed(hotkey::menu_open))

View File

@ -68,12 +68,10 @@ HRESULT Hook::PresentDx9(IDirect3DDevice9 *pDevice, RECT* pSourceRect, RECT* pDe
ImGui::EndFrame(); ImGui::EndFrame();
ImGui::Render(); ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData()); ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
} }
else else
{ {
Globals::init_done = true; Globals::init_done = true;
ImGui::CreateContext(); ImGui::CreateContext();
ImGuiStyle& style = ImGui::GetStyle(); ImGuiStyle& style = ImGui::GetStyle();
@ -189,19 +187,23 @@ Hook::Hook()
{ {
if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success) if (kiero::init(kiero::RenderType::D3D9) == kiero::Status::Success)
{ {
assert(kiero::bind(16, (void**)&oReset9, ResetDx9) == kiero::Status::Success); if (kiero::bind(16, (void**)&oReset9, ResetDx9) == kiero::Status::Success
assert(kiero::bind(17, (void**)&oPresent9, PresentDx9) == kiero::Status::Success); && kiero::bind(17, (void**)&oPresent9, PresentDx9) == kiero::Status::Success)
Globals::renderer = Render_DirectX9; {
Globals::renderer = Render_DirectX9;
flog << "Successfully hooked dx9 device." << std::endl; flog << "Successfully hooked dx9 device." << std::endl;
}
} }
else else
{ {
// gtaRenderHook // gtaRenderHook
if (kiero::init(kiero::RenderType::D3D11) == kiero::Status::Success) if (kiero::init(kiero::RenderType::D3D11) == kiero::Status::Success)
{ {
kiero::bind(8, (void**)&oPresent11, PresentDx11); if (kiero::bind(8, (void**)&oPresent11, PresentDx11) == kiero::Status::Success)
Globals::renderer = Render_DirectX11; {
Globals::renderer = Render_DirectX11;
flog << "Successfully hooked dx11 device." << std::endl;
}
flog << "Successfully hooked dx11 device." << std::endl; flog << "Successfully hooked dx11 device." << std::endl;
} }

View File

@ -49,7 +49,6 @@ Ped::~Ped()
} }
} }
void Ped::SpawnPed(std::string& model) void Ped::SpawnPed(std::string& model)
{ {
if (spawn_ped::list.size() == SPAWN_PED_LIMIT) if (spawn_ped::list.size() == SPAWN_PED_LIMIT)