From c70e496e7249574648930094e0185c05cd79fdc8 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Tue, 27 Apr 2021 23:33:46 +0300 Subject: [PATCH] fix dedicated server build --- appframework/sdlmgr.cpp | 4 +++- engine/host.cpp | 3 +++ tier0/assert_dialog.cpp | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/appframework/sdlmgr.cpp b/appframework/sdlmgr.cpp index 5d121805..7234f4d1 100644 --- a/appframework/sdlmgr.cpp +++ b/appframework/sdlmgr.cpp @@ -4,8 +4,10 @@ // //=============================================================================// +#ifdef USE_SDL #include "SDL.h" #include "SDL_opengl.h" +#endif #include "appframework/ilaunchermgr.h" #include "inputsystem/ButtonCode.h" @@ -66,7 +68,7 @@ that Apple unhelpfully clamps you to vsync in this scenario, which would explain the 60fps max. There are a few options: -- SDL_WINDOW_FULLSCREEN mode will not use this new magic (only +- SDL_WAINDOW_FULLSCREEN mode will not use this new magic (only SDL_WINDOW_FULLSCREEN_DESKTOP), but that brings other problems and I wouldn't recommend a drastic change like that. diff --git a/engine/host.cpp b/engine/host.cpp index 0ff16bb2..067f9ee8 100644 --- a/engine/host.cpp +++ b/engine/host.cpp @@ -127,8 +127,11 @@ #endif #if defined( LINUX ) #include + +#ifdef USE_SDL #include "SDL.h" #endif +#endif #include "ixboxsystem.h" extern IXboxSystem *g_pXboxSystem; diff --git a/tier0/assert_dialog.cpp b/tier0/assert_dialog.cpp index 04325f62..89af64c1 100644 --- a/tier0/assert_dialog.cpp +++ b/tier0/assert_dialog.cpp @@ -23,7 +23,7 @@ #include #endif -#if defined( LINUX ) || defined( USE_SDL ) +#if defined( USE_SDL ) // We lazily load the SDL shared object, and only reference functions if it's // available, so this can be included on the dedicated server too. @@ -357,7 +357,7 @@ DBG_INTERFACE void SetAllAssertsDisabled( bool bAssertsDisabled ) g_bAssertsEnabled = !bAssertsDisabled; } -#if defined( LINUX ) || defined( USE_SDL ) +#if defined( USE_SDL ) SDL_Window *g_SDLWindow = NULL; DBG_INTERFACE void SetAssertDialogParent( struct SDL_Window *window ) @@ -534,7 +534,7 @@ DBG_INTERFACE bool DoNewAssertDialog( const tchar *pFilename, int line, const tc DialogBox( g_hTier0Instance, MAKEINTRESOURCE( IDD_ASSERT_DIALOG ), hParentWindow, AssertDialogProc ); } -#elif defined( POSIX ) +#elif defined( POSIX ) && defined ( USE_SDL ) static FUNC_SDL_ShowMessageBox *pfnSDLShowMessageBox = NULL; if( !pfnSDLShowMessageBox ) {