mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-11-25 07:32:30 +00:00
WaitForNextTick: make closer to cocoa version
This commit is contained in:
parent
90f6f77f8b
commit
ce0bf30189
@ -1704,10 +1704,9 @@ GLOBALFUNC blnr ExtraTimeNotOver(void) {
|
|||||||
GLOBALPROC WaitForNextTick(void) {
|
GLOBALPROC WaitForNextTick(void) {
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
NSRunLoop *mainRunLoop = [NSRunLoop mainRunLoop];
|
NSRunLoop *mainRunLoop = [NSRunLoop mainRunLoop];
|
||||||
|
NSDate *until = [NSDate distantPast];
|
||||||
label_retry:
|
label_retry:
|
||||||
while (ExtraTimeNotOver()) {
|
[mainRunLoop runMode:NSDefaultRunLoopMode beforeDate:until];
|
||||||
[mainRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceReferenceDate:NextTickChangeTime]];
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckForSavedTasks();
|
CheckForSavedTasks();
|
||||||
|
|
||||||
@ -1717,6 +1716,12 @@ label_retry:
|
|||||||
|
|
||||||
if (CurSpeedStopped) {
|
if (CurSpeedStopped) {
|
||||||
DoneWithDrawingForTick();
|
DoneWithDrawingForTick();
|
||||||
|
until = [NSDate distantFuture];
|
||||||
|
goto label_retry;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ExtraTimeNotOver()) {
|
||||||
|
until = [NSDate dateWithTimeIntervalSinceReferenceDate:NextTickChangeTime];
|
||||||
goto label_retry;
|
goto label_retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user