mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
Pass ticFrac to the model renderer as a parameter
This also removes the rather pointless gl_RenderModel functions because with their two lines of content they can just be placed inline.
This commit is contained in:
parent
8787905fed
commit
46d73e7b4b
8 changed files with 9 additions and 33 deletions
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -51,5 +51,3 @@ public:
|
||||||
void DrawElements(int numIndices, size_t offset) override;
|
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);
|
|
||||||
|
|
|
@ -276,7 +276,8 @@ void FDrawInfo::DrawSprite(GLSprite *sprite, int pass)
|
||||||
}
|
}
|
||||||
else
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,8 @@ void FDrawInfo::DrawPSprite (HUDSprite *huds)
|
||||||
if (huds->mframe)
|
if (huds->mframe)
|
||||||
{
|
{
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, 0);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ void PolyRenderModel(PolyRenderThread *thread, const Mat4f &worldToClip, uint32_
|
||||||
{
|
{
|
||||||
PolyModelRenderer renderer(thread, worldToClip, stencilValue);
|
PolyModelRenderer renderer(thread, worldToClip, stencilValue);
|
||||||
renderer.AddLights(actor);
|
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);
|
PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ extern TDeletingArray<FVoxelDef *> VoxelDefs;
|
||||||
|
|
||||||
DeletingModelArray Models;
|
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.
|
// Setup transformation.
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s
|
||||||
if (actor->renderflags & RF_INTERPOLATEANGLES)
|
if (actor->renderflags & RF_INTERPOLATEANGLES)
|
||||||
{
|
{
|
||||||
// [Nash] use interpolated angles
|
// [Nash] use interpolated angles
|
||||||
DRotator Angles = actor->InterpolatedAngles(r_viewpoint.TicFrac);
|
DRotator Angles = actor->InterpolatedAngles(ticFrac);
|
||||||
angle = Angles.Yaw.Degrees;
|
angle = Angles.Yaw.Degrees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class FModelRenderer
|
||||||
public:
|
public:
|
||||||
virtual ~FModelRenderer() { }
|
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);
|
void RenderHUDModel(DPSprite *psp, float ofsx, float ofsy);
|
||||||
|
|
||||||
virtual ModelRendererType GetType() const = 0;
|
virtual ModelRendererType GetType() const = 0;
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace swrenderer
|
||||||
{
|
{
|
||||||
SWModelRenderer renderer(thread, clip3DFloor, &WorldToClip, MirrorWorldToClip);
|
SWModelRenderer renderer(thread, clip3DFloor, &WorldToClip, MirrorWorldToClip);
|
||||||
renderer.AddLights(actor);
|
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);
|
PolyTriangleDrawer::SetModelVertexShader(thread->DrawQueue, -1, -1, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue