Navigation Menu

Skip to content

Commit

Permalink
Server|GameMap: Remove unused SurfaceSet for GameMap's glowing surfaces
Browse files Browse the repository at this point in the history
On Server side there is no need to maintain a set of glowing surfaces.
  • Loading branch information
danij-deng committed Feb 24, 2013
1 parent e3d3cdb commit 4778694
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions doomsday/client/include/map/gamemap.h
Expand Up @@ -115,8 +115,8 @@ class GameMap
SurfaceSet scrollingSurfaces_;
#ifdef __CLIENT__
SurfaceSet decoratedSurfaces_;
#endif
SurfaceSet glowingSurfaces_;
#endif

struct blockmap_s* mobjBlockmap;
struct blockmap_s* polyobjBlockmap;
Expand Down Expand Up @@ -158,13 +158,13 @@ class GameMap
*/
SurfaceSet &decoratedSurfaces();

#endif // __CLIENT__

/**
* Returns the set of glowing surfaces for the map.
*/
SurfaceSet &glowingSurfaces();

#endif // __CLIENT__

/**
* Returns the set of scrolling surfaces for the map.
*/
Expand Down
5 changes: 3 additions & 2 deletions doomsday/client/src/map/gamemap.cpp
Expand Up @@ -84,14 +84,15 @@ SurfaceSet &GameMap::decoratedSurfaces()
{
return decoratedSurfaces_;
}
#endif

SurfaceSet &GameMap::glowingSurfaces()
{
return glowingSurfaces_;
}

const Uri* GameMap_Uri(GameMap* map)
#endif // __CLIENT__

Uri const *GameMap_Uri(GameMap *map)
{
DENG2_ASSERT(map);
return map->uri;
Expand Down
14 changes: 8 additions & 6 deletions doomsday/client/src/map/r_world.cpp
Expand Up @@ -408,12 +408,12 @@ void R_DestroyPlaneOfSector(uint id, Sector *sec)
// If this plane's surface is in the moving list, remove it.
theMap->scrollingSurfaces().remove(&plane->surface);

#ifdef __CLIENT__

// If this plane's surface is in the glowing list, remove it.
theMap->glowingSurfaces().remove(&plane->surface);

#ifdef __CLIENT__

// If this plane's surface is in the deocrated list, remove it.
// If this plane's surface is in the decorated list, remove it.
theMap->decoratedSurfaces().remove(&plane->surface);

// Destroy the biassurfaces for this plane.
Expand Down Expand Up @@ -1027,6 +1027,7 @@ void R_MapInitSurfaces(boolean forceUpdate)
}
}

#ifdef __CLIENT__
static void addToSurfaceSets(Surface *suf, Material *material)
{
if(!suf || !material) return;
Expand All @@ -1036,19 +1037,18 @@ static void addToSurfaceSets(Surface *suf, Material *material)
theMap->glowingSurfaces().insert(suf);
}

#ifdef __CLIENT__
if(material->isDecorated())
{
theMap->decoratedSurfaces().insert(suf);
}
#endif
}
#endif // __CLIENT__

void R_MapInitSurfaceLists()
{
#ifdef __CLIENT__

theMap->decoratedSurfaces().clear();
#endif
theMap->glowingSurfaces().clear();

for(uint i = 0; i < NUM_SIDEDEFS; ++i)
Expand All @@ -1070,6 +1070,8 @@ void R_MapInitSurfaceLists()
addToSurfaceSets(&sec->SP_planesurface(j), sec->SP_planematerial(j));
}
}

#endif // __CLIENT__
}

#undef R_SetupMap
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/map/surface.cpp
Expand Up @@ -87,24 +87,24 @@ bool Surface::setMaterial(Material *newMaterial)

if(!ddMapSetup)
{
#ifdef __CLIENT__
GameMap *map = theMap; /// @todo Do not assume surface is from the CURRENT map.

#ifdef __CLIENT__
// If this plane's surface is in the decorated list, remove it.
map->decoratedSurfaces().remove(this);
#endif // __CLIENT__

// If this plane's surface is in the glowing list, remove it.
map->glowingSurfaces().remove(this);
#endif // __CLIENT__

if(newMaterial)
{
#ifdef __CLIENT__
if(newMaterial->hasGlow())
{
map->glowingSurfaces().insert(this);
}

#ifdef __CLIENT__
if(newMaterial->isDecorated())
{
map->decoratedSurfaces().insert(this);
Expand Down

0 comments on commit 4778694

Please sign in to comment.