Skip to content

Commit

Permalink
Remove linked list from particles
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 committed Sep 18, 2023
1 parent cfe30c1 commit 6fc4767
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 161 deletions.
8 changes: 4 additions & 4 deletions src/g_cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ CUSTOM_CVAR(Int, r_maxparticles, 4000, CVAR_ARCHIVE | CVAR_NOINITCALL)
{
if (self == 0)
self = 4000;
else if (self > 65535)
self = 65535;
else if (self < 100)
self = 100;
else if (self > ABSOLUTE_MAX_PARTICLES)
self = ABSOLUTE_MAX_PARTICLES;
else if (self < ABSOLUTE_MIN_PARTICLES)
self = ABSOLUTE_MIN_PARTICLES;

if (gamestate != GS_STARTUP)
{
Expand Down
7 changes: 3 additions & 4 deletions src/g_levellocals.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,10 @@ struct FLevelLocals
DSeqNode *SequenceListHead;

// [RH] particle globals
uint32_t OldestParticle; // [MC] Oldest particle for replacing with PS_REPLACE
uint32_t ActiveParticles;
uint32_t InactiveParticles;

TArray<particle_t> Particles;
TArray<uint16_t> ParticlesInSubsec;
TArray<particle_t> ReplaceableParticles;

FThinkerCollection Thinkers;

TArray<DVector2> Scrolls; // NULL if no DScrollers in this level
Expand Down
2 changes: 2 additions & 0 deletions src/gamedata/r_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,8 @@ struct subsector_t
FPortalCoverage portalcoverage[2];

LightmapSurface *lightmap[2];

TArray<uint32_t> particles;
};


Expand Down
Loading

0 comments on commit 6fc4767

Please sign in to comment.