[Scummvm-git-logs] scummvm master -> 3147b65b07b598fd1c8be4866d82637fc484fdb9

bluegr noreply at scummvm.org
Tue Nov 12 00:47:50 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3147b65b07 GLK: SCOTT: Check for RTL events - bug #14256


Commit: 3147b65b07b598fd1c8be4866d82637fc484fdb9
    https://github.com/scummvm/scummvm/commit/3147b65b07b598fd1c8be4866d82637fc484fdb9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-11-12T02:47:28+02:00

Commit Message:
GLK: SCOTT: Check for RTL events - bug #14256

Changed paths:
    engines/glk/scott/c64_checksums.cpp
    engines/glk/scott/scott.cpp
    engines/glk/scott/seas_of_blood.cpp


diff --git a/engines/glk/scott/c64_checksums.cpp b/engines/glk/scott/c64_checksums.cpp
index 4471eeb71bb..1596e833fd3 100644
--- a/engines/glk/scott/c64_checksums.cpp
+++ b/engines/glk/scott/c64_checksums.cpp
@@ -206,6 +206,9 @@ int savageIslandMenu(uint8_t **sf, size_t *extent, int recIndex) {
 				g_scott->glk_request_char_event(_G(_bottomWindow));
 			}
 		}
+
+		if (g_vm->shouldQuit())
+			return 0;
 	} while (result == 0);
 
 	g_scott->glk_window_clear(_G(_bottomWindow));
@@ -235,7 +238,6 @@ int savageIslandMenu(uint8_t **sf, size_t *extent, int recIndex) {
 		return decrunchC64(sf, extent, rec);
 	} else {
 		error("savageIslandMenu: Failed loading file %s\n", rec._appendFile);
-		return 0;
 	}
 }
 
@@ -285,6 +287,9 @@ int mysteriousMenu(uint8_t **sf, size_t *extent, int recindex) {
 				g_scott->glk_request_char_event(_G(_bottomWindow));
 			}
 		}
+
+		if (g_vm->shouldQuit())
+			return 0;
 	} while (result == 0);
 
 	g_scott->glk_window_clear(_G(_bottomWindow));
@@ -311,7 +316,6 @@ int mysteriousMenu(uint8_t **sf, size_t *extent, int recindex) {
 		break;
 	default:
 		error("mysteriousMenu: Unknown Game");
-		break;
 	}
 
 	int length;
@@ -352,6 +356,9 @@ int mysteriousMenu2(uint8_t **sf, size_t *extent, int recindex) {
 				g_scott->glk_request_char_event(_G(_bottomWindow));
 			}
 		}
+
+		if (g_vm->shouldQuit())
+			return 0;
 	} while (result == 0);
 
 	g_scott->glk_window_clear(_G(_bottomWindow));
@@ -375,7 +382,6 @@ int mysteriousMenu2(uint8_t **sf, size_t *extent, int recindex) {
 		break;
 	default:
 		error("mysteriousMenu2: Unknown Game");
-		break;
 	}
 
 	int length;
@@ -389,7 +395,6 @@ int mysteriousMenu2(uint8_t **sf, size_t *extent, int recindex) {
 		return decrunchC64(sf, extent, rec);
 	} else {
 		error("mysteriousMenu2: Failed loading file %s", filename);
-		return 0;
 	}
 }
 
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index a025214e237..870a56c35d3 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -328,7 +328,7 @@ void Scott::delay(double seconds) {
 		do {
 			glk_select(&ev);
 			updates(ev);
-		} while (drawingVector());
+		} while (drawingVector() && !g_vm->shouldQuit());
 		if (_G(_gliSlowDraw))
 			seconds = 0.5;
 	}
@@ -338,7 +338,7 @@ void Scott::delay(double seconds) {
 	do {
 		glk_select(&ev);
 		updates(ev);
-	} while (ev.type != evtype_Timer);
+	} while (ev.type != evtype_Timer && !g_vm->shouldQuit());
 
 	glk_request_timer_events(0);
 }
@@ -1921,7 +1921,7 @@ int Scott::yesOrNo() {
 			}
 		} else
 			updates(ev);
-	} while (result == 0);
+	} while (result == 0 && !g_vm->shouldQuit());
 
 	return (result == 1);
 }
@@ -1941,7 +1941,7 @@ void Scott::hitEnter() {
 			}
 		} else
 			updates(ev);
-	} while (result == 0);
+	} while (result == 0 && !g_vm->shouldQuit());
 
 	return;
 }
diff --git a/engines/glk/scott/seas_of_blood.cpp b/engines/glk/scott/seas_of_blood.cpp
index 07b52fa545f..d309fb36c0d 100644
--- a/engines/glk/scott/seas_of_blood.cpp
+++ b/engines/glk/scott/seas_of_blood.cpp
@@ -588,7 +588,7 @@ int rollDice(int strike, int stamina, int boatFlag) {
 
 	int delay = 60;
 
-	while (1) {
+	while (!g_vm->shouldQuit()) {
 		g_scott->glk_select(&event);
 		if (event.type == evtype_Timer) {
 			if (theirDiceStopped) {
@@ -670,8 +670,7 @@ void battleHitEnter(int strike, int stamina, int boatFlag) {
 			rearrangeBattleDisplay(strike, stamina, boatFlag);
 		}
 
-	} while (result == 0);
-	return;
+	} while (result == 0 && !g_vm->shouldQuit());
 }
 
 void battleLoop(int enemy, int strike, int stamina, int boatFlag) {
@@ -726,8 +725,7 @@ void battleLoop(int enemy, int strike, int stamina, int boatFlag) {
 
 		battleHitEnter(strike, stamina, boatFlag);
 		g_scott->glk_window_clear(_G(_bottomWindow));
-
-	} while (stamina > 0 && _G(_counters)[3] > 0);
+	} while (stamina > 0 && _G(_counters)[3] > 0 && !g_vm->shouldQuit());
 }
 
 void swapStaminaAndCrewStrength(void) {




More information about the Scummvm-git-logs mailing list