Opened 8 months ago
Closed 8 months ago
#15006 closed defect (fixed)
GRAPHICS: MACGUI: Screen can change between menu is activated and menu is drawn, causing glitches
Reported by: | eriktorbjorn | Owned by: | eriktorbjorn |
---|---|---|---|
Priority: | normal | Component: | Video |
Version: | Keywords: | ||
Cc: | Game: | Indiana Jones 3 |
Description (last modified by )
I don't know which games this will affect, but I've managed to reproduce it reliably with the Macintosh version of Indiana Jones and the Last Crusade.
When the menu is activated (by moving the mouse to the top of the screen), it will make a copy of the screen and flag the menu as visible. When the menu is closed, the screen is restored to that copy. But if the screen changes in the brief time between the menu is activated and it's first drawn, it will have saved an outdated version of the screen.
Try this in Last Crusade:
Walk from one room to another. There is a quick graphics transition. While the transition is running, quickly move the mouse to the top of the screen. If you time it right, you will have caused it to save the screen while it was still mostly black.
When the menu closes again, your screen may look something like this:
So instead of copying the screen right away, it should probably set a flag that the screen should be copied, and then do that right before the menu is actually drawn. But I'm a bit fuzzy on exactly how the Mac Window Manager class works.
Attachments (4)
Change History (10)
by , 8 months ago
Attachment: | scummvm-indy3-ega-mac-00000.png added |
---|
comment:1 by , 8 months ago
Description: | modified (diff) |
---|
by , 8 months ago
Attachment: | macgui-menu-corruption.txt added |
---|
comment:2 by , 8 months ago
comment:3 by , 8 months ago
When I was testing my patch in the 2.8 branch, I somehow got into a situation where the game became unresponsive. I could press the Mac verb buttons, but they didn't pop back out, and everything in the scene was frozen.
Another time, it froze in mid screen-transition.
Have I mentioned that I hate threads? :-(
In both cases, the Mac menu kept working. It was just the game itself that was frozen. Or possibly just paused.
comment:4 by , 8 months ago
I tried a more paranoid version of my patch, but I was still able to trigger the glitch. Am I barking up the completely wrong tree here?
by , 8 months ago
Attachment: | macgui-menu-corruption2.txt added |
---|
by , 8 months ago
Attachment: | macgui_menu_corruption3.txt added |
---|
comment:5 by , 8 months ago
Here's a third version of the patch that eliminates the use of a timer, and the glitch still happens. I have a feeling that it may have to do with that the menu can actually appear in the middle of a screen transition, not after it's finished as I first thought. You can verify that easily by changing delay
in the waitForTimer()
call at the end of ScummEngine::transitionEffect()
to delay * 10
or something like that.
I see two possibilities here: Either we need our transition effects to honor engine pausing in mid-transition, or we need to suspend the Mac GUI's event processing so that the menu doesn't appear until the screen transition is finished.
Or is there a third way? I'm not sure how to proceed here...
comment:6 by , 8 months ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Hopefully fixed now.
I've attached a possible patch, along the lines that I described. I'm not sure if it's correct.