2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-11 20:24:01 +00:00

CFluidUVMotion: Return std::array by value from CalculateFluidTextureOffset()

Same behavior, but allows for easier use of API and makes it harder to
misuse. It also makes it easier for analysis to determine out of bounds,
given we leverage std::array rather than a pointer that causes arrays to
decay and lose their size information.
This commit is contained in:
Lioncash
2020-04-12 09:20:22 -04:00
parent 3c8619ba44
commit 14f6dd2cd8
4 changed files with 26 additions and 19 deletions

View File

@@ -18,11 +18,10 @@ CFluidPlaneShader::RenderSetupInfo CFluidPlaneDoor::RenderSetup(const CStateMana
bool noNormals) {
CFluidPlaneShader::RenderSetupInfo out;
float uvT = mgr.GetFluidPlaneManager()->GetUVT();
const float uvT = mgr.GetFluidPlaneManager()->GetUVT();
CGraphics::SetModelMatrix(xf);
float fluidUVs[3][2];
x4c_uvMotion.CalculateFluidTextureOffset(uvT, fluidUVs);
const auto fluidUVs = x4c_uvMotion.CalculateFluidTextureOffset(uvT);
out.texMtxs[0][0][0] = x4c_uvMotion.GetFluidLayers()[1].GetUVScale();
out.texMtxs[0][1][1] = x4c_uvMotion.GetFluidLayers()[1].GetUVScale();