- Add model rendering to the software renderer

This commit is contained in:
Magnus Norddahl 2017-11-27 23:47:26 +01:00
commit d43ac8b9ae
32 changed files with 792 additions and 87 deletions

View file

@ -33,6 +33,9 @@
#include "actorinlines.h"
#include "i_time.h"
void gl_FlushModels();
bool polymodelsInUse;
void PolyRenderModel(PolyRenderThread *thread, const TriMatrix &worldToClip, const PolyClipPlane &clipPlane, uint32_t stencilValue, float x, float y, float z, FSpriteModelFrame *smf, AActor *actor)
{
PolyModelRenderer renderer(thread, worldToClip, clipPlane, stencilValue);
@ -47,6 +50,15 @@ void PolyRenderHUDModel(PolyRenderThread *thread, const TriMatrix &worldToClip,
/////////////////////////////////////////////////////////////////////////////
PolyModelRenderer::PolyModelRenderer(PolyRenderThread *thread, const TriMatrix &worldToClip, const PolyClipPlane &clipPlane, uint32_t stencilValue) : Thread(thread), WorldToClip(worldToClip), ClipPlane(clipPlane), StencilValue(stencilValue)
{
if (!polymodelsInUse)
{
gl_FlushModels();
polymodelsInUse = true;
}
}
void PolyModelRenderer::BeginDrawModel(AActor *actor, FSpriteModelFrame *smf, const VSMatrix &objectToWorldMatrix)
{
ModelActor = actor;