mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +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;
|
const unsigned char* dataAt = data;
|
||||||
|
|
||||||
// id
|
// id
|
||||||
// TODO: this is where we should handle reading old style IDs and converting them into UUIDs... maybe we just discard them
|
// this old bitstream format had 32bit IDs. They are obsolete and need to be replaced with our new UUID
|
||||||
// and create the new ID from that...
|
// format. We can simply read and ignore the old ID since they should not be repeated. This code should only
|
||||||
memcpy(&_id, dataAt, sizeof(_id));
|
// run on loading from an old file.
|
||||||
dataAt += sizeof(_id);
|
quint32 oldID;
|
||||||
bytesRead += sizeof(_id);
|
memcpy(&oldID, dataAt, sizeof(oldID));
|
||||||
|
dataAt += sizeof(oldID);
|
||||||
|
bytesRead += sizeof(oldID);
|
||||||
|
_id = QUuid::createUuid();
|
||||||
|
//qDebug() << "ModelEntityItem::oldVersionReadEntityDataFromBuffer()... oldID=" << oldID << "new _id=" << _id;
|
||||||
|
|
||||||
// _lastUpdated
|
// _lastUpdated
|
||||||
memcpy(&_lastUpdated, dataAt, sizeof(_lastUpdated));
|
memcpy(&_lastUpdated, dataAt, sizeof(_lastUpdated));
|
||||||
|
|
|
@ -43,7 +43,7 @@ Model properties:
|
||||||
DONE -- 22e) void ModelTreeElement::getModelsInside(const AACube& box, QVector<ModelItem*>& foundModels)...
|
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???)
|
1) random crashes on moving (I think things going out of bounds???)
|
||||||
|
@ -63,7 +63,6 @@ Model properties:
|
||||||
8) EntityTreeRenderer::clearModelsCache()
|
8) EntityTreeRenderer::clearModelsCache()
|
||||||
|
|
||||||
|
|
||||||
9) Handle the ID -> UUID swap in old files to new files
|
|
||||||
|
|
||||||
10) Test models -> attachments logic
|
10) Test models -> attachments logic
|
||||||
|
|
||||||
|
@ -257,4 +256,7 @@ Model properties:
|
||||||
// Sit somewhere
|
// Sit somewhere
|
||||||
// Move model with another avatar.
|
// Move model with another avatar.
|
||||||
// Observe first avatar moving.
|
// 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