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
Add BitMap methods for bitwise boolean operations #91093
base: master
Are you sure you want to change the base?
Conversation
Includes AND, OR, XOR, and NOT operations. Documentation included.
This comment was marked as resolved.
This comment was marked as resolved.
Alright, I just opened a proposal and linked this PR. Sorry; it's my first time committing to this engine; I've worked on another engine before but it was niche and the organizer could personally review each PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, useful
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Created methods for BitMap for boolean operators AND, OR, XOR, and NOT.
The methods for the binary operators (AND, OR, XOR) all have a parameter "other" for the secondary bitmap (the one being compared to). Additionally, there is a BitwiseSizeMode enum which controls the size of the new bitmap being made, in the case that the bitmaps are not the same size. The method bitwise_not is unary, and thus does not have any parameters.
This is an uninstrusive QOL change for handling bitmaps. Combining and operating on bitmaps is a common operation in many games that use them. I, for one, am working on a puzzle game where geometry is generated from bitmaps you edit. Ordinarily, comparing two bitmaps can be tedious, usually involving some sort of nested double for loop. This can obviously bloat your game's codebase. The new methods in this PR will make combining bitmaps much simpler for developers.