Skip to content

Commit

Permalink
Map Renderer: Cleaned up interface to the angle clipper
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 20, 2013
1 parent a66549d commit a81ae66
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 313 deletions.
37 changes: 14 additions & 23 deletions doomsday/client/include/render/rend_clip.h
@@ -1,6 +1,6 @@
/**
* @file rend_clip.h
* Angle Clipper (clipnodes and oranges). @ingroup render
/** @file rend_clip.h Angle Clipper (clipnodes and oranges).
*
* @ingroup render
*
* The idea is to keep track of occluded angles around the camera.
* Since BSP leafs are rendered front-to-back, the occlusion lists
Expand Down Expand Up @@ -28,26 +28,23 @@
* 02110-1301 USA</small>
*/

#ifndef LIBDENG_RENDER_CLIP_H
#define LIBDENG_RENDER_CLIP_H
#ifndef DENG_RENDER_ANGLE_CLIPPER
#define DENG_RENDER_ANGLE_CLIPPER

#include "map/p_mapdata.h"
#include <de/binangle.h>

#ifdef __cplusplus
extern "C" {
#endif
class BspLeaf;

extern int devNoCulling;
DENG_EXTERN_C int devNoCulling;

void C_Init(void);
void C_Init();

/**
* @return Non-zero if clipnodes cover the whole range [0..360] degrees.
*/
int C_IsFull(void);
int C_IsFull();

void C_ClearRanges(void);
void C_ClearRanges();

int C_SafeAddRange(binangle_t startAngle, binangle_t endAngle);

Expand All @@ -66,34 +63,28 @@ int C_IsAngleVisible(binangle_t bang);
/**
* @return Non-zero if @a bspLeaf might be visible, else @c 0.
*/
int C_CheckBspLeaf(BspLeaf* bspLeaf);
int C_CheckBspLeaf(BspLeaf *bspLeaf);

/**
* Add a segment relative to the current viewpoint.
*/
void C_AddRangeFromViewRelPoints(coord_t const from[2], coord_t const to[2]);
void C_AddRangeFromViewRelPointsXY(coord_t fromX, coord_t fromY, coord_t toX, coord_t toY);

/**
* Add an occlusion segment relative to the current viewpoint.
*/
void C_AddViewRelOcclusion(coord_t const* v1, coord_t const* v2, coord_t height, boolean tophalf);
void C_AddViewRelOcclusion(coord_t const from[2], coord_t const to[2], coord_t height, bool tophalf);

/**
* Check a segment relative to the current viewpoint.
*/
int C_CheckRangeFromViewRelPoints(coord_t const from[2], coord_t const to[2]);
int C_CheckRangeFromViewRelPointsXY(coord_t fromX, coord_t fromY, coord_t toX, coord_t toY);

#ifdef DENG_DEBUG
/**
* A debugging aid: checks if clipnode links are valid.
*/
void C_Ranger(void);
#endif

#ifdef __cplusplus
} // extern "C"
void C_Ranger();
#endif

#endif // LIBDENG_RENDER_CLIP_H
#endif // DENG_RENDER_ANGLE_CLIPPER

0 comments on commit a81ae66

Please sign in to comment.