Skip to content

Commit

Permalink
Server|Sector: Sector LightGridData is no use to the server
Browse files Browse the repository at this point in the history
This client only data is no longer allocated on server side.
  • Loading branch information
danij-deng committed May 21, 2013
1 parent 5a0b4bf commit effa6a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 9 additions & 1 deletion doomsday/client/include/map/sector.h
Expand Up @@ -33,6 +33,10 @@
#include "Line"
#include "Plane"

#ifdef __CLIENT__
# include "render/lightgrid.h"
#endif

class BspLeaf;
class GameMap;
class Surface;
Expand Down Expand Up @@ -74,6 +78,7 @@ class Sector : public de::MapElement,
typedef QList<Plane *> Planes;
typedef QList<BspLeaf *> BspLeafs;

#ifdef __CLIENT__
/**
* LightGrid data values for "smoothed sector lighting".
*/
Expand All @@ -86,8 +91,9 @@ class Sector : public de::MapElement,
uint changedBlockCount;

/// Block indices.
ushort *blocks;
de::LightGrid::Index *blocks;
};
#endif

public: /// @todo Make private:
/// @ref sectorFrameFlags
Expand All @@ -106,8 +112,10 @@ class Sector : public de::MapElement,
/// characteristics of the sector (not owned).
BspLeafs _reverbBspLeafs;

#ifdef __CLIENT__
/// LightGrid data values.
LightGridData _lightGridData;
#endif

/// Final environmental audio characteristics.
AudioEnvironmentFactors _reverb;
Expand Down
12 changes: 6 additions & 6 deletions doomsday/client/src/render/lightgrid.cpp
Expand Up @@ -151,8 +151,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(LightBlock::Flags)

DENG2_PIMPL_NOREF(LightBlock)
{
/// Primary sector attributed to this block.
Sector *sector;

/// State flags.
Flags flags;

/// Positive bias means that the light is shining in the floor of the sector.
Expand All @@ -165,7 +167,8 @@ DENG2_PIMPL_NOREF(LightBlock)
/// and a full grid update is needed.
Vector3f oldColor;

Instance(Sector *sector) : sector(sector), bias(0)
Instance(Sector *sector)
: sector(sector), bias(0)
{}
};

Expand Down Expand Up @@ -296,10 +299,6 @@ void LightBlock::applySector(Vector3f const &color, float level, int bias, float
d->bias = de::clamp(-0x80, int(d->bias * (1 - factor) + bias * factor), 0x7f);
}

/**
* Provides immutable access to the "raw" color (i.e., non-biased) for the
* block. Primarily intended for debugging.
*/
Vector3f const &LightBlock::rawColorRef() const
{
return d->color;
Expand Down Expand Up @@ -777,7 +776,8 @@ DENG2_OBSERVES(Sector, LightLevelChange)

if(lgData.blockCount > 0)
{
lgData.blocks = (ushort *) Z_Malloc(sizeof(*lgData.blocks) * lgData.blockCount, PU_MAPSTATIC, 0);
lgData.blocks = (LightGrid::Index *)
Z_Malloc(sizeof(*lgData.blocks) * lgData.blockCount, PU_MAPSTATIC, 0);

int a = 0, b = changedCount;
for(int x = 0; x < dimensions.x * dimensions.y; ++x)
Expand Down

0 comments on commit effa6a8

Please sign in to comment.