SACT/NIGHTDLL: Check nact->is_quit flag in wait loops

This commit is contained in:
kichikuou
2021-01-24 11:43:23 +09:00
parent 04c3e22339
commit d61ce9a18e
6 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -312,7 +312,7 @@ static int ntmsg_keywait() {
night.waittype = KEYWAIT_MESSAGE;
night.waitkey = -1;
while (night.waitkey == -1) {
while (night.waitkey == -1 && !nact->is_quit) {
int st = get_high_counter(SYSTEMCOUNTER_MSEC);
int interval = 25;
+2 -2
View File
@@ -1012,7 +1012,7 @@ static void WaitKeySimple() {
sact.waittype = KEYWAIT_SIMPLE;
sact.waitkey = -1;
while(sact.waitkey == -1) {
while (sact.waitkey == -1 && !nact->is_quit) {
sys_keywait(25, KEYWAIT_CANCELABLE);
}
@@ -1587,7 +1587,7 @@ static void TimerWait() {
int wTimerID = getCaliValue();
int wCount = getCaliValue();
while(wCount > stimer_get(wTimerID)) {
while (wCount > stimer_get(wTimerID) && !nact->is_quit) {
sys_keywait(10, KEYWAIT_NONCANCELABLE);
}
+1 -1
View File
@@ -135,7 +135,7 @@ int ssnd_waitkey(int no, int *res) {
sact.waittype = KEYWAIT_SIMPLE;
sact.waitkey = -1;
while(sact.waitkey == -1 && mus_wav_get_playposition(slot)) {
while (sact.waitkey == -1 && mus_wav_get_playposition(slot) && !nact->is_quit) {
sys_keywait(25, KEYWAIT_CANCELABLE);
}
+1 -1
View File
@@ -150,7 +150,7 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout
endtime = timeout < 0 ? INT_MAX : (curtime + timeout * 10);
// スプライトキー待ちメイン
while (!waitcond(endtime)) {
while (!waitcond(endtime) && !nact->is_quit) {
sys_keywait(25, KEYWAIT_CANCELABLE);
}
+1 -1
View File
@@ -403,7 +403,7 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
sact.waittype = KEYWAIT_MESSAGE;
sact.waitkey = -1;
while (sact.waitkey == -1) {
while (sact.waitkey == -1 && !nact->is_quit) {
int st = get_high_counter(SYSTEMCOUNTER_MSEC);
int interval = 25;
+2
View File
@@ -238,6 +238,8 @@ static int sel_main() {
while(selected_item == -1) {
sys_keywait(25, KEYWAIT_CANCELABLE);
if (nact->is_quit)
selected_item = 0;
}
sact.waittype = KEYWAIT_NONE;