diff --git a/src/common/models/model.h b/src/common/models/model.h index bb2699a1a7..f77574e9a2 100644 --- a/src/common/models/model.h +++ b/src/common/models/model.h @@ -69,12 +69,12 @@ public: virtual ~FModel(); virtual bool Load(const char * fn, int lumpnum, const char * buffer, int length) = 0; - virtual int FindFrame(const char* name, bool nodefault = false) = 0; + virtual int FindFrame(const char * name, bool nodefault = false) = 0; virtual void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray& animationData) = 0; virtual void BuildVertexBuffer(FModelRenderer *renderer) = 0; virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) = 0; virtual float getAspectFactor(float vscale) { return 1.f; } - virtual const TArray* AttachAnimationData() = 0; + virtual const TArray* AttachAnimationData() { return nullptr; }; void SetVertexBuffer(int type, IModelVertexBuffer *buffer) { mVBuf[type] = buffer; } IModelVertexBuffer *GetVertexBuffer(int type) const { return mVBuf[type]; } diff --git a/src/common/models/model_kvx.h b/src/common/models/model_kvx.h index fa10401f0a..e6f569bd6e 100644 --- a/src/common/models/model_kvx.h +++ b/src/common/models/model_kvx.h @@ -64,7 +64,6 @@ public: FTextureID GetPaletteTexture() const { return mPalette; } void BuildVertexBuffer(FModelRenderer *renderer) override; float getAspectFactor(float vscale) override; - const TArray* AttachAnimationData() override; }; diff --git a/src/common/models/model_md2.h b/src/common/models/model_md2.h index 8be0497337..f6c4ce050e 100644 --- a/src/common/models/model_md2.h +++ b/src/common/models/model_md2.h @@ -116,7 +116,6 @@ public: virtual void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray& animationData) override; virtual void LoadGeometry(); virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override; - const TArray* AttachAnimationData() override; void UnloadGeometry(); void BuildVertexBuffer(FModelRenderer *renderer); diff --git a/src/common/models/model_md3.h b/src/common/models/model_md3.h index 84dda60af5..84fba75049 100644 --- a/src/common/models/model_md3.h +++ b/src/common/models/model_md3.h @@ -71,6 +71,5 @@ public: void LoadGeometry(); void BuildVertexBuffer(FModelRenderer *renderer); virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override; - const TArray* AttachAnimationData() override; }; diff --git a/src/common/models/model_obj.h b/src/common/models/model_obj.h index 97fb1c15a9..4eb4883d9a 100644 --- a/src/common/models/model_obj.h +++ b/src/common/models/model_obj.h @@ -101,7 +101,6 @@ public: void RenderFrame(FModelRenderer* renderer, FGameTexture* skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray& animationData) override; void BuildVertexBuffer(FModelRenderer* renderer) override; void AddSkins(uint8_t* hitlist, const FTextureID* surfaceskinids) override; - const TArray* AttachAnimationData() override; }; #endif diff --git a/src/common/models/model_ue1.h b/src/common/models/model_ue1.h index 7ae9d11df8..d59526ea6a 100644 --- a/src/common/models/model_ue1.h +++ b/src/common/models/model_ue1.h @@ -29,7 +29,6 @@ public: void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray& animationData) override; void BuildVertexBuffer(FModelRenderer *renderer) override; void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override; - const TArray* AttachAnimationData() override; void LoadGeometry(); void UnloadGeometry(); FUE1Model() diff --git a/src/common/models/models_iqm.cpp b/src/common/models/models_iqm.cpp index a3354e04b5..5d1985fc09 100644 --- a/src/common/models/models_iqm.cpp +++ b/src/common/models/models_iqm.cpp @@ -426,10 +426,10 @@ void IQMModel::LoadBlendIndexes(IQMFileReader& reader, const IQMVertexArray& ver for (FModelVertex& v : Vertices) { int x = reader.ReadUByte(); - int y = reader.ReadUByte(); - int z = reader.ReadUByte(); - int w = reader.ReadUByte(); - v.SetBoneSelector(x, y, z, w); + int y = reader.ReadUByte(); + int z = reader.ReadUByte(); + int w = reader.ReadUByte(); + v.SetBoneSelector(x, y, z, w); } } else if (vertexArray.Format == IQM_INT && vertexArray.Size == 4) diff --git a/src/common/models/models_md2.cpp b/src/common/models/models_md2.cpp index 6a84b4e469..c55bc42603 100644 --- a/src/common/models/models_md2.cpp +++ b/src/common/models/models_md2.cpp @@ -381,19 +381,6 @@ void FDMDModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f renderer->SetInterpolation(0.f); } -//=========================================================================== -// -// Pointless for this format -// -//=========================================================================== - -const TArray* FDMDModel::AttachAnimationData() -{ - return {}; -} - - - //=========================================================================== // // Internal data structures of MD2 files - only used during loading diff --git a/src/common/models/models_md3.cpp b/src/common/models/models_md3.cpp index b9a3ceeb36..7c8119efd9 100644 --- a/src/common/models/models_md3.cpp +++ b/src/common/models/models_md3.cpp @@ -334,7 +334,7 @@ int FMD3Model::FindFrame(const char* name, bool nodefault) { if (!stricmp(name, Frames[i].Name)) return i; } - return -1; + return FErr_NotFound; } //=========================================================================== @@ -379,13 +379,3 @@ void FMD3Model::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f renderer->SetInterpolation(0.f); } -//=========================================================================== -// -// -// -//=========================================================================== - -const TArray* FMD3Model::AttachAnimationData() -{ - return {}; -} diff --git a/src/common/models/models_obj.cpp b/src/common/models/models_obj.cpp index 6f93061706..9c52e1d4b6 100644 --- a/src/common/models/models_obj.cpp +++ b/src/common/models/models_obj.cpp @@ -700,14 +700,3 @@ FOBJModel::~FOBJModel() faces.Clear(); surfaces.Clear(); } - -//=========================================================================== -// -// -// -//=========================================================================== - -const TArray* FOBJModel::AttachAnimationData() -{ - return {}; -} diff --git a/src/common/models/models_ue1.cpp b/src/common/models/models_ue1.cpp index 04450a1d3d..f6936b1686 100644 --- a/src/common/models/models_ue1.cpp +++ b/src/common/models/models_ue1.cpp @@ -321,8 +321,3 @@ FUE1Model::~FUE1Model() { UnloadGeometry(); } - -const TArray* FUE1Model::AttachAnimationData() -{ - return {}; -} diff --git a/src/common/models/models_voxel.cpp b/src/common/models/models_voxel.cpp index 2e6ca4bd65..4832757bdd 100644 --- a/src/common/models/models_voxel.cpp +++ b/src/common/models/models_voxel.cpp @@ -406,15 +406,3 @@ void FVoxelModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int renderer->SetupFrame(this, 0, 0, 0, {}); renderer->DrawElements(mNumIndices, 0); } - -//=========================================================================== -// -// Voxels don't use bones -// -//=========================================================================== - -const TArray* FVoxelModel::AttachAnimationData() -{ - return {}; -} - diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 4b6c70d536..94358a078e 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -343,7 +343,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr auto& ssids = surfaceskinids.Size() > 0 ? surfaceskinids : smf->surfaceskinIDs; auto ssidp = (unsigned)(i * MD3_MAX_SURFACES) < ssids.Size() ? &ssids[i * MD3_MAX_SURFACES] : nullptr; - const TArray* animationData = {}; + const TArray* animationData = nullptr; if (smf->animationIDs[i] >= 0) {