Skip to content

Commit f84b96a

Browse files
committed
[core] Improved UI update in video thread.
1 parent 72ae8c8 commit f84b96a

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/video.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -490,21 +490,18 @@ void ShutdownVideo() {
490490
free(plx_screen_txr);
491491
plx_screen_txr = NULL;
492492
}
493-
494493
if(plx_cursor_txr) {
495494
plx_txr_destroy(plx_cursor_txr);
496495
plx_cursor_txr = NULL;
497496
}
498-
499-
if (plx_cxt) {
497+
if(plx_cxt) {
500498
plx_fcxt_destroy(plx_cxt);
501499
plx_cxt = NULL;
502500
}
503-
if (plx_fnt) {
501+
if(plx_fnt) {
504502
plx_font_destroy(plx_fnt);
505503
plx_fnt = NULL;
506504
}
507-
508505
SDL_Quit();
509506
}
510507

@@ -543,6 +540,7 @@ void SDL_DS_Blit_Textured() {
543540
plx_fcxt_end(plx_cxt);
544541
}
545542

543+
plx_mat_identity();
546544
plx_mat3d_translate(sdl_dc_trans_x, sdl_dc_trans_y, sdl_dc_trans_z);
547545

548546
plx_cxt_texture(plx_screen_txr);
@@ -586,44 +584,46 @@ static void *VideoThread(void *ptr) {
586584
thd_pass();
587585
continue;
588586
}
589-
590587
LockVideo();
591588

592-
if(screen_changed && draw_screen) {
593-
if(video_dma) {
594-
dcache_flush_range((uintptr_t)sdl_dc_buftex, sdl_dc_wtex * sdl_dc_htex * 2);
595-
do {
596-
int rs = pvr_txr_load_dma(sdl_dc_buftex, sdl_dc_memtex,
597-
sdl_dc_wtex * sdl_dc_htex * 2, 1, NULL, 0);
598-
if(rs < 0 && errno == EINPROGRESS) {
599-
thd_pass();
600-
continue;
601-
}
602-
break;
603-
} while(1);
604-
}
605-
else {
606-
pvr_txr_load(sdl_dc_buftex, sdl_dc_memtex, sdl_dc_wtex * sdl_dc_htex * 2);
589+
if(draw_screen) {
590+
ProcessVideoEventsRender();
591+
592+
if(screen_changed) {
593+
if(video_dma) {
594+
dcache_flush_range((uintptr_t)sdl_dc_buftex, sdl_dc_wtex * sdl_dc_htex * 2);
595+
do {
596+
int rs = pvr_txr_load_dma(sdl_dc_buftex, sdl_dc_memtex,
597+
sdl_dc_wtex * sdl_dc_htex * 2, 1, NULL, 0);
598+
if(rs < 0 && errno == EINPROGRESS) {
599+
thd_pass();
600+
continue;
601+
}
602+
break;
603+
} while(1);
604+
}
605+
else {
606+
pvr_txr_load(sdl_dc_buftex, sdl_dc_memtex, sdl_dc_wtex * sdl_dc_htex * 2);
607+
}
608+
screen_changed = 0;
607609
}
608-
screen_changed = 0;
609610
}
610611

611612
pvr_scene_begin();
612613

613614
if(draw_screen) {
614615
pvr_list_begin(PVR_LIST_TR_POLY);
615-
ScreenFadeStep();
616616

617-
ProcessVideoEventsRender();
617+
ScreenFadeStep();
618618
SDL_DS_Blit_Textured();
619619
ProcessVideoEventsRenderPost();
620620
SDL_DS_Blit_Cursor();
621621

622622
pvr_list_finish();
623-
} else {
623+
}
624+
else {
624625
ProcessVideoEventsRender();
625626
}
626-
627627
pvr_scene_finish();
628628
UnlockVideo();
629629
}

0 commit comments

Comments
 (0)