Skip to content

Conversation

BinaryTENSHi
Copy link
Contributor

Small fix in the conversion from a u32 to a BltPixel.

Because the precedence of the shift operator is stronger than the bitwise AND, the masks are shifted before applying, resulting in all channels being set to the blue channel.

Without the additional parenthesis, green: (color & 0x00_FF_00 >> 8) expands to green: (color & 0x00_00_FF) first.

@GabrielMajeri
Copy link
Collaborator

Whoops, that was quite an oversight. Thanks for the fix!

@GabrielMajeri GabrielMajeri merged commit 57c7554 into rust-osdev:master May 28, 2020
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