Skip to content

Commit

Permalink
Renderer: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 2, 2013
1 parent d29855e commit b784a53
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 151 deletions.
10 changes: 5 additions & 5 deletions doomsday/client/include/render/billboard.h
Expand Up @@ -35,7 +35,7 @@ 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.
*/
struct rendmaskedwallparams_t
struct drawmaskedwallparams_t
{
void *material; /// MaterialVariant
blendmode_t blendMode; ///< Blendmode to be used when drawing
Expand All @@ -53,7 +53,7 @@ struct rendmaskedwallparams_t
float modColor[4];
};

void Rend_DrawMaskedWall(rendmaskedwallparams_t const &parms);
void Rend_DrawMaskedWall(drawmaskedwallparams_t const &parms);

/**
* Billboard drawing arguments for a "player" sprite (HUD sprite).
Expand All @@ -76,7 +76,7 @@ void Rend_DrawPSprite(rendpspriteparams_t const &parms);
/**
* Billboard drawing arguments for a map entity, sprite visualization.
*/
struct rendspriteparams_t
struct drawspriteparams_t
{
// Position/Orientation/Scale
coord_t center[3]; // The real center point.
Expand All @@ -100,7 +100,7 @@ struct rendspriteparams_t
BspLeaf *bspLeaf;
};

void Rend_DrawSprite(rendspriteparams_t const &parms);
void Rend_DrawSprite(drawspriteparams_t const &parms);

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

Expand All @@ -117,7 +117,7 @@ de::MaterialVariantSpec const &Rend_SpriteMaterialSpec(int tclass = 0, int tmap
*
* @see H_RenderHalo()
*/
struct rendflareparams_t
struct drawflareparams_t
{
byte flags; // @ref rendFlareFlags.
int size;
Expand Down
6 changes: 2 additions & 4 deletions doomsday/client/include/render/rend_model.h
Expand Up @@ -31,7 +31,7 @@ class TextureVariantSpec;
#define RENDER_MAX_MODEL_VERTS 16192

/// @todo Split this large inflexible structure into logical subcomponent pieces.
struct rendmodelparams_t
struct drawmodelparams_t
{
// Animation, frame interpolation.
ModelDef *mf, *nextMF;
Expand Down Expand Up @@ -109,8 +109,6 @@ void Rend_ModelShutdown();
*/
bool Rend_ModelExpandVertexBuffers(uint numVertices);

void Rend_ModelSetFrame(ModelDef &modef, int frame);

/**
* Lookup the texture specification for diffuse model skins.
*
Expand All @@ -129,6 +127,6 @@ TextureVariantSpec &Rend_ModelShinyTextureSpec();
/**
* Render all the submodels of a model.
*/
void Rend_DrawModel(rendmodelparams_t const &parms);
void Rend_DrawModel(drawmodelparams_t const &parms);

#endif // DENG_CLIENT_RENDER_MODEL_H
12 changes: 6 additions & 6 deletions doomsday/client/include/render/vissprite.h
Expand Up @@ -50,10 +50,10 @@ typedef struct vissprite_s {

// An anonymous union for the data.
union vissprite_data_u {
rendspriteparams_t sprite;
rendmaskedwallparams_t wall;
rendmodelparams_t model;
rendflareparams_t flare;
drawspriteparams_t sprite;
drawmaskedwallparams_t wall;
drawmodelparams_t model;
drawflareparams_t flare;
} data;
} vissprite_t;

Expand All @@ -62,15 +62,15 @@ typedef struct vissprite_s {
#define VS_MODEL(v) (&((v)->data.model))
#define VS_FLARE(v) (&((v)->data.flare))

void VisSprite_SetupSprite(rendspriteparams_t &p,
void VisSprite_SetupSprite(drawspriteparams_t &p,
de::Vector3d const &center, coord_t distToEye, de::Vector3d const &visOffset,
float secFloor, float secCeil, float floorClip, float top,
Material &material, bool matFlipS, bool matFlipT, blendmode_t blendMode,
de::Vector4f const &ambientColor,
uint vLightListIdx, int tClass, int tMap, BspLeaf *bspLeafAtOrigin,
bool floorAdjust, bool fitTop, bool fitBottom, bool viewAligned);

void VisSprite_SetupModel(rendmodelparams_t &p,
void VisSprite_SetupModel(drawmodelparams_t &p,
de::Vector3d const &origin, coord_t distToEye, de::Vector3d const &visOffset,
float gzt, float yaw, float yawAngleOffset, float pitch, float pitchAngleOffset,
ModelDef *mf, ModelDef *nextMF, float inter,
Expand Down
3 changes: 3 additions & 0 deletions doomsday/client/include/resource/models.h
Expand Up @@ -282,6 +282,9 @@ ModelDef *Models_ModelDef(int index);
*/
ModelDef *Models_ModelDef(char const *id);

/// @todo Refactor away. Used for animating particle/sky models.
void Models_SetFrame(ModelDef &modelDef, int frame);

/**
* Cache all resources needed to visualize models using the given @a modelDef.
*/
Expand Down
6 changes: 3 additions & 3 deletions doomsday/client/src/render/billboard.cpp
Expand Up @@ -84,7 +84,7 @@ static inline void drawQuad(dgl_vertex_t *v, dgl_color_t *c, dgl_texcoord_t *tc)
glEnd();
}

void Rend_DrawMaskedWall(rendmaskedwallparams_t const &parms)
void Rend_DrawMaskedWall(drawmaskedwallparams_t const &parms)
{
DENG_ASSERT_IN_MAIN_THREAD();
DENG_ASSERT_GL_CONTEXT_ACTIVE();
Expand Down Expand Up @@ -423,7 +423,7 @@ MaterialVariantSpec const &Rend_SpriteMaterialSpec(int tclass, int tmap)
1, -2, -1, true, true, true, false);
}

static MaterialVariant *chooseSpriteMaterial(rendspriteparams_t const &p)
static MaterialVariant *chooseSpriteMaterial(drawspriteparams_t const &p)
{
if(!renderTextures) return 0;
if(renderTextures == 2)
Expand All @@ -447,7 +447,7 @@ static int drawVectorLightWorker(VectorLight const *vlight, void *context)
return false; // Continue iteration.
}

void Rend_DrawSprite(rendspriteparams_t const &parms)
void Rend_DrawSprite(drawspriteparams_t const &parms)
{
DENG_ASSERT_IN_MAIN_THREAD();
DENG_ASSERT_GL_CONTEXT_ACTIVE();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/r_main.cpp
Expand Up @@ -1211,7 +1211,7 @@ static void drawPlayerSprites()
}
}

static void setupModelParamsForVisPSprite(rendmodelparams_t *params, vispsprite_t *spr)
static void setupModelParamsForVisPSprite(drawmodelparams_t *params, vispsprite_t *spr)
{
params->mf = spr->data.model.mf;
params->nextMF = spr->data.model.nextMF;
Expand Down Expand Up @@ -1312,7 +1312,7 @@ static void drawPlayerModels()

if(spr->type != VPSPR_MODEL) continue; // Not used.

rendmodelparams_t parms; zap(parms);
drawmodelparams_t parms; zap(parms);
setupModelParamsForVisPSprite(&parms, spr);
Rend_DrawModel(parms);
}
Expand Down

0 comments on commit b784a53

Please sign in to comment.