Browse code

Reduce refresh requests without screen vector

Devine Lu Linvega authored on 26/01/2023 17:35:56
Showing 1 changed files
... ...
@@ -445,10 +445,13 @@ run(Uxn *u)
445 445
 		if(uxn_screen.fg.changed || uxn_screen.bg.changed)
446 446
 			redraw();
447 447
 		now = SDL_GetPerformanceCounter();
448
-		if(!BENCH && ((Sint64)(frame_end - now)) > 0) {
449
-			SDL_Delay((frame_end - now) / ms_interval);
450
-			now = frame_end;
451
-		}
448
+		if(u->dev[0x20]) {
449
+			if(!BENCH && ((Sint64)(frame_end - now)) > 0) {
450
+				SDL_Delay((frame_end - now) / ms_interval);
451
+				now = frame_end;
452
+			}
453
+		} else
454
+			SDL_WaitEvent(NULL);
452 455
 	}
453 456
 	return error("SDL_WaitEvent", SDL_GetError());
454 457
 }