PSP2: Simplify frame limiter code

This commit is contained in:
Vicki Pfau 2018-10-08 20:02:32 -07:00
parent 357e2e2d6b
commit 8fd76bc9f5
1 changed files with 5 additions and 6 deletions

View File

@ -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();
}