diff --git a/src/gl/models/gl_models.cpp b/src/gl/models/gl_models.cpp index 8669d7bab..25b8182ca 100644 --- a/src/gl/models/gl_models.cpp +++ b/src/gl/models/gl_models.cpp @@ -338,27 +338,3 @@ void FModelVertexBuffer::SetupFrame(FModelRenderer *renderer, unsigned int frame } } } - -//=========================================================================== -// -// gl_RenderModel -// -//=========================================================================== - -void gl_RenderModel(GLSprite * spr, int mli) -{ - FGLModelRenderer renderer(mli); - renderer.RenderModel(spr->x, spr->y, spr->z, spr->modelframe, spr->actor); -} - -//=========================================================================== -// -// gl_RenderHUDModel -// -//=========================================================================== - -void gl_RenderHUDModel(DPSprite *psp, float ofsX, float ofsY, int mli) -{ - FGLModelRenderer renderer(mli); - renderer.RenderHUDModel(psp, ofsX, ofsY); -} diff --git a/src/gl/models/gl_models.h b/src/gl/models/gl_models.h index 0fb82f9f4..9cab5ecfc 100644 --- a/src/gl/models/gl_models.h +++ b/src/gl/models/gl_models.h @@ -51,5 +51,3 @@ public: void DrawElements(int numIndices, size_t offset) override; }; -void gl_RenderModel(GLSprite * spr, int mli); -void gl_RenderHUDModel(DPSprite *psp, float ofsx, float ofsy, int mli); diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index b4116d60e..cc988ec73 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -276,7 +276,8 @@ void FDrawInfo::DrawSprite(GLSprite *sprite, int pass) } else { - gl_RenderModel(sprite, sprite->dynlightindex); + FGLModelRenderer renderer(sprite->dynlightindex); + renderer.RenderModel(sprite->x, sprite->y, sprite->z, sprite->modelframe, sprite->actor, r_viewpoint.TicFrac); } } diff --git a/src/gl/scene/gl_weapon.cpp b/src/gl/scene/gl_weapon.cpp index 6ab0d5222..a842eda6e 100644 --- a/src/gl/scene/gl_weapon.cpp +++ b/src/gl/scene/gl_weapon.cpp @@ -66,7 +66,8 @@ void FDrawInfo::DrawPSprite (HUDSprite *huds) if (huds->mframe) { gl_RenderState.AlphaFunc(GL_GEQUAL, 0); - gl_RenderHUDModel(huds->weapon, huds->mx, huds->my, huds->lightindex); + FGLModelRenderer renderer(huds->lightindex); + renderer.RenderHUDModel(huds->weapon, huds->mx, huds->my); } else { diff --git a/src/polyrenderer/scene/poly_model.cpp b/src/polyrenderer/scene/poly_model.cpp index 46d064a7b..4251589d9 100644 --- a/src/polyrenderer/scene/poly_model.cpp +++ b/src/polyrenderer/scene/poly_model.cpp @@ -37,7 +37,7 @@ void PolyRenderModel(PolyRenderThread *thread, const Mat4f &worldToClip, uint32_ { PolyModelRenderer renderer(thread, worldToClip, stencilValue); renderer.AddLights(actor); - renderer.RenderModel(x, y, z, smf, actor); + renderer.RenderModel(x, y, z, smf, actor, r_viewpoint.TicFrac); PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f); } diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index 316281f65..b248f2895 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -54,7 +54,7 @@ extern TDeletingArray VoxelDefs; DeletingModelArray Models; -void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *smf, AActor *actor) +void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *smf, AActor *actor, double ticFrac) { // Setup transformation. @@ -128,7 +128,7 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s if (actor->renderflags & RF_INTERPOLATEANGLES) { // [Nash] use interpolated angles - DRotator Angles = actor->InterpolatedAngles(r_viewpoint.TicFrac); + DRotator Angles = actor->InterpolatedAngles(ticFrac); angle = Angles.Yaw.Degrees; } diff --git a/src/r_data/models/models.h b/src/r_data/models/models.h index 213e9ab21..e4da6efac 100644 --- a/src/r_data/models/models.h +++ b/src/r_data/models/models.h @@ -60,7 +60,7 @@ class FModelRenderer public: virtual ~FModelRenderer() { } - void RenderModel(float x, float y, float z, FSpriteModelFrame *modelframe, AActor *actor); + void RenderModel(float x, float y, float z, FSpriteModelFrame *modelframe, AActor *actor, double ticFrac); void RenderHUDModel(DPSprite *psp, float ofsx, float ofsy); virtual ModelRendererType GetType() const = 0; diff --git a/src/swrenderer/things/r_model.cpp b/src/swrenderer/things/r_model.cpp index aa9437670..0991d1d45 100644 --- a/src/swrenderer/things/r_model.cpp +++ b/src/swrenderer/things/r_model.cpp @@ -76,7 +76,7 @@ namespace swrenderer { SWModelRenderer renderer(thread, clip3DFloor, &WorldToClip, MirrorWorldToClip); renderer.AddLights(actor); - renderer.RenderModel(x, y, z, smf, actor); + renderer.RenderModel(x, y, z, smf, actor, r_viewpoint.TicFrac); PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f); }