From c1e547cd4f4c1d5b8acc959bdbe77a6d8f6958e7 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 18 Sep 2024 00:46:52 -0600 Subject: [PATCH] Minor CUVElement progress --- src/Kyoto/Particles/CUVElement.cpp | 16 +++++++--------- src/Weapons/CDecal.cpp | 4 ++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Kyoto/Particles/CUVElement.cpp b/src/Kyoto/Particles/CUVElement.cpp index f56f080a..70e67378 100644 --- a/src/Kyoto/Particles/CUVElement.cpp +++ b/src/Kyoto/Particles/CUVElement.cpp @@ -45,18 +45,16 @@ CUVEAnimTexture::CUVEAnimTexture(TToken< CTexture > tex, CIntElement* tileW, CIn const int xTiles = rstl::max_val(1, width / x18_strideW); const int yTiles = rstl::max_val(1, height / x1c_strideH); - int tiles = xTiles * yTiles; - x20_tiles = tiles; - x2c_uvElems.reserve(tiles); + x20_tiles = xTiles * yTiles; + x2c_uvElems.reserve(xTiles * yTiles); for (int y = yTiles - 1; y >= 0; --y) { for (int x = 0; x < xTiles; ++x) { - SUVElementSet uvs = { - float(x18_strideW * x) / float(width), - float(x1c_strideH * y) / float(height), - float(x18_strideW * x + x10_tileW) / float(width), - float(x1c_strideH * y + x14_tileH) / float(height), - }; + SUVElementSet uvs; + uvs.xMin = float(x18_strideW * x) / float(width); + uvs.yMin = float(x1c_strideH * y) / float(height); + uvs.xMax = float(x18_strideW * x + x10_tileW) / float(width); + uvs.yMax = float(x1c_strideH * y + x14_tileH) / float(height); x2c_uvElems.push_back(uvs); } } diff --git a/src/Weapons/CDecal.cpp b/src/Weapons/CDecal.cpp index ebaf4863..2b64b1b2 100644 --- a/src/Weapons/CDecal.cpp +++ b/src/Weapons/CDecal.cpp @@ -75,6 +75,10 @@ void CDecal::RenderQuad(CQuadDecal& decal, const CDecalDescription::SQuadDescr& } SUVElementSet uvSet; + uvSet.xMin = 0.f; + uvSet.xMax = 1.f; + uvSet.yMin = 0.f; + uvSet.yMax = 1.f; if (!desc.x14_TEX.null()) { TLockedToken< CTexture > tex = desc.x14_TEX->GetValueTexture(x58_frameIdx); tex->Load(GX_TEXMAP0, CTexture::kCM_Repeat);