[Scummvm-tracker] [ScummVM :: Bugs] #16205: SCUMM: TTS can read text for buttons that are not currently active, or even no longer there

ScummVM :: Bugs trac at scummvm.org
Sat Sep 13 16:20:07 UTC 2025


#16205: SCUMM: TTS can read text for buttons that are not currently active, or even
no longer there
-------------------------+---------------------------
Reporter:  eriktorbjorn  |      Owner:  (none)
    Type:  defect        |     Status:  new
Priority:  normal        |  Component:  Engine: SCUMM
 Version:                |   Keywords:
    Game:                |
-------------------------+---------------------------
 I noticed that when you pause a SCUMM game, using the original GUI,
 Valgrind may warn that
 `ScummEngine::getInternalGUIControlFromCoordinates()` is looking at
 uninitialized data.

 I thought this was an easy fix, but it turned out that my attempt broke
 other things, and that the problems go deeper than I first anticipated. So
 back to square one. The problem stems from text-to-speech, even when text-
 to-speech is not enabled. But for now, let's assume it is. I'm using Day
 of the Tentacle as an example, because it has a nice, juicy menu dialog
 with lots of controls.

 Scenario 1:

 - Open the SCUMM menu for the game.
 - Click Quit. At least if you've enabled confirmation before exiting, this
 will print a question if you really want to quit.
 - Move the cursor over the menu dialog still displayed in the background.

 It will read the names of the controls, even though they're not currently
 accessible. It will not do that for the verbs while the menu is open, so
 the behavior is not consistent.

 Scenario 2:

 - Open the SCUMM menu for the game.
 - Close the menu, then pause the game.

 The mouse cursor is invisible, but you can still move it around, and the
 voice will read back buttons from the menu dialog, which is no longer
 visible.

 This appears to be because
 `ScummEngine::getInternalGUIControlFromCoordinates()` will loop through
 all of the internal GUI controls, whether they are used or not. We can't
 make them inactive (at least by by setting `relativeCenterX` to -1),
 because then they're still inactive when the banner has been closed. That
 was the fix I was trying to make earlier.

 Perhaps a stack to keep track of which controls to look at? But that may
 be some serious overkill. How deeply can the dialogs nest anyway?

 We could probably also look at `_messageBannerActive`. If it's true, only
 look at the first control. If not, look at the rest of them. (The other
 dialogs don't use slot 0, apparently.)

 The banner text is already read once when the banner is displayed. You
 could make the case that it doesn't need to read it again when the mouse
 moves across it. (Particularly since for some of these banners, the mouse
 cursor is hidden.)
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/16205>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list