From c56d70f2b16dc7853049ae93e0910f8fa9e49c31 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 23 Jun 2024 09:05:45 -0500 Subject: [PATCH] Added SPF_(NO)FACECAMERA flagst for specifying camera facing on particles and visual thinkers. - This also adds ensures facing camera is applied to these via the option menu. --- src/playsim/p_effect.h | 2 ++ src/rendering/hwrenderer/scene/hw_sprites.cpp | 5 +++-- wadsrc/static/zscript/constants.zs | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/playsim/p_effect.h b/src/playsim/p_effect.h index c87aa2c7d..d22438f10 100644 --- a/src/playsim/p_effect.h +++ b/src/playsim/p_effect.h @@ -66,6 +66,8 @@ enum EParticleFlags SPF_NO_XY_BILLBOARD = 1 << 8, SPF_LOCAL_ANIM = 1 << 9, SPF_NEGATIVE_FADESTEP = 1 << 10, + SPF_FACECAMERA = 1 << 11, + SPF_NOFACECAMERA = 1 << 12, }; class DVisualThinker; diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index c06812858..41112a411 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -400,8 +400,9 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) && (gl_billboard_mode == 1 || (actor && actor->renderflags & RF_FORCEXYBILLBOARD)))); const bool drawBillboardFacingCamera = hw_force_cambbpref ? gl_billboard_faces_camera : - (gl_billboard_faces_camera && (actor && !(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA))) - || !!(actor && actor->renderflags2 & RF2_BILLBOARDFACECAMERA); + gl_billboard_faces_camera + && ((actor && (!(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA) || (actor->renderflags2 & RF2_BILLBOARDFACECAMERA))) + || (particle && particle->texture.isValid() && (!(particle->flags & SPF_NOFACECAMERA) || (particle->flags & SPF_FACECAMERA)))); // [Nash] has +ROLLSPRITE const bool drawRollSpriteActor = (actor != nullptr && actor->renderflags & RF_ROLLSPRITE); diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 8e36a5516..6f9d5027a 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -715,6 +715,8 @@ enum EParticleFlags SPF_NO_XY_BILLBOARD = 1 << 8, SPF_LOCAL_ANIM = 1 << 9, SPF_NEGATIVE_FADESTEP = 1 << 10, + SPF_FACECAMERA = 1 << 11, + SPF_NOFACECAMERA = 1 << 12, SPF_RELATIVE = SPF_RELPOS|SPF_RELVEL|SPF_RELACCEL|SPF_RELANG };