summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d985a32)
raw | patch | inline | side by side (parent: d985a32)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 1 Dec 2019 21:04:59 +0000 (00:04 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 1 Dec 2019 21:04:59 +0000 (00:04 +0300) |
index c5a6590f7ffc896658d207f6e12154b0850951c5..58c544c0d72694378b2900fa4ce85c70d9309d5e 100644 (file)
--- a/README
+++ b/README
Create the "tmp" and "bin" directories and then run:
cd src/game
- fpc -O3 -FE../../bin -FU../../tmp Doom2DF.lpr
+ fpc -g -gl -O3 -FE../../bin -FU../../tmp Doom2DF.lpr
Additionally you can add following options:
System driver:
* -dUSE_MPG123 Build with libmpg123
* -dUSE_OPUS Build with libopus
Other:
+ * -dSDL2_NODPI Build for old libSDL2
* -dUSE_MINIUPNPC Build with libminiupnpc for automatic server port
forwarding via UPNP
* -dENABLE_HOLMES Build with ingame map debugger
* -dHEADLESS Build a headless executable for dedicated servers
-Replace -O3 with -g -gl to enable debugging features. Run the game with --gdb
-when using a debugger to prevent it from eating exceptions.
+Run the game with --gdb when using a debugger to prevent it from eating
+exceptions.
Windows binaries will require the appropriate DLLs (SDL2.dll, SDL2_mixer.dll or
FMODEx.dll, ENet.dll, miniupnpc.dll), unless you choose to static link them.
index bfb76fb5bae1f5a69f01ff3f575ade72c80c2810..694042c37dea2db0f756e690b4d14a00f63f16e7 100644 (file)
flags := SDL_INIT_TIMER or $00004000;
{$ENDIF}
{$ELSE}
- flags := SDL_INIT_JOYSTICK or SDL_INIT_TIMER or SDL_INIT_VIDEO;
+ flags := SDL_INIT_TIMER or SDL_INIT_VIDEO;
{$ENDIF}
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, '0');
if SDL_Init(flags) <> 0 then
raise Exception.Create('SDL: Init failed: ' + SDL_GetError);
+ {$IFNDEF HEADLESS}
+ if SDL_InitSubSystem(SDL_INIT_JOYSTICK) <> 0 then
+ e_LogWritefln('SDL: Init subsystem failed: %s', [SDL_GetError()]);
+ {$ENDIF}
SDL_ShowCursor(SDL_DISABLE);
end;
index 697187971a198bea8a001a8badf3f9703206fd64..23cfbc1fc3ca8920b518d9e0af0494ae7de90ab7 100644 (file)
begin
founded := false;
- if SDL_GetDisplayDPI(0, @dpi, nil, nil) <> 0 then
+ {$IFNDEF SDL2_NODPI}
+ if SDL_GetDisplayDPI(0, @dpi, nil, nil) <> 0 then
+ dpi := 96;
+ {$ELSE}
dpi := 96;
+ {$ENDIF}
sz := Trunc(g_touch_size * dpi); sw := gScreenWidth; sh := gScreenHeight;
x := 0; y := Round(sh * g_touch_offset / 100);
diff --git a/src/lib/sdl2/sdl2.pas b/src/lib/sdl2/sdl2.pas
index 6e77ca2b1fe785a6338ffebba7131e488ccca582..ab47a820b9cb7590e15d535f76a873d47dbfdf48 100644 (file)
--- a/src/lib/sdl2/sdl2.pas
+++ b/src/lib/sdl2/sdl2.pas
{$ENDIF}
{$IF DEFINED(UNIX)}
- {$IF NOT DEFINED(HAIKU) AND NOT DEFINED(ANDROID)}
+ {$IF NOT DEFINED(HAIKU) AND NOT DEFINED(ANDROID) AND NOT DEFINED(DARWIN)}
uses
X,
XLib;
index e3ac0a8f6bbb0851634830b385e942c4714a4d0a..5dc90fc079b247c234d8cdc5b376dc0b0faea24b 100644 (file)
{$ENDIF}
{$IF DEFINED (LINUX) OR DEFINED(UNIX)}
- {$IF NOT DEFINED(HAIKU) AND NOT DEFINED(ANDROID)}
+ {$IF NOT DEFINED(HAIKU) AND NOT DEFINED(ANDROID) AND NOT DEFINED(DARWIN)}
{$DEFINE SDL_VIDEO_DRIVER_X11}
{$ENDIF}
{$IFEND}