From e4715a2df60e6f9d22c98875f9a13f3b8da8842b Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 20 Mar 2022 16:52:07 -0400 Subject: [PATCH] CGX: Fix sVtxDescList size --- Runtime/Graphics/CGX.cpp | 2 +- Runtime/Graphics/CGX.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/Graphics/CGX.cpp b/Runtime/Graphics/CGX.cpp index eb4283efd..8569877ad 100644 --- a/Runtime/Graphics/CGX.cpp +++ b/Runtime/Graphics/CGX.cpp @@ -4,7 +4,7 @@ namespace metaforce::CGX { SGXState sGXState{}; -std::array sVtxDescList{}; +std::array sVtxDescList{}; void ResetGXStates() noexcept { sGXState.x48_descList = 0; diff --git a/Runtime/Graphics/CGX.hpp b/Runtime/Graphics/CGX.hpp index b21ef7a4e..4e8ed6b94 100644 --- a/Runtime/Graphics/CGX.hpp +++ b/Runtime/Graphics/CGX.hpp @@ -53,7 +53,7 @@ struct SGXState { GXColor x25c_fogColor; }; extern SGXState sGXState; -extern std::array sVtxDescList; +extern std::array sVtxDescList; static inline void update_fog(u32 value) noexcept { if (sGXState.x53_fogType == GX::FOG_NONE || (sGXState.x56_blendMode & 0xE0) == (value & 0xE0)) { @@ -396,7 +396,7 @@ static inline void SetTexCoordGen(GX::TexCoordID dstCoord, u32 flags) noexcept { static inline void SetVtxDescv_Compressed(u32 descList) noexcept { u32 currentDescList = sGXState.x48_descList; if (descList != currentDescList) { - size_t remain = sVtxDescList.size(); + size_t remain = sVtxDescList.size() - 1; u32 shift = 0; u32 attrIdx = 0; do {