mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
upgrade emitters garbage collection
This commit is contained in:
parent
78761a445a
commit
52494a680c
3 changed files with 21 additions and 12 deletions
|
|
@ -19,7 +19,7 @@ Emitter::Emitter(
|
|||
)
|
||||
: level(level),
|
||||
origin(std::move(origin)),
|
||||
prototype({this, 0, glm::vec3(), preset.velocity, preset.lifetime, region}),
|
||||
prototype({this, 0, {}, preset.velocity, preset.lifetime, region}),
|
||||
texture(texture),
|
||||
count(count),
|
||||
preset(std::move(preset)) {
|
||||
|
|
@ -113,6 +113,7 @@ void Emitter::update(
|
|||
if (count > 0) {
|
||||
count--;
|
||||
}
|
||||
refCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -124,6 +125,10 @@ bool Emitter::isDead() const {
|
|||
return count == 0;
|
||||
}
|
||||
|
||||
bool Emitter::isReferred() const {
|
||||
return refCount > 0;
|
||||
}
|
||||
|
||||
const EmitterOrigin& Emitter::getOrigin() const {
|
||||
return origin;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue