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

Player reflection and other imps

This commit is contained in:
Jack Andersen
2017-03-25 19:53:04 -10:00
parent db12dd2ea2
commit c069666307
35 changed files with 654 additions and 72 deletions

View File

@@ -978,6 +978,14 @@ void CBooRenderer::BeginScene()
void CBooRenderer::EndScene()
{
CGraphics::EndScene();
if (x2dc_reflectionAge >= 2)
{
// Delete reflection tex x14c_
}
else
{
++x2dc_reflectionAge;
}
}
void CBooRenderer::SetAmbientColor(const zeus::CColor& color)
@@ -994,6 +1002,24 @@ u32 CBooRenderer::GetFPS()
return 0;
}
void CBooRenderer::CacheReflection(TReflectionCallback cb, void* ctx, bool clearAfter)
{
if (!x318_24_refectionDirty)
return;
x318_24_refectionDirty = false;
x2dc_reflectionAge = 0;
BindReflectionDrawTarget();
SViewport backupVp = g_Viewport;
SetViewport(0, 0, 256, 256);
CGraphics::g_BooMainCommandQueue->clearTarget();
cb(ctx, CBooModel::g_ReflectViewPos);
boo::SWindowRect rect(0, 0, 256, 256);
CGraphics::g_BooMainCommandQueue->resolveBindTexture(x14c_reflectionTex, rect, false, 0, true, false);
BindMainDrawTarget();
SetViewport(backupVp.x0_left, backupVp.x4_top, backupVp.x8_width, backupVp.xc_height);
}
void CBooRenderer::DrawSpaceWarp(const zeus::CVector3f& pt, float strength)
{
m_spaceWarpFilter.setStrength(strength);