Skip to content

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
@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