mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
SACT: Ctrl key cancels SACT.Wait and SACT.TimerWait
This fixes an issue where the roulette in Rance 5D could not be fast forwarded using the Ctrl key.
This commit is contained in:
+7
-7
@@ -1613,10 +1613,10 @@ static void TimerWait() {
|
||||
int wTimerID = getCaliValue();
|
||||
int wCount = getCaliValue();
|
||||
|
||||
while (wCount > stimer_get(wTimerID) && !nact->is_quit) {
|
||||
sys_keywait(10, KEYWAIT_NONCANCELABLE);
|
||||
}
|
||||
|
||||
int msec = (wCount - stimer_get(wTimerID)) * 10;
|
||||
if (msec > 0)
|
||||
sys_keywait(msec, KEYWAIT_CTRL_CANCELABLE);
|
||||
|
||||
TRACE("SACT.TimerWait %d,%d:", wTimerID, wCount);
|
||||
}
|
||||
|
||||
@@ -1627,9 +1627,9 @@ static void TimerWait() {
|
||||
*/
|
||||
static void Wait() {
|
||||
int wCount = getCaliValue();
|
||||
|
||||
sys_keywait(wCount*10, KEYWAIT_NONCANCELABLE);
|
||||
|
||||
|
||||
sys_keywait(wCount * 10, KEYWAIT_CTRL_CANCELABLE);
|
||||
|
||||
TRACE("SACT.Wait %d:", wCount);
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ int sys_keywait(int msec, unsigned flags) {
|
||||
key = sys_getInputInfo();
|
||||
cancel_yield(); // We just yielded!
|
||||
if ((flags & KEYWAIT_CANCELABLE) && key) break;
|
||||
if ((flags & KEYWAIT_CTRL_CANCELABLE) && RawKeyInfo[KEY_CTRL]) break;
|
||||
}
|
||||
|
||||
return key;
|
||||
|
||||
+4
-3
@@ -38,9 +38,10 @@ struct SDL_Point;
|
||||
#define SYS35KEY_ESC 64
|
||||
#define SYS35KEY_TAB 128
|
||||
|
||||
#define KEYWAIT_NONCANCELABLE 0
|
||||
#define KEYWAIT_CANCELABLE 1
|
||||
#define KEYWAIT_SKIPPABLE 2
|
||||
#define KEYWAIT_NONCANCELABLE 0
|
||||
#define KEYWAIT_CANCELABLE 1
|
||||
#define KEYWAIT_SKIPPABLE 2
|
||||
#define KEYWAIT_CTRL_CANCELABLE 4
|
||||
|
||||
// System3.x key codes (IG command, etc.)
|
||||
// These are originated from Windows virtual key codes (VK_*).
|
||||
|
||||
Reference in New Issue
Block a user