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

Update camera's screen size on update() instead of previous draw() #3175

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mstoeckl
Copy link
Contributor

@mstoeckl mstoeckl commented Jan 13, 2025

These changes ensure the screen size used in Camera::update() will match that used by the next ::draw(), instead of sometimes being one frame behind when the SuperTux window is resized. They also may ensure that when the scale is being changed over time, the scale-divided screen size observed by Squirrel will update more frequently. By reducing the number of public functions which can modify the Camera state, they should make Camera very slightly easier to refactor.

This ensures that, by the next Sector::draw(), the camera has been
updated to use the current screen size, instead of that from the
previous frame.
@mstoeckl mstoeckl force-pushed the camera-direct-load-size branch from ee49072 to dfb5936 Compare February 15, 2025 02:11
Copy link
Member

@MatusGuy MatusGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants