mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:43:08 +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);
|
return (byte >> (7 - bitIndex) & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setAtBit(unsigned char& byte, int bitIndex) {
|
||||||
|
byte += (1 << (7 - bitIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void switchToResourcesParentIfRequired() {
|
void switchToResourcesParentIfRequired() {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||||
|
|
|
@ -49,6 +49,7 @@ void outputBits(unsigned char byte, bool withNewLine = true);
|
||||||
void printVoxelCode(unsigned char* voxelCode);
|
void printVoxelCode(unsigned char* voxelCode);
|
||||||
int numberOfOnes(unsigned char byte);
|
int numberOfOnes(unsigned char byte);
|
||||||
bool oneAtBit(unsigned char byte, int bitIndex);
|
bool oneAtBit(unsigned char byte, int bitIndex);
|
||||||
|
void setAtBit(unsigned char& byte, int bitIndex);
|
||||||
|
|
||||||
void switchToResourcesParentIfRequired();
|
void switchToResourcesParentIfRequired();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue