mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #3614
3614: Mac OS X -> macOS r=heinrich5991 a=def- Changing the filenames of the releases will be a bit more annoying, so not sure we want to do that > Apple shortened the name to "OS X" in 2012 and then changed it to "macOS" in 2016 <!-- What is the motivation for the changes of this pull request --> ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
e6846827cf
|
@ -535,8 +535,8 @@ elseif(TARGET_OS STREQUAL "mac")
|
||||||
find_library(OPENGL OpenGL)
|
find_library(OPENGL OpenGL)
|
||||||
find_library(SECURITY Security)
|
find_library(SECURITY Security)
|
||||||
set(PLATFORM_CLIENT
|
set(PLATFORM_CLIENT
|
||||||
src/osx/notifications.mm
|
src/macos/notifications.mm
|
||||||
src/osxlaunch/client.m
|
src/macoslaunch/client.m
|
||||||
)
|
)
|
||||||
set(PLATFORM_CLIENT_LIBS ${COCOA} ${OPENGL})
|
set(PLATFORM_CLIENT_LIBS ${COCOA} ${OPENGL})
|
||||||
set(PLATFORM_LIBS ${CARBON} ${SECURITY})
|
set(PLATFORM_LIBS ${CARBON} ${SECURITY})
|
||||||
|
@ -2073,7 +2073,7 @@ list(APPEND TARGETS_OWN ${TARGET_SERVER})
|
||||||
list(APPEND TARGETS_LINK ${TARGET_SERVER})
|
list(APPEND TARGETS_LINK ${TARGET_SERVER})
|
||||||
|
|
||||||
if(TARGET_OS AND TARGET_OS STREQUAL "mac")
|
if(TARGET_OS AND TARGET_OS STREQUAL "mac")
|
||||||
set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm)
|
set(SERVER_LAUNCHER_SRC src/macoslaunch/server.mm)
|
||||||
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
|
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
|
||||||
add_executable(${TARGET_SERVER_LAUNCHER} ${SERVER_LAUNCHER_SRC})
|
add_executable(${TARGET_SERVER_LAUNCHER} ${SERVER_LAUNCHER_SRC})
|
||||||
target_link_libraries(${TARGET_SERVER_LAUNCHER} ${COCOA})
|
target_link_libraries(${TARGET_SERVER_LAUNCHER} ${COCOA})
|
||||||
|
|
|
@ -63,8 +63,8 @@
|
||||||
#if defined(MACOSX) || defined(__APPLE__) || defined(__DARWIN__)
|
#if defined(MACOSX) || defined(__APPLE__) || defined(__DARWIN__)
|
||||||
#define CONF_FAMILY_UNIX 1
|
#define CONF_FAMILY_UNIX 1
|
||||||
#define CONF_FAMILY_STRING "unix"
|
#define CONF_FAMILY_STRING "unix"
|
||||||
#define CONF_PLATFORM_MACOSX 1
|
#define CONF_PLATFORM_MACOS 1
|
||||||
#define PLATFORM_STRING "macosx"
|
#define PLATFORM_STRING "macos"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__sun)
|
#if defined(__sun)
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
// some lock and pthread functions are already defined in headers
|
// some lock and pthread functions are already defined in headers
|
||||||
// included from Carbon.h
|
// included from Carbon.h
|
||||||
// this prevents having duplicate definitions of those
|
// this prevents having duplicate definitions of those
|
||||||
|
@ -882,7 +882,7 @@ void sphore_init(SEMAPHORE *sem)
|
||||||
void sphore_wait(SEMAPHORE *sem) { WaitForSingleObject((HANDLE)*sem, INFINITE); }
|
void sphore_wait(SEMAPHORE *sem) { WaitForSingleObject((HANDLE)*sem, INFINITE); }
|
||||||
void sphore_signal(SEMAPHORE *sem) { ReleaseSemaphore((HANDLE)*sem, 1, NULL); }
|
void sphore_signal(SEMAPHORE *sem) { ReleaseSemaphore((HANDLE)*sem, 1, NULL); }
|
||||||
void sphore_destroy(SEMAPHORE *sem) { CloseHandle((HANDLE)*sem); }
|
void sphore_destroy(SEMAPHORE *sem) { CloseHandle((HANDLE)*sem); }
|
||||||
#elif defined(CONF_PLATFORM_MACOSX)
|
#elif defined(CONF_PLATFORM_MACOS)
|
||||||
void sphore_init(SEMAPHORE *sem)
|
void sphore_init(SEMAPHORE *sem)
|
||||||
{
|
{
|
||||||
char aBuf[64];
|
char aBuf[64];
|
||||||
|
@ -935,7 +935,7 @@ int64 time_get_impl(void)
|
||||||
{
|
{
|
||||||
static int64 last = 0;
|
static int64 last = 0;
|
||||||
{
|
{
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
static int got_timebase = 0;
|
static int got_timebase = 0;
|
||||||
mach_timebase_info_data_t timebase;
|
mach_timebase_info_data_t timebase;
|
||||||
uint64 time;
|
uint64 time;
|
||||||
|
@ -986,7 +986,7 @@ int64 time_get(void)
|
||||||
|
|
||||||
int64 time_freq(void)
|
int64 time_freq(void)
|
||||||
{
|
{
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
return 1000000000;
|
return 1000000000;
|
||||||
#elif defined(CONF_FAMILY_UNIX)
|
#elif defined(CONF_FAMILY_UNIX)
|
||||||
return 1000000;
|
return 1000000;
|
||||||
|
@ -2061,13 +2061,13 @@ int fs_storage_path(const char *appname, char *path, int max)
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
#if !defined(CONF_PLATFORM_MACOSX)
|
#if !defined(CONF_PLATFORM_MACOS)
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
if(!home)
|
if(!home)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
snprintf(path, max, "%s/Library/Application Support/%s", home, appname);
|
snprintf(path, max, "%s/Library/Application Support/%s", home, appname);
|
||||||
#else
|
#else
|
||||||
snprintf(path, max, "%s/.%s", home, appname);
|
snprintf(path, max, "%s/.%s", home, appname);
|
||||||
|
|
|
@ -611,7 +611,7 @@ void lock_unlock(LOCK lock) RELEASE(lock);
|
||||||
/* Group: Semaphores */
|
/* Group: Semaphores */
|
||||||
#if defined(CONF_FAMILY_WINDOWS)
|
#if defined(CONF_FAMILY_WINDOWS)
|
||||||
typedef void *SEMAPHORE;
|
typedef void *SEMAPHORE;
|
||||||
#elif defined(CONF_PLATFORM_MACOSX)
|
#elif defined(CONF_PLATFORM_MACOS)
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
typedef sem_t *SEMAPHORE;
|
typedef sem_t *SEMAPHORE;
|
||||||
#elif defined(CONF_FAMILY_UNIX)
|
#elif defined(CONF_FAMILY_UNIX)
|
||||||
|
@ -1655,7 +1655,7 @@ int fs_makedir_rec_for(const char *path);
|
||||||
|
|
||||||
Remarks:
|
Remarks:
|
||||||
- Returns ~/.appname on UNIX based systems
|
- Returns ~/.appname on UNIX based systems
|
||||||
- Returns ~/Library/Applications Support/appname on Mac OS X
|
- Returns ~/Library/Applications Support/appname on macOS
|
||||||
- Returns %APPDATA%/Appname on Windows based systems
|
- Returns %APPDATA%/Appname on Windows based systems
|
||||||
*/
|
*/
|
||||||
int fs_storage_path(const char *appname, char *path, int max);
|
int fs_storage_path(const char *appname, char *path, int max);
|
||||||
|
|
|
@ -74,7 +74,7 @@ void CGraphicsBackend_Threaded::ThreadFunc(void *pUser)
|
||||||
pThis->m_Activity.Wait();
|
pThis->m_Activity.Wait();
|
||||||
if(pThis->m_pBuffer)
|
if(pThis->m_pBuffer)
|
||||||
{
|
{
|
||||||
#ifdef CONF_PLATFORM_MACOSX
|
#ifdef CONF_PLATFORM_MACOS
|
||||||
CAutoreleasePool AutoreleasePool;
|
CAutoreleasePool AutoreleasePool;
|
||||||
#endif
|
#endif
|
||||||
pThis->m_pProcessor->RunBuffer(pThis->m_pBuffer);
|
pThis->m_pProcessor->RunBuffer(pThis->m_pBuffer);
|
||||||
|
@ -4757,7 +4757,7 @@ void CGraphicsBackend_SDL_OpenGL::Maximize()
|
||||||
|
|
||||||
bool CGraphicsBackend_SDL_OpenGL::Fullscreen(bool State)
|
bool CGraphicsBackend_SDL_OpenGL::Fullscreen(bool State)
|
||||||
{
|
{
|
||||||
#if defined(CONF_PLATFORM_MACOSX) // Todo SDL: remove this when fixed (game freezes when losing focus in fullscreen)
|
#if defined(CONF_PLATFORM_MACOS) // Todo SDL: remove this when fixed (game freezes when losing focus in fullscreen)
|
||||||
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) == 0;
|
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) == 0;
|
||||||
#else
|
#else
|
||||||
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN : 0) == 0;
|
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN : 0) == 0;
|
||||||
|
@ -4836,7 +4836,7 @@ void CGraphicsBackend_SDL_OpenGL::NotifyWindow()
|
||||||
desc.dwTimeout = 0;
|
desc.dwTimeout = 0;
|
||||||
|
|
||||||
FlashWindowEx(&desc);
|
FlashWindowEx(&desc);
|
||||||
#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOSX)
|
#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOS)
|
||||||
Display *dpy = info.info.x11.display;
|
Display *dpy = info.info.x11.display;
|
||||||
Window win = info.info.x11.window;
|
Window win = info.info.x11.window;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
#include <objc/objc-runtime.h>
|
#include <objc/objc-runtime.h>
|
||||||
|
|
||||||
class CAutoreleasePool
|
class CAutoreleasePool
|
||||||
|
|
|
@ -4255,7 +4255,7 @@ void CClient::HandleMapPath(const char *pPath)
|
||||||
Upstream latency
|
Upstream latency
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
extern "C" int TWMain(int argc, const char **argv) // ignore_convention
|
extern "C" int TWMain(int argc, const char **argv) // ignore_convention
|
||||||
#else
|
#else
|
||||||
int main(int argc, const char **argv) // ignore_convention
|
int main(int argc, const char **argv) // ignore_convention
|
||||||
|
|
|
@ -347,7 +347,7 @@ int CInput::Update()
|
||||||
m_InputGrabbed = true;
|
m_InputGrabbed = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(CONF_PLATFORM_MACOSX) // Todo: remove this when fixed in SDL
|
#if defined(CONF_PLATFORM_MACOS) // Todo: remove this when fixed in SDL
|
||||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||||
MouseModeAbsolute();
|
MouseModeAbsolute();
|
||||||
MouseModeRelative();
|
MouseModeRelative();
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include <base/detect.h>
|
#include <base/detect.h>
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
// Code is in src/osx/notification.mm.
|
// Code is in src/macos/notification.mm.
|
||||||
#elif defined(CONF_FAMILY_UNIX)
|
#elif defined(CONF_FAMILY_UNIX)
|
||||||
#include <libnotify/notify.h>
|
#include <libnotify/notify.h>
|
||||||
void NotificationsInit()
|
void NotificationsInit()
|
||||||
|
|
|
@ -215,7 +215,7 @@ void CVideo::NextVideoFrameThread()
|
||||||
{
|
{
|
||||||
if(m_NextFrame && m_Recording)
|
if(m_NextFrame && m_Recording)
|
||||||
{
|
{
|
||||||
// #ifdef CONF_PLATFORM_MACOSX
|
// #ifdef CONF_PLATFORM_MACOS
|
||||||
// CAutoreleasePool AutoreleasePool;
|
// CAutoreleasePool AutoreleasePool;
|
||||||
// #endif
|
// #endif
|
||||||
m_Vseq += 1;
|
m_Vseq += 1;
|
||||||
|
@ -243,7 +243,7 @@ void CVideo::NextVideoFrame()
|
||||||
{
|
{
|
||||||
if(m_Recording)
|
if(m_Recording)
|
||||||
{
|
{
|
||||||
// #ifdef CONF_PLATFORM_MACOSX
|
// #ifdef CONF_PLATFORM_MACOS
|
||||||
// CAutoreleasePool AutoreleasePool;
|
// CAutoreleasePool AutoreleasePool;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#else
|
#else
|
||||||
#include "SDL_opengl.h"
|
#include "SDL_opengl.h"
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
#include "OpenGL/glu.h"
|
#include "OpenGL/glu.h"
|
||||||
#else
|
#else
|
||||||
#include "GL/glu.h"
|
#include "GL/glu.h"
|
||||||
|
|
|
@ -98,7 +98,7 @@ MACRO_CONFIG_INT(SndHighlight, snd_highlight, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CL
|
||||||
MACRO_CONFIG_INT(GfxScreen, gfx_screen, 0, 0, 15, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen index")
|
MACRO_CONFIG_INT(GfxScreen, gfx_screen, 0, 0, 15, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen index")
|
||||||
MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution width")
|
MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution width")
|
||||||
MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution height")
|
MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution height")
|
||||||
#if !defined(CONF_PLATFORM_MACOSX)
|
#if !defined(CONF_PLATFORM_MACOS)
|
||||||
MACRO_CONFIG_INT(GfxBorderless, gfx_borderless, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Borderless window (not to be used with fullscreen)")
|
MACRO_CONFIG_INT(GfxBorderless, gfx_borderless, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Borderless window (not to be used with fullscreen)")
|
||||||
MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Fullscreen")
|
MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Fullscreen")
|
||||||
#else
|
#else
|
||||||
|
@ -395,7 +395,7 @@ MACRO_CONFIG_INT(GfxOpenGLTextureLODBIAS, gfx_opengl_texture_lod_bias, -500, -15
|
||||||
|
|
||||||
MACRO_CONFIG_INT(Gfx3DTextureAnalysisDone, gfx_3d_texture_analysis_done, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Analyzed, if sampling 3D/2D array textures was correct")
|
MACRO_CONFIG_INT(Gfx3DTextureAnalysisDone, gfx_3d_texture_analysis_done, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Analyzed, if sampling 3D/2D array textures was correct")
|
||||||
MACRO_CONFIG_INT(GfxDriverIsBlocked, gfx_driver_is_blocked, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "If 1, the current driver is in a blocked error state.")
|
MACRO_CONFIG_INT(GfxDriverIsBlocked, gfx_driver_is_blocked, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "If 1, the current driver is in a blocked error state.")
|
||||||
#if !defined(CONF_PLATFORM_MACOSX)
|
#if !defined(CONF_PLATFORM_MACOS)
|
||||||
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
|
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
|
||||||
#else
|
#else
|
||||||
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
|
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
|
||||||
|
|
|
@ -269,7 +269,7 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined(CONF_PLATFORM_MACOSX)
|
#if defined(CONF_PLATFORM_MACOS)
|
||||||
str_append(m_aBinarydir, "/../../../DDNet-Server.app/Contents/MacOS", sizeof(m_aBinarydir));
|
str_append(m_aBinarydir, "/../../../DDNet-Server.app/Contents/MacOS", sizeof(m_aBinarydir));
|
||||||
str_format(aBuf, sizeof(aBuf), "%s/" PLAT_SERVER_EXEC, m_aBinarydir);
|
str_format(aBuf, sizeof(aBuf), "%s/" PLAT_SERVER_EXEC, m_aBinarydir);
|
||||||
IOHANDLE File = io_open(aBuf, IOFLAG_READ);
|
IOHANDLE File = io_open(aBuf, IOFLAG_READ);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# There are 3 special paths available:
|
# There are 3 special paths available:
|
||||||
# $USERDIR
|
# $USERDIR
|
||||||
# - ~/.appname on UNIX based systems
|
# - ~/.appname on UNIX based systems
|
||||||
# - ~/Library/Applications Support/appname on Mac OS X
|
# - ~/Library/Applications Support/appname on macOS
|
||||||
# - %APPDATA%/Appname on Windows based systems
|
# - %APPDATA%/Appname on Windows based systems
|
||||||
# $DATADIR
|
# $DATADIR
|
||||||
# - the 'data' directory which is part of an official
|
# - the 'data' directory which is part of an official
|
||||||
|
|
Loading…
Reference in a new issue