Skip to content

Commit

Permalink
Surface: Mark as requiring a decoration update during construction
Browse files Browse the repository at this point in the history
This will ensure the decoration sources are updated automatically
when they are first referenced.
  • Loading branch information
danij-deng committed Apr 12, 2013
1 parent 9731f58 commit cd097ea
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions doomsday/client/include/map/surface.h
Expand Up @@ -90,7 +90,6 @@ class Surface : public de::MapElement

public:
#ifdef __CLIENT__
/// @todo Does this data belong here?
struct DecorationData
{
/// @c true= An update is needed.
Expand Down Expand Up @@ -456,8 +455,6 @@ class Surface : public de::MapElement

/**
* Mark the surface as needing a decoration source update.
*
* @todo This data should not be owned by Surface.
*/
void markAsNeedingDecorationUpdate();
#endif // __CLIENT__
Expand Down
3 changes: 1 addition & 2 deletions doomsday/client/src/map/surface.cpp
Expand Up @@ -187,7 +187,7 @@ Surface::Surface(MapElement &owner, float opacity, Vector3f const &tintColor)
: MapElement(DMU_SURFACE), d(new Instance(this, owner))
{
#ifdef __CLIENT__
_decorationData.needsUpdate = false;
_decorationData.needsUpdate = true;
_decorationData.sources = 0;
_decorationData.numSources = 0;
#endif
Expand Down Expand Up @@ -628,7 +628,6 @@ void Surface::markAsNeedingDecorationUpdate()
{
if(ddMapSetup || !isAttachedToMap()) return;

/// @todo Replace with a de::Observer-based mechanism.
_decorationData.needsUpdate = true;
}
#endif // __CLIENT__
Expand Down
5 changes: 0 additions & 5 deletions doomsday/client/src/render/rend_decor.cpp
Expand Up @@ -19,12 +19,9 @@
* 02110-1301 USA</small>
*/

//#include <cmath>

#include "de_base.h"
#include "de_console.h"
#include "de_play.h"
//#include "de_graphics.h"
#include "de_render.h"

#include "def_main.h"
Expand Down Expand Up @@ -309,7 +306,6 @@ static void newSource(Surface const &suf, Surface::DecorSource const &dec)

static void plotSourcesForSurface(Surface &suf)
{
/// @todo Replace with a de::Observer-based mechanism.
if(suf._decorationData.needsUpdate)
{
suf.clearDecorations();
Expand All @@ -333,7 +329,6 @@ static void plotSourcesForSurface(Surface &suf)
DENG2_ASSERT(0); // Invalid type.
}

/// @todo Replace with a de::Observer-based mechanism.
suf._decorationData.needsUpdate = false;
}

Expand Down

0 comments on commit cd097ea

Please sign in to comment.