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

Fix potential bug in SDL2 driver introduced in last cleanup, and cleanup some more #8664

Merged
merged 4 commits into from Feb 11, 2021

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

During final preparations for SDL OpenGL, I found that I jumped the gun on the last cleanup, and already removed some lines that should not have been removed.

Additionally, I had a few more minor cleanups that might as well hit master.

Description

_local_palette was not reset before making a new palette, potentially not sending the full palette to SDL.
Otherwise, a few cleanups (rather minor).
Lastly, removal of a line that is absolutely unclear to me as to why it is there. I cannot find any issue with removing it, so yeah .. there we go.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

This means the code depended that the caller did this for us
before MakePalette() is executed, which is neither a
requirement nor a promise the code makes.
This reduces confusion when reading different drivers.
In testing, I could find no reason why this statement is here.

The comment is rather unclear (it states what it does, but not
why it would be needed).

This line of code was introduced with f4f4044, which gives no
further insight on why it would be needed to have it here.

As such, let's remove it and see if anyone else reports any
problems with it. If so, this commit can be reverted and a more
clear comment should be added what this line of code is dealing
with (the WHY, not the WHAT).
@TrueBrain TrueBrain merged commit 52317bb into OpenTTD:master Feb 11, 2021
@TrueBrain TrueBrain deleted the sdl-cleanup-take-two branch February 11, 2021 19:23
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.

None yet

2 participants