From c49b9d540f33060d597896e92bae17375c76f129 Mon Sep 17 00:00:00 2001 From: SlynxCZ Date: Wed, 14 Jan 2026 17:20:19 +0400 Subject: [PATCH] Chore: fix windows building caz useless MSVC --- docker/Dockerfile | 7 ++++++- src/Shared.cpp | 19 ------------------- src/Shared.h | 7 ------- src/vectorextends.h | 5 +++++ 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 152fee3..fd61869 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,9 +2,14 @@ FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest WORKDIR /app +RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-21 main" >> /etc/apt/sources.list.d/llvm.list +RUN echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-21 main" >> /etc/apt/sources.list.d/llvm.list +RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - +RUN apt update && apt install -y clang-21 +RUN ln -sf /usr/bin/clang-21 /usr/bin/clang && ln -sf /usr/bin/clang++-21 /usr/bin/clang++ + RUN apt update && apt install -y \ build-essential \ - g++ \ cmake \ ninja-build \ git \ diff --git a/src/Shared.cpp b/src/Shared.cpp index 7f34817..6245f74 100644 --- a/src/Shared.cpp +++ b/src/Shared.cpp @@ -38,25 +38,6 @@ namespace RayTracePlugin::shared if (!g_pGlobalVars) g_pGlobalVars = server->GetGlobals(); return g_pNetworkServerService->GetIGameServer()->GetGlobals(); } - constexpr float engine_fixed_tick_interval = 0.015625f; - const char* GetMapName() - { - if (getGlobalVars() == nullptr) return nullptr; - return getGlobalVars()->mapname.ToCStr(); - } - void ServerCommand(const char* command) - { - auto clean_command = std::string(command); - clean_command.append("\n\0"); - g_pEngine->ServerCommand(clean_command.c_str()); - } - double GetEngineTime() { return Plat_FloatTime(); } - float GetTickInterval() { return engine_fixed_tick_interval; } - float GetCurrentTime() { return getGlobalVars()->curtime; } - int GetTickCount() { return getGlobalVars()->tickcount; } - float GetGameFrameTime() { return getGlobalVars()->frametime; } - - bool g_bHasTicked = false; bool g_bDetoursLoaded = false; } diff --git a/src/Shared.h b/src/Shared.h index 19b0fae..a6fbec4 100644 --- a/src/Shared.h +++ b/src/Shared.h @@ -37,13 +37,6 @@ namespace RayTracePlugin::shared extern int source_hook_pluginid; CGlobalVars* getGlobalVars(); - extern const char *GetMapName(); - extern void ServerCommand(const char *command); - extern double GetEngineTime(); - extern float GetTickInterval(); - extern float GetCurrentTime(); - extern int GetTickCount(); - extern float GetGameFrameTime(); extern bool g_bDetoursLoaded; } diff --git a/src/vectorextends.h b/src/vectorextends.h index 1df201c..720952f 100644 --- a/src/vectorextends.h +++ b/src/vectorextends.h @@ -8,6 +8,11 @@ #include #include +#ifdef _WIN32 +#undef min +#undef max +#endif + namespace RayTracePlugin::VectorExtends { inline const Vector VectorZero{0.0f, 0.0f, 0.0f};