diff --git a/src/sdl/hardware.cpp b/src/sdl/hardware.cpp index 49730802b..ee907e601 100644 --- a/src/sdl/hardware.cpp +++ b/src/sdl/hardware.cpp @@ -190,10 +190,11 @@ void I_ClosestResolution (int *width, int *height, int bits) // Pass a negative value for the limit to use the value of vid_maxfps. // //========================================================================== - + EXTERN_CVAR(Int, vid_maxfps); EXTERN_CVAR(Bool, cl_capfps); - + +#ifndef __APPLE__ Semaphore FPSLimitSemaphore; static void FPSLimitNotify(sigval val) @@ -244,7 +245,14 @@ void I_SetFPSLimit(int limit) Printf("Failed to set FPS limitter timer\n"); DPrintf("FPS timer set to %u ms\n", (unsigned int) period.it_interval.tv_nsec / 1000000); } -} +} +#else +// So Apple doesn't support POSIX timers and I can't find a good substitute short of +// having Objective-C Cocoa events or something like that. +void I_SetFPSLimit(int limit) +{ +} +#endif CUSTOM_CVAR (Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { diff --git a/src/sdl/hardware.h b/src/sdl/hardware.h index 86f3bd242..04d02c9bf 100644 --- a/src/sdl/hardware.h +++ b/src/sdl/hardware.h @@ -46,7 +46,7 @@ typedef semaphore_t Semaphore; #define SEMAPHORE_WAIT(sem) \ while(semaphore_wait(sem) != KERN_SUCCESS){} #define SEMAPHORE_SIGNAL(sem) \ - semaphore_signal(sem) + semaphore_signal(sem); #define SEMAPHORE_INIT(sem, shared, value) \ semaphore_create(mach_task_self(), &sem, shared, value); #else diff --git a/src/sdl/sdlvideo.cpp b/src/sdl/sdlvideo.cpp index f0a324565..cba5c4cf7 100644 --- a/src/sdl/sdlvideo.cpp +++ b/src/sdl/sdlvideo.cpp @@ -374,11 +374,13 @@ void SDLFB::Update () } DrawRateStuff (); - + +#ifndef __APPLE__ if(vid_maxfps) { SEMAPHORE_WAIT(FPSLimitSemaphore) - } + } +#endif Buffer = NULL; LockCount = 0;