Skip to content

Commit c56d70f

Browse files
MajorCookemadame-rachelle
authored andcommitted
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.
1 parent 2e4bf69 commit c56d70f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/playsim/p_effect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ enum EParticleFlags
6666
SPF_NO_XY_BILLBOARD = 1 << 8,
6767
SPF_LOCAL_ANIM = 1 << 9,
6868
SPF_NEGATIVE_FADESTEP = 1 << 10,
69+
SPF_FACECAMERA = 1 << 11,
70+
SPF_NOFACECAMERA = 1 << 12,
6971
};
7072

7173
class DVisualThinker;

src/rendering/hwrenderer/scene/hw_sprites.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
400400
&& (gl_billboard_mode == 1 || (actor && actor->renderflags & RF_FORCEXYBILLBOARD))));
401401

402402
const bool drawBillboardFacingCamera = hw_force_cambbpref ? gl_billboard_faces_camera :
403-
(gl_billboard_faces_camera && (actor && !(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA)))
404-
|| !!(actor && actor->renderflags2 & RF2_BILLBOARDFACECAMERA);
403+
gl_billboard_faces_camera
404+
&& ((actor && (!(actor->renderflags2 & RF2_BILLBOARDNOFACECAMERA) || (actor->renderflags2 & RF2_BILLBOARDFACECAMERA)))
405+
|| (particle && particle->texture.isValid() && (!(particle->flags & SPF_NOFACECAMERA) || (particle->flags & SPF_FACECAMERA))));
405406

406407
// [Nash] has +ROLLSPRITE
407408
const bool drawRollSpriteActor = (actor != nullptr && actor->renderflags & RF_ROLLSPRITE);

wadsrc/static/zscript/constants.zs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ enum EParticleFlags
715715
SPF_NO_XY_BILLBOARD = 1 << 8,
716716
SPF_LOCAL_ANIM = 1 << 9,
717717
SPF_NEGATIVE_FADESTEP = 1 << 10,
718+
SPF_FACECAMERA = 1 << 11,
719+
SPF_NOFACECAMERA = 1 << 12,
718720

719721
SPF_RELATIVE = SPF_RELPOS|SPF_RELVEL|SPF_RELACCEL|SPF_RELANG
720722
};

0 commit comments

Comments
 (0)