/* * common.h * * Created on: Dec 5, 2016 * Author: nullifiedcat */ #ifndef COMMON_H_ #define COMMON_H_ #if defined(LINUX) and not defined(NO_IPC) #define ENABLE_IPC 1 #else #undef ENABLE_IPC #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "timer.hpp" #include "averager.hpp" #include "segvcatch/segvcatch.h" #include #include "macros.hpp" #include "colors.hpp" #if ENABLE_VISUALS == 1 extern "C" { #include } #include "ftrender.hpp" #include "drawing.hpp" #include "fidgetspinner.hpp" #include DRAW_API #include "EffectGlow.hpp" #include "atlas.hpp" #include "EffectChams.hpp" #include "drawmgr.hpp" #endif #include "profiler.hpp" #include "offsets.hpp" #include #include "hoovy.hpp" #include #include "projlogging.hpp" #include "ucccccp_cmds.hpp" #include "velocity.hpp" #include "angles.hpp" #include "entityhitboxcache.hpp" #include "globals.h" #include #include "playerlist.hpp" #include #include #include #include #include #include "playerresource.h" #include "usercmd.hpp" #include "trace.hpp" #include #include "netvars.hpp" #include "vfunc.hpp" #include "hooks.hpp" #include #include #include #include #include "textfile.hpp" #include "ipc.hpp" #include "hooks/hookedmethods.hpp" #include "classinfo/classinfo.hpp" #include "crits.hpp" #include "textmode.hpp" #include "backpacktf.hpp" #include "sharedobj.hpp" #include "init.hpp" #include "copypasted/Netvar.h" #include "copypasted/CSignature.h" #if ENABLE_GUI #include "gui/GUI.hpp" #endif #include #include template constexpr T _clamp(T _min, T _max, T _val) { return ((_val > _max) ? _max : ((_val < _min) ? _min : _val)); } #define _FASTCALL __attribute__((fastcall)) #define STRINGIFY(x) #x #include "gameinfo.hpp" #define SQR(x) (x) * (x) #ifndef CATHOOK_BUILD_NUMBER #define CATHOOK_BUILD_NUMBER "LATEST" #endif #define CATHOOK_BUILD_NAME "Cat's Eye" #define CON_NAME "cat" #define CON_PREFIX CON_NAME "_" #define SUPER_VERBOSE_DEBUG false #if SUPER_VERBOSE_DEBUG == true #define SVDBG(...) logging::Info(__VA_ARGS__) #else #define SVDBG(...) #endif #ifndef DEG2RAD #define DEG2RAD(x) (float)(x) * (PI / 180.0f) #endif #define DEBUG_SEGV false #define STR(c) #c #if DEBUG_SEGV == true #define SEGV_BEGIN \ try { #define SEGV_END \ } catch (...) { \ logging::Info("SEGV/FPE occured! %s in %s:%d", __func__, __FILE__, __LINE__); \ } #define SEGV_END_INFO(x) \ } catch (...) { \ logging::Info("SEGV/FPE occured! (%s)", x); \ } #define SAFE_CALL(x) \ SEGV_BEGIN \ x; \ SEGV_END_INFO(#x) #else #define SEGV_BEGIN #define SEGV_END #define SEGV_END_INFO(x) #define SAFE_CALL(x) x #endif #define GET_RENDER_CONTEXT (IsTF2() ? g_IMaterialSystem->GetRenderContext() : g_IMaterialSystemHL->GetRenderContext()) #endif /* COMMON_H_ */