Navigation Menu

Skip to content

Commit

Permalink
Renderer|Billboard: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Nov 21, 2013
1 parent 53a82af commit d316c7a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
59 changes: 33 additions & 26 deletions doomsday/client/include/render/billboard.h
@@ -1,4 +1,6 @@
/** @file billboard.h Rendering billboard "sprites".
*
* @ingroup render
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
Expand Down Expand Up @@ -28,13 +30,13 @@
class BspLeaf;

/**
* A sort of a sprite, I guess... Masked walls must be rendered sorted
* with sprites, so no artifacts appear when sprites are seen behind
* masked walls.
* Billboard drawing arguments for a masked wall.
*
* @ingroup render
* A sort of a sprite, I guess... Masked walls must be rendered sorted with
* sprites, so no artifacts appear when sprites are seen behind masked walls.
*/
typedef struct rendmaskedwallparams_s {
struct rendmaskedwallparams_t
{
void *material; /// MaterialVariant
blendmode_t blendMode; ///< Blendmode to be used when drawing
/// (two sided mid textures only)
Expand All @@ -49,9 +51,13 @@ typedef struct rendmaskedwallparams_s {
DGLuint modTex; ///< Texture to modulate with.
float modTexCoord[2][2]; ///< [top-left, bottom-right][x, y]
float modColor[4];
} rendmaskedwallparams_t;
};

/// @ingroup render
void Rend_DrawMaskedWall(rendmaskedwallparams_t const &parms);

/**
* Billboard drawing arguments for a "player" sprite (HUD sprite).
*/
struct rendpspriteparams_t
{
float pos[2]; // {X, Y} Screen-space position.
Expand All @@ -65,8 +71,13 @@ struct rendpspriteparams_t
uint vLightListIdx;
};

/// @ingroup render
typedef struct rendspriteparams_s {
void Rend_DrawPSprite(rendpspriteparams_t const &parms);

/**
* Billboard drawing arguments for a map entity, sprite visualization.
*/
struct rendspriteparams_t
{
// Position/Orientation/Scale
coord_t center[3]; // The real center point.
coord_t srvo[3]; // Short-range visual offset.
Expand All @@ -87,19 +98,27 @@ typedef struct rendspriteparams_s {

// Misc
BspLeaf *bspLeaf;
} rendspriteparams_t;
};

void Rend_DrawSprite(rendspriteparams_t const &parms);

de::MaterialVariantSpec const &Rend_SpriteMaterialSpec(int tclass = 0, int tmap = 0);

/**
* @defgroup rendFlareFlags Flare renderer flags
* @ingroup render
* @{
*/
#define RFF_NO_PRIMARY 0x1 ///< Do not draw a primary flare (aka halo).
#define RFF_NO_TURN 0x2 ///< Flares do not turn in response to viewangle/viewdir
/**@}*/

/// @ingroup render
typedef struct rendflareparams_s {
/**
* Billboard drawing arguments for a lens flare.
*
* @see H_RenderHalo()
*/
struct rendflareparams_t
{
byte flags; // @ref rendFlareFlags.
int size;
float color[3];
Expand All @@ -109,10 +128,8 @@ typedef struct rendflareparams_s {
float mul; // Flare brightness factor.
boolean isDecoration;
int lumIdx;
} rendflareparams_t;
};

/// @addtogroup render
/// @{
DENG_EXTERN_C int alwaysAlign;
DENG_EXTERN_C int spriteLight, useSpriteAlpha, useSpriteBlend;
DENG_EXTERN_C int noSpriteZWrite;
Expand All @@ -121,14 +138,4 @@ DENG_EXTERN_C byte devNoSprites;

DENG_EXTERN_C void Rend_SpriteRegister();

void Rend_DrawMaskedWall(rendmaskedwallparams_t const &parms);

void Rend_DrawPSprite(rendpspriteparams_t const &parms);

void Rend_DrawSprite(rendspriteparams_t const &parms);

de::MaterialVariantSpec const &Rend_SpriteMaterialSpec(int tclass = 0, int tmap = 0);

/// @}

#endif // DENG_CLIENT_RENDER_BILLBOARD_H
2 changes: 2 additions & 0 deletions doomsday/client/src/render/rend_main.cpp
Expand Up @@ -3343,7 +3343,9 @@ static bool generateHaloForVisSprite(vissprite_t const *spr, bool primary = fals
float occlusionFactor;

if(primary && (spr->data.flare.flags & RFF_NO_PRIMARY))
{
return false;
}

if(spr->data.flare.isDecoration)
{
Expand Down

0 comments on commit d316c7a

Please sign in to comment.