src/video/cocoa_v.m
branchcustombridgeheads
changeset 5648 1608018c5ff2
parent 5643 3778051e8095
child 5650 aefc131bf5ce
--- a/src/video/cocoa_v.m	Wed Jan 03 20:00:29 2007 +0000
+++ b/src/video/cocoa_v.m	Thu Jan 11 13:16:26 2007 +0000
@@ -337,10 +337,7 @@
 
 		case QZ_RETURN:
 		case QZ_f:
-			if (down && (
-						(_cocoa_video_data.current_mods & NSControlKeyMask) ||
-						(_cocoa_video_data.current_mods & NSCommandKeyMask)
-					)) {
+			if (down && (_cocoa_video_data.current_mods & NSCommandKeyMask)) {
 				CocoaVideoFullScreen(!_fullscreen);
 			}
 			break;
@@ -655,8 +652,8 @@
 
 static void QZ_GameLoop(void)
 {
-	uint32 next_tick = GetTick() + 30;
-	uint32 cur_ticks;
+	uint32 cur_ticks = GetTick();
+	uint32 next_tick = cur_ticks + 30;
 	uint32 pal_tick = 0;
 #ifdef _DEBUG
 	uint32 et0, et, st0, st;
@@ -683,6 +680,7 @@
 	CSleep(1);
 
 	for (;;) {
+		uint32 prev_cur_ticks; // to check for wrapping
 		InteractiveRandom(); // randomness
 
 		while (QZ_PollEvent()) {}
@@ -701,11 +699,8 @@
 		}
 
 		cur_ticks = GetTick();
-		if ((_fast_forward && !_pause) || cur_ticks > next_tick)
-			next_tick = cur_ticks;
-
-		if (cur_ticks == next_tick) {
-			next_tick += 30;
+		if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+			next_tick = cur_ticks + 30;
 
 			_ctrl_pressed = !!(_cocoa_video_data.current_mods & NSControlKeyMask);
 			_shift_pressed = !!(_cocoa_video_data.current_mods & NSShiftKeyMask);