Skip to content

Commit

Permalink
- Exposed PrevRoll, enabling roll interpolation disabling without aff…
Browse files Browse the repository at this point in the history
…ecting position interpolation.

- Added translation parameter to the `Spawn` function again.
  • Loading branch information
MajorCooke committed Nov 18, 2023
1 parent a6ff639 commit 3d147df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/playsim/p_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ void DZSprite::Serialize(FSerializer& arc)
("prev", Prev)
("scale", Scale)
("roll", Roll)
("prevroll", PrevRoll)
("offset", Offset)
("alpha", Alpha)
("texture", Texture)
Expand All @@ -1247,6 +1248,7 @@ DEFINE_FIELD(DZSprite, Prev);
DEFINE_FIELD(DZSprite, Scale);
DEFINE_FIELD(DZSprite, Offset);
DEFINE_FIELD(DZSprite, Roll);
DEFINE_FIELD(DZSprite, PrevRoll);
DEFINE_FIELD(DZSprite, Alpha);
DEFINE_FIELD(DZSprite, Texture);
DEFINE_FIELD(DZSprite, Translation);
Expand Down
5 changes: 3 additions & 2 deletions wadsrc/static/zscript/zsprite.zs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Class ZSprite : Thinker native
{
native Vector3 Pos, Vel, Prev;
native Vector2 Scale, Offset;
native double Roll, Alpha;
native double Roll, Alpha, PrevRoll;
native TextureID Texture;
native TranslationID Translation;
native uint16 Flags;
Expand All @@ -19,7 +19,7 @@ Class ZSprite : Thinker native
native bool IsFrozen();

static ZSprite Spawn(Class<ZSprite> type, TextureID tex, Vector3 pos, Vector3 vel, double alpha = 1.0, int flags = 0,
double roll = 0.0, Vector2 scale = (1,1), Vector2 offset = (0,0), int style = STYLE_Normal)
double roll = 0.0, Vector2 scale = (1,1), Vector2 offset = (0,0), int style = STYLE_Normal, TranslationID trans = 0)
{
if (!Level) return null;

Expand All @@ -34,6 +34,7 @@ Class ZSprite : Thinker native
p.Scale = scale;
p.Offset = offset;
p.SetRenderStyle(style);
p.Translation = trans;
p.Flags = flags;
}
return p;
Expand Down

0 comments on commit 3d147df

Please sign in to comment.