Index: meson.build ================================================================== --- meson.build +++ meson.build @@ -7,11 +7,14 @@ '-fobjc-arc-exceptions' ], language: 'objcpp') objfw_dep = dependency('objfw') -sdl12_dep = dependency('sdl12_compat') +sdl_dep = dependency('sdl12_compat', required: false) +if not sdl_dep.found() + sdl_dep = dependency('SDL') +endif sdlimage_dep = dependency('SDL_image') sdlmixer_dep = dependency('SDL_mixer') zlib_dep = dependency('zlib') client_link_args = [] @@ -19,13 +22,15 @@ extra_deps = [] if host_machine.system() == 'windows' client_link_args += ['-lopengl32', '-lglu32', '-lwinmm'] server_link_args += ['-lwinmm'] +elif host_machine.system() == 'darwin' + extra_deps += dependency('OpenGL', method: 'extraframework') else extra_deps += dependency('gl') extra_deps += dependency('glu') extra_deps += dependency('x11') endif subdir('enet') subdir('src') Index: src/Cube.mm ================================================================== --- src/Cube.mm +++ src/Cube.mm @@ -120,11 +120,11 @@ {'w', @"width", 1, NULL, NULL}, {'h', @"height", 1, NULL, NULL}, {'u', @"upload-rate", 1, NULL, NULL}, {'n', @"server-desc", 1, NULL, &sdesc}, {'i', @"ip", 1, NULL, &ip}, {'m', @"master", 1, NULL, &master}, {'p', @"password", 1, NULL, &passwd}, - {'c', @"max-clients", 1, NULL, NULL}}; + {'c', @"max-clients", 1, NULL, NULL}, {'\0', nil, 0, NULL, NULL}}; OFOptionsParser *optionsParser = [OFOptionsParser parserWithOptions:options]; OFUnichar option; while ((option = [optionsParser nextOption]) != '\0') { switch (option) { Index: src/console.mm ================================================================== --- src/console.mm +++ src/console.mm @@ -43,14 +43,14 @@ strcat_s(cl.cref, sf); } else { strcpy_s(cl.cref, sf); }; puts(cl.cref); -#ifndef _WIN32 +#ifndef OF_WINDOWS fflush(stdout); #endif -}; +} void conoutf(OFString *str, ...) { sprintf_sdv(sf, str.UTF8String); @@ -142,28 +142,28 @@ strn0cpy(hdr.maptitle, s.UTF8String, 128); } } COMMAND(mapmsg, ARG_1STR) -#ifndef _WIN32 +#if !defined(OF_WINDOWS) && !defined(OF_MACOS) # include # include #endif void pasteconsole() { -#ifdef _WIN32 +#if defined(OF_WINDOWS) if (!IsClipboardFormatAvailable(CF_TEXT)) return; if (!OpenClipboard(NULL)) return; char *cb = (char *)GlobalLock(GetClipboardData(CF_TEXT)); strcat_s(commandbuf, cb); GlobalUnlock(cb); CloseClipboard(); -#else +#elif !defined(OF_MACOS) SDL_SysWMinfo wminfo; SDL_VERSION(&wminfo.version); wminfo.subsystem = SDL_SYSWM_X11; if (!SDL_GetWMInfo(&wminfo)) return; Index: src/cube.h ================================================================== --- src/cube.h +++ src/cube.h @@ -458,13 +458,21 @@ # include #endif #include -#include -#include -#include +#ifdef OF_MACOS +# define GL_SILENCE_DEPRECATION +# define GL_EXT_texture_env_combine 1 +# include +# include +# include +#else +# include +# include +# include +#endif #include #include #include Index: src/editing.mm ================================================================== --- src/editing.mm +++ src/editing.mm @@ -12,11 +12,11 @@ block sel; OF_CONSTRUCTOR() { enqueueInit(^{ - sel = { + sel = (block){ variable(@"selx", 0, 0, 4096, &sel.x, NULL, false), variable(@"sely", 0, 0, 4096, &sel.y, NULL, false), variable(@"selxs", 0, 0, 4096, &sel.xs, NULL, false), variable(@"selys", 0, 0, 4096, &sel.ys, NULL, false), }; Index: src/meson.build ================================================================== --- src/meson.build +++ src/meson.build @@ -34,11 +34,11 @@ 'worldocull.mm', 'worldrender.mm', ], dependencies: [ objfw_dep, - sdl12_dep, + sdl_dep, sdlimage_dep, sdlmixer_dep, zlib_dep, extra_deps ], @@ -55,11 +55,11 @@ 'tools.mm', ], objcpp_args: ['-DSTANDALONE'], dependencies: [ objfw_dep, - sdl12_dep + sdl_dep ], include_directories: [enet_includes], link_args: server_link_args, link_with: [enet], win_subsystem: 'console')