From 8bb56871591146669ebd6a7a8349119b3d26d0c3 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 29 Jul 2017 11:32:58 -0400 Subject: [PATCH] - Implemented GetCaps() for the software renderer - fixed: Forgot to describe Brightmap capability in the GL Renderer --- src/gl/scene/gl_scene.cpp | 4 ++-- src/swrenderer/r_swrenderer.cpp | 17 +++++++++++++++++ src/swrenderer/r_swrenderer.h | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index ad3af273bc..681af98a64 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -1175,13 +1175,13 @@ uint32_t FGLInterface::GetCaps() else if (!(FGLRenderBuffers::IsEnabled())) { // truecolor is always available when renderbuffers are unavailable because palette tonemap is not possible - FlagSet |= RFF_TRUECOLOR | RFF_MATSHADER; + FlagSet |= RFF_TRUECOLOR | RFF_MATSHADER | RFF_BRIGHTMAP; } else { if (gl_tonemap != 5) // not running palette tonemap shader FlagSet |= RFF_TRUECOLOR; - FlagSet |= RFF_MATSHADER | RFF_POSTSHADER; + FlagSet |= RFF_MATSHADER | RFF_POSTSHADER | RFF_BRIGHTMAP; } return (uint32_t)FlagSet; } diff --git a/src/swrenderer/r_swrenderer.cpp b/src/swrenderer/r_swrenderer.cpp index 026252dc8a..fec82c30e7 100644 --- a/src/swrenderer/r_swrenderer.cpp +++ b/src/swrenderer/r_swrenderer.cpp @@ -378,3 +378,20 @@ void FSoftwareRenderer::PreprocessLevel() void FSoftwareRenderer::CleanLevelData() { } + +uint32_t FSoftwareRenderer::GetCaps() +{ + ActorRenderFeatureFlags FlagSet = RFF_UNCLIPPEDTEX; + + if (r_polyrenderer) + FlagSet |= RFF_POLYGONAL | RFF_TILTPITCH; + else + FlagSet |= RFF_VOXELS; + + if (screen && screen->IsBgra()) + FlagSet |= RFF_TRUECOLOR; + else + FlagSet |= RFF_COLORMAP; + + return (uint32_t)FlagSet; +} \ No newline at end of file diff --git a/src/swrenderer/r_swrenderer.h b/src/swrenderer/r_swrenderer.h index 91b4dcdfb8..06946321fc 100644 --- a/src/swrenderer/r_swrenderer.h +++ b/src/swrenderer/r_swrenderer.h @@ -35,6 +35,8 @@ struct FSoftwareRenderer : public FRenderer void PreprocessLevel() override; void CleanLevelData() override; + uint32_t GetCaps() override; + private: void PrecacheTexture(FTexture *tex, int cache);