From 5ea579d27442c658aaaeb828fe5f6fe1db34c4c7 Mon Sep 17 00:00:00 2001 From: Lev Date: Thu, 9 Mar 2017 08:07:22 +0500 Subject: [PATCH] Adjust public amalgamation on dedicated project. Add files to project. --- rehlds/common/ObjectList.cpp | 4 ++-- rehlds/common/SteamAppStartUp.cpp | 2 ++ rehlds/common/TextConsoleUnix.cpp | 8 ++++--- rehlds/common/TextConsoleWin32.cpp | 7 +++--- rehlds/common/textconsole.cpp | 6 +---- rehlds/dedicated/build.gradle | 23 +++++++++++++++--- rehlds/dedicated/msvc/dedicated.vcxproj | 9 +++++++ .../dedicated/msvc/dedicated.vcxproj.filters | 24 +++++++++++++++++++ rehlds/dedicated/src/precompiled.h | 4 ++++ rehlds/dedicated/src/public_amalgamation.cpp | 8 ------- 10 files changed, 71 insertions(+), 24 deletions(-) diff --git a/rehlds/common/ObjectList.cpp b/rehlds/common/ObjectList.cpp index 58bba64..789c4a7 100644 --- a/rehlds/common/ObjectList.cpp +++ b/rehlds/common/ObjectList.cpp @@ -1,4 +1,4 @@ -#include "ObjectList.h" +#include "precompiled.h" ObjectList::ObjectList() { @@ -8,7 +8,7 @@ ObjectList::ObjectList() ObjectList::~ObjectList() { - Clear(false); + ObjectList::Clear(false); } bool ObjectList::AddHead(void *newObject) diff --git a/rehlds/common/SteamAppStartUp.cpp b/rehlds/common/SteamAppStartUp.cpp index ae38d12..344c360 100644 --- a/rehlds/common/SteamAppStartUp.cpp +++ b/rehlds/common/SteamAppStartUp.cpp @@ -1,3 +1,5 @@ +#include "precompiled.h" + #ifdef _WIN32 #include "SteamAppStartup.h" diff --git a/rehlds/common/TextConsoleUnix.cpp b/rehlds/common/TextConsoleUnix.cpp index 411d625..08a4e54 100644 --- a/rehlds/common/TextConsoleUnix.cpp +++ b/rehlds/common/TextConsoleUnix.cpp @@ -1,3 +1,5 @@ +#include "precompiled.h" + #if !defined(_WIN32) #include "TextConsoleUnix.h" @@ -15,7 +17,7 @@ CTextConsoleUnix console; CTextConsoleUnix::~CTextConsoleUnix() { - ShutDown(); + CTextConsoleUnix::ShutDown(); } bool CTextConsoleUnix::Init(IBaseSystem *system) @@ -76,8 +78,8 @@ void CTextConsoleUnix::ShutDown() { sigset_t block_ttou; - sigemptyset(&block_ttou); - sigaddset(&block_ttou, SIGTTOU); + sigemptyset(&block_ttou); + sigaddset(&block_ttou, SIGTTOU); sigprocmask(SIG_BLOCK, &block_ttou, NULL); tcsetattr(STDIN_FILENO, TCSANOW, &termStored); sigprocmask(SIG_UNBLOCK, &block_ttou, NULL); diff --git a/rehlds/common/TextConsoleWin32.cpp b/rehlds/common/TextConsoleWin32.cpp index c875740..6bcdfc5 100644 --- a/rehlds/common/TextConsoleWin32.cpp +++ b/rehlds/common/TextConsoleWin32.cpp @@ -1,5 +1,6 @@ +#include "precompiled.h" + #if defined(_WIN32) -#include "TextConsoleWin32.h" CTextConsoleWin32 console; @@ -46,7 +47,7 @@ HWND GetConsoleHwnd() CTextConsoleWin32::~CTextConsoleWin32() { - ShutDown(); + CTextConsoleWin32::ShutDown(); } bool CTextConsoleWin32::Init(IBaseSystem *system) @@ -56,7 +57,7 @@ bool CTextConsoleWin32::Init(IBaseSystem *system) SetTitle(m_System ? m_System->GetName() : "Console"); - hinput = GetStdHandle(STD_INPUT_HANDLE); + hinput = GetStdHandle(STD_INPUT_HANDLE); houtput = GetStdHandle(STD_OUTPUT_HANDLE); if (!SetConsoleCtrlHandler(&ConsoleHandlerRoutine, TRUE)) diff --git a/rehlds/common/textconsole.cpp b/rehlds/common/textconsole.cpp index 929784a..a0b8238 100644 --- a/rehlds/common/textconsole.cpp +++ b/rehlds/common/textconsole.cpp @@ -1,8 +1,4 @@ -#include -#include - -#include "textconsole.h" -#include "ObjectList.h" +#include "precompiled.h" bool CTextConsole::Init(IBaseSystem *system) { diff --git a/rehlds/dedicated/build.gradle b/rehlds/dedicated/build.gradle index 47aff3a..5f9cf42 100644 --- a/rehlds/dedicated/build.gradle +++ b/rehlds/dedicated/build.gradle @@ -87,25 +87,42 @@ model { srcDir "src" include "**/*.cpp" exclude "precompiled.cpp" - if (GradleCppUtils.windows) { exclude "sys_linux.cpp" } else { exclude "sys_window.cpp", "conproc.cpp" } } - exportedHeaders { srcDirs "vgui" } } + dedicated_common(CppSourceSet) { + source { + srcDir "../common" + include "ObjectList.cpp" + include "SteamAppStartUp.cpp" + include "textconsole.cpp" + if (GradleCppUtils.windows) { + include "TextConsoleWin32.cpp" + } + else { + include "TextConsoleUnix.cpp" + } + } + } + dedicated_engine(CppSourceSet) { + source { + srcDir "../engine" + include "mem.cpp" + } + } dedicated_pch(CppSourceSet) { source { srcDir "src" include "precompiled.cpp" } } - rc { source { srcDir "msvc" diff --git a/rehlds/dedicated/msvc/dedicated.vcxproj b/rehlds/dedicated/msvc/dedicated.vcxproj index 0720a4e..12c2ca4 100644 --- a/rehlds/dedicated/msvc/dedicated.vcxproj +++ b/rehlds/dedicated/msvc/dedicated.vcxproj @@ -154,6 +154,15 @@ + + + + + true + true + + + diff --git a/rehlds/dedicated/msvc/dedicated.vcxproj.filters b/rehlds/dedicated/msvc/dedicated.vcxproj.filters index a6dcaad..380ebeb 100644 --- a/rehlds/dedicated/msvc/dedicated.vcxproj.filters +++ b/rehlds/dedicated/msvc/dedicated.vcxproj.filters @@ -8,6 +8,12 @@ {711de26d-f116-48c0-96c0-5d4189574ad1} + + {c464f3ce-2fb5-4a0e-bda1-388b49b46871} + + + {565e56ff-60b6-4708-9749-010284e122a1} + @@ -61,6 +67,24 @@ src + + src\common + + + src\common + + + src\common + + + src\common + + + src\common + + + src\engine + diff --git a/rehlds/dedicated/src/precompiled.h b/rehlds/dedicated/src/precompiled.h index 27a19de..6484ade 100644 --- a/rehlds/dedicated/src/precompiled.h +++ b/rehlds/dedicated/src/precompiled.h @@ -6,6 +6,7 @@ #include "FileSystem.h" #include "common.h" +#include "mem.h" #include "engine_hlds_api.h" #include "idedicatedexports.h" @@ -16,6 +17,9 @@ #include "textconsole.h" #include "vgui/vguihelpers.h" +#include "IObjectContainer.h" +#include "ObjectList.h" + #ifdef _WIN32 #include "conproc.h" #endif // _WIN32 diff --git a/rehlds/dedicated/src/public_amalgamation.cpp b/rehlds/dedicated/src/public_amalgamation.cpp index 1d3ef03..1fc308c 100644 --- a/rehlds/dedicated/src/public_amalgamation.cpp +++ b/rehlds/dedicated/src/public_amalgamation.cpp @@ -1,11 +1,3 @@ #include "precompiled.h" -#include "mem.cpp" #include "interface.cpp" -#include "SteamAppStartUp.cpp" - -#include "ObjectList.cpp" - -#include "textconsole.cpp" -#include "TextConsoleUnix.cpp" -#include "TextConsoleWin32.cpp"