mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 13:22:53 +02:00
fix octal code char issue
This commit is contained in:
parent
d59a721f16
commit
afe39aba46
4 changed files with 8 additions and 8 deletions
|
@ -425,8 +425,8 @@ bool EntityTree::updateEntity(EntityItemPointer entity, const EntityItemProperti
|
||||||
if (!childEntity) {
|
if (!childEntity) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
EntityTreeElementPointer containingElement = childEntity->getElement();
|
EntityTreeElementPointer childContainingElement = childEntity->getElement();
|
||||||
if (!containingElement) {
|
if (!childContainingElement) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ bool EntityTree::updateEntity(EntityItemPointer entity, const EntityItemProperti
|
||||||
addToNeedsParentFixupList(childEntity);
|
addToNeedsParentFixupList(childEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateEntityOperator theChildOperator(getThisPointer(), containingElement, childEntity, queryCube);
|
UpdateEntityOperator theChildOperator(getThisPointer(), childContainingElement, childEntity, queryCube);
|
||||||
recurseTreeWithOperator(&theChildOperator);
|
recurseTreeWithOperator(&theChildOperator);
|
||||||
foreach (SpatiallyNestablePointer childChild, childEntity->getChildren()) {
|
foreach (SpatiallyNestablePointer childChild, childEntity->getChildren()) {
|
||||||
if (childChild && childChild->getNestableType() == NestableType::Entity) {
|
if (childChild && childChild->getNestableType() == NestableType::Entity) {
|
||||||
|
|
|
@ -288,7 +288,7 @@ OctreeElementPointer UpdateEntityOperator::possiblyCreateChildAt(const OctreeEle
|
||||||
int indexOfChildContainingNewEntity = element->getMyChildContaining(_newEntityBox);
|
int indexOfChildContainingNewEntity = element->getMyChildContaining(_newEntityBox);
|
||||||
|
|
||||||
if (childIndex == indexOfChildContainingNewEntity) {
|
if (childIndex == indexOfChildContainingNewEntity) {
|
||||||
return element->addChildAtIndex(childIndex);;
|
return element->addChildAtIndex(childIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ void printOctalCode(const unsigned char* octalCode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char sectionValue(const unsigned char* startByte, char startIndexInByte) {
|
char sectionValue(const unsigned char* startByte, char startIndexInByte) {
|
||||||
char rightShift = 8 - startIndexInByte - 3;
|
int8_t rightShift = 8 - startIndexInByte - 3;
|
||||||
|
|
||||||
if (rightShift < 0) {
|
if (rightShift < 0) {
|
||||||
return ((startByte[0] << -rightShift) & 7) + (startByte[1] >> (8 + rightShift));
|
return ((startByte[0] << -rightShift) & 7) + (startByte[1] >> (8 + rightShift));
|
||||||
|
@ -73,7 +73,7 @@ int branchIndexWithDescendant(const unsigned char* ancestorOctalCode, const unsi
|
||||||
return sectionValue(descendantOctalCode + 1 + (branchStartBit / 8), branchStartBit % 8);
|
return sectionValue(descendantOctalCode + 1 + (branchStartBit / 8), branchStartBit % 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNumber) {
|
unsigned char* childOctalCode(const unsigned char* parentOctalCode, int childNumber) {
|
||||||
|
|
||||||
// find the length (in number of three bit code sequences)
|
// find the length (in number of three bit code sequences)
|
||||||
// in the parent
|
// in the parent
|
||||||
|
@ -111,7 +111,7 @@ unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNu
|
||||||
|
|
||||||
// calculate the amount of left shift required
|
// calculate the amount of left shift required
|
||||||
// this will be -1 or -2 if there's wrap
|
// this will be -1 or -2 if there's wrap
|
||||||
char leftShift = 8 - (startBit % 8) - 3;
|
int8_t leftShift = 8 - (startBit % 8) - 3;
|
||||||
|
|
||||||
if (leftShift < 0) {
|
if (leftShift < 0) {
|
||||||
// we have a wrap-around to accomodate
|
// we have a wrap-around to accomodate
|
||||||
|
|
|
@ -30,7 +30,7 @@ using OctalCodePtrList = std::vector<OctalCodePtr>;
|
||||||
void printOctalCode(const unsigned char* octalCode);
|
void printOctalCode(const unsigned char* octalCode);
|
||||||
size_t bytesRequiredForCodeLength(unsigned char threeBitCodes);
|
size_t bytesRequiredForCodeLength(unsigned char threeBitCodes);
|
||||||
int branchIndexWithDescendant(const unsigned char* ancestorOctalCode, const unsigned char* descendantOctalCode);
|
int branchIndexWithDescendant(const unsigned char* ancestorOctalCode, const unsigned char* descendantOctalCode);
|
||||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNumber);
|
unsigned char* childOctalCode(const unsigned char* parentOctalCode, int childNumber);
|
||||||
|
|
||||||
const int OVERFLOWED_OCTCODE_BUFFER = -1;
|
const int OVERFLOWED_OCTCODE_BUFFER = -1;
|
||||||
const int UNKNOWN_OCTCODE_LENGTH = -2;
|
const int UNKNOWN_OCTCODE_LENGTH = -2;
|
||||||
|
|
Loading…
Reference in a new issue