From 47786945d9fc5875d1acf5cd520bca26663805a9 Mon Sep 17 00:00:00 2001 From: danij Date: Sun, 24 Feb 2013 21:50:34 +0000 Subject: [PATCH] Server|GameMap: Remove unused SurfaceSet for GameMap's glowing surfaces On Server side there is no need to maintain a set of glowing surfaces. --- doomsday/client/include/map/gamemap.h | 6 +++--- doomsday/client/src/map/gamemap.cpp | 5 +++-- doomsday/client/src/map/r_world.cpp | 14 ++++++++------ doomsday/client/src/map/surface.cpp | 6 +++--- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/doomsday/client/include/map/gamemap.h b/doomsday/client/include/map/gamemap.h index 2f8da21768..ecdb1f271f 100644 --- a/doomsday/client/include/map/gamemap.h +++ b/doomsday/client/include/map/gamemap.h @@ -115,8 +115,8 @@ class GameMap SurfaceSet scrollingSurfaces_; #ifdef __CLIENT__ SurfaceSet decoratedSurfaces_; -#endif SurfaceSet glowingSurfaces_; +#endif struct blockmap_s* mobjBlockmap; struct blockmap_s* polyobjBlockmap; @@ -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. */ diff --git a/doomsday/client/src/map/gamemap.cpp b/doomsday/client/src/map/gamemap.cpp index dd4527c5a1..e28eb7f5f5 100644 --- a/doomsday/client/src/map/gamemap.cpp +++ b/doomsday/client/src/map/gamemap.cpp @@ -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; diff --git a/doomsday/client/src/map/r_world.cpp b/doomsday/client/src/map/r_world.cpp index 129369534e..a24ac5e7b6 100644 --- a/doomsday/client/src/map/r_world.cpp +++ b/doomsday/client/src/map/r_world.cpp @@ -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. @@ -1027,6 +1027,7 @@ void R_MapInitSurfaces(boolean forceUpdate) } } +#ifdef __CLIENT__ static void addToSurfaceSets(Surface *suf, Material *material) { if(!suf || !material) return; @@ -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) @@ -1070,6 +1070,8 @@ void R_MapInitSurfaceLists() addToSurfaceSets(&sec->SP_planesurface(j), sec->SP_planematerial(j)); } } + +#endif // __CLIENT__ } #undef R_SetupMap diff --git a/doomsday/client/src/map/surface.cpp b/doomsday/client/src/map/surface.cpp index d23959abe0..a1da5d729a 100644 --- a/doomsday/client/src/map/surface.cpp +++ b/doomsday/client/src/map/surface.cpp @@ -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);