Skip to content

Commit

Permalink
Server|Fixed: Unidentifiable sound emitters
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 28, 2013
1 parent 75dc96d commit 64ef163
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
17 changes: 14 additions & 3 deletions doomsday/client/include/map/gamemap.h
Expand Up @@ -217,11 +217,22 @@ class GameMap
*/
Surface *surfaceBySoundEmitter(ddmobj_base_t const &soundEmitter) const;

//#ifdef __SERVER__
/// @return @c true iff @a emitter is an identifiable map element.
#if defined(__SERVER__) || defined(DENG_DEBUG)
/**
* Given an @a emitter origin, attempt to identify the map element
* to which it belongs.
*
* @param emitter The sound emitter to be identified.
* @param sector The identified sector if found is written here.
* @param poly The identified polyobj if found is written here.
* @param plane The identified plane if found is written here.
* @param surface The identified line side surface if found is written here.
*
* @return @c true iff @a emitter is an identifiable map element.
*/
bool identifySoundEmitter(ddmobj_base_t const &emitter, Sector **sector,
Polyobj **poly, Plane **plane, Surface **surface) const;
//#endif
#endif

/**
* Provides access to the list of polyobjs for efficient traversal.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/map/gamemap.cpp
Expand Up @@ -759,7 +759,7 @@ Surface *GameMap::surfaceBySoundEmitter(ddmobj_base_t const &soundEmitter) const
return 0; // Not found.
}

//#ifdef __SERVER__
#if defined(__SERVER__) || defined(DENG_DEBUG)
bool GameMap::identifySoundEmitter(ddmobj_base_t const &emitter, Sector **sector,
Polyobj **poly, Plane **plane, Surface **surface) const
{
Expand Down Expand Up @@ -790,7 +790,7 @@ bool GameMap::identifySoundEmitter(ddmobj_base_t const &emitter, Sector **sector

return (*sector != 0 || *poly != 0|| *plane != 0|| *surface != 0);
}
//#endif // __SERVER__
#endif // defined(__SERVER__) || defined(DENG_DEBUG)

Polyobj *GameMap::polyobjByTag(int tag) const
{
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/map/r_world.cpp
Expand Up @@ -735,7 +735,7 @@ static void updateAllMapSectors(GameMap &map)
}
}

#if /*defined(__SERVER__) &&*/ defined(DENG_DEBUG)
#ifdef DENG_DEBUG
static void verifyAllSoundEmitters()
{
DENG_ASSERT(theMap != 0);
Expand Down Expand Up @@ -768,7 +768,7 @@ static void verifyAllSoundEmitters()
DENG_ASSERT(theMap->identifySoundEmitter(side.topSoundEmitter(), &emSec, &emPoly, &emPln, &emSuf));
}
}
#endif // defined(__SERVER__) && defined(DENG_DEBUG)
#endif // DENG_DEBUG

#undef R_SetupMap
DENG_EXTERN_C void R_SetupMap(int mode, int flags)
Expand Down Expand Up @@ -843,7 +843,7 @@ DENG_EXTERN_C void R_SetupMap(int mode, int flags)

// Map setup has been completed.

#if /*defined(__SERVER__) &&*/ defined(DENG_DEBUG)
#ifdef DENG_DEBUG
// Ensure all sound emitters are identifiable.
verifyAllSoundEmitters();
#endif
Expand Down

0 comments on commit 64ef163

Please sign in to comment.