Skip to content

Commit

Permalink
fix for vkdoom
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and nashmuhandes committed Jan 30, 2025
1 parent cc76631 commit 5eb9a10
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/models/modelrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ class FModelRenderer
virtual void DrawArrays(int start, int count) = 0;
virtual void DrawElements(int numIndices, size_t offset) = 0;
virtual void SetupFrame(FModel* model, unsigned int frame1, unsigned int frame2, unsigned int size, int boneStartIndex) {};
virtual int UploadBones(const TArray<VSMatrix>& bones) = 0;
};

2 changes: 1 addition & 1 deletion src/common/models/models_iqm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ double IQMModel::FindFramerate(FName name)
void IQMModel::RenderFrame(FModelRenderer* renderer, FGameTexture* skin, int frame1, int frame2, double inter, FTranslationID translation, const FTextureID* surfaceskinids, int boneStartPosition, void * act)
{

renderer->SetupFrame(this, 0, 0, NumVertices, boneStartPosition >= 0 ? boneStartPosition : screen->mBones->UploadBones(boneData));
renderer->SetupFrame(this, 0, 0, NumVertices, boneStartPosition >= 0 ? boneStartPosition : renderer->UploadBones(boneData));

FGameTexture* lastSkin = nullptr;
for (unsigned i = 0; i < Meshes.Size(); i++)
Expand Down
2 changes: 1 addition & 1 deletion src/r_data/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr

if(smf_flags & MDL_MODELSAREATTACHMENTS || is_decoupled)
{
boneStartingPosition = boneData ? screen->mBones->UploadBones(*boneData) : -1;
boneStartingPosition = boneData ? renderer->UploadBones(*boneData) : -1;
evaluatedSingle = true;
}

Expand Down
5 changes: 5 additions & 0 deletions src/rendering/hwrenderer/hw_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ void FHWModelRenderer::DrawElements(int numIndices, size_t offset)
//
//===========================================================================

int FHWModelRenderer::UploadBones(const TArray<VSMatrix>& bones)
{
return state.UploadBones(bones);
}

void FHWModelRenderer::SetupFrame(FModel *model, unsigned int frame1, unsigned int frame2, unsigned int size, int boneStartIndex)
{
auto mdbuff = static_cast<FModelVertexBuffer*>(model->GetVertexBuffer(GetType()));
Expand Down
1 change: 1 addition & 0 deletions src/rendering/hwrenderer/hw_models.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class FHWModelRenderer : public FModelRenderer
void DrawArrays(int start, int count) override;
void DrawElements(int numIndices, size_t offset) override;
void SetupFrame(FModel *model, unsigned int frame1, unsigned int frame2, unsigned int size, int boneStartIndex) override;
int UploadBones(const TArray<VSMatrix>& bones) override;

};

0 comments on commit 5eb9a10

Please sign in to comment.