Skip to content
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

merge some commits from the base of new_rendering, should fix problems with rendering on MacOS in master #6756

Merged
merged 10 commits into from Jun 10, 2022

Conversation

mesilliac
Copy link
Contributor

This is to address some bugs preventing the game from working on MacOS, raised on Discord.

It removes the fake compatibility framebuffer that was being used to maintain old code that expected to be able to draw directly to the screen. However it does so in a way that is likely to be very bad for performance. Or rather, the subsequent commits that bring performance back into line haven't been pulled in to this PR.

It needs some brief testing from someone with a less fast system than i have. Previously there were reports of slowness in the editor, but i don't experience it. Two things might cause slowness: scrolling around a large map in game, and scrolling the tool pallete in the map editor. If these are acceptable, then this should be merged.

Actually that editor issue might also be in current master... i'm not sure. It seems fine to me.

Most of this is converting things that used to use SDL_Surface to use SDL_Texture in stead.

There are several "TODO" comments added. Most of these are already resolved in the new_rendering branch.

@github-actions github-actions bot added Editor Map/scenario editor issues. UI User interface issues, including both back-end and front-end issues. Units Issues that involve unit definitions or their implementation in the engine. labels Jun 8, 2022
@github-actions github-actions bot added Building Build-time issues. CMake Issues involving the CMake build system. SCons Issues involving the SCons build system. labels Jun 9, 2022
@mesilliac
Copy link
Contributor Author

This should now be passing all tests. (that Windows one is just failing to download something...)

I added a renderer to the fake display used for the boost unit tests. It seems to work fine. It's rendering to an offscreen texture, so theoretically it might even be able to render things for tests, if that's ever useful / relevant.

The WML validation tests are still using a headless setup with no renderer (which i think is what you get if you run wesnoth with --nogui). I got this working just by sprinkling some extra checks around, so things don't try to draw in headless mode.

I'll probably rebase and merge this along with #6760 tomorrow, assuming there are no objections.

Many places are not completely converted, but rather just converting
a surface to a texture on the fly. This is likely to be very bad for
performance. However they can now be addressed one by one.
This removes drawingSurface, and the compatibility shims blit_surface()
and render_low_res() entirely.

All draws should now use the new drawing interface in draw.cpp,
primarily draw::blit().

There are still things reading pixels back from the screen. These
should be phased out, but the interface will remain for screenshots
and the like.
They silently do nothing in this case.
It was (a) spitting warnings, (b) deserving to do so because it was
relying on undefined behaviour, and (c) doing nothing that the check
directly above it hadn't just done.
Display no longer tries to draw or make buttons when it doesn't have
a screen, and the request for an empty theme name is treated as a
request for the default theme.
@mesilliac mesilliac merged commit 072c22f into wesnoth:master Jun 10, 2022
@mesilliac mesilliac deleted the fake_fb_removal branch June 10, 2022 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Building Build-time issues. CMake Issues involving the CMake build system. Editor Map/scenario editor issues. SCons Issues involving the SCons build system. UI User interface issues, including both back-end and front-end issues. Units Issues that involve unit definitions or their implementation in the engine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant