From d87760b78b8fdd4fd0e6801d69bf0a71752ccb7e Mon Sep 17 00:00:00 2001 From: Nemirtingas Date: Wed, 14 Aug 2019 15:09:57 +0200 Subject: [PATCH] Created a define to not compile overlay. --- overlay_experimental/Base_Hook.cpp | 6 +++++- overlay_experimental/Base_Hook.h | 4 ++-- overlay_experimental/DX10_Hook.cpp | 4 ++-- overlay_experimental/DX10_Hook.h | 4 ++-- overlay_experimental/DX11_Hook.cpp | 4 ++-- overlay_experimental/DX11_Hook.h | 4 ++-- overlay_experimental/DX12_Hook.cpp | 4 ++-- overlay_experimental/DX12_Hook.h | 4 ++-- overlay_experimental/DX9_Hook.cpp | 4 ++-- overlay_experimental/DX9_Hook.h | 4 ++-- overlay_experimental/Hook_Manager.cpp | 6 +++++- overlay_experimental/Hook_Manager.h | 4 ++-- overlay_experimental/OpenGL_Hook.cpp | 4 ++-- overlay_experimental/OpenGL_Hook.h | 4 ++-- overlay_experimental/steam_overlay.cpp | 8 +------- overlay_experimental/steam_overlay.h | 2 +- 16 files changed, 36 insertions(+), 34 deletions(-) diff --git a/overlay_experimental/Base_Hook.cpp b/overlay_experimental/Base_Hook.cpp index d0da907..4c98310 100644 --- a/overlay_experimental/Base_Hook.cpp +++ b/overlay_experimental/Base_Hook.cpp @@ -1,5 +1,7 @@ #include "Base_Hook.h" +#ifndef NO_OVERLAY + #include #include "Hook_Manager.h" @@ -38,4 +40,6 @@ void Base_Hook::HookFunc(std::pair hook) { if( DetourAttach(hook.first, hook.second) == 0 ) _hooked_funcs.emplace_back(hook); -} \ No newline at end of file +} + +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/Base_Hook.h b/overlay_experimental/Base_Hook.h index e00404e..47a04cd 100644 --- a/overlay_experimental/Base_Hook.h +++ b/overlay_experimental/Base_Hook.h @@ -3,7 +3,7 @@ #include "../dll/base.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN @@ -49,6 +49,6 @@ public: } }; -#endif +#endif//NO_OVERLAY #endif//__INCLUDED_BASE_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/DX10_Hook.cpp b/overlay_experimental/DX10_Hook.cpp index f065455..103079c 100644 --- a/overlay_experimental/DX10_Hook.cpp +++ b/overlay_experimental/DX10_Hook.cpp @@ -1,6 +1,6 @@ #include "../dll/base.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include "DX10_Hook.h" #include "Hook_Manager.h" @@ -214,4 +214,4 @@ void DX10_Hook::loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain) #undef LOAD_FUNC } -#endif \ No newline at end of file +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/DX10_Hook.h b/overlay_experimental/DX10_Hook.h index a713287..ffcbca6 100644 --- a/overlay_experimental/DX10_Hook.h +++ b/overlay_experimental/DX10_Hook.h @@ -2,7 +2,7 @@ #define __INCLUDED_DX10_HOOK_H__ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include "DirectX_VTables.h" @@ -48,6 +48,6 @@ public: void loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain); }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_DX10_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/DX11_Hook.cpp b/overlay_experimental/DX11_Hook.cpp index 782d007..3541d30 100644 --- a/overlay_experimental/DX11_Hook.cpp +++ b/overlay_experimental/DX11_Hook.cpp @@ -1,6 +1,6 @@ #include "../dll/base.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include "DX11_Hook.h" #include "Hook_Manager.h" @@ -233,4 +233,4 @@ void DX11_Hook::loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain) #undef LOAD_FUNC } -#endif \ No newline at end of file +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/DX11_Hook.h b/overlay_experimental/DX11_Hook.h index be04502..838c51f 100644 --- a/overlay_experimental/DX11_Hook.h +++ b/overlay_experimental/DX11_Hook.h @@ -2,7 +2,7 @@ #define __INCLUDED_DX11_HOOK_H__ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include "DirectX_VTables.h" @@ -48,6 +48,6 @@ public: void loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain); }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_DX11_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/DX12_Hook.cpp b/overlay_experimental/DX12_Hook.cpp index 799f334..5e117d3 100644 --- a/overlay_experimental/DX12_Hook.cpp +++ b/overlay_experimental/DX12_Hook.cpp @@ -1,6 +1,6 @@ #include "../dll/base.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include "DX12_Hook.h" #include "Hook_Manager.h" @@ -189,4 +189,4 @@ void DX12_Hook::loadFunctions(ID3D12Device *pDevice, IDXGISwapChain *pSwapChain) #undef LOAD_FUNC } -#endif \ No newline at end of file +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/DX12_Hook.h b/overlay_experimental/DX12_Hook.h index c01acd5..e89d90c 100644 --- a/overlay_experimental/DX12_Hook.h +++ b/overlay_experimental/DX12_Hook.h @@ -2,7 +2,7 @@ #define __INCLUDED_DX12_HOOK_H__ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include "DirectX_VTables.h" @@ -48,5 +48,5 @@ public: void loadFunctions(ID3D12Device *pDevice, IDXGISwapChain *pSwapChain); }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_DX12_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/DX9_Hook.cpp b/overlay_experimental/DX9_Hook.cpp index 0affc7f..2d8dbf9 100644 --- a/overlay_experimental/DX9_Hook.cpp +++ b/overlay_experimental/DX9_Hook.cpp @@ -1,6 +1,6 @@ #include "DX9_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include "Hook_Manager.h" @@ -227,4 +227,4 @@ void DX9_Hook::loadFunctions(IDirect3DDevice9Ex* pDeviceEx) #undef LOAD_FUNC } -#endif \ No newline at end of file +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/DX9_Hook.h b/overlay_experimental/DX9_Hook.h index 69470d1..86678aa 100644 --- a/overlay_experimental/DX9_Hook.h +++ b/overlay_experimental/DX9_Hook.h @@ -2,7 +2,7 @@ #define __INCLUDED_DX9_HOOK_H__ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include "DirectX_VTables.h" @@ -49,6 +49,6 @@ public: void loadFunctions(IDirect3DDevice9Ex *pDeviceEx); }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_DX9_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/Hook_Manager.cpp b/overlay_experimental/Hook_Manager.cpp index 32812a4..16f2d01 100644 --- a/overlay_experimental/Hook_Manager.cpp +++ b/overlay_experimental/Hook_Manager.cpp @@ -1,6 +1,8 @@ #include "../dll/dll.h" #include "Hook_Manager.h" +#ifndef NO_OVERLAY + #include "../detours/detours.h" #include "DX12_Hook.h" @@ -172,4 +174,6 @@ void Hook_Manager::ChangeGameWindow(HWND hWnd) const void Hook_Manager::CallOverlayProc(int width, int height) const { overlay->OverlayProc(width, height); -} \ No newline at end of file +} + +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/Hook_Manager.h b/overlay_experimental/Hook_Manager.h index 5a600af..529b828 100644 --- a/overlay_experimental/Hook_Manager.h +++ b/overlay_experimental/Hook_Manager.h @@ -3,7 +3,7 @@ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include @@ -45,6 +45,6 @@ public: Steam_Overlay* GetOverlay() const { return overlay; } }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_HOOK_BASE_H__ \ No newline at end of file diff --git a/overlay_experimental/OpenGL_Hook.cpp b/overlay_experimental/OpenGL_Hook.cpp index 368a07f..ff77a35 100644 --- a/overlay_experimental/OpenGL_Hook.cpp +++ b/overlay_experimental/OpenGL_Hook.cpp @@ -1,6 +1,6 @@ #include "../dll/base.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include "OpenGL_Hook.h" #include "Hook_Manager.h" @@ -152,4 +152,4 @@ void OpenGL_Hook::Create() } } -#endif \ No newline at end of file +#endif//NO_OVERLAY \ No newline at end of file diff --git a/overlay_experimental/OpenGL_Hook.h b/overlay_experimental/OpenGL_Hook.h index b32cf88..975cf92 100644 --- a/overlay_experimental/OpenGL_Hook.h +++ b/overlay_experimental/OpenGL_Hook.h @@ -2,7 +2,7 @@ #define __INCLUDED_OPENGL_HOOK_H__ #include "Base_Hook.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY class OpenGL_Hook : public Base_Hook { @@ -38,5 +38,5 @@ public: static void Create(); // Initialize OGL Hook. }; -#endif//STEAM_WIN32 +#endif//NO_OVERLAY #endif//__INCLUDED_OPENGL_HOOK_H__ \ No newline at end of file diff --git a/overlay_experimental/steam_overlay.cpp b/overlay_experimental/steam_overlay.cpp index 723e4a2..f0e42af 100644 --- a/overlay_experimental/steam_overlay.cpp +++ b/overlay_experimental/steam_overlay.cpp @@ -1,6 +1,6 @@ #include "steam_overlay.h" -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY #include #include @@ -561,10 +561,4 @@ void Steam_Overlay::RunCallbacks() } } -#else - -/* TODO: - * Add here the code for Linux overlay - */ - #endif \ No newline at end of file diff --git a/overlay_experimental/steam_overlay.h b/overlay_experimental/steam_overlay.h index 0f95031..4a6bf22 100644 --- a/overlay_experimental/steam_overlay.h +++ b/overlay_experimental/steam_overlay.h @@ -39,7 +39,7 @@ struct Friend_Less } }; -#ifdef STEAM_WIN32 +#ifndef NO_OVERLAY class Steam_Overlay {