1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00

Fix root frame index bug

This commit is contained in:
Daniel Evans 2014-06-08 22:40:46 +01:00
parent 55742a4e11
commit e060b6d0b1
2 changed files with 3 additions and 3 deletions

View File

@ -26,14 +26,14 @@ Model* LoaderDFF::loadFromMemory(char *data, GameData *gameData)
model->frames.reserve(list.numframes); model->frames.reserve(list.numframes);
for(size_t f = 0; f < list.numframes; ++f) { for(size_t f = 0; f < list.numframes; ++f) {
RW::BSFrameListFrame& rawframe = sec.readSubStructure<RW::BSFrameListFrame>(fdataI); RW::BSFrameListFrame& rawframe = sec.readSubStructure<RW::BSFrameListFrame>(fdataI);
fdataI += sizeof(RW::BSFrameListFrame); fdataI += sizeof(RW::BSFrameListFrame);
ModelFrame* parent = nullptr; ModelFrame* parent = nullptr;
if(rawframe.index != -1) { if(rawframe.index != -1) {
parent = model->frames[rawframe.index]; parent = model->frames[rawframe.index];
} }
else { else {
model->rootFrameIdx = 0; model->rootFrameIdx = f;
} }
model->frames.push_back( model->frames.push_back(
new ModelFrame(parent, rawframe.rotation, rawframe.position) new ModelFrame(parent, rawframe.rotation, rawframe.position)