Opened 7 days ago

Last modified 7 days ago

#17044 new defect

ASYLUM: Encounter cursor still shown after encounter has ended

Reported by: eriktorbjorn Owned by:
Priority: normal Component: Engine: Asylum
Version: Keywords:
Cc: Game: Sanitarium

Description (last modified by eriktorbjorn)

English version of Sanitarium, current development version of ScummVM.

In some cases, there will be an encounter (the cursor changes to a mouth, and you see one or more text boxes) where, after the encounter has ended, you still have the encounter cursor (an animated mouth).

This happens in the Hive chapter, when entering the furnace for the first time. (See attached savegame.)

The problem seems to be that the encounter is triggered while you are walking, so either _rightButtonDown or _keyState will be true. So Scene::updateCursor() will get stuck on that case, but since you are apparently no longer walking it will just return without changing the cursor.

You never reach the cases where it would set the cursor back to (probably) a magnifying glass or something.

I had hoped I would be able to suggest a fix, but this is as far as I got.

Attachments (1)

asylum.024 (49.2 KB ) - added by eriktorbjorn 7 days ago.

Download all attachments as: .zip

Change History (5)

by eriktorbjorn, 7 days ago

Attachment: asylum.024 added

comment:1 by eriktorbjorn, 7 days ago

I'm guessing the problem is that not every event loop clears _rightButton and _keyState.

_keyState tracks which of the left, right, up and down keys are being held down, I think.

_rightButtonDown tracks if the right mouse button is pressed or not.

For the latter, we could probably check getButtonState() in the event manager instead, but for the keyboard I don't see any equivalent functionality.

comment:2 by eriktorbjorn, 7 days ago

Description: modified (diff)

comment:3 by eriktorbjorn, 7 days ago

So where does the Asylum engine call pollEvent()? Here are cases where events are just thrown away, without clearing the variables:

  • Scene::playIntroSpeech()
  • Scene::preload()
  • Screen::paletteFade()
  • AsylumEngine::playIntro()

This is presumably the main one, where the variables can be cleared:

  • AsylumEngine::handleEvents()

But the engine can swap out the event handler, so it's hard to get an overview of what does or doesn't happen here.

Last edited 7 days ago by eriktorbjorn (previous) (diff)

comment:4 by eriktorbjorn, 7 days ago

In this particular case, it's running the main event loop but it switches out the event handler for another one. Specifically, it switches to the one in the Encounter class.

Note: See TracTickets for help on using tickets.