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 color-shifting bug #53

Merged
merged 1 commit into from Feb 6, 2020
Merged

Conversation

dgant
Copy link
Contributor

@dgant dgant commented Feb 6, 2020

Fixes #52 -- see screenshots and explanation there

@JasperGeurtz
Copy link
Collaborator

JasperGeurtz commented Feb 6, 2020

Thank you for the extensive explanation!

Fix is perfect 👍 , maybe char could be used which is unsigned byte in java, but int is good enough because space used is very small + makes code more readable

@JasperGeurtz JasperGeurtz merged commit 9dd1679 into JavaBWAPI:develop Feb 6, 2020
@dgant dgant deleted the colorshift branch February 6, 2020 14:18
@Bytekeeper
Copy link
Collaborator

Actually, byte should be ok. It's just that you need to "&0xFF" in places were it gets converted to int. Otherwise all values > 128 are negative and will stay negative after the conversion.

@dgant
Copy link
Contributor Author

dgant commented Feb 6, 2020

Could be made to work, but the overall memory usage is pretty low. short would be a compromise option.

@Bytekeeper
Copy link
Collaborator

It's fine. If memory consumption was problem here byte should be the choice. But for "this" int is probably ok. It's also Java, people expect high mem consumption ;)

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.

Renders wrong colors
3 participants