Skip to content

Commit

Permalink
Refactor|GameMap: Removed the now obsolete GameMap_BspNode()
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 3, 2013
1 parent 7a89552 commit 28135c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
9 changes: 0 additions & 9 deletions doomsday/client/include/map/gamemap.h
Expand Up @@ -469,15 +469,6 @@ Sector *GameMap_SectorBySoundEmitter(GameMap *map, void const *soundEmitter);
*/
Surface *GameMap_SurfaceBySoundEmitter(GameMap* map, void const *soundEmitter);

/**
* Lookup a BspNode by its unique index.
*
* @param map GameMap instance.
* @param idx Unique index of the bsp node.
* @return Pointer to BspNode with this index else @c NULL if @a idx is not valid.
*/
BspNode *GameMap_BspNode(GameMap *map, uint idx);

/**
* Lookup the unique index for @a vertex.
*
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/map/dam_file.cpp
Expand Up @@ -841,7 +841,7 @@ static MapElement *readBspReference(GameMap *map)
{
return map->bspLeaf().at(idx & ~NF_LEAF);
}
return GameMap_BspNode(map, idx);
return map->bspNodes().at(idx);
}

#undef NF_LEAF
Expand Down
7 changes: 0 additions & 7 deletions doomsday/client/src/map/gamemap.cpp
Expand Up @@ -306,13 +306,6 @@ int GameMap_BspNodeIndex(GameMap *map, BspNode const *bspLeaf)
return bspLeaf->origIndex();
}

BspNode *GameMap_BspNode(GameMap *map, uint idx)
{
DENG2_ASSERT(map);
if(idx >= map->bspNodeCount()) return NULL;
return map->_bspNodes[idx];
}

uint GameMap_VertexCount(GameMap *map)
{
DENG2_ASSERT(map);
Expand Down
14 changes: 7 additions & 7 deletions doomsday/client/src/map/p_dmu.cpp
Expand Up @@ -344,21 +344,21 @@ void *P_ToPtr(int type, uint index)
case DMU_SIDEDEF:
return theMap->sideDefs().at(index);

case DMU_BSPLEAF:
return theMap->bspLeafs().at(index);

case DMU_SECTOR:
return theMap->sectors().at(index);

case DMU_BSPNODE:
return GameMap_BspNode(theMap, index);

case DMU_PLANE: {
/// @todo Throw exception.
QByteArray msg = String("P_ToPtr: Cannot convert %1 to a ptr (sector is unknown).").arg(DMU_Str(type)).toUtf8();
LegacyCore_FatalError(msg.constData());
return 0; /* Unreachable. */ }

case DMU_BSPLEAF:
return theMap->bspLeafs().at(index);

case DMU_BSPNODE:
return theMap->bspNodes().at(index);

case DMU_MATERIAL:
if(index == 0) return 0;
return &App_Materials().toManifest(index).material();
Expand Down Expand Up @@ -476,7 +476,7 @@ int P_Callback(int type, uint index, void *context, int (*callback)(void *p, voi

case DMU_BSPNODE:
if(index < GameMap_BspNodeCount(theMap))
return callback(GameMap_BspNode(theMap, index), context);
return callback(theMap->bspNodes().at(index), context);
break;

case DMU_BSPLEAF:
Expand Down

0 comments on commit 28135c4

Please sign in to comment.