From ee443b6fb65e938cacd2dee0c76add3755eeaebf Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 14 Apr 2018 22:22:40 +0200 Subject: [PATCH] - disable software models --- src/polyrenderer/scene/poly_playersprite.cpp | 3 ++- src/polyrenderer/scene/poly_sprite.cpp | 19 +++++++++++-------- src/swrenderer/scene/r_scene.cpp | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/polyrenderer/scene/poly_playersprite.cpp b/src/polyrenderer/scene/poly_playersprite.cpp index cf0f808a76..8a387401f0 100644 --- a/src/polyrenderer/scene/poly_playersprite.cpp +++ b/src/polyrenderer/scene/poly_playersprite.cpp @@ -34,6 +34,7 @@ EXTERN_CVAR(Bool, r_drawplayersprites) EXTERN_CVAR(Bool, r_deathcamera) EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor) +EXTERN_CVAR(Bool, r_models) void RenderPolyPlayerSprites::Render(PolyRenderThread *thread) { @@ -59,7 +60,7 @@ void RenderPolyPlayerSprites::Render(PolyRenderThread *thread) (r_deathcamera && viewpoint.camera->health <= 0)) return; - renderHUDModel = gl_IsHUDModelForPlayerAvailable(players[consoleplayer].camera->player); + renderHUDModel = r_models && gl_IsHUDModelForPlayerAvailable(players[consoleplayer].camera->player); PolyTransferHeights fakeflat(viewpoint.camera->subsector); diff --git a/src/polyrenderer/scene/poly_sprite.cpp b/src/polyrenderer/scene/poly_sprite.cpp index 65e50ea33d..00641a7e52 100644 --- a/src/polyrenderer/scene/poly_sprite.cpp +++ b/src/polyrenderer/scene/poly_sprite.cpp @@ -74,15 +74,18 @@ bool RenderPolySprite::GetLine(AActor *thing, DVector2 &left, DVector2 &right) void RenderPolySprite::Render(PolyRenderThread *thread, const PolyClipPlane &clipPlane, AActor *thing, subsector_t *sub, uint32_t stencilValue, float t1, float t2) { - int spritenum = thing->sprite; - bool isPicnumOverride = thing->picnum.isValid(); - FSpriteModelFrame *modelframe = isPicnumOverride ? nullptr : gl_FindModelFrame(thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED)); - if (modelframe) + if (r_models) { - const auto &viewpoint = PolyRenderer::Instance()->Viewpoint; - DVector3 pos = thing->InterpolatedPosition(viewpoint.TicFrac); - PolyRenderModel(thread, PolyRenderer::Instance()->WorldToClip, clipPlane, stencilValue, (float)pos.X, (float)pos.Y, (float)pos.Z, modelframe, thing); - return; + int spritenum = thing->sprite; + bool isPicnumOverride = thing->picnum.isValid(); + FSpriteModelFrame *modelframe = isPicnumOverride ? nullptr : gl_FindModelFrame(thing->GetClass(), spritenum, thing->frame, !!(thing->flags & MF_DROPPED)); + if (modelframe) + { + const auto &viewpoint = PolyRenderer::Instance()->Viewpoint; + DVector3 pos = thing->InterpolatedPosition(viewpoint.TicFrac); + PolyRenderModel(thread, PolyRenderer::Instance()->WorldToClip, clipPlane, stencilValue, (float)pos.X, (float)pos.Y, (float)pos.Z, modelframe, thing); + return; + } } DVector2 line[2]; diff --git a/src/swrenderer/scene/r_scene.cpp b/src/swrenderer/scene/r_scene.cpp index 9e28e0c10a..27c5af2932 100644 --- a/src/swrenderer/scene/r_scene.cpp +++ b/src/swrenderer/scene/r_scene.cpp @@ -66,7 +66,7 @@ void PeekThreadedErrorPane(); EXTERN_CVAR(Int, r_clearbuffer) CVAR(Bool, r_scene_multithreaded, false, 0); -CVAR(Bool, r_models, true, 0); +CVAR(Bool, r_models, false, 0); namespace swrenderer {