Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSprites #2197

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/engine/namedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ xx(Object)
xx(Actor)
xx(Class)
xx(Thinker)
xx(ZSprite)
xx(Crosshairs)

xx(Untranslated)
Expand Down
4 changes: 3 additions & 1 deletion src/g_levellocals.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ struct FLevelLocals
DThinker *thinker = static_cast<DThinker*>(cls->CreateNew());
assert(thinker->IsKindOf(RUNTIME_CLASS(DThinker)));
thinker->ObjectFlags |= OF_JustSpawned;
if (thinker->IsKindOf(RUNTIME_CLASS(DZSprite))) // [MC] This absolutely must happen for this class!
statnum = STAT_SPRITE;
Thinkers.Link(thinker, statnum);
thinker->Level = this;
return thinker;
Expand Down Expand Up @@ -665,7 +667,7 @@ struct FLevelLocals
DSeqNode *SequenceListHead;

// [RH] particle globals
uint32_t OldestParticle; // [MC] Oldest particle for replacing with PS_REPLACE
uint32_t OldestParticle; // [MC] Oldest particle for replacing with SPF_REPLACE
uint32_t ActiveParticles;
uint32_t InactiveParticles;
TArray<particle_t> Particles;
Expand Down
3 changes: 2 additions & 1 deletion src/gamedata/r_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "fcolormap.h"
#include "r_sky.h"
#include "p_terrain.h"
#include "p_effect.h"

#include "hwrenderer/data/buffers.h"

Expand Down Expand Up @@ -1662,7 +1663,7 @@ struct subsector_t
int Index() const { return subsectornum; }
// 2: has one-sided walls
FPortalCoverage portalcoverage[2];

TArray<DZSprite *> sprites;
LightmapSurface *lightmap[2];
};

Expand Down
7 changes: 6 additions & 1 deletion src/playsim/dthinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,12 @@ DEFINE_ACTION_FUNCTION_NATIVE(DThinker, ChangeStatNum, ChangeStatNum)
{
PARAM_SELF_PROLOGUE(DThinker);
PARAM_INT(stat);
ChangeStatNum(self, stat);

// do not allow ZScript to reposition thinkers in or out of particle ticking.
if (stat != STAT_SPRITE && !dynamic_cast<DZSprite*>(self))
{
ChangeStatNum(self, stat);
}
return 0;
}

Expand Down
12 changes: 0 additions & 12 deletions src/playsim/p_actionfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,18 +1607,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnDebris)
// A_SpawnParticle
//
//===========================================================================
enum SPFflag
{
SPF_FULLBRIGHT = 1,
SPF_RELPOS = 1 << 1,
SPF_RELVEL = 1 << 2,
SPF_RELACCEL = 1 << 3,
SPF_RELANG = 1 << 4,
SPF_NOTIMEFREEZE = 1 << 5,
SPF_ROLL = 1 << 6,
SPF_REPLACE = 1 << 7,
SPF_NO_XY_BILLBOARD = 1 << 8,
};

DEFINE_ACTION_FUNCTION(AActor, A_SpawnParticle)
{
Expand Down
Loading
Loading