diff --git a/src/common/models/model.h b/src/common/models/model.h index 3f613d6f49..a849b8ba79 100644 --- a/src/common/models/model.h +++ b/src/common/models/model.h @@ -5,7 +5,6 @@ #include "i_modelvertexbuffer.h" #include "matrix.h" #include "TRS.h" -#include "d_player.h" class FModelRenderer; class FGameTexture; @@ -77,7 +76,7 @@ public: virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) = 0; virtual float getAspectFactor(float vscale) { return 1.f; } virtual const TArray* AttachAnimationData() { return nullptr; }; - virtual const TArray CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, AActor* actor, int index) { return {}; }; + virtual const TArray CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, DBoneComponents* bones, int index) { return {}; }; void SetVertexBuffer(int type, IModelVertexBuffer *buffer) { mVBuf[type] = buffer; } IModelVertexBuffer *GetVertexBuffer(int type) const { return mVBuf[type]; } diff --git a/src/common/models/model_iqm.h b/src/common/models/model_iqm.h index 21f8338e99..5b6aad4ce8 100644 --- a/src/common/models/model_iqm.h +++ b/src/common/models/model_iqm.h @@ -113,7 +113,7 @@ public: void BuildVertexBuffer(FModelRenderer* renderer) override; void AddSkins(uint8_t* hitlist, const FTextureID* surfaceskinids) override; const TArray* AttachAnimationData() override; - const TArray CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, AActor* actor, int index) override; + const TArray CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, DBoneComponents* bones, int index) override; private: void LoadGeometry(); diff --git a/src/common/models/models_iqm.cpp b/src/common/models/models_iqm.cpp index 9ded3df01d..a743db6c20 100644 --- a/src/common/models/models_iqm.cpp +++ b/src/common/models/models_iqm.cpp @@ -510,17 +510,17 @@ const TArray* IQMModel::AttachAnimationData() return &TRSData; } -const TArray IQMModel::CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, AActor* actor, int index) +const TArray IQMModel::CalculateBones(int frame1, int frame2, double inter, const TArray& animationData, DBoneComponents* boneComponentData, int index) { const TArray& animationFrames = &animationData ? animationData : TRSData; if (Joints.Size() > 0) { int numbones = Joints.Size(); - if (actor->boneComponentData->trscomponents[index].Size() != numbones) - actor->boneComponentData->trscomponents[index].Resize(numbones); - if (actor->boneComponentData->trsmatrix[index].Size() != numbones) - actor->boneComponentData->trsmatrix[index].Resize(numbones); + if (boneComponentData->trscomponents[index].Size() != numbones) + boneComponentData->trscomponents[index].Resize(numbones); + if (boneComponentData->trsmatrix[index].Size() != numbones) + boneComponentData->trsmatrix[index].Resize(numbones); frame1 = clamp(frame1, 0, ((int)animationFrames.Size() - 1) / numbones); frame2 = clamp(frame2, 0, ((int)animationFrames.Size() - 1) / numbones); @@ -556,18 +556,18 @@ const TArray IQMModel::CalculateBones(int frame1, int frame2, double i if (Joints[i].Parent >= 0 && modifiedBone[Joints[i].Parent]) { - actor->boneComponentData->trscomponents[index][i] = bone; + boneComponentData->trscomponents[index][i] = bone; modifiedBone[i] = true; } - else if (actor->boneComponentData->trscomponents[index][i].Equals(bone)) + else if (boneComponentData->trscomponents[index][i].Equals(bone)) { - bones[i] = actor->boneComponentData->trsmatrix[index][i]; + bones[i] = boneComponentData->trsmatrix[index][i]; modifiedBone[i] = false; continue; } else { - actor->boneComponentData->trscomponents[index][i] = bone; + boneComponentData->trscomponents[index][i] = bone; modifiedBone[i] = true; } @@ -595,7 +595,7 @@ const TArray IQMModel::CalculateBones(int frame1, int frame2, double i result.multMatrix(swapYZ); } - actor->boneComponentData->trsmatrix[index] = bones; + boneComponentData->trsmatrix[index] = bones; return bones; }