unixtype, linux
{$ELSEIF DEFINED(WINDOWS)}
Windows
+ {$ELSEIF DEFINED(HAIKU)}
+ unixtype
{$ELSE}
{$WARNING You suck!}
{$ENDIF}
if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available');
mFrequency := 1; // just a flag
if (r.tv_nsec <> 0) then mFrequency := 1000000000000000000 div r.tv_nsec;
-{$ELSE}
+{$ELSEIF DEFINED(WINDOWS)}
mHasHPTimer := QueryPerformanceFrequency(r);
if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available');
mFrequency := r;
{$IF DEFINED(LINUX)}
clock_gettime(CLOCK_MONOTONIC, @r);
result := UInt64(r.tv_sec)*1000000+UInt64(r.tv_nsec) div 1000; // microseconds
- {$ELSE}
+ {$ELSEIF DEFINED(WINDOWS)}
QueryPerformanceCounter(r);
result := UInt64(r)*1000000 div mFrequency;
{$ENDIF}
e_input, e_log, g_console, g_items, g_map, g_panel,
g_playermodel, g_gfx, g_options, g_weapons, Math,
g_triggers, g_monsters, e_sound, CONFIG,
- g_language, g_net, SDL,
+ g_language, g_net,
ENet, e_msg, g_netmsg, g_netmaster, GL, GLExt,
sfs, wadreader, g_holmes;
{$ENDIF}
{$ELSE}
{$IFDEF USE_SDLMIXER}
- sdlflags := SDL_INIT_EVERYTHING;
+ {*sdlflags := SDL_INIT_EVERYTHING;*}
+ sdlflags := SDL_INIT_JOYSTICK or SDL_INIT_TIMER or SDL_INIT_VIDEO;
{$ELSE}
sdlflags := SDL_INIT_JOYSTICK or SDL_INIT_TIMER or SDL_INIT_VIDEO;
{$ENDIF}
Windows;
{$ENDIF}
- {$IFDEF UNIX}
- uses
- X,
- XLib;
+ {$IF DEFINED(UNIX)}
+ {$IF NOT DEFINED(HAIKU)}
+ uses
+ X,
+ XLib;
+ {$ENDIF}
{$ENDIF}
{$IFDEF DARWIN}
SDL_LibName = 'SDL2.dll';
{$ENDIF}
- {$IFDEF UNIX}
+ {$IF DEFINED(HAIKU)}
+ SDL_LibName = 'libSDL2.so.0';
+ {$ELSEIF DEFINED(UNIX)}
{$IFDEF DARWIN}
SDL_LibName = 'libSDL2.dylib';
{$ELSE}
{$ENDIF}
{$IF DEFINED (LINUX) OR DEFINED(UNIX)}
- {$DEFINE SDL_VIDEO_DRIVER_X11}
+ {$IF NOT DEFINED(HAIKU)}
+ {$DEFINE SDL_VIDEO_DRIVER_X11}
+ {$ENDIF}
{$IFEND}
{$IFDEF DARWIN}
{$ELSEIF DEFINED(WINDOWS)}
{$DEFINE STOPWATCH_IS_HERE}
Windows
+ {$ELSEIF DEFINED(HAIKU)}
+ {$DEFINE STOPWATCH_IS_HERE}
+ unixtype
{$ELSE}
{$IFDEF STOPWATCH_IS_HERE}
{$UNDEF STOPWATCH_IS_HERE}
if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available');
mFrequency := 1; // just a flag
if (r.tv_nsec <> 0) then mFrequency := 1000000000000000000 div r.tv_nsec;
-{$ELSE}
+{$ELSEIF DEFINED(WINDOWS)}
mHasHPTimer := QueryPerformanceFrequency(r);
if not mHasHPTimer then raise Exception.Create('profiler error: hires timer is not available');
mFrequency := r;
{$IF DEFINED(LINUX)}
clock_gettime(CLOCK_MONOTONIC, @r);
result := UInt64(r.tv_sec)*1000000+UInt64(r.tv_nsec) div 1000; // microseconds
- {$ELSE}
+ {$ELSEIF DEFINED(WINDOWS)}
QueryPerformanceCounter(r);
result := UInt64(r)*1000000 div mFrequency;
{$ENDIF}