Merge pull request #63 from lioncash/char

CActorModelParticles: Make DGRP array constexpr
This commit is contained in:
Phillip Stephens 2019-09-10 04:03:06 -07:00 committed by GitHub
commit 60409d2f6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,7 @@
#include "CActorModelParticles.hpp"
#include <array>
#include "CStateManager.hpp"
#include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp"
@ -377,7 +380,7 @@ void CActorModelParticles::IncrementDependency(EDependency d) {
xe4_loadingDeps |= (1 << int(d));
}
static const char* ParticleDGRPs[] = {
constexpr std::array<const char*, 6> ParticleDGRPs{
"Effect_OnFire_DGRP", "Effect_IceBreak_DGRP", "Effect_Ash_DGRP",
"Effect_FirePop_DGRP", "Effect_Electric_DGRP", "Effect_IcePop_DGRP",
};
@ -393,8 +396,9 @@ CActorModelParticles::Dependency CActorModelParticles::GetParticleDGRPTokens(con
}
void CActorModelParticles::LoadParticleDGRPs() {
for (int i = 0; i < 6; ++i)
x50_dgrps.push_back(GetParticleDGRPTokens(ParticleDGRPs[i]));
for (const char* dgrp : ParticleDGRPs) {
x50_dgrps.push_back(GetParticleDGRPTokens(dgrp));
}
}
std::unique_ptr<CElementGen> CActorModelParticles::MakeOnFireGen() const {