-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
billboard.h
135 lines (115 loc) · 4 KB
/
billboard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/** @file billboard.h Rendering billboard "sprites".
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2015 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#ifndef CLIENT_RENDER_BILLBOARD_H
#define CLIENT_RENDER_BILLBOARD_H
#include "dd_types.h"
#include "Material"
#include "MaterialAnimator"
#include "MaterialVariantSpec"
class BspLeaf;
struct vissprite_t;
/**
* Billboard drawing arguments for a masked wall.
*
* 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.
*
* @ingroup render
*/
struct drawmaskedwallparams_t
{
MaterialAnimator *animator;
blendmode_t blendMode; ///< Blendmode to be used when drawing (two sided mid textures only)
struct wall_vertex_s {
de::dfloat pos[3]; ///< x y and z coordinates.
de::dfloat color[4];
} vertices[4];
de::ddouble texOffset[2];
de::dfloat texCoord[2][2]; ///< u and v coordinates.
DGLuint modTex; ///< Texture to modulate with.
de::dfloat modTexCoord[2][2]; ///< [top-left, bottom-right][x, y]
de::dfloat modColor[4];
};
void Rend_DrawMaskedWall(drawmaskedwallparams_t const &parms);
/**
* Billboard drawing arguments for a "player" sprite (HUD sprite).
* @ingroup render
*/
struct rendpspriteparams_t
{
de::dfloat pos[2]; ///< [X, Y] Screen-space position.
de::dfloat width;
de::dfloat height;
Material *mat;
de::dfloat texOffset[2];
dd_bool texFlip[2]; ///< [X, Y] Flip along the specified axis.
de::dfloat ambientColor[4];
de::duint vLightListIdx;
};
void Rend_DrawPSprite(rendpspriteparams_t const &parms);
/**
* Billboard drawing arguments for a map entity, sprite visualization.
* @ingroup render
*/
struct drawspriteparams_t
{
dd_bool noZWrite;
blendmode_t blendMode;
MaterialAnimator *matAnimator;
dd_bool matFlip[2]; ///< [S, T] Flip along the specified axis.
BspLeaf *bspLeaf;
};
void Rend_DrawSprite(vissprite_t const &spr);
de::MaterialVariantSpec const &Rend_SpriteMaterialSpec(de::dint tclass = 0, de::dint 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
/**@}*/
/**
* Billboard drawing arguments for a lens flare.
*
* @see H_RenderHalo()
* @ingroup render
*/
struct drawflareparams_t
{
de::dbyte flags; ///< @ref rendFlareFlags.
de::dint size;
de::dfloat color[3];
de::dbyte factor;
de::dfloat xOff;
DGLuint tex; ///< Flaremap if flareCustom ELSE (flaretexName id. Zero = automatical)
de::dfloat mul; ///< Flare brightness factor.
dd_bool isDecoration;
de::dint lumIdx;
};
DENG_EXTERN_C de::dint alwaysAlign;
DENG_EXTERN_C de::dint spriteLight;
DENG_EXTERN_C de::dint useSpriteAlpha;
DENG_EXTERN_C de::dint useSpriteBlend;
DENG_EXTERN_C de::dint noSpriteZWrite;
DENG_EXTERN_C de::dbyte noSpriteTrans;
DENG_EXTERN_C de::dbyte devNoSprites;
DENG_EXTERN_C void Rend_SpriteRegister();
#endif // CLIENT_RENDER_BILLBOARD_H