From dca8af4d96a9a9fcf9426a02963b1513c96d8211 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 3 Feb 2022 07:26:33 -0800 Subject: [PATCH] Fix division on packed normals --- Runtime/Graphics/CCubeModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Graphics/CCubeModel.cpp b/Runtime/Graphics/CCubeModel.cpp index fab9dd65e..0034690f5 100644 --- a/Runtime/Graphics/CCubeModel.cpp +++ b/Runtime/Graphics/CCubeModel.cpp @@ -64,8 +64,8 @@ CModel::CModel(std::unique_ptr in, u32 dataLen, IObjectStore* store) m_normals.emplace_back(hecl::SBig(norm[0]), hecl::SBig(norm[1]), hecl::SBig(norm[2])); } else { const auto* norm = reinterpret_cast(normals + (i * (sizeof(s16) * 3))); - m_normals.emplace_back(hecl::SBig(norm[0]) / 32676.f, hecl::SBig(norm[1]) / 32676.f, - hecl::SBig(norm[2]) / 32676.f); + m_normals.emplace_back(hecl::SBig(norm[0]) / 32767.f, hecl::SBig(norm[1]) / 32767.f, + hecl::SBig(norm[2]) / 32767.f); } } u32 numColors = hecl::SBig(*secSizeCur) / (sizeof(int));