Created a define to not compile overlay.

This commit is contained in:
Nemirtingas 2019-08-14 15:09:57 +02:00
parent 40d7237ab0
commit d87760b78b
16 changed files with 36 additions and 34 deletions

View File

@ -1,5 +1,7 @@
#include "Base_Hook.h" #include "Base_Hook.h"
#ifndef NO_OVERLAY
#include <algorithm> #include <algorithm>
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -39,3 +41,5 @@ void Base_Hook::HookFunc(std::pair<void**, void*> hook)
if( DetourAttach(hook.first, hook.second) == 0 ) if( DetourAttach(hook.first, hook.second) == 0 )
_hooked_funcs.emplace_back(hook); _hooked_funcs.emplace_back(hook);
} }
#endif//NO_OVERLAY

View File

@ -3,7 +3,7 @@
#include "../dll/base.h" #include "../dll/base.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN #define VC_EXTRALEAN
@ -49,6 +49,6 @@ public:
} }
}; };
#endif #endif//NO_OVERLAY
#endif//__INCLUDED_BASE_HOOK_H__ #endif//__INCLUDED_BASE_HOOK_H__

View File

@ -1,6 +1,6 @@
#include "../dll/base.h" #include "../dll/base.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include "DX10_Hook.h" #include "DX10_Hook.h"
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -214,4 +214,4 @@ void DX10_Hook::loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain)
#undef LOAD_FUNC #undef LOAD_FUNC
} }
#endif #endif//NO_OVERLAY

View File

@ -2,7 +2,7 @@
#define __INCLUDED_DX10_HOOK_H__ #define __INCLUDED_DX10_HOOK_H__
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <d3d10.h> #include <d3d10.h>
#include "DirectX_VTables.h" #include "DirectX_VTables.h"
@ -48,6 +48,6 @@ public:
void loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain); void loadFunctions(ID3D10Device *pDevice, IDXGISwapChain *pSwapChain);
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_DX10_HOOK_H__ #endif//__INCLUDED_DX10_HOOK_H__

View File

@ -1,6 +1,6 @@
#include "../dll/base.h" #include "../dll/base.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include "DX11_Hook.h" #include "DX11_Hook.h"
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -233,4 +233,4 @@ void DX11_Hook::loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain)
#undef LOAD_FUNC #undef LOAD_FUNC
} }
#endif #endif//NO_OVERLAY

View File

@ -2,7 +2,7 @@
#define __INCLUDED_DX11_HOOK_H__ #define __INCLUDED_DX11_HOOK_H__
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <d3d11.h> #include <d3d11.h>
#include "DirectX_VTables.h" #include "DirectX_VTables.h"
@ -48,6 +48,6 @@ public:
void loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain); void loadFunctions(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_DX11_HOOK_H__ #endif//__INCLUDED_DX11_HOOK_H__

View File

@ -1,6 +1,6 @@
#include "../dll/base.h" #include "../dll/base.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include "DX12_Hook.h" #include "DX12_Hook.h"
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -189,4 +189,4 @@ void DX12_Hook::loadFunctions(ID3D12Device *pDevice, IDXGISwapChain *pSwapChain)
#undef LOAD_FUNC #undef LOAD_FUNC
} }
#endif #endif//NO_OVERLAY

View File

@ -2,7 +2,7 @@
#define __INCLUDED_DX12_HOOK_H__ #define __INCLUDED_DX12_HOOK_H__
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <d3d12.h> #include <d3d12.h>
#include "DirectX_VTables.h" #include "DirectX_VTables.h"
@ -48,5 +48,5 @@ public:
void loadFunctions(ID3D12Device *pDevice, IDXGISwapChain *pSwapChain); void loadFunctions(ID3D12Device *pDevice, IDXGISwapChain *pSwapChain);
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_DX12_HOOK_H__ #endif//__INCLUDED_DX12_HOOK_H__

View File

@ -1,6 +1,6 @@
#include "DX9_Hook.h" #include "DX9_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -227,4 +227,4 @@ void DX9_Hook::loadFunctions(IDirect3DDevice9Ex* pDeviceEx)
#undef LOAD_FUNC #undef LOAD_FUNC
} }
#endif #endif//NO_OVERLAY

View File

@ -2,7 +2,7 @@
#define __INCLUDED_DX9_HOOK_H__ #define __INCLUDED_DX9_HOOK_H__
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <d3d9.h> #include <d3d9.h>
#include "DirectX_VTables.h" #include "DirectX_VTables.h"
@ -49,6 +49,6 @@ public:
void loadFunctions(IDirect3DDevice9Ex *pDeviceEx); void loadFunctions(IDirect3DDevice9Ex *pDeviceEx);
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_DX9_HOOK_H__ #endif//__INCLUDED_DX9_HOOK_H__

View File

@ -1,6 +1,8 @@
#include "../dll/dll.h" #include "../dll/dll.h"
#include "Hook_Manager.h" #include "Hook_Manager.h"
#ifndef NO_OVERLAY
#include "../detours/detours.h" #include "../detours/detours.h"
#include "DX12_Hook.h" #include "DX12_Hook.h"
@ -173,3 +175,5 @@ void Hook_Manager::CallOverlayProc(int width, int height) const
{ {
overlay->OverlayProc(width, height); overlay->OverlayProc(width, height);
} }
#endif//NO_OVERLAY

View File

@ -3,7 +3,7 @@
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <Windows.h> #include <Windows.h>
#include <vector> #include <vector>
@ -45,6 +45,6 @@ public:
Steam_Overlay* GetOverlay() const { return overlay; } Steam_Overlay* GetOverlay() const { return overlay; }
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_HOOK_BASE_H__ #endif//__INCLUDED_HOOK_BASE_H__

View File

@ -1,6 +1,6 @@
#include "../dll/base.h" #include "../dll/base.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include "OpenGL_Hook.h" #include "OpenGL_Hook.h"
#include "Hook_Manager.h" #include "Hook_Manager.h"
@ -152,4 +152,4 @@ void OpenGL_Hook::Create()
} }
} }
#endif #endif//NO_OVERLAY

View File

@ -2,7 +2,7 @@
#define __INCLUDED_OPENGL_HOOK_H__ #define __INCLUDED_OPENGL_HOOK_H__
#include "Base_Hook.h" #include "Base_Hook.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
class OpenGL_Hook : public Base_Hook class OpenGL_Hook : public Base_Hook
{ {
@ -38,5 +38,5 @@ public:
static void Create(); // Initialize OGL Hook. static void Create(); // Initialize OGL Hook.
}; };
#endif//STEAM_WIN32 #endif//NO_OVERLAY
#endif//__INCLUDED_OPENGL_HOOK_H__ #endif//__INCLUDED_OPENGL_HOOK_H__

View File

@ -1,6 +1,6 @@
#include "steam_overlay.h" #include "steam_overlay.h"
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
#include <thread> #include <thread>
#include <string> #include <string>
@ -561,10 +561,4 @@ void Steam_Overlay::RunCallbacks()
} }
} }
#else
/* TODO:
* Add here the code for Linux overlay
*/
#endif #endif

View File

@ -39,7 +39,7 @@ struct Friend_Less
} }
}; };
#ifdef STEAM_WIN32 #ifndef NO_OVERLAY
class Steam_Overlay class Steam_Overlay
{ {