mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 19:53:30 +02:00
fix conversion from old format to new format of entity IDs
This commit is contained in:
parent
d5fa23bcdf
commit
8d947662c8
2 changed files with 14 additions and 8 deletions
|
@ -221,11 +221,15 @@ int ModelEntityItem::oldVersionReadEntityDataFromBuffer(const unsigned char* dat
|
|||
const unsigned char* dataAt = data;
|
||||
|
||||
// id
|
||||
// TODO: this is where we should handle reading old style IDs and converting them into UUIDs... maybe we just discard them
|
||||
// and create the new ID from that...
|
||||
memcpy(&_id, dataAt, sizeof(_id));
|
||||
dataAt += sizeof(_id);
|
||||
bytesRead += sizeof(_id);
|
||||
// this old bitstream format had 32bit IDs. They are obsolete and need to be replaced with our new UUID
|
||||
// format. We can simply read and ignore the old ID since they should not be repeated. This code should only
|
||||
// run on loading from an old file.
|
||||
quint32 oldID;
|
||||
memcpy(&oldID, dataAt, sizeof(oldID));
|
||||
dataAt += sizeof(oldID);
|
||||
bytesRead += sizeof(oldID);
|
||||
_id = QUuid::createUuid();
|
||||
//qDebug() << "ModelEntityItem::oldVersionReadEntityDataFromBuffer()... oldID=" << oldID << "new _id=" << _id;
|
||||
|
||||
// _lastUpdated
|
||||
memcpy(&_lastUpdated, dataAt, sizeof(_lastUpdated));
|
||||
|
|
|
@ -43,7 +43,7 @@ Model properties:
|
|||
DONE -- 22e) void ModelTreeElement::getModelsInside(const AACube& box, QVector<ModelItem*>& foundModels)...
|
||||
|
||||
|
||||
2) verify shadows work
|
||||
|
||||
|
||||
|
||||
1) random crashes on moving (I think things going out of bounds???)
|
||||
|
@ -63,7 +63,6 @@ Model properties:
|
|||
8) EntityTreeRenderer::clearModelsCache()
|
||||
|
||||
|
||||
9) Handle the ID -> UUID swap in old files to new files
|
||||
|
||||
10) Test models -> attachments logic
|
||||
|
||||
|
@ -257,4 +256,7 @@ Model properties:
|
|||
// Sit somewhere
|
||||
// Move model with another avatar.
|
||||
// Observe first avatar moving.
|
||||
|
||||
// SOLVED -- 2) verify shadows work
|
||||
// SOLVED -- 9) Handle the ID -> UUID swap in old files to new files - verify old files read correctly
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue