mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Input check before WaitVsync
This commit is contained in:
+3
-4
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user