Skip to content

Commit

Permalink
Refactor|Renderer: Relocated all code which doesn't belong in billboa…
Browse files Browse the repository at this point in the history
…rd.cpp/h
  • Loading branch information
danij-deng committed Nov 21, 2013
1 parent 94148dc commit 4a89ad1
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 521 deletions.
46 changes: 12 additions & 34 deletions doomsday/client/include/render/billboard.h
Expand Up @@ -22,11 +22,13 @@
#define DENG_CLIENT_RENDER_BILLBOARD_H

#include "dd_types.h"
#include "render/vissprite.h"
#include "MaterialVariantSpec"

/// @addtogroup render
///@{

typedef struct rendpspriteparams_s
struct rendpspriteparams_t
{
float pos[2]; // {X, Y} Screen-space position.
float width, height;
Expand All @@ -37,51 +39,27 @@ typedef struct rendpspriteparams_s

float ambientColor[4];
uint vLightListIdx;
} rendpspriteparams_t;
};

DENG_EXTERN_C int alwaysAlign;
DENG_EXTERN_C int spriteLight, useSpriteAlpha, useSpriteBlend;
DENG_EXTERN_C int noSpriteZWrite;
DENG_EXTERN_C byte noSpriteTrans;
DENG_EXTERN_C byte devNoSprites;

DENG_EXTERN_C void Rend_SpriteRegister(void);

#ifdef __CLIENT__
#ifdef __cplusplus

#include "MaterialVariantSpec"

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

extern "C" {
#endif // __cplusplus

/**
* Render sprites, 3D models, masked wall segments and halos, ordered
* back to front. Halos are rendered with Z-buffer tests and writes
* disabled, so they don't go into walls or interfere with real objects.
* It means that halos can be partly occluded by objects that are closer
* to the viewpoint, but that's the price to pay for not having access to
* the actual Z-buffer per-pixel depth information. The other option would
* be for halos to shine through masked walls, sprites and models, which
* looks even worse. (Plus, they are *halos*, not real lens flares...)
*/
void Rend_DrawMasked(void);
DENG_EXTERN_C void Rend_SpriteRegister();

/**
* Draws 2D HUD sprites. If they were already drawn 3D, this won't do anything.
* 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.
*/
void Rend_Draw2DPlayerSprites(void);

void Rend_Draw3DPlayerSprites(void);
void Rend_DrawMaskedWall(rendmaskedwallparams_t const *parms);

#ifdef __cplusplus
} // extern "C"
#endif
void Rend_DrawPSprite(rendpspriteparams_t const *parms);

#endif // __CLIENT__
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: 1 addition & 1 deletion doomsday/client/include/render/rend_model.h
Expand Up @@ -133,6 +133,6 @@ struct texturevariantspecification_s &Rend_ModelShinyTextureSpec();
/**
* Render a submodel according to paramaters.
*/
void Rend_RenderModel(rendmodelparams_t const *params);
void Rend_DrawModel(rendmodelparams_t const *params);

#endif // LIBDENG_RENDER_MODEL_H

0 comments on commit 4a89ad1

Please sign in to comment.