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

Big fixes and big memory leak refactor (linux only for now)

This commit is contained in:
Jack Andersen
2018-05-19 20:14:57 -10:00
parent 5f03362149
commit f60af632b3
84 changed files with 849 additions and 689 deletions

View File

@@ -15,6 +15,8 @@ boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_texAdditiveZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAlphaZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAdditiveZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAlphaZGEqual;
boo::ObjToken<boo::IVertexFormat> CLineRendererShaders::m_texVtxFmt;
boo::ObjToken<boo::IVertexFormat> CLineRendererShaders::m_noTexVtxFmt;
@@ -25,8 +27,8 @@ void CLineRendererShaders::Initialize()
if (!CGraphics::g_BooFactory)
return;
CGraphics::CommitResources(
[&](boo::IGraphicsDataFactory::Context& ctx) -> bool
CGraphicsCommitResources(
[&](boo::IGraphicsDataFactory::Context& ctx)
{
switch (ctx.platform())
{
@@ -67,6 +69,7 @@ void CLineRendererShaders::Shutdown()
m_texAdditiveZ.reset();
m_noTexAlphaZ.reset();
m_noTexAdditiveZ.reset();
m_noTexAlphaZGEqual.reset();
m_texVtxFmt.reset();
m_noTexVtxFmt.reset();
}
@@ -74,10 +77,15 @@ void CLineRendererShaders::Shutdown()
void CLineRendererShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CLineRenderer& renderer,
const boo::ObjToken<boo::ITexture>& texture,
bool additive, bool zTest)
bool additive, bool zTest, bool zGEqual)
{
boo::ObjToken<boo::IShaderPipeline> pipeline;
if (zTest)
if (zGEqual)
{
pipeline = m_noTexAlphaZGEqual;
}
else if (zTest)
{
if (texture)
{