- 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
parent 43c70cdf9d
commit 3caa6247be
4 changed files with 9 additions and 5 deletions

View file

@ -481,7 +481,7 @@ enum ActorRenderFlag
RF_MASKROTATION = 0x00200000, // [MC] Only draw the actor when viewed from a certain angle range.
RF_ABSMASKANGLE = 0x00400000, // [MC] The mask rotation does not offset by the actor's angle.
RF_ABSMASKPITCH = 0x00800000, // [MC] The mask rotation does not offset by the actor's pitch.
RF_INTERPOLATEANGLES = 0x01000000, // [MC] Allow interpolation of the actor's angle, pitch and roll.
RF_INTERPOLATEANGLES = 0x01000000, // [MC] Allow interpolation of the actor's angle, pitch and roll.
RF_MAYBEINVISIBLE = 0x02000000,
RF_DONTINTERPOLATE = 0x04000000, // no render interpolation ever!
@ -489,13 +489,14 @@ enum ActorRenderFlag
RF_ZDOOMTRANS = 0x10000000, // is not normally transparent in Vanilla Doom
RF_CASTSPRITESHADOW = 0x20000000, // actor will cast a sprite shadow
RF_NOINTERPOLATEVIEW = 0x40000000, // don't interpolate the view next frame if this actor is a camera.
RF_NOSPRITESHADOW = 0x80000000, // actor will not cast a sprite shadow
RF_NOSPRITESHADOW = 0x80000000, // actor will not cast a sprite shadow
};
enum ActorRenderFlag2
{
RF2_INVISIBLEINMIRRORS = 0x0001, // [Nash] won't render in mirrors
RF2_ONLYVISIBLEINMIRRORS = 0x0002, // [Nash] only renders in mirrors
RF2_BILLBOARDFACECAMERA = 0x0004, // Sprite billboard face camera (override gl_billboard_faces_camera)
};
// This translucency value produces the closest match to Heretic's TINTTAB.

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;

View file

@ -378,6 +378,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(RF, NOSPRITESHADOW, AActor, renderflags),
DEFINE_FLAG(RF2, INVISIBLEINMIRRORS, AActor, renderflags2),
DEFINE_FLAG(RF2, ONLYVISIBLEINMIRRORS, AActor, renderflags2),
DEFINE_FLAG(RF2, BILLBOARDFACECAMERA, AActor, renderflags2),
// Bounce flags
DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),