Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
World|Map|DMU API: Segments are no longer addressable using DMU
See: 5411643
  • Loading branch information
danij-deng committed Aug 8, 2013
1 parent 5411643 commit 3227758
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 40 deletions.
8 changes: 0 additions & 8 deletions doomsday/client/include/world/map.h
Expand Up @@ -154,7 +154,6 @@ class Map

typedef QList<BspNode *> BspNodes;
typedef QList<BspLeaf *> BspLeafs;
typedef QList<Segment *> Segments;

#ifdef __CLIENT__
typedef QSet<Plane *> PlaneSet;
Expand Down Expand Up @@ -289,11 +288,6 @@ class Map
*/
BspLeafs const &bspLeafs() const;

/**
* Provides access to the list of line segments for efficient traversal.
*/
Segments const &segments() const;

inline int vertexCount() const { return vertexes().count(); }

inline int lineCount() const { return lines().count(); }
Expand All @@ -308,8 +302,6 @@ class Map

inline int bspLeafCount() const { return bspLeafs().count(); }

inline int segmentCount() const { return segments().count(); }

/**
* Helper function which returns the relevant side index given a @a lineIndex
* and @a side identifier.
Expand Down
11 changes: 0 additions & 11 deletions doomsday/client/src/world/api_map.cpp
Expand Up @@ -299,7 +299,6 @@ int P_ToIndex(void const *ptr)
switch(elem->type())
{
case DMU_VERTEX:
case DMU_SEGMENT:
case DMU_LINE:
case DMU_SIDE:
case DMU_BSPLEAF:
Expand Down Expand Up @@ -328,9 +327,6 @@ void *P_ToPtr(int type, int index)
case DMU_VERTEX:
return App_World().map().vertexes().at(index);

case DMU_SEGMENT:
return App_World().map().segments().at(index);

case DMU_LINE:
return App_World().map().lines().at(index);

Expand Down Expand Up @@ -372,7 +368,6 @@ int P_Count(int type)
switch(type)
{
case DMU_VERTEX: return App_World().hasMap()? App_World().map().vertexCount() : 0;
case DMU_SEGMENT: return App_World().hasMap()? App_World().map().segmentCount() : 0;
case DMU_LINE: return App_World().hasMap()? App_World().map().lineCount() : 0;
case DMU_SIDE: return App_World().hasMap()? App_World().map().sideCount() : 0;
case DMU_BSPNODE: return App_World().hasMap()? App_World().map().bspNodeCount() : 0;
Expand Down Expand Up @@ -460,11 +455,6 @@ int P_Callback(int type, int index, void *context, int (*callback)(void *p, void
return callback(App_World().map().vertexes().at(index), context);
break;

case DMU_SEGMENT:
if(index >= 0 && index < App_World().map().segmentCount())
return callback(App_World().map().segments().at(index), context);
break;

case DMU_LINE:
if(index >= 0 && index < App_World().map().lineCount())
return callback(App_World().map().lines().at(index), context);
Expand Down Expand Up @@ -531,7 +521,6 @@ int P_Callbackp(int type, void *elPtr, void *context, int (*callback)(void *p, v
switch(type)
{
case DMU_VERTEX:
case DMU_SEGMENT:
case DMU_LINE:
case DMU_SIDE:
case DMU_BSPNODE:
Expand Down
4 changes: 0 additions & 4 deletions doomsday/client/src/world/bsp/partitioner.cpp
Expand Up @@ -1367,10 +1367,6 @@ DENG2_PIMPL(Partitioner)
{
switch(elm->type())
{
case DMU_SEGMENT:
/// @todo fixme: Implement a mechanic for tracking Segment ownership.
return true;

case DMU_BSPLEAF:
case DMU_BSPNODE: {
BspTreeNode *treeNode = treeNodeForBspElement(elm);
Expand Down
20 changes: 4 additions & 16 deletions doomsday/client/src/world/map.cpp
Expand Up @@ -143,7 +143,6 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
MapElement *bspRoot;

/// BSP element LUTs:
Segments segments;
BspNodes bspNodes;
BspLeafs bspLeafs;

Expand Down Expand Up @@ -223,9 +222,10 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
lightGrid.reset();
#endif

/// @todo fixme: What about Segments?

qDeleteAll(bspNodes);
qDeleteAll(bspLeafs);
qDeleteAll(segments);
qDeleteAll(sectors);
foreach(Polyobj *polyobj, polyobjs)
{
Expand Down Expand Up @@ -467,13 +467,7 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)

foreach(Segment *seg, leaf->allSegments())
{
// Take ownership of the Segment.
partitioner.take(seg);

// Add this segment to the LUT.
seg->setMap(thisPublic);
seg->setIndexInMap(segments.count());
segments.append(seg);
}

return;
Expand All @@ -499,7 +493,6 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
bool buildBsp()
{
DENG2_ASSERT(bspRoot == 0);
DENG2_ASSERT(segments.isEmpty());
DENG2_ASSERT(bspLeafs.isEmpty());
DENG2_ASSERT(bspNodes.isEmpty());

Expand Down Expand Up @@ -557,7 +550,6 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
bspRoot = rootNode->userData(); // We'll formally take ownership shortly...

#ifdef DENG2_QT_4_7_OR_NEWER
segments.reserve(partitioner.numSegments());
bspNodes.reserve(partitioner.numNodes());
bspLeafs.reserve(partitioner.numLeafs());
#endif
Expand Down Expand Up @@ -1203,7 +1195,8 @@ DENG2_OBSERVES(bsp::Partitioner, UnclosedSectorFound)
*/
bias.lastChangeOnFrame = frameCount;

foreach(Segment *seg, segments)
foreach(BspLeaf *bspLeaf, bspLeafs)
foreach(Segment *seg, bspLeaf->allSegments())
{
seg->applyBiasDigest(allChanges);
}
Expand Down Expand Up @@ -1275,11 +1268,6 @@ Map::BspLeafs const &Map::bspLeafs() const
return d->bspLeafs;
}

Map::Segments const &Map::segments() const
{
return d->segments;
}

#ifdef __CLIENT__

Map::SurfaceSet &Map::decoratedSurfaces()
Expand Down
1 change: 0 additions & 1 deletion doomsday/client/src/world/world.cpp
Expand Up @@ -493,7 +493,6 @@ DENG2_PIMPL(World)
os << TABBED(map->sectorCount(), "Sectors");
os << TABBED(map->bspNodeCount(), "BSP Nodes");
os << TABBED(map->bspLeafCount(), "BSP Leafs");
os << TABBED(map->segmentCount(), "Segments");

LOG_INFO("%s") << str.rightStrip();

Expand Down

0 comments on commit 3227758

Please sign in to comment.