2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 05:07:43 +00:00

Runtime: Collapse emplace_back() calls where applicable

Same behavior, but with less code.
This commit is contained in:
Lioncash
2020-03-13 16:32:24 -04:00
parent df4487bae8
commit 097d4a4422
18 changed files with 103 additions and 123 deletions

View File

@@ -114,8 +114,7 @@ void CDecal::RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const {
g_instTexData.clear();
g_instTexData.reserve(1);
g_instTexData.emplace_back();
SParticleInstanceTex& inst = g_instTexData.back();
SParticleInstanceTex& inst = g_instTexData.emplace_back();
if (decal.x8_rotation == 0.f) {
inst.pos[0] = zeus::CVector3f(-size, 0.001f, size);
inst.pos[1] = zeus::CVector3f(size, 0.001f, size);
@@ -142,8 +141,7 @@ void CDecal::RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const {
g_instNoTexData.clear();
g_instNoTexData.reserve(1);
g_instNoTexData.emplace_back();
SParticleInstanceNoTex& inst = g_instNoTexData.back();
SParticleInstanceNoTex& inst = g_instNoTexData.emplace_back();
if (decal.x8_rotation == 0.f) {
inst.pos[0] = zeus::CVector3f(-size, 0.001f, size);
inst.pos[1] = zeus::CVector3f(size, 0.001f, size);