2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 16:24:55 +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

@@ -1607,7 +1607,8 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
alpha *= mapAlpha;
zeus::CColor modColor = g_tweakAutoMapper->GetMiniMapSamusModColor();
modColor.a *= alpha;
CModelFlags flags(5, 0, 3 | 8 | 1, modColor);
CModelFlags flags(5, 0, 8 | 1, modColor); /* Depth GEqual */
flags.m_extendedShader = EExtendedShader::DepthGEqualNoZWrite;
x30_miniMapSamus->Draw(flags);
}
if (IsInMapperState(EAutoMapperState::MapScreen))

View File

@@ -54,7 +54,7 @@ void CMapArea::PostConstruct()
m_surfaces.back().PostConstruct(x44_buf.get(), index);
}
CGraphics::CommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx)
CGraphicsCommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx)
{
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, m_verts.data(), 16, m_verts.size());
m_ibo = ctx.newStaticBuffer(boo::BufferUse::Index, index.data(), 4, index.size());
@@ -84,7 +84,8 @@ void CMapArea::PostConstruct()
u32 count = r.readUint32Big();
r.seek(count);
r.seekAlign4();
linePrims.emplace_back(ctx, CLineRenderer::EPrimitiveMode::LineStrip, count, nullptr, false);
linePrims.emplace_back(ctx, CLineRenderer::EPrimitiveMode::LineStrip, count,
nullptr, false, false, true);
}
}
}

View File

@@ -294,7 +294,7 @@ void CMappableObject::ReadAutoMapperTweaks(const ITweakAutoMapper& tweaks)
doorVerts[6].assign(.2f * -center.z, center.y, 0.f);
doorVerts[7].assign(.2f * -center.z, center.y, 2.f * center.x);
CGraphics::CommitResources([](boo::IGraphicsDataFactory::Context& ctx)
CGraphicsCommitResources([](boo::IGraphicsDataFactory::Context& ctx)
{
g_doorVbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, skDoorVerts, 16, 8);
g_doorIbo = ctx.newStaticBuffer(boo::BufferUse::Index, DoorIndices, 4, 24);

View File

@@ -74,7 +74,7 @@ private:
CLineRenderer m_outline;
DoorSurface(boo::IGraphicsDataFactory::Context& ctx)
: m_surface(ctx, g_doorVbo, g_doorIbo),
m_outline(ctx, CLineRenderer::EPrimitiveMode::LineLoop, 5, nullptr, false)
m_outline(ctx, CLineRenderer::EPrimitiveMode::LineLoop, 5, nullptr, false, false, true)
{}
};
std::experimental::optional<DoorSurface> m_doorSurface;