mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-09 01:01:05 +00:00
Changes before To-Dos
- Removed redundant AttachAnimationData functions from derived model classes - Fixed indentation in IQM loader - Fixed a merging issue in the MD3 FindFrame - Fixed a formatting issue in FindFrame in Model.h?
This commit is contained in:
parent
08f520f1c6
commit
e9e919b54c
13 changed files with 8 additions and 64 deletions
|
@ -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<VSMatrix>& 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<VSMatrix>* AttachAnimationData() = 0;
|
||||
virtual const TArray<VSMatrix>* AttachAnimationData() { return nullptr; };
|
||||
|
||||
void SetVertexBuffer(int type, IModelVertexBuffer *buffer) { mVBuf[type] = buffer; }
|
||||
IModelVertexBuffer *GetVertexBuffer(int type) const { return mVBuf[type]; }
|
||||
|
|
|
@ -64,7 +64,6 @@ public:
|
|||
FTextureID GetPaletteTexture() const { return mPalette; }
|
||||
void BuildVertexBuffer(FModelRenderer *renderer) override;
|
||||
float getAspectFactor(float vscale) override;
|
||||
const TArray<VSMatrix>* AttachAnimationData() override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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<VSMatrix>& animationData) override;
|
||||
virtual void LoadGeometry();
|
||||
virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override;
|
||||
const TArray<VSMatrix>* AttachAnimationData() override;
|
||||
|
||||
void UnloadGeometry();
|
||||
void BuildVertexBuffer(FModelRenderer *renderer);
|
||||
|
|
|
@ -71,6 +71,5 @@ public:
|
|||
void LoadGeometry();
|
||||
void BuildVertexBuffer(FModelRenderer *renderer);
|
||||
virtual void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override;
|
||||
const TArray<VSMatrix>* AttachAnimationData() override;
|
||||
};
|
||||
|
||||
|
|
|
@ -101,7 +101,6 @@ public:
|
|||
void RenderFrame(FModelRenderer* renderer, FGameTexture* skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray<VSMatrix>& animationData) override;
|
||||
void BuildVertexBuffer(FModelRenderer* renderer) override;
|
||||
void AddSkins(uint8_t* hitlist, const FTextureID* surfaceskinids) override;
|
||||
const TArray<VSMatrix>* AttachAnimationData() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,7 +29,6 @@ public:
|
|||
void RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids, const TArray<VSMatrix>& animationData) override;
|
||||
void BuildVertexBuffer(FModelRenderer *renderer) override;
|
||||
void AddSkins(uint8_t *hitlist, const FTextureID* surfaceskinids) override;
|
||||
const TArray<VSMatrix>* AttachAnimationData() override;
|
||||
void LoadGeometry();
|
||||
void UnloadGeometry();
|
||||
FUE1Model()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -381,19 +381,6 @@ void FDMDModel::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f
|
|||
renderer->SetInterpolation(0.f);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Pointless for this format
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
const TArray<VSMatrix>* FDMDModel::AttachAnimationData()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Internal data structures of MD2 files - only used during loading
|
||||
|
|
|
@ -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<VSMatrix>* FMD3Model::AttachAnimationData()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -700,14 +700,3 @@ FOBJModel::~FOBJModel()
|
|||
faces.Clear();
|
||||
surfaces.Clear();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
const TArray<VSMatrix>* FOBJModel::AttachAnimationData()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -321,8 +321,3 @@ FUE1Model::~FUE1Model()
|
|||
{
|
||||
UnloadGeometry();
|
||||
}
|
||||
|
||||
const TArray<VSMatrix>* FUE1Model::AttachAnimationData()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -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<VSMatrix>* FVoxelModel::AttachAnimationData()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
@ -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<VSMatrix>* animationData = {};
|
||||
const TArray<VSMatrix>* animationData = nullptr;
|
||||
|
||||
if (smf->animationIDs[i] >= 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue