Fix crash with nvidia overlay

This commit is contained in:
Grinch_ 2021-07-09 15:02:54 +06:00
parent a7e69d0d05
commit b082a6da30
4 changed files with 11 additions and 10 deletions

View File

@ -166,19 +166,19 @@ Hook::Hook()
{
ImGui::CreateContext();
// gtaRenderHook
if (init(kiero::RenderType::D3D11) == kiero::Status::Success)
if (init(kiero::RenderType::D3D9) == kiero::Status::Success)
{
Globals::renderer = Render_DirectX11;
kiero::bind(8, (void**)&oPresent11, Dx11Handler);
Globals::renderer = Render_DirectX9;
kiero::bind(16, (void**)&oReset, Reset);
kiero::bind(42, (void**)&oEndScene, Dx9Handler);
}
else
{
if (init(kiero::RenderType::D3D9) == kiero::Status::Success)
// gtaRenderHook
if (init(kiero::RenderType::D3D11) == kiero::Status::Success)
{
Globals::renderer = Render_DirectX9;
kiero::bind(16, (void**)&oReset, Reset);
kiero::bind(42, (void**)&oEndScene, Dx9Handler);
Globals::renderer = Render_DirectX11;
kiero::bind(8, (void**)&oPresent11, Dx11Handler);
}
}
}

View File

@ -15,7 +15,7 @@ private:
inline static f_EndScene oEndScene;
inline static f_Reset oReset;
inline static bool m_bMouseVisibility;
static void CALLBACK RenderFrame(void* ptr);
static HRESULT CALLBACK Dx9Handler(IDirect3DDevice9* pDevice);
static HRESULT CALLBACK Dx11Handler(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);

View File

@ -8,6 +8,7 @@ Vehicle::Vehicle()
{
ParseVehiclesIDE();
ParseCarcolsDAT();
Events::processScriptsEvent += [this]
{
if (!m_bImagesLoaded)

View File

@ -93,7 +93,7 @@ struct STextureStructure
{
std::string m_FileName;
std::string m_CategoryName;
void* m_pTexture;
void* m_pTexture = nullptr;
};
struct HotKeyData