Browse Source

Fix export of Emote Anims

Bug in the registry key list refactor... We wrote out all the keys in the
key list instead of only the keys with objects. This meant we got a lot of
garbage (empty) objects when exporting [Fem|M]aleWave.
Adam Johnson 12 years ago
parent
commit
dcacfc8665
  1. 20
      Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp

20
Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp

@ -217,15 +217,27 @@ void plRegistryKeyList::Write(hsStream* s)
s->WriteLE32(0); s->WriteLE32(0);
s->WriteByte(0); // Deprecated flags s->WriteByte(0); // Deprecated flags
s->WriteLE32(fKeys.size()); // We only write out keys with data. Fill this value in later...
uint32_t countPos = s->GetPosition();
s->WriteLE32(0);
// Write out all our keys // Write out all our keys with data
uint32_t keyCount = 0;
for (auto it = fKeys.begin(); it != fKeys.end(); ++it) for (auto it = fKeys.begin(); it != fKeys.end(); ++it)
(*it)->Write(s); {
plKeyImp* key = *it;
if (key->ObjectIsLoaded())
{
++keyCount;
key->Write(s);
}
}
// Go back to the start and write the length of our data // Rewind and write out data size and key count
uint32_t endPos = s->GetPosition(); uint32_t endPos = s->GetPosition();
s->SetPosition(beginPos); s->SetPosition(beginPos);
s->WriteLE32(endPos-beginPos-sizeof(uint32_t)); s->WriteLE32(endPos-beginPos-sizeof(uint32_t));
s->SetPosition(countPos);
s->WriteLE32(keyCount);
s->SetPosition(endPos); s->SetPosition(endPos);
} }

Loading…
Cancel
Save