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 981f1b6
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 163 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
9 changes: 5 additions & 4 deletions src/g_levellocals.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#pragma once

#include <deque>

#include "doomdata.h"
#include "g_level.h"
#include "r_defs.h"
Expand Down Expand Up @@ -654,11 +656,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;
std::deque<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<struct particle_t *> particles;
};


Expand Down
Loading

0 comments on commit 981f1b6

Please sign in to comment.