mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-26 05:41:07 +00:00
- OK, so we can't have vid_maxfps on OS X since there does not appear to be an equivalent to POSIX timers. The only thing I could find would require Objective-C and an event loop.
SVN r3892 (trunk)
This commit is contained in:
parent
1907983ab7
commit
df5d43badf
3 changed files with 16 additions and 6 deletions
|
@ -194,6 +194,7 @@ void I_ClosestResolution (int *width, int *height, int bits)
|
||||||
EXTERN_CVAR(Int, vid_maxfps);
|
EXTERN_CVAR(Int, vid_maxfps);
|
||||||
EXTERN_CVAR(Bool, cl_capfps);
|
EXTERN_CVAR(Bool, cl_capfps);
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
Semaphore FPSLimitSemaphore;
|
Semaphore FPSLimitSemaphore;
|
||||||
|
|
||||||
static void FPSLimitNotify(sigval val)
|
static void FPSLimitNotify(sigval val)
|
||||||
|
@ -245,6 +246,13 @@ void I_SetFPSLimit(int limit)
|
||||||
DPrintf("FPS timer set to %u ms\n", (unsigned int) period.it_interval.tv_nsec / 1000000);
|
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)
|
CUSTOM_CVAR (Int, vid_maxfps, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@ typedef semaphore_t Semaphore;
|
||||||
#define SEMAPHORE_WAIT(sem) \
|
#define SEMAPHORE_WAIT(sem) \
|
||||||
while(semaphore_wait(sem) != KERN_SUCCESS){}
|
while(semaphore_wait(sem) != KERN_SUCCESS){}
|
||||||
#define SEMAPHORE_SIGNAL(sem) \
|
#define SEMAPHORE_SIGNAL(sem) \
|
||||||
semaphore_signal(sem)
|
semaphore_signal(sem);
|
||||||
#define SEMAPHORE_INIT(sem, shared, value) \
|
#define SEMAPHORE_INIT(sem, shared, value) \
|
||||||
semaphore_create(mach_task_self(), &sem, shared, value);
|
semaphore_create(mach_task_self(), &sem, shared, value);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -375,10 +375,12 @@ void SDLFB::Update ()
|
||||||
|
|
||||||
DrawRateStuff ();
|
DrawRateStuff ();
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
if(vid_maxfps)
|
if(vid_maxfps)
|
||||||
{
|
{
|
||||||
SEMAPHORE_WAIT(FPSLimitSemaphore)
|
SEMAPHORE_WAIT(FPSLimitSemaphore)
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Buffer = NULL;
|
Buffer = NULL;
|
||||||
LockCount = 0;
|
LockCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue