[Scummvm-git-logs] scummvm branch-3-0 -> 53eb5888ba203019cbe70df1623712fa04be9fe9
sluicebox
noreply at scummvm.org
Fri Jan 2 17:23:59 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
51354f370c HUGO: Process events during introduction delays
53eb5888ba HUGO: Add Escape hotkey for end-game prompt
Commit: 51354f370ca91d7b2ae8eb35ae4daa4a6718caee
https://github.com/scummvm/scummvm/commit/51354f370ca91d7b2ae8eb35ae4daa4a6718caee
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-02T09:23:33-08:00
Commit Message:
HUGO: Process events during introduction delays
- Fixes unresponsive program window during introductions
- Quit and Return-to-launcher now works during all introductions
- Escape key now reliably skips all introductions
Changed paths:
engines/hugo/intro.cpp
engines/hugo/intro.h
diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp
index 943f76018c4..39155c57764 100644
--- a/engines/hugo/intro.cpp
+++ b/engines/hugo/intro.cpp
@@ -27,6 +27,7 @@
*/
#include "common/system.h"
+#include "common/events.h"
#include "common/textconsole.h"
#include "graphics/font.h"
#include "graphics/pixelformat.h"
@@ -81,6 +82,44 @@ void IntroHandler::freeIntroData() {
_introX = _introY = nullptr;
}
+/**
+ * Wait for a delay in milliseconds while processing events.
+ * This keeps the program window responsive during long delays.
+ * Returns false if interrupted by a quit event or the Escape key.
+ */
+bool IntroHandler::wait(uint32 delay) {
+ const uint32 startTime = _vm->_system->getMillis();
+
+ while (!_vm->shouldQuit()) {
+ Common::Event event;
+ while (_vm->getEventManager()->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_RETURN_TO_LAUNCHER:
+ case Common::EVENT_QUIT:
+ return false; // interrupted by quit
+
+ case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
+ if (event.customType == kActionEscape) {
+ return false; // interrupted by Escape
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_vm->_system->getMillis() - startTime >= delay) {
+ return true; // delay completed
+ }
+
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(10);
+ }
+
+ return false; // interrupted by quit
+}
+
intro_v1d::intro_v1d(HugoEngine *vm) : IntroHandler(vm) {
_introState = 0;
}
@@ -278,8 +317,11 @@ bool intro_v1d::introPlay() {
#endif
_vm->_screen->displayBackground();
- g_system->updateScreen();
- g_system->delayMillis(1000);
+ if (!wait(1000)) {
+ // Wait was interrupted by quit event or Escape.
+ // Skip the rest of the introduction.
+ return true;
+ }
}
return (++_introTicks >= introSize);
@@ -331,8 +373,7 @@ void intro_v2d::introInit() {
#endif
_vm->_screen->displayBackground();
- g_system->updateScreen();
- g_system->delayMillis(5000);
+ wait(5000);
#ifdef USE_TTS
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
@@ -390,8 +431,7 @@ void intro_v3d::introInit() {
#endif
_vm->_screen->displayBackground();
- g_system->updateScreen();
- g_system->delayMillis(5000);
+ wait(5000);
#ifdef USE_TTS
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
@@ -467,8 +507,7 @@ void intro_v2w::introInit() {
_vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen
_vm->_screen->displayBackground();
- g_system->updateScreen();
- g_system->delayMillis(3000);
+ wait(3000);
}
bool intro_v2w::introPlay() {
@@ -491,8 +530,7 @@ void intro_v3w::introInit() {
_vm->_screen->displayList(kDisplayInit);
_vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen
_vm->_screen->displayBackground();
- g_system->updateScreen();
- g_system->delayMillis(3000);
+ wait(3000);
_vm->_file->readBackground(22); // display screen MAP_3w
_vm->_screen->displayBackground();
_introTicks = 0;
diff --git a/engines/hugo/intro.h b/engines/hugo/intro.h
index 7ff5887c32b..ad06a71764c 100644
--- a/engines/hugo/intro.h
+++ b/engines/hugo/intro.h
@@ -63,6 +63,8 @@ protected:
byte *_introY;
byte _introXSize;
int16 _introTicks; // Count calls to introPlay()
+
+ bool wait(uint32 delay);
};
class intro_v1w : public IntroHandler {
Commit: 53eb5888ba203019cbe70df1623712fa04be9fe9
https://github.com/scummvm/scummvm/commit/53eb5888ba203019cbe70df1623712fa04be9fe9
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-02T09:23:39-08:00
Commit Message:
HUGO: Add Escape hotkey for end-game prompt
This is original behavior in DOS versions
Changed paths:
engines/hugo/parser.cpp
engines/hugo/parser.h
engines/hugo/parser_v1d.cpp
engines/hugo/parser_v1w.cpp
engines/hugo/parser_v2d.cpp
engines/hugo/parser_v3d.cpp
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index c735e0e4f25..1c047e45b8e 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -372,9 +372,11 @@ void Parser::actionHandler(Common::Event event) {
switchTurbo();
break;
case kActionEscape: // Escape key, may want to QUIT
- if (gameStatus._viewState == kViewIntro)
+ if (gameStatus._viewState == kViewIntro) {
gameStatus._skipIntroFl = true;
- else {
+ } else if (gameStatus._viewState == kViewPlay) {
+ endGamePrompt();
+ } else {
if (_vm->_inventory->getInventoryState() == kInventoryActive) // Remove inventory, if displayed
_vm->_inventory->setInventoryState(kInventoryUp);
_vm->_screen->resetInventoryObjId();
@@ -536,4 +538,10 @@ void Parser::showDosInventory() const {
Utils::notifyBox(buffer.c_str(), false);
}
+void Parser::endGamePrompt() {
+ if (Utils::yesNoBox(_vm->_text->getTextParser(kTBExit_1d))) {
+ _vm->endGame();
+ }
+}
+
} // End of namespace Hugo
diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h
index 7641ba8758a..86a6d8b2543 100644
--- a/engines/hugo/parser.h
+++ b/engines/hugo/parser.h
@@ -120,6 +120,7 @@ protected:
void readBG(Common::ReadStream &in, Background &curBG);
void readCmd(Common::ReadStream &in, cmd &curCmd);
void showDosInventory() const;
+ void endGamePrompt();
bool _checkDoubleF1Fl; // Flag used to display user help or instructions
uint16 _getIndex; // Index into ring buffer
diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp
index 36c5d76bb7b..a6d55454a5d 100644
--- a/engines/hugo/parser_v1d.cpp
+++ b/engines/hugo/parser_v1d.cpp
@@ -361,8 +361,7 @@ void Parser_v1d::lineHandler() {
}
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
- if (Utils::yesNoBox(_vm->_text->getTextParser(kTBExit_1d)))
- _vm->endGame();
+ endGamePrompt();
return;
}
diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp
index 5764bf6a2ff..7a4ea4c5b03 100644
--- a/engines/hugo/parser_v1w.cpp
+++ b/engines/hugo/parser_v1w.cpp
@@ -114,8 +114,7 @@ void Parser_v1w::lineHandler() {
// Special meta commands
// EXIT/QUIT
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
- if (Utils::yesNoBox(_vm->_text->getTextParser(kTBExit_1d)))
- _vm->endGame();
+ endGamePrompt();
return;
}
diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp
index c4f4af78e9d..982630f55dd 100644
--- a/engines/hugo/parser_v2d.cpp
+++ b/engines/hugo/parser_v2d.cpp
@@ -111,8 +111,7 @@ void Parser_v2d::lineHandler() {
}
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
- if (Utils::yesNoBox(_vm->_text->getTextParser(kTBExit_1d)))
- _vm->endGame();
+ endGamePrompt();
return;
}
diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp
index 201c22010be..e56030ba52d 100644
--- a/engines/hugo/parser_v3d.cpp
+++ b/engines/hugo/parser_v3d.cpp
@@ -113,8 +113,7 @@ void Parser_v3d::lineHandler() {
// Special meta commands
// EXIT/QUIT
if (!strcmp("exit", _vm->_line) || strstr(_vm->_line, "quit")) {
- if (Utils::yesNoBox(_vm->_text->getTextParser(kTBExit_1d)))
- _vm->endGame();
+ endGamePrompt();
return;
}
More information about the Scummvm-git-logs
mailing list