From da8f644d465af13f8925ca9ed2118ffe649a41bd Mon Sep 17 00:00:00 2001 From: iamthesenate1 Date: Tue, 25 Jan 2022 21:32:26 +0200 Subject: [PATCH] Remove some redundant #ifdefs and added some new ones --- Sources/CMakeLists.txt | 2 +- Sources/Ecc/CMakeLists.txt | 2 +- Sources/Engine/Base/ErrorReporting.cpp | 4 ---- Sources/Engine/Base/Win32/Win32DynamicLoader.cpp | 3 +++ Sources/Engine/Base/Win32/Win32FileSystem.cpp | 6 ++++-- Sources/Engine/Base/Win32/Win32Input.cpp | 4 ++++ Sources/Engine/Base/Win32/Win32Synchronization.cpp | 3 +++ Sources/Engine/Base/Win32/Win32Timer.cpp | 4 ++++ Sources/Engine/Engine.cpp | 3 --- Sources/Engine/Graphics/Adapter.cpp | 6 +++--- Sources/Engine/Graphics/GfxLibrary.cpp | 5 ----- Sources/Engine/Graphics/Gfx_Direct3D.cpp | 4 +++- Sources/Engine/Graphics/Win32/Win32Adapter.cpp | 4 +++- Sources/Engine/Graphics/Win32/Win32OpenGL.cpp | 3 +++ Sources/Engine/Sound/SoundLibrary.cpp | 4 ---- Sources/Engine/World/WorldIO.cpp | 2 +- 16 files changed, 33 insertions(+), 26 deletions(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 558a2c1..65a01b6 100755 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.7.2) project(SeriousEngine) # Set @rpath for Mac OS X shared library install names. diff --git a/Sources/Ecc/CMakeLists.txt b/Sources/Ecc/CMakeLists.txt index 8113cf6..3a51733 100644 --- a/Sources/Ecc/CMakeLists.txt +++ b/Sources/Ecc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.7.2) project(Ecc) if(MSVC) diff --git a/Sources/Engine/Base/ErrorReporting.cpp b/Sources/Engine/Base/ErrorReporting.cpp index 8a5ba42..bdf7256 100644 --- a/Sources/Engine/Base/ErrorReporting.cpp +++ b/Sources/Engine/Base/ErrorReporting.cpp @@ -26,10 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include -#ifndef PLATFORM_WIN32 -#include "SDL.h" -#endif - INDEX con_bNoWarnings = 0; // global handle for application window in full-screen mode diff --git a/Sources/Engine/Base/Win32/Win32DynamicLoader.cpp b/Sources/Engine/Base/Win32/Win32DynamicLoader.cpp index a0af2fa..bb419ee 100644 --- a/Sources/Engine/Base/Win32/Win32DynamicLoader.cpp +++ b/Sources/Engine/Base/Win32/Win32DynamicLoader.cpp @@ -2,6 +2,8 @@ /* rcg10072001 Implemented. */ +#ifdef PLATFORM_WIN32 + #include #include @@ -83,6 +85,7 @@ CWin32DynamicLoader::~CWin32DynamicLoader(void) ::FreeLibrary(module); } +#endif //PLATFORM_WIN32 // end of Win32DynamicLoader.cpp ... diff --git a/Sources/Engine/Base/Win32/Win32FileSystem.cpp b/Sources/Engine/Base/Win32/Win32FileSystem.cpp index fe6f3cf..e64582f 100644 --- a/Sources/Engine/Base/Win32/Win32FileSystem.cpp +++ b/Sources/Engine/Base/Win32/Win32FileSystem.cpp @@ -4,6 +4,8 @@ // !!! FIXME: rcg10142001 This should really be using CTStrings... +#ifdef PLATFORM_WIN32 + #include #include @@ -116,6 +118,6 @@ CDynamicArray CWin32FileSystem::FindFiles(const char *dir, return(retval); } +#endif //PLATFORM_WIN32 + // end of Win32FileSystem.cpp ... - - diff --git a/Sources/Engine/Base/Win32/Win32Input.cpp b/Sources/Engine/Base/Win32/Win32Input.cpp index 41fff97..213fe19 100644 --- a/Sources/Engine/Base/Win32/Win32Input.cpp +++ b/Sources/Engine/Base/Win32/Win32Input.cpp @@ -2,6 +2,8 @@ /* rcg10072001 Moved stuff into this file. */ +#ifdef PLATFORM_WIN32 + #include #include #include @@ -982,5 +984,7 @@ LONG CInput::PlatformGetJoystickCount(void) return((LONG) joyGetNumDevs()); } +#endif //PLATFORM_WIN32 + // end of Win32Input.cpp ... diff --git a/Sources/Engine/Base/Win32/Win32Synchronization.cpp b/Sources/Engine/Base/Win32/Win32Synchronization.cpp index 00a0093..655101e 100644 --- a/Sources/Engine/Base/Win32/Win32Synchronization.cpp +++ b/Sources/Engine/Base/Win32/Win32Synchronization.cpp @@ -13,6 +13,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifdef PLATFORM_WIN32 + #include "Engine/StdH.h" #include @@ -317,3 +319,4 @@ void CTSingleLock::Unlock(void) sl_bLocked = FALSE; } +#endif //PLATFORM_WIN32 diff --git a/Sources/Engine/Base/Win32/Win32Timer.cpp b/Sources/Engine/Base/Win32/Win32Timer.cpp index 8eb701e..bb4d3a9 100644 --- a/Sources/Engine/Base/Win32/Win32Timer.cpp +++ b/Sources/Engine/Base/Win32/Win32Timer.cpp @@ -2,6 +2,8 @@ /* rcg10072001 Moved stuff into this file. */ +#ifdef PLATFORM_WIN32 + #include #include @@ -10,6 +12,8 @@ void CTimer::Sleep(DWORD milliseconds) ::Sleep(milliseconds); } +#endif //PLATFORM_WIN32 + // end of Win32Timer.cpp ... diff --git a/Sources/Engine/Engine.cpp b/Sources/Engine/Engine.cpp index 41ee6e8..90700a9 100755 --- a/Sources/Engine/Engine.cpp +++ b/Sources/Engine/Engine.cpp @@ -45,9 +45,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -#if PLATFORM_UNIX -#include "SDL.h" -#endif // this version string can be referenced from outside the engine ENGINE_API CTString _strEngineBuild = ""; diff --git a/Sources/Engine/Graphics/Adapter.cpp b/Sources/Engine/Graphics/Adapter.cpp index 32e23d1..956689f 100644 --- a/Sources/Engine/Graphics/Adapter.cpp +++ b/Sources/Engine/Graphics/Adapter.cpp @@ -22,9 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc., // !!! FIXME : rcg11052001 move this somewhere. -#ifdef PLATFORM_UNIX -#include "SDL.h" -#endif +//#ifdef PLATFORM_UNIX +//#include "SDL.h" +//#endif extern BOOL _bDedicatedServer; #ifdef SE1_D3D diff --git a/Sources/Engine/Graphics/GfxLibrary.cpp b/Sources/Engine/Graphics/GfxLibrary.cpp index 287d705..56c5baa 100755 --- a/Sources/Engine/Graphics/GfxLibrary.cpp +++ b/Sources/Engine/Graphics/GfxLibrary.cpp @@ -52,11 +52,6 @@ with this program; if not, write to the Free Software Foundation, Inc., // !!! FIXME: rcg10112001 driver type is valid. -// !!! FIXME: rcg11052001 ... and I could get rid of this, too... -#ifdef PLATFORM_UNIX -#include -#endif - // control for partial usage of compiled vertex arrays BOOL CVA_b2D = FALSE; BOOL CVA_bWorld = FALSE; diff --git a/Sources/Engine/Graphics/Gfx_Direct3D.cpp b/Sources/Engine/Graphics/Gfx_Direct3D.cpp index 9aabf66..835f820 100644 --- a/Sources/Engine/Graphics/Gfx_Direct3D.cpp +++ b/Sources/Engine/Graphics/Gfx_Direct3D.cpp @@ -15,6 +15,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "Engine/StdH.h" +#ifdef SE1_D3D + #include #include #include @@ -27,7 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -#ifdef SE1_D3D + // asm shortcuts diff --git a/Sources/Engine/Graphics/Win32/Win32Adapter.cpp b/Sources/Engine/Graphics/Win32/Win32Adapter.cpp index d2100b3..9a45ff7 100644 --- a/Sources/Engine/Graphics/Win32/Win32Adapter.cpp +++ b/Sources/Engine/Graphics/Win32/Win32Adapter.cpp @@ -1,5 +1,7 @@ /* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */ +#ifdef PLATFORM_WIN32 + #include ULONG DetermineDesktopWidth(void) @@ -7,4 +9,4 @@ ULONG DetermineDesktopWidth(void) return((ULONG) ::GetSystemMetrics(SM_CXSCREEN)); } - +#endif diff --git a/Sources/Engine/Graphics/Win32/Win32OpenGL.cpp b/Sources/Engine/Graphics/Win32/Win32OpenGL.cpp index 2ecf9d3..eb525c9 100644 --- a/Sources/Engine/Graphics/Win32/Win32OpenGL.cpp +++ b/Sources/Engine/Graphics/Win32/Win32OpenGL.cpp @@ -1,5 +1,7 @@ /* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */ +#ifdef PLATFORM_WIN32 + #include static void FailFunction_t(const char *strName) { @@ -438,3 +440,4 @@ BOOL CGfxLibrary::SetCurrentViewport_OGL(CViewPort *pvp) return TRUE; } +#endif // PLATFORM_WIN32 diff --git a/Sources/Engine/Sound/SoundLibrary.cpp b/Sources/Engine/Sound/SoundLibrary.cpp index 8bf8133..1f7aaee 100644 --- a/Sources/Engine/Sound/SoundLibrary.cpp +++ b/Sources/Engine/Sound/SoundLibrary.cpp @@ -25,10 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "initguid.h" #endif -// !!! FIXME : Move all the SDL stuff to a different file... -#ifdef PLATFORM_UNIX -#include "SDL.h" -#endif #include #include diff --git a/Sources/Engine/World/WorldIO.cpp b/Sources/Engine/World/WorldIO.cpp index a2c6983..19a3722 100644 --- a/Sources/Engine/World/WorldIO.cpp +++ b/Sources/Engine/World/WorldIO.cpp @@ -197,7 +197,7 @@ void CWorld::ReadBrushes_t( CTStream *istrm)// throw char * wo_baBrushes.Read_t(istrm); CallProgressHook_t(1.0f); - // if there are some terrais in world + // if there are some terrains in world if(istrm->PeekID_t()==CChunkID("TRAR")) { // 'terrain archive' SetProgressDescription(TRANS("loading terrains")); CallProgressHook_t(0.0f);