Skip to content

Commit

Permalink
FX|Renderer: Added a method to query if bloom is enabled
Browse files Browse the repository at this point in the history
No need to check the cvar.
  • Loading branch information
skyjake committed Apr 10, 2014
1 parent fd7f50b commit fc58178
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions doomsday/client/include/render/fx/bloom.h
Expand Up @@ -38,6 +38,7 @@ class Bloom : public ConsoleEffect
void draw();

static void consoleRegister();
static bool isEnabled();

private:
DENG2_PRIVATE(d)
Expand Down
5 changes: 5 additions & 0 deletions doomsday/client/src/render/fx/bloom.cpp
Expand Up @@ -256,4 +256,9 @@ void Bloom::consoleRegister()
C_VAR_INT ("rend-bloom-complexity", &bloomComplexity, 0, 0, 1);
}

bool Bloom::isEnabled() // static
{
return bloomEnabled;
}

} // namespace fx
3 changes: 2 additions & 1 deletion doomsday/client/src/render/viewports.cpp
Expand Up @@ -30,6 +30,7 @@
#include "edit_bias.h"
#include "api_render.h"
#include "render/vr.h"
#include "render/fx/bloom.h"

#include "network/net_demo.h"
#include "filesys/fs_util.h"
Expand Down Expand Up @@ -980,7 +981,7 @@ static void clearViewPorts()
{
GLbitfield bits = GL_DEPTH_BUFFER_BIT;

if(Con_GetInteger("rend-bloom"))
if(fx::Bloom::isEnabled())
{
/*
* Parts of the previous frame might leak in the bloom unless we clear the color
Expand Down

0 comments on commit fc58178

Please sign in to comment.