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

Canvas cleanup #6804

Merged
merged 7 commits into from Jun 28, 2022
Merged

Canvas cleanup #6804

merged 7 commits into from Jun 28, 2022

Conversation

mesilliac
Copy link
Contributor

Pulling most of the canvas cleanup out of the new_rendering branch.

This fixes #6787 , or at least it puts it back to the state it was in before. The GUI is still using the wrong layout at those resolutions, but it won't go all black.

This also introduces bugs with the credits screen. I managed to get it at least not crashing, but it looks terrible. That can't be fixed without overhauling the credits screen to not try to draw 80000 pixels worth of text all at once. It's not trying to draw all that here, but the way the canvas overhaul was set up, it still can't handle the size even if it only draws a small amount.

I left out the massive removal of dirty widget handling code.

I also had to completely overhaul how viewport setting works to micromanage clipping regions. It was not pleasant. I am not a fan of viewports.

mesilliac and others added 7 commits June 28, 2022 00:58
Viewports now manage the clipping rectangle when set and unset,
converting it to the viewport coordinate space. Some improvements
were also made to handling when clipping is disabled.
Text is still drawing clipped because otherwise Credits crashes. It has
bugs because the viewport is too large, but at least it doesn't crash.
I didn't take too close a look at what that weird cache was doing, but I recall last time
I did this concluding it didn't do much of anything at all.
These were added in 8f945cf, but since the "new" listbox
implementation never came to be, these have just been unused clutter. There was one place
they were used as parameters in a manual call to calculate_blitting_rectangle, but that was
refactored out in db17177.

This also removes an overload of widget::draw_debug_border, since without the offsets, both
functions now did the same thing.

This affects:
* widget::draw_background
* widget::draw_children
* widget::draw_foreground
* widget::impl_draw_background (offset overload removed)
* widget::impl_draw_children
* widget::impl_draw_foreground
* widget::calculate_blitting_rectangle
* widget::calculate_clipping_rectangle
* widget::draw_debug_border
@github-actions github-actions bot added the UI User interface issues, including both back-end and front-end issues. label Jun 27, 2022
@mesilliac mesilliac merged commit 7f1bc41 into wesnoth:master Jun 28, 2022
@mesilliac mesilliac deleted the canvas_cleanup branch June 28, 2022 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI User interface issues, including both back-end and front-end issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacOS and Add-ons Menu
2 participants