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 issue 2291 #2309

Conversation

Eulenmensch93
Copy link
Contributor

As described in issue 2291, the code to handle the colorkey parameter in the spr function did not use the correct default value in one of the two code paths.

We now pass the correct default value to getInteger2, this handles cases where the parameter is not present, and where the parameter is undefined in JS.

In case that no parameter or undefined is passed to the spr function in
JS, the parameter would evaluate to 0 due to a wrong default value in
the code path when colorkey is not an array. In case of an array the
default value would be -1, which is also specified in the wiki.

We now pass -1 in case the parameter is not an array.

See: nesbox#2291
@Skeptim
Copy link
Contributor

Skeptim commented Sep 22, 2023

Let me just add a link to: issue #2291.

@nesbox nesbox merged commit cc50420 into nesbox:main Sep 23, 2023
31 checks passed
@nesbox nesbox linked an issue Sep 23, 2023 that may be closed by this pull request
@Eulenmensch93 Eulenmensch93 deleted the fix_2291_unexpected_spr_rendering_with_undefined_colorkey branch September 24, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] [JavaScript] Unexpected spr() rendering with undefined colorKey
3 participants