PSP2: Simplify frame limiter code
Vicki Pfau vi@endrift.com
Mon, 08 Oct 2018 20:02:32 -0700
1 files changed,
5 insertions(+),
6 deletions(-)
jump to
M
src/platform/psp2/main.c
→
src/platform/psp2/main.c
@@ -25,18 +25,17 @@
#include <vita2d.h> static void _drawStart(void) { - vita2d_set_vblank_wait(false); + static int vcount = 0; + extern bool frameLimiter; + int oldVCount = vcount; + vcount = sceDisplayGetVcount(); + vita2d_set_vblank_wait(frameLimiter && vcount + 1 >= oldVCount); vita2d_start_drawing(); vita2d_clear_screen(); } static void _drawEnd(void) { - static int vcount = 0; - extern bool frameLimiter; - int oldVCount = vcount; vita2d_end_drawing(); - vcount = sceDisplayGetVcount(); - vita2d_set_vblank_wait(frameLimiter && vcount + 1 >= oldVCount); vita2d_swap_buffers(); }