Initial port to macOS

Doesn't work yet as SDL1 is broken on modern macOS.

FossilOrigin-Name: f5b62f82030659a511f4add8212857fca598c6cef86a3238705eb60e35011631
This commit is contained in:
Jonathan Schleifer 2025-03-04 23:03:58 +00:00
parent 9782fa9b54
commit c3cd8d4fac
6 changed files with 26 additions and 13 deletions

View file

@ -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;

View file

@ -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;

View file

@ -460,9 +460,17 @@ enum // function signatures for script functions, see command.cpp
#include <time.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glu.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>

View file

@ -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),

View file

@ -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,