Initial port to macOS
Doesn't work yet as SDL1 is broken on modern macOS. FossilOrigin-Name: f5b62f82030659a511f4add8212857fca598c6cef86a3238705eb60e35011631
This commit is contained in:
parent
9782fa9b54
commit
c3cd8d4fac
6 changed files with 26 additions and 13 deletions
|
@ -9,7 +9,10 @@ add_global_arguments(
|
|||
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')
|
||||
|
@ -21,6 +24,8 @@ 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')
|
||||
|
|
|
@ -122,7 +122,7 @@ int framesinmap = 0;
|
|||
{'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;
|
||||
|
|
|
@ -45,10 +45,10 @@ conline(const char *sf, bool highlight) // add a line to the console buffer
|
|||
strcpy_s(cl.cref, sf);
|
||||
};
|
||||
puts(cl.cref);
|
||||
#ifndef _WIN32
|
||||
#ifndef OF_WINDOWS
|
||||
fflush(stdout);
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
void
|
||||
conoutf(OFString *str, ...)
|
||||
|
@ -144,7 +144,7 @@ mapmsg(OFString *s)
|
|||
}
|
||||
COMMAND(mapmsg, ARG_1STR)
|
||||
|
||||
#ifndef _WIN32
|
||||
#if !defined(OF_WINDOWS) && !defined(OF_MACOS)
|
||||
# include <SDL_syswm.h>
|
||||
# include <X11/Xlib.h>
|
||||
#endif
|
||||
|
@ -152,7 +152,7 @@ COMMAND(mapmsg, ARG_1STR)
|
|||
void
|
||||
pasteconsole()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#if defined(OF_WINDOWS)
|
||||
if (!IsClipboardFormatAvailable(CF_TEXT))
|
||||
return;
|
||||
if (!OpenClipboard(NULL))
|
||||
|
@ -161,7 +161,7 @@ pasteconsole()
|
|||
strcat_s(commandbuf, cb);
|
||||
GlobalUnlock(cb);
|
||||
CloseClipboard();
|
||||
#else
|
||||
#elif !defined(OF_MACOS)
|
||||
SDL_SysWMinfo wminfo;
|
||||
SDL_VERSION(&wminfo.version);
|
||||
wminfo.subsystem = SDL_SYSWM_X11;
|
||||
|
|
|
@ -460,9 +460,17 @@ enum // function signatures for script functions, see command.cpp
|
|||
|
||||
#include <time.h>
|
||||
|
||||
#ifdef OF_MACOS
|
||||
# define GL_SILENCE_DEPRECATION
|
||||
# define GL_EXT_texture_env_combine 1
|
||||
# include <OpenGL/gl.h>
|
||||
# include <OpenGL/glext.h>
|
||||
# include <OpenGL/glu.h>
|
||||
#else
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glext.h>
|
||||
# include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
|
|
|
@ -14,7 +14,7 @@ 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),
|
||||
|
|
|
@ -36,7 +36,7 @@ executable('client',
|
|||
],
|
||||
dependencies: [
|
||||
objfw_dep,
|
||||
sdl12_dep,
|
||||
sdl_dep,
|
||||
sdlimage_dep,
|
||||
sdlmixer_dep,
|
||||
zlib_dep,
|
||||
|
@ -57,7 +57,7 @@ executable('server',
|
|||
objcpp_args: ['-DSTANDALONE'],
|
||||
dependencies: [
|
||||
objfw_dep,
|
||||
sdl12_dep
|
||||
sdl_dep
|
||||
],
|
||||
include_directories: [enet_includes],
|
||||
link_args: server_link_args,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue