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:
parent
55742a4e11
commit
e060b6d0b1
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user