From d2184af9b1c26ae71dfc785b5ced75ce437ee095 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 14 Apr 2021 21:12:12 +0200 Subject: [PATCH] Resolved compiler errors related to disabling SDL. Now we've just got a ton of linker errors to deal with... --- engine/Quake/gl_vidsdl.c | 3 +++ engine/Quake/in_sdl.c | 3 +++ engine/Quake/pl_win.c | 3 +++ engine/Quake/sys_sdl_win.c | 3 +++ engine/UniQuake/sys_uniquake.c | 30 ++++++++++++++++++++++++++---- 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/engine/Quake/gl_vidsdl.c b/engine/Quake/gl_vidsdl.c index f09e3e0..58ee798 100644 --- a/engine/Quake/gl_vidsdl.c +++ b/engine/Quake/gl_vidsdl.c @@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // gl_vidsdl.c -- SDL GL vid component +#if defined(USE_LIBSDL) && defined(USE_OPENGL) + #include "quakedef.h" #include "cfgfile.h" #include "bgmusic.h" @@ -2333,3 +2335,4 @@ static void VID_Menu_f (void) VID_Menu_RebuildRateList (); } +#endif // USE_LIBSDL && USE_OPENGL diff --git a/engine/Quake/in_sdl.c b/engine/Quake/in_sdl.c index bc8b55b..0f58b97 100644 --- a/engine/Quake/in_sdl.c +++ b/engine/Quake/in_sdl.c @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef USE_LIBSDL + #include "quakedef.h" #if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) #if defined(USE_SDL2) @@ -1138,3 +1140,4 @@ void IN_SendKeyEvents (void) } } +#endif // USE_LIBSDL diff --git a/engine/Quake/pl_win.c b/engine/Quake/pl_win.c index d6a5045..3e937ea 100644 --- a/engine/Quake/pl_win.c +++ b/engine/Quake/pl_win.c @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef USE_LIBSDL + #include "quakedef.h" #include #if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) @@ -112,3 +114,4 @@ void PL_ErrorDialog(const char *errorMsg) MB_OK | MB_SETFOREGROUND | MB_ICONSTOP); } +#endif // USE_LIBSDL diff --git a/engine/Quake/sys_sdl_win.c b/engine/Quake/sys_sdl_win.c index 5996577..4cc4c94 100644 --- a/engine/Quake/sys_sdl_win.c +++ b/engine/Quake/sys_sdl_win.c @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef USE_LIBSDL + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -441,3 +443,4 @@ void Sys_SendKeyEvents (void) IN_SendKeyEvents(); } +#endif // USE_LIBSDL diff --git a/engine/UniQuake/sys_uniquake.c b/engine/UniQuake/sys_uniquake.c index deb4b9b..88fbbf5 100644 --- a/engine/UniQuake/sys_uniquake.c +++ b/engine/UniQuake/sys_uniquake.c @@ -98,18 +98,40 @@ void Sys_mkdir(const char *path) Sys_Error("Unable to create directory %s", path); } -void Sys_Sleep_New(unsigned long msecs) +const char *Sys_ConsoleInput(void) +{ + // Not implemented: we support neither STDIN nor dedicated servers in UniQuake + return NULL; +} + +#ifndef USE_LIBSDL + +void Sys_Sleep(unsigned long msecs) { // TODO: implement } -void Sys_SendKeyEvents_New(void) +void Sys_SendKeyEvents(void) { // TODO: signal Unity to process input & send commands } -const char *Sys_ConsoleInput(void) +void PL_SetWindowIcon(void) +{ +} + +void PL_VID_Shutdown(void) +{ +} + +char *PL_GetClipboardData(void) { - // Not implemented: we support neither STDIN nor dedicated servers in UniQuake return NULL; } + +void PL_ErrorDialog(const char *text) +{ + // TODO: could signal this back to Unity and show a platform-specific system dialog +} + +#endif // !USE_LIBSDL