mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
added setAtBit() utility
This commit is contained in:
parent
d59a8143d7
commit
2c1518144a
2 changed files with 6 additions and 0 deletions
|
@ -94,6 +94,11 @@ bool oneAtBit(unsigned char byte, int bitIndex) {
|
|||
return (byte >> (7 - bitIndex) & 1);
|
||||
}
|
||||
|
||||
void setAtBit(unsigned char& byte, int bitIndex) {
|
||||
byte += (1 << (7 - bitIndex));
|
||||
}
|
||||
|
||||
|
||||
void switchToResourcesParentIfRequired() {
|
||||
#ifdef __APPLE__
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
|
|
|
@ -49,6 +49,7 @@ void outputBits(unsigned char byte, bool withNewLine = true);
|
|||
void printVoxelCode(unsigned char* voxelCode);
|
||||
int numberOfOnes(unsigned char byte);
|
||||
bool oneAtBit(unsigned char byte, int bitIndex);
|
||||
void setAtBit(unsigned char& byte, int bitIndex);
|
||||
|
||||
void switchToResourcesParentIfRequired();
|
||||
|
||||
|
|
Loading…
Reference in a new issue