Skip to content

Commit

Permalink
Cleanup: Define MAX_BIAS_SOURCES in de::Map
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jun 25, 2013
1 parent 3b49a40 commit ddb3d45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/include/render/rend_bias.h
Expand Up @@ -24,7 +24,7 @@

#include <de/Vector>

#define MAX_BIAS_SOURCES (8 * 32) // Hard limit due to change tracking.
#include "world/map.h"

// Vertex illumination flags.
#define VIF_LERP 0x1 ///< Interpolation is in progress.
Expand Down Expand Up @@ -72,7 +72,7 @@ void lerpIllumination(VertexIllum &illum, uint currentTime, int lightSpeed,
class BiasTracker
{
public:
static int const MAX_TRACKED = (MAX_BIAS_SOURCES / 8);
static int const MAX_TRACKED = (de::Map::MAX_BIAS_SOURCES / 8);

public:
BiasTracker() { de::zap(_changes); }
Expand Down
7 changes: 7 additions & 0 deletions doomsday/client/include/world/map.h
Expand Up @@ -137,6 +137,13 @@ class Map
DENG2_DEFINE_AUDIENCE(UnclosedSectorFound,
void unclosedSectorFound(Sector &sector, Vector2d const &nearPoint))

/*
* Constants:
*/
#ifdef __CLIENT__
static int const MAX_BIAS_SOURCES = 8 * 32; // Hard limit due to change tracking.
#endif

/*
* Linked-element lists/sets:
*/
Expand Down
5 changes: 2 additions & 3 deletions doomsday/client/src/edit_bias.cpp
Expand Up @@ -479,7 +479,6 @@ D_CMD(BLEditor)
#include "world/p_players.h"
#include "BspLeaf"

#include "render/rend_bias.h" // MAX_BIAS_SOURCES, remove me (Map should provide)
#include "render/rend_font.h"

static void drawBoxBackground(Vector2i const &origin_, Vector2i const &size_, ui_color_t *color)
Expand Down Expand Up @@ -685,8 +684,8 @@ void SBE_DrawGui()
// Overall stats: numSources / MAX (left)
String text = String("%1 / %2 (%3 free)")
.arg(map.biasSourceCount())
.arg(MAX_BIAS_SOURCES)
.arg(MAX_BIAS_SOURCES - map.biasSourceCount());
.arg(Map::MAX_BIAS_SOURCES)
.arg(Map::MAX_BIAS_SOURCES - map.biasSourceCount());

FR_SetFont(fontFixed);
FR_LoadDefaultAttrib();
Expand Down

0 comments on commit ddb3d45

Please sign in to comment.