mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
Fixed a couple bugs
- MODELSAREATTACHMENTS was basically being applied anyways - Fixed a crash related to using an animation that never had the vertex buffer drawn because it was never used as a model
This commit is contained in:
parent
be9a671217
commit
6564adf310
2 changed files with 7 additions and 4 deletions
|
@ -361,7 +361,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
|
||||||
FModel* animation = Models[animationid];
|
FModel* animation = Models[animationid];
|
||||||
animationData = animation->AttachAnimationData();
|
animationData = animation->AttachAnimationData();
|
||||||
|
|
||||||
if ((!smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
|
if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
|
||||||
{
|
{
|
||||||
boneData = animation->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
|
boneData = animation->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
|
||||||
boneStartingPosition = renderer->SetupFrame(animation, 0, 0, 0, boneData, -1);
|
boneStartingPosition = renderer->SetupFrame(animation, 0, 0, 0, boneData, -1);
|
||||||
|
@ -370,7 +370,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
|
if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
|
||||||
{
|
{
|
||||||
boneData = mdl->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
|
boneData = mdl->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
|
||||||
boneStartingPosition = renderer->SetupFrame(mdl, 0, 0, 0, boneData, -1);
|
boneStartingPosition = renderer->SetupFrame(mdl, 0, 0, 0, boneData, -1);
|
||||||
|
|
|
@ -141,8 +141,11 @@ int FHWModelRenderer::SetupFrame(FModel *model, unsigned int frame1, unsigned in
|
||||||
auto mdbuff = static_cast<FModelVertexBuffer*>(model->GetVertexBuffer(GetType()));
|
auto mdbuff = static_cast<FModelVertexBuffer*>(model->GetVertexBuffer(GetType()));
|
||||||
boneIndexBase = boneStartIndex >= 0 ? boneStartIndex : screen->mBones->UploadBones(bones);
|
boneIndexBase = boneStartIndex >= 0 ? boneStartIndex : screen->mBones->UploadBones(bones);
|
||||||
state.SetBoneIndexBase(boneIndexBase);
|
state.SetBoneIndexBase(boneIndexBase);
|
||||||
state.SetVertexBuffer(mdbuff->vertexBuffer(), frame1, frame2);
|
if (mdbuff)
|
||||||
if (mdbuff->indexBuffer()) state.SetIndexBuffer(mdbuff->indexBuffer());
|
{
|
||||||
|
state.SetVertexBuffer(mdbuff->vertexBuffer(), frame1, frame2);
|
||||||
|
if (mdbuff->indexBuffer()) state.SetIndexBuffer(mdbuff->indexBuffer());
|
||||||
|
}
|
||||||
return boneIndexBase;
|
return boneIndexBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue