diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 1ba56a18..744abdef 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -38,7 +38,8 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/trace.hpp" "${CMAKE_CURRENT_LIST_DIR}/velocity.hpp" "${CMAKE_CURRENT_LIST_DIR}/votelogger.hpp" - "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.hpp") + "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.hpp" + "${CMAKE_CURRENT_LIST_DIR}/Options.hpp") target_include_directories(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}") diff --git a/include/Options.hpp b/include/Options.hpp new file mode 100644 index 00000000..51e977a2 --- /dev/null +++ b/include/Options.hpp @@ -0,0 +1,13 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#pragma once + +namespace options +{ + + + +} \ No newline at end of file diff --git a/include/hacks/Aimbot.hpp b/include/hacks/Aimbot.hpp index f5ddef05..5e9e903b 100755 --- a/include/hacks/Aimbot.hpp +++ b/include/hacks/Aimbot.hpp @@ -13,11 +13,7 @@ class ConVar; class IClientEntity; -namespace hacks -{ -namespace shared -{ -namespace aimbot +namespace hacks::shared::aimbot { // Used to store aimbot data to prevent calculating it again @@ -61,5 +57,3 @@ void DoSlowAim(Vector &inputAngle); bool UpdateAimkey(); float EffectiveTargetingRange(); } -} -} diff --git a/include/hacks/Announcer.hpp b/include/hacks/Announcer.hpp index 670c5c79..9763cae6 100644 --- a/include/hacks/Announcer.hpp +++ b/include/hacks/Announcer.hpp @@ -9,16 +9,10 @@ #include "common.hpp" -namespace hacks -{ -namespace shared -{ -namespace announcer +namespace hacks::shared::announcer { void playsound(const std::string &); void init(); void shutdown(); } -} -} diff --git a/include/hacks/AntiAim.hpp b/include/hacks/AntiAim.hpp index fb14de2d..8c671e06 100755 --- a/include/hacks/AntiAim.hpp +++ b/include/hacks/AntiAim.hpp @@ -10,11 +10,7 @@ class CatVar; class CUserCmd; -namespace hacks -{ -namespace shared -{ -namespace antiaim +namespace hacks::shared::antiaim { // TODO paste AA from AimTux @@ -35,6 +31,4 @@ extern int safe_space; void SetSafeSpace(int safespace); bool ShouldAA(CUserCmd *cmd); void ProcessUserCmd(CUserCmd *cmd); -} -} -} +} \ No newline at end of file diff --git a/include/hacks/AntiBackstab.hpp b/include/hacks/AntiBackstab.hpp index 91f8275a..21eaee94 100755 --- a/include/hacks/AntiBackstab.hpp +++ b/include/hacks/AntiBackstab.hpp @@ -7,15 +7,12 @@ #pragma once -namespace hacks -{ -namespace tf2 -{ -namespace antibackstab +namespace hacks::tf2::antibackstab { + extern bool noaa; + void CreateMove(); + void PaintTraverse(); } -} -} diff --git a/include/hacks/AntiCheat.hpp b/include/hacks/AntiCheat.hpp index 95e42e26..2f2ffb84 100755 --- a/include/hacks/AntiCheat.hpp +++ b/include/hacks/AntiCheat.hpp @@ -13,11 +13,7 @@ #include "ac/antiaim.hpp" #include "ac/bhop.hpp" -namespace hacks -{ -namespace shared -{ -namespace anticheat +namespace hacks::shared::anticheat { void Accuse(int eid, const std::string &hack, const std::string &details); @@ -27,6 +23,4 @@ void CreateMove(); void ResetPlayer(int index); void ResetEverything(); -} -} -} +} \ No newline at end of file diff --git a/include/hacks/AntiDisguise.hpp b/include/hacks/AntiDisguise.hpp index 5571a54d..2f1b774d 100755 --- a/include/hacks/AntiDisguise.hpp +++ b/include/hacks/AntiDisguise.hpp @@ -9,16 +9,10 @@ #include "common.hpp" -namespace hacks -{ -namespace tf2 -{ -namespace antidisguise +namespace hacks::tf2::antidisguise { extern CatVar enabled; void Draw(); } -} -} diff --git a/include/hacks/AutoBackstab.hpp b/include/hacks/AutoBackstab.hpp index 9f5f6ec5..d777510f 100755 --- a/include/hacks/AutoBackstab.hpp +++ b/include/hacks/AutoBackstab.hpp @@ -7,15 +7,9 @@ #pragma once -namespace hacks -{ -namespace tf2 -{ -namespace autobackstab +namespace hacks::tf2::autobackstab { void CreateMove(); const Vector GetWorldSpaceCenter(CachedEntity *ent); } -} -} diff --git a/include/hacks/AutoDeadringer.hpp b/include/hacks/AutoDeadringer.hpp index 4dc2bcef..317d11a2 100644 --- a/include/hacks/AutoDeadringer.hpp +++ b/include/hacks/AutoDeadringer.hpp @@ -6,13 +6,8 @@ */ #pragma once -namespace hacks -{ -namespace shared -{ -namespace deadringer +namespace hacks::shared::deadringer { + void CreateMove(); } -} -} diff --git a/include/hacks/AutoDetonator.hpp b/include/hacks/AutoDetonator.hpp index ab213202..9aa690f4 100755 --- a/include/hacks/AutoDetonator.hpp +++ b/include/hacks/AutoDetonator.hpp @@ -9,13 +9,8 @@ #include "common.hpp" -namespace hacks -{ -namespace tf -{ -namespace autodetonator +namespace hacks::tf::autodetonator { + void CreateMove(); } -} -} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b653f3b3..944a3379 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,7 +31,8 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/ucccccp_cmds.cpp" "${CMAKE_CURRENT_LIST_DIR}/velocity.cpp" "${CMAKE_CURRENT_LIST_DIR}/votelogger.cpp" - "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.cpp") + "${CMAKE_CURRENT_LIST_DIR}/MiscTemporary.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Options.cpp") add_subdirectory(core) add_subdirectory(classinfo) diff --git a/src/Options.cpp b/src/Options.cpp new file mode 100644 index 00000000..87f06c8f --- /dev/null +++ b/src/Options.cpp @@ -0,0 +1,8 @@ +/* + Created by Jenny White on 29.04.18. + Copyright (c) 2018 nullworks. All rights reserved. +*/ + +#include "Options.hpp" +#include "core/cvwrapper.hpp" + diff --git a/src/hooks/visual/SDL_GL_SwapWindow.cpp b/src/hooks/visual/SDL_GL_SwapWindow.cpp index 749700c3..ffea1dbf 100644 --- a/src/hooks/visual/SDL_GL_SwapWindow.cpp +++ b/src/hooks/visual/SDL_GL_SwapWindow.cpp @@ -49,7 +49,9 @@ DEFINE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *window) } { PROF_SECTION(SWAPWINDOW_tf2); - //SDL_GL_MakeCurrent(window, tf2_sdl); +#if EXTERNAL_DRAWING + SDL_GL_MakeCurrent(window, tf2_sdl); +#endif original::SDL_GL_SwapWindow(window); // glXMakeContextCurrent(wminfo.info.x11.display, // wminfo.info.x11.window, diff --git a/src/visual/drawex.cpp b/src/visual/drawex.cpp index 81ddaae1..ce0608c2 100755 --- a/src/visual/drawex.cpp +++ b/src/visual/drawex.cpp @@ -77,8 +77,8 @@ void initialize() logging::Info("Xoverlay initialized"); } xoverlay_show(); + context = SDL_GL_CreateContext(sdl_hooks::window); #else - //context = SDL_GL_CreateContext(sdl_hooks::window); glClearColor(1.0, 0.0, 0.0, 0.5); glewExperimental = GL_TRUE; glewInit(); @@ -159,10 +159,9 @@ void draw_begin() PROF_SECTION(DRAWEX_draw_begin); #if EXTERNAL_DRAWING xoverlay_draw_begin(); -#else { PROF_SECTION(draw_begin__SDL_GL_MakeCurrent); - //SDL_GL_MakeCurrent(sdl_hooks::window, context); + // SDL_GL_MakeCurrent(sdl_hooks::window, context); } #endif { @@ -179,12 +178,12 @@ void draw_end() PROF_SECTION(draw_end__glez_end); glez_end(); } - { - PROF_SECTION(draw_end__SDL_GL_MakeCurrent); - //SDL_GL_MakeCurrent(sdl_hooks::window, nullptr); - } #if EXTERNAL_DRAWING xoverlay_draw_end(); + { + PROF_SECTION(draw_end__SDL_GL_MakeCurrent); + SDL_GL_MakeCurrent(sdl_hooks::window, nullptr); + } #endif } }