-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix glitched graphics in undrawn area of the window #56215
Conversation
Unfortunately the issue still persists @Qrox: It occurred after experiencing a debug error popup and closing/ignoring the error.
|
I don't think I alt-tabbed at all during this testing session (it was about 5-10 minutes of gameplay, long enough to get to a city from evac shelter and trigger a debug popup) so that aspect of the original bug report may be misleading. Sorry about that. |
Well, in my test I didn't see any stuck graphics when closing a debug error popup. Could you post a screenshot before closing the debug error popup and returning to main menu so I can compare these screenshots? |
The debug error popup does not hide the sidebar in this image, which is weird.
Based on my understanding of the code the tile graphics should have the same height as the sidebar, but in this image the tile graphics are taller than the sidebar. Could you post |
I don't think I see any additional information. Is there something I can do to increase logging verbosity?
|
I think you need to define |
OK. It may take me some time to get that set up correctly. I'm compiling through MSYS2 with this
I was following the instructions at https://github.com/CleverRaven/Cataclysm-DDA/blob/178dbc825fb8c3b6bf3ae2bb1feb003b9c97003c/doc/COMPILING/COMPILING-MSYS.md which doesn't seem to go into the details about linking the |
Unless I missed something, you just extract the zipped files to the usual library path and compile with |
Would that be something like |
I'm using MinGW-w64 so I have no idea what the library path of MSYS2 is. Try it out maybe? Or you can see if you can reproduce the stuck graphics with the official release, which should already be compiled with stack trace on, and post the stack trace of the debug message that leads to the stuck graphics. |
Since MSYS2 includes mingw64 I assumed you had encountered this. The solution was to unzip
|
Thanks, it seems |
…when alt-tabbing back
The new changes should fix the stuck graphics, see the OP for the detail. @remd Please test if it now fixes your issue. |
@Qrox The latest changes fixed the issue for me. 🎉 Thank you! ❤️ |
Summary
Bugfixes "Fix glitched graphics in undrawn area of the window"
Purpose of change
Fix two graphic glitches when alt-tabbing. Fixes #56064.
Describe the solution
For the first gitch, the undrawn area sometimes contain random pixels when alt-tabbing back, which is fixed by the following changes:
SDL_RENDER_TARGETS_RESET
event.SDL_RENDER_TARGETS_RESET
when game window is resized, because resizing already reinitializes the render target.SDL_WINDOWEVENT_EXPOSED
does not actually require a redraw, only a update of the screen, so skip redrawing forSDL_WINDOWEVENT_EXPOSED
.For the second glitch, the undrawn area contains terrain graphics normally not drawn there after a debug message is shown during the terrain redraw callback (for example, when a terrain id is not found), which is fixed by the following changes:
Testing
For the first glitch, use the configuration posted in #56064 (other testers may need to adjust the font size to make the active borderless window smaller than the screen), and alt-tab out and back. Before this change sometimes the undrawn edge region contains random pixels (11 out of 20 times when I tested), and after this change the random pixels no longer appear (0 out of 20 times when I tested).
For the second glitch, add a
debugmsg
call to the redraw callback of the terrain UI and trigger the debug message. Before this fix, if the window has undrawn area below, terrain would be drawn there and not cleared. After this fix, the undrawn area is kept black. I also tested triggering debug messages in the resize and redraw callbacks of the terrain, overmap, and diary UIs, and they were all redrawn correctly after closing the debug message.