- add flag +BILLBOARDFACECAMERA - renders actor billboard to always face the camera

tested with this code snippet:
```
class ZombieManFaceCamera : Zombieman replaces Zombieman
{
	default
	{
		+BILLBOARDFACECAMERA;
	}
}
```
This commit is contained in:
Rachael Alexanderson 2023-12-08 10:12:58 -05:00
commit 3caa6247be
4 changed files with 9 additions and 5 deletions

View file

@ -523,7 +523,7 @@ void HWDrawList::SortSpriteIntoWall(HWDrawInfo *di, SortNode * head,SortNode * s
const bool drawWithXYBillboard = ((ss->particle && gl_billboard_particles) || (!(ss->actor && ss->actor->renderflags & RF_FORCEYBILLBOARD)
&& (gl_billboard_mode == 1 || (ss->actor && ss->actor->renderflags & RF_FORCEXYBILLBOARD))));
const bool drawBillboardFacingCamera = gl_billboard_faces_camera;
const bool drawBillboardFacingCamera = gl_billboard_faces_camera || (ss->actor && ss->actor->renderflags2 & RF2_BILLBOARDFACECAMERA);
// [Nash] has +ROLLSPRITE
const bool rotated = (ss->actor != nullptr && ss->actor->renderflags & (RF_ROLLSPRITE | RF_WALLSPRITE | RF_FLATSPRITE));

View file

@ -386,7 +386,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
//&& di->mViewActor != nullptr
&& (gl_billboard_mode == 1 || (actor && actor->renderflags & RF_FORCEXYBILLBOARD))));
const bool drawBillboardFacingCamera = gl_billboard_faces_camera;
const bool drawBillboardFacingCamera = gl_billboard_faces_camera || !!(actor->renderflags2 & RF2_BILLBOARDFACECAMERA);
// [Nash] has +ROLLSPRITE
const bool drawRollSpriteActor = (actor != nullptr && actor->renderflags & RF_ROLLSPRITE);
@ -1135,7 +1135,9 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
// This is a non-translucent sprite (i.e. STYLE_Normal or equivalent)
trans = 1.f;
if (!gl_sprite_blend || modelframe || (thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) || gl_billboard_faces_camera)
if (!gl_sprite_blend || modelframe ||
(thing->renderflags & (RF_FLATSPRITE | RF_WALLSPRITE)) || gl_billboard_faces_camera ||
thing->renderflags2 & RF2_BILLBOARDFACECAMERA)
{
RenderStyle.SrcAlpha = STYLEALPHA_One;
RenderStyle.DestAlpha = STYLEALPHA_Zero;