2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-15 23:37:02 +00:00

Implement water rippling and fix CFluidPlane memory access errors

This commit is contained in:
Jack Andersen
2018-06-03 15:56:21 -10:00
parent 40fdfde691
commit e63102e180
12 changed files with 86 additions and 81 deletions

View File

@@ -50,6 +50,11 @@ CFluidPlaneDoor::RenderSetup(const CStateManager& mgr, float alpha, const zeus::
return out;
}
/* Used to be part of locked cache
* These are too big for stack allocation */
static CFluidPlaneCPURender::SHFieldSample lc_heights[46][46] = {};
static u8 lc_flags[9][9] = {};
void CFluidPlaneDoor::Render(const CStateManager& mgr, float alpha, const zeus::CAABox& aabb, const zeus::CTransform& xf,
const zeus::CTransform& areaXf, bool noNormals, const zeus::CFrustum& frustum,
const std::experimental::optional<CRippleManager>& rippleManager, TUniqueId waterId,
@@ -86,10 +91,7 @@ void CFluidPlaneDoor::Render(const CStateManager& mgr, float alpha, const zeus::
CFluidPlaneCPURender::NormalMode::None,
0, 0, 0, 0, 0, 0, 0, nullptr);
CFluidPlaneCPURender::SHFieldSample heights[45][45];
u8 flags[9][9] = {};
RenderPatch(patchInfo, heights, flags, true, true, m_verts);
RenderPatch(patchInfo, lc_heights, lc_flags, true, true, m_verts);
}
}
}