mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:44:56 +00:00
Windows build fixes and warning avoidance
This commit is contained in:
@@ -32,7 +32,7 @@ CDecal::CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf
|
||||
else
|
||||
x5c_29_modelInvalid = true;
|
||||
|
||||
CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
||||
CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
||||
{
|
||||
for (int i=0 ; i<2 ; ++i)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ CDecal::CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf
|
||||
CDecalShaders::BuildShaderDataBinding(ctx, decal);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
} BooTrace);
|
||||
}
|
||||
|
||||
bool CDecal::InitQuad(CQuadDecal& quad, const SQuadDescr& desc)
|
||||
|
||||
@@ -234,7 +234,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||
size_t maxInsts = x26c_30_MBLR ? (m_maxMBSP * x90_MAXP) : x90_MAXP;
|
||||
maxInsts = (maxInsts == 0 ? 256 : maxInsts);
|
||||
|
||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||
{
|
||||
if (!x26c_31_LINE)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||
}
|
||||
CElementGenShaders::BuildShaderDataBinding(ctx, *this);
|
||||
return true;
|
||||
});
|
||||
} BooTrace);
|
||||
}
|
||||
|
||||
CElementGen::~CElementGen()
|
||||
@@ -382,6 +382,12 @@ void CElementGen::AccumulateBounds(zeus::CVector3f& pos, float size)
|
||||
|
||||
void CElementGen::UpdateAdvanceAccessParameters(u32 activeParticleCount, u32 particleFrame)
|
||||
{
|
||||
if (activeParticleCount >= x60_advValues.size())
|
||||
{
|
||||
CParticleGlobals::g_particleAccessParameters = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
CGenDescription* desc = x1c_genDesc.GetObj();
|
||||
|
||||
std::array<float, 8>& arr = x60_advValues[activeParticleCount];
|
||||
@@ -436,7 +442,10 @@ void CElementGen::UpdateExistingParticles()
|
||||
|
||||
x25c_activeParticleCount = 0;
|
||||
CParticleGlobals::SetEmitterTime(x74_curFrame);
|
||||
CParticleGlobals::g_particleAccessParameters = &x60_advValues[x25c_activeParticleCount];
|
||||
if (x25c_activeParticleCount < x60_advValues.size())
|
||||
CParticleGlobals::g_particleAccessParameters = &x60_advValues[x25c_activeParticleCount];
|
||||
else
|
||||
CParticleGlobals::g_particleAccessParameters = nullptr;
|
||||
|
||||
for (auto it = x30_particles.begin(); it != x30_particles.end();)
|
||||
{
|
||||
@@ -1030,13 +1039,17 @@ void CElementGen::RenderModels(const CActorLights* actorLights)
|
||||
|
||||
if (particle.x0_endFrame == -1)
|
||||
{
|
||||
++matrixIt;
|
||||
if (x2c_orientType == EModelOrientationType::One)
|
||||
++matrixIt;
|
||||
continue;
|
||||
}
|
||||
CParticleGlobals::SetParticleLifetime(particle.x0_endFrame - particle.x28_startFrame);
|
||||
int partFrame = x74_curFrame - particle.x28_startFrame - 1;
|
||||
CParticleGlobals::UpdateParticleLifetimeTweenValues(partFrame);
|
||||
CParticleGlobals::g_particleAccessParameters = &x60_advValues[i];
|
||||
if (i < x60_advValues.size())
|
||||
CParticleGlobals::g_particleAccessParameters = &x60_advValues[i];
|
||||
else
|
||||
CParticleGlobals::g_particleAccessParameters = nullptr;
|
||||
CVectorElement* pmop = desc->x6c_x58_PMOP.get();
|
||||
if (pmop)
|
||||
pmop->GetValue(partFrame, pmopVec);
|
||||
@@ -1154,7 +1167,8 @@ void CElementGen::RenderModels(const CActorLights* actorLights)
|
||||
}
|
||||
}
|
||||
|
||||
++matrixIt;
|
||||
if (x2c_orientType == EModelOrientationType::One)
|
||||
++matrixIt;
|
||||
}
|
||||
|
||||
if (desc->x45_24_x31_26_PMUS)
|
||||
@@ -1376,7 +1390,7 @@ void CElementGen::RenderParticles()
|
||||
|
||||
std::sort(sortItems.begin(), sortItems.end(),
|
||||
[](const CParticleListItem& a, const CParticleListItem& b) -> bool
|
||||
{return a.x4_viewPoint[1] >= b.x4_viewPoint[1];});
|
||||
{return a.x4_viewPoint[1] > b.x4_viewPoint[1];});
|
||||
}
|
||||
|
||||
bool moveRedToAlphaBuffer = false;
|
||||
|
||||
@@ -9,10 +9,10 @@ set(PARTICLE_SOURCES
|
||||
CUVElement.hpp CUVElement.cpp
|
||||
CEmitterElement.hpp CEmitterElement.cpp
|
||||
CParticleDataFactory.hpp CParticleDataFactory.cpp
|
||||
CSwooshDescription.hpp CSwooshDescription.cpp
|
||||
CElectricDescription.hpp CElectricDescription.cpp
|
||||
CDecalDescription.hpp CDecalDescription.cpp
|
||||
CWeaponDescription.hpp CWeaponDescription.cpp
|
||||
CSwooshDescription.hpp
|
||||
CElectricDescription.hpp
|
||||
CDecalDescription.hpp
|
||||
CWeaponDescription.hpp
|
||||
CDecalDataFactory.hpp CDecalDataFactory.cpp
|
||||
CElementGen.hpp CElementGen.cpp
|
||||
CParticleSwooshDataFactory.hpp CParticleSwooshDataFactory.cpp
|
||||
@@ -24,7 +24,7 @@ set(PARTICLE_SOURCES
|
||||
CDecal.hpp CDecal.cpp
|
||||
CDecalManager.hpp CDecalManager.cpp
|
||||
CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp
|
||||
CWarp.hpp CWarp.cpp
|
||||
CWarp.hpp
|
||||
CFlameWarp.hpp CFlameWarp.cpp
|
||||
CParticleGlobals.hpp CParticleGlobals.cpp
|
||||
${PLAT_SRCS})
|
||||
|
||||
@@ -69,13 +69,13 @@ CParticleSwoosh::CParticleSwoosh(const TToken<CSwooshDescription>& desc, int len
|
||||
{
|
||||
int maxVerts = x1b4_LENG * (x1b0_SPLN+1) * x1b8_SIDE * 4;
|
||||
m_cachedVerts.reserve(maxVerts);
|
||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||
{
|
||||
m_vertBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(CParticleSwooshShaders::Vert), maxVerts);
|
||||
m_uniformBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CMatrix4f), 1);
|
||||
CParticleSwooshShaders::BuildShaderDataBinding(ctx, *this);
|
||||
return true;
|
||||
});
|
||||
} BooTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user