From a637ec60c41941b5994a5f268383b1fee7e33765 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 20 Jan 2020 05:46:18 -0500 Subject: [PATCH] - finally - we have a compile on linux! --- source/common/initfs.cpp | 2 +- source/common/menu/savegamemanager.cpp | 2 +- source/common/music/i_soundfont.cpp | 2 +- source/common/searchpaths.cpp | 1 + source/platform/posix/i_system.h | 1 + source/platform/posix/sdl/i_input.cpp | 6 ++---- source/platform/posix/unix/i_specialpaths.cpp | 17 +++++++++++++++++ 7 files changed, 24 insertions(+), 7 deletions(-) diff --git a/source/common/initfs.cpp b/source/common/initfs.cpp index cbe2973bb..8d9315817 100644 --- a/source/common/initfs.cpp +++ b/source/common/initfs.cpp @@ -45,7 +45,7 @@ #include "sc_man.h" #include "v_video.h" #include "v_text.h" -#include "../platform/win32/i_findfile.h" // This is a temporary direct path. Needs to be fixed when stuff gets cleaned up. +#include "i_system.h" #ifndef PATH_MAX #define PATH_MAX 260 diff --git a/source/common/menu/savegamemanager.cpp b/source/common/menu/savegamemanager.cpp index e1f20a9ca..44d68989d 100644 --- a/source/common/menu/savegamemanager.cpp +++ b/source/common/menu/savegamemanager.cpp @@ -50,7 +50,7 @@ #include "savegamehelp.h" #include "i_specialpaths.h" #include "c_dispatch.h" -#include "../../platform/win32/i_findfile.h" // This is a temporary direct path. Needs to be fixed when stuff gets cleaned up. +#include "i_system.h" FSavegameManager savegameManager; diff --git a/source/common/music/i_soundfont.cpp b/source/common/music/i_soundfont.cpp index 46c6a32d5..5d911a200 100644 --- a/source/common/music/i_soundfont.cpp +++ b/source/common/music/i_soundfont.cpp @@ -41,7 +41,7 @@ #include "zmusic/zmusic.h" #include "resourcefile.h" #include "version.h" -#include "../platform/win32/i_findfile.h" // This is a temporary direct path. Needs to be fixed when stuff gets cleaned up. +#include "i_system.h" //========================================================================== // diff --git a/source/common/searchpaths.cpp b/source/common/searchpaths.cpp index 98519ee37..4d42fc5d2 100644 --- a/source/common/searchpaths.cpp +++ b/source/common/searchpaths.cpp @@ -47,6 +47,7 @@ #include "gamecontrol.h" #include "m_argv.h" #include "filesystem/filesystem.h" +#include "filesystem/resourcefile.h" static const char* res_exts[] = { ".grp", ".zip", ".pk3", ".pk4", ".7z", ".pk7" }; diff --git a/source/platform/posix/i_system.h b/source/platform/posix/i_system.h index 4f9688c1f..48c365af2 100644 --- a/source/platform/posix/i_system.h +++ b/source/platform/posix/i_system.h @@ -116,4 +116,5 @@ inline int I_GetNumaNodeThreadCount(int numaNode) { return std::max(std::th inline void I_SetThreadNumaNode(std::thread &thread, int numaNode) { } FString I_GetFromClipboard (bool use_primary_selection); + #endif diff --git a/source/platform/posix/sdl/i_input.cpp b/source/platform/posix/sdl/i_input.cpp index 7e0a3faae..1fc75552c 100644 --- a/source/platform/posix/sdl/i_input.cpp +++ b/source/platform/posix/sdl/i_input.cpp @@ -47,8 +47,6 @@ static void I_CheckNativeMouse (); static bool NativeMouse = true; -extern int paused; - CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) @@ -241,8 +239,8 @@ static void I_CheckNativeMouse () bool focus = SDL_GetKeyboardFocus() != NULL; bool fs = screen->IsFullscreen(); - // TODO: We want this to check for demo playback, as well. - bool wantNative = !focus || (!use_mouse || GUICapture || paused || !inGame()); + // TODO: We want this to check for demo playback, as well. And paused state + bool wantNative = !focus || (!use_mouse || GUICapture || !inGame()); if (wantNative != NativeMouse) { diff --git a/source/platform/posix/unix/i_specialpaths.cpp b/source/platform/posix/unix/i_specialpaths.cpp index 8944dab1a..60d742bc5 100644 --- a/source/platform/posix/unix/i_specialpaths.cpp +++ b/source/platform/posix/unix/i_specialpaths.cpp @@ -199,4 +199,21 @@ FString M_GetDemoPath() return M_GetDocumentsPath() + "/demo/"; } +//=========================================================================== +// +// M_NormalizedPath +// +// Normalizes the given path and returns the result. +// +//=========================================================================== + +FString M_GetNormalizedPath(const char* path) +{ + char *actualpath; + actualpath = realpath(path, NULL); + if (!actualpath) // error ? + return nullptr; + FString fullpath = actualpath; + return fullpath; +}