Fixed negative offsets
This commit is contained in:
parent
754d687486
commit
b52bf4a918
1 changed files with 7 additions and 1 deletions
|
@ -903,8 +903,14 @@ namespace DTSC {
|
|||
}
|
||||
|
||||
///\brief returns the offset of a part
|
||||
///Assumes the offset is actually negative if bit 0x800000 is set.
|
||||
uint32_t Part::getOffset() {
|
||||
return Bit::btoh24(data + 6);
|
||||
uint32_t ret = Bit::btoh24(data + 6);
|
||||
if (ret & 0x800000){
|
||||
return ret | 0xff000000ul;
|
||||
}else{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
///\brief Sets the offset of a part
|
||||
|
|
Loading…
Add table
Reference in a new issue