feat: randomization-free landing particles

This commit is contained in:
Fireblade
2026-08-02 18:11:23 -04:00
parent f8a4de8afd
commit 8d3e02bc1f
11 changed files with 144 additions and 54 deletions
+17 -2
View File
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include <unordered_map>
#include "ParticleType.h"
ParticleType::ParticleType(const std::string& name, int id, bool overrideLimiter, int paramCount)
@@ -10,6 +11,19 @@ ParticleType::ParticleType(const std::string& name, int id, bool overrideLimiter
this->paramCount = paramCount;
}
const ParticleType* ParticleType::blockdust = new ParticleType("blockdust_", 0x29, false, 1);
const ParticleType* ParticleType::blockcrack = new ParticleType("blockcrack_", 0x28, false, 2);
static std::unordered_map<int, const ParticleType*>& particleRegistry()
{
static std::unordered_map<int, const ParticleType*> registry = {
{ ParticleType::blockdust->getId(), ParticleType::blockdust },
{ ParticleType::blockcrack->getId(), ParticleType::blockcrack },
};
return registry;
}
int ParticleType::getId() const
{
return id;
@@ -34,6 +48,7 @@ const ParticleType* ParticleType::getDefault()
const ParticleType* ParticleType::byId(int searchId)
{
return nullptr;
auto& reg = particleRegistry();
auto it = reg.find(searchId);
return (it != reg.end()) ? it->second : nullptr;
}