From 5fc3d44ba54f18d62ed1e2ef4fe6d3fc240ecfd2 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 23 Jun 2024 09:44:13 -0500 Subject: [PATCH] Added SPF_ROLLCENTER for particles and visual thinkers. --- src/playsim/p_effect.h | 1 + src/rendering/hwrenderer/scene/hw_sprites.cpp | 2 +- wadsrc/static/zscript/constants.zs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/playsim/p_effect.h b/src/playsim/p_effect.h index d22438f10..29f1cb720 100644 --- a/src/playsim/p_effect.h +++ b/src/playsim/p_effect.h @@ -68,6 +68,7 @@ enum EParticleFlags SPF_NEGATIVE_FADESTEP = 1 << 10, SPF_FACECAMERA = 1 << 11, SPF_NOFACECAMERA = 1 << 12, + SPF_ROLLCENTER = 1 << 13, }; class DVisualThinker; diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index 41112a411..9340839b9 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -415,7 +415,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp) // [Nash] is a flat sprite const bool isWallSprite = (actor != nullptr) && (spritetype == RF_WALLSPRITE); - const bool useOffsets = (actor != nullptr) && !(actor->renderflags & RF_ROLLCENTER); + const bool useOffsets = ((actor != nullptr) && !(actor->renderflags & RF_ROLLCENTER)) || (particle && !(particle->flags & SPF_ROLLCENTER)); FVector2 offset = FVector2( offx, offy ); float xx = -center.X + x; diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 6f9d5027a..bd92db9b8 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -717,6 +717,7 @@ enum EParticleFlags SPF_NEGATIVE_FADESTEP = 1 << 10, SPF_FACECAMERA = 1 << 11, SPF_NOFACECAMERA = 1 << 12, + SPF_ROLLCENTER = 1 << 13, SPF_RELATIVE = SPF_RELPOS|SPF_RELVEL|SPF_RELACCEL|SPF_RELANG };