diff --git a/CMakeLists.txt b/CMakeLists.txt index d4307989..ecf74de4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(GameValues "tf2;hl2dm;dab;tf2c;css;dynamic" CACHE INTERNAL "List of supporte set_property(CACHE Game PROPERTY STRINGS ${GameValues}) set(EnableVisuals 1 CACHE BOOL "Enable Visuals") +set(ExternalDrawing 0 CACHE BOOL "External Visuals") set(EnableGUI 1 CACHE BOOL "Enable GUI") set(EnableIPC 0 CACHE BOOL "Enable IPC") set(DataPath "/opt/cathook/data" CACHE STRING "Data location") @@ -23,6 +24,8 @@ find_package(SimpleIPC REQUIRED) get_target_property(SimpleIPC_INCLUDE_DIRS SimpleIPC INTERFACE_INCLUDE_DIRECTORIES) +configure_file(include/config.h.in ${CMAKE_SOURCE_DIR}/include/config.h @ONLY) + add_library(cathook SHARED "") set_target_properties(cathook PROPERTIES COMPILE_FLAGS "-m32 -msse -msse2 -msse3" LINK_FLAGS "-m32 -static") diff --git a/include/.gitignore b/include/.gitignore new file mode 100644 index 00000000..299bb98e --- /dev/null +++ b/include/.gitignore @@ -0,0 +1 @@ +config.h \ No newline at end of file diff --git a/include/common.hpp b/include/common.hpp index 6f8e40ed..831370e7 100755 --- a/include/common.hpp +++ b/include/common.hpp @@ -1,18 +1,13 @@ /* - * common.h + * common.hpp * * Created on: Dec 5, 2016 * Author: nullifiedcat */ -#ifndef COMMON_H_ -#define COMMON_H_ +#pragma once -#if defined(LINUX) and not defined(NO_IPC) -#define ENABLE_IPC 1 -#else -#undef ENABLE_IPC -#endif +#include "config.h" #include #include @@ -41,12 +36,12 @@ #include #include #include -#include #include #include -#include #include -#include +#include +#include +#include #include "timer.hpp" #include "averager.hpp" @@ -151,5 +146,3 @@ template constexpr T _clamp(T _min, T _max, T _val) #define GET_RENDER_CONTEXT \ (IsTF2() ? g_IMaterialSystem->GetRenderContext() \ : g_IMaterialSystemHL->GetRenderContext()) - -#endif /* COMMON_H_ */ diff --git a/include/config.h.in b/include/config.h.in index d9fc8203..83a31abc 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -2,6 +2,7 @@ #define GAME @Game@ #define ENABLE_VISUALS @EnableVisuals@ +#define EXTERNAL_DRAWING @ExternalDrawing@ #define ENABLE_GUI @EnableGUI@ #define ENABLE_IPC @EnableIPC@ #define DATA_PATH "@DataPath@" diff --git a/include/macros.hpp b/include/macros.hpp index 28ae6788..725dbfb3 100755 --- a/include/macros.hpp +++ b/include/macros.hpp @@ -23,9 +23,5 @@ constexpr int c_strcmp(char const *lhs, char const *rhs) : c_strcmp(lhs + 1, rhs + 1); } -#ifndef DATA_PATH -#define DATA_PATH "/opt/cathook" -#endif - #define FEATURE_RADAR_DISABLED #define FEATURE_FIDGET_SPINNER_DISABLED diff --git a/src/crits.cpp b/src/crits.cpp index 130d93cd..4f97881e 100644 --- a/src/crits.cpp +++ b/src/crits.cpp @@ -6,7 +6,6 @@ */ #include "common.hpp" -#include CatVar crit_info(CV_SWITCH, "crit_info", "0", "Show crit info"); CatVar crit_key(CV_KEY, "crit_key", "0", "Crit Key"); diff --git a/src/hack.cpp b/src/hack.cpp index 1fb6855d..7fcc0c41 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -47,7 +47,7 @@ const std::string &hack::GetType() #if not ENABLE_GUI version += " NOGUI"; #else - version += " IMGUI"; + version += " GUI"; #endif #ifndef DYNAMIC_CLASSES