Add a cvar for sprite billboarding, off by default.
This commit is contained in:
parent
4d77ed925e
commit
8273534967
|
@ -4249,7 +4249,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
|
||||||
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
|
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
|
||||||
static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts)
|
static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts)
|
||||||
{
|
{
|
||||||
if (spr && spr->mobj && wallVerts)
|
if (cv_grspritebillboarding.value && spr && spr->mobj && wallVerts)
|
||||||
{
|
{
|
||||||
float basey = FIXED_TO_FLOAT(spr->mobj->z);
|
float basey = FIXED_TO_FLOAT(spr->mobj->z);
|
||||||
float lowy = wallVerts[0].y;
|
float lowy = wallVerts[0].y;
|
||||||
|
@ -4530,7 +4530,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
wallVerts[1].y = endbot;
|
wallVerts[1].y = endbot;
|
||||||
|
|
||||||
// The x and y only need to be adjusted in the case that it's not a papersprite
|
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||||
if (spr->mobj)
|
if (cv_grspritebillboarding.value && spr->mobj)
|
||||||
{
|
{
|
||||||
// Get the x and z of the vertices so billboarding draws correctly
|
// Get the x and z of the vertices so billboarding draws correctly
|
||||||
realheight = realbot - realtop;
|
realheight = realbot - realtop;
|
||||||
|
@ -4559,7 +4559,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
wallVerts[0].y = wallVerts[1].y = bot;
|
wallVerts[0].y = wallVerts[1].y = bot;
|
||||||
|
|
||||||
// The x and y only need to be adjusted in the case that it's not a papersprite
|
// The x and y only need to be adjusted in the case that it's not a papersprite
|
||||||
if (spr->mobj)
|
if (cv_grspritebillboarding.value && spr->mobj)
|
||||||
{
|
{
|
||||||
// Get the x and z of the vertices so billboarding draws correctly
|
// Get the x and z of the vertices so billboarding draws correctly
|
||||||
realheight = realbot - realtop;
|
realheight = realbot - realtop;
|
||||||
|
|
|
@ -95,6 +95,7 @@ extern consvar_t cv_grcorrecttricks;
|
||||||
extern consvar_t cv_voodoocompatibility;
|
extern consvar_t cv_voodoocompatibility;
|
||||||
extern consvar_t cv_grfovchange;
|
extern consvar_t cv_grfovchange;
|
||||||
extern consvar_t cv_grsolvetjoin;
|
extern consvar_t cv_grsolvetjoin;
|
||||||
|
extern consvar_t cv_grspritebillboarding;
|
||||||
|
|
||||||
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
||||||
|
|
||||||
|
|
|
@ -1407,6 +1407,7 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_grcoronasize);
|
CV_RegisterVar(&cv_grcoronasize);
|
||||||
#endif
|
#endif
|
||||||
CV_RegisterVar(&cv_grmd2);
|
CV_RegisterVar(&cv_grmd2);
|
||||||
|
CV_RegisterVar(&cv_grspritebillboarding);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|
|
@ -81,6 +81,7 @@ consvar_t cv_grcoronasize = {"gr_coronasize", "1", CV_SAVE| CV_FLOAT, 0, NULL, 0
|
||||||
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
||||||
// console variables in development
|
// console variables in development
|
||||||
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const UINT8 gammatable[5][256] =
|
const UINT8 gammatable[5][256] =
|
||||||
|
|
Loading…
Reference in New Issue