Fixed issue where a screen redraw might occur after it has been unset

This commit is contained in:
Devine Lu Linvega 2023-04-02 20:27:15 -07:00
parent 8b43d0d7ae
commit 3b10969f9e
1 changed files with 2 additions and 1 deletions

View File

@ -448,7 +448,7 @@ run(Uxn *u)
{ {
Uint64 now = SDL_GetPerformanceCounter(), frame_end, frame_interval = SDL_GetPerformanceFrequency() / 60; Uint64 now = SDL_GetPerformanceCounter(), frame_end, frame_interval = SDL_GetPerformanceFrequency() / 60;
for(;;) { for(;;) {
Uint16 screen_vector = PEEK2(&u->dev[0x20]); Uint16 screen_vector;
/* .System/halt */ /* .System/halt */
if(u->dev[0x0f]) if(u->dev[0x0f])
return error("Run", "Ended."); return error("Run", "Ended.");
@ -456,6 +456,7 @@ run(Uxn *u)
exec_deadline = now + deadline_interval; exec_deadline = now + deadline_interval;
if(!handle_events(u)) if(!handle_events(u))
return 0; return 0;
screen_vector = PEEK2(&u->dev[0x20]);
uxn_eval(u, screen_vector); uxn_eval(u, screen_vector);
if(uxn_screen.fg.changed || uxn_screen.bg.changed) if(uxn_screen.fg.changed || uxn_screen.bg.changed)
redraw(); redraw();