mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Add common I_GetSysName function
Replaces the OS defines in Command_Version_f() with a common function to fetch the system name the game is currently running on.
This commit is contained in:
parent
c16791bc11
commit
ddfb59d185
4 changed files with 16 additions and 12 deletions
|
@ -206,5 +206,10 @@ void I_GetCursorPosition(INT32 *x, INT32 *y)
|
|||
(void)y;
|
||||
}
|
||||
|
||||
const char *I_GetSysName(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#include "../sdl/dosstr.c"
|
||||
|
||||
|
|
|
@ -335,4 +335,8 @@ void I_GetCursorPosition(INT32 *x, INT32 *y);
|
|||
*/
|
||||
void I_SetMouseGrab(boolean grab);
|
||||
|
||||
/** \brief Returns the system name.
|
||||
*/
|
||||
const char *I_GetSysName(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3812,18 +3812,7 @@ static void Command_Version_f(void)
|
|||
#endif
|
||||
|
||||
// OS
|
||||
// Would be nice to use SDL_GetPlatform for this
|
||||
#if defined (_WIN32) || defined (_WIN64)
|
||||
CONS_Printf("Windows ");
|
||||
#elif defined(__linux__)
|
||||
CONS_Printf("Linux ");
|
||||
#elif defined(MACOSX)
|
||||
CONS_Printf("macOS ");
|
||||
#elif defined(UNIXCOMMON)
|
||||
CONS_Printf("Unix (Common) ");
|
||||
#else
|
||||
CONS_Printf("Other OS ");
|
||||
#endif
|
||||
CONS_Printf("%s ", I_GetSysName());
|
||||
|
||||
// Bitness
|
||||
if (sizeof(void*) == 4)
|
||||
|
|
|
@ -3256,4 +3256,10 @@ const CPUInfoFlags *I_CPUInfo(void)
|
|||
|
||||
// note CPUAFFINITY code used to reside here
|
||||
void I_RegisterSysCommands(void) {}
|
||||
|
||||
const char *I_GetSysName(void)
|
||||
{
|
||||
return SDL_GetPlatform();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue