Input check before WaitVsync

This commit is contained in:
kichikuou
2018-12-30 11:56:50 +09:00
parent f4d35b544e
commit fb0499fa10
2 changed files with 7 additions and 15 deletions
+3 -4
View File
@@ -24,12 +24,11 @@
#ifndef __XSYSTEM35_COUNTER__
#define __XSYSTEM35_COUNTER__
#define EXTER_HIGHTCOUNTER_NUM 5
#define EXTER_HIGHTCOUNTER_NUM 4
#define SYSTEMCOUNTER_MP3 (256 + 1)
#define SYSTEMCOUNTER_MIDI (256 + 2)
#define SYSTEMCOUNTER_MAINLOOP (256 + 3)
#define SYSTEMCOUNTER_FADE (256 + 4)
#define SYSTEMCOUNTER_MSEC (256 + 5) /* 1msec no reset counter */
#define SYSTEMCOUNTER_FADE (256 + 3)
#define SYSTEMCOUNTER_MSEC (256 + 4) /* 1msec no reset counter */
extern int get_counter(int division);
extern void reset_counter(int val);
+4 -11
View File
@@ -181,11 +181,8 @@ static int checkMessage() {
return c0;
}
#define MAINLOOP_EVENTCHECK_INTERVAL 16 /* 16 msec */
void nact_main() {
reset_counter_high(SYSTEMCOUNTER_MSEC, 1, 0);
reset_counter_high(SYSTEMCOUNTER_MAINLOOP, MAINLOOP_EVENTCHECK_INTERVAL, 0);
int cnt = 0;
nact->frame_count = 0;
@@ -200,16 +197,12 @@ void nact_main() {
check_command(c0);
nact->cmd_count++;
}
#ifndef ENABLE_SDL
if (!nact->is_message_locked) {
if (get_high_counter(SYSTEMCOUNTER_MAINLOOP)) {
sys_getInputInfo();
reset_counter_high(SYSTEMCOUNTER_MAINLOOP, MAINLOOP_EVENTCHECK_INTERVAL, 0);
}
}
#endif
nact->callback();
}
#ifndef __EMSCRIPTEN__
if (!nact->is_message_locked)
sys_getInputInfo();
#endif
WaitVsync();
nact->frame_count++;
nact->wait_vsync = FALSE;