Minor CUVElement progress

This commit is contained in:
Luke Street 2024-09-18 00:46:52 -06:00
parent 50bac36770
commit c1e547cd4f
2 changed files with 11 additions and 9 deletions

View File

@ -45,18 +45,16 @@ CUVEAnimTexture::CUVEAnimTexture(TToken< CTexture > tex, CIntElement* tileW, CIn
const int xTiles = rstl::max_val(1, width / x18_strideW); const int xTiles = rstl::max_val(1, width / x18_strideW);
const int yTiles = rstl::max_val(1, height / x1c_strideH); const int yTiles = rstl::max_val(1, height / x1c_strideH);
int tiles = xTiles * yTiles; x20_tiles = xTiles * yTiles;
x20_tiles = tiles; x2c_uvElems.reserve(xTiles * yTiles);
x2c_uvElems.reserve(tiles);
for (int y = yTiles - 1; y >= 0; --y) { for (int y = yTiles - 1; y >= 0; --y) {
for (int x = 0; x < xTiles; ++x) { for (int x = 0; x < xTiles; ++x) {
SUVElementSet uvs = { SUVElementSet uvs;
float(x18_strideW * x) / float(width), uvs.xMin = float(x18_strideW * x) / float(width);
float(x1c_strideH * y) / float(height), uvs.yMin = float(x1c_strideH * y) / float(height);
float(x18_strideW * x + x10_tileW) / float(width), uvs.xMax = float(x18_strideW * x + x10_tileW) / float(width);
float(x1c_strideH * y + x14_tileH) / float(height), uvs.yMax = float(x1c_strideH * y + x14_tileH) / float(height);
};
x2c_uvElems.push_back(uvs); x2c_uvElems.push_back(uvs);
} }
} }

View File

@ -75,6 +75,10 @@ void CDecal::RenderQuad(CQuadDecal& decal, const CDecalDescription::SQuadDescr&
} }
SUVElementSet uvSet; SUVElementSet uvSet;
uvSet.xMin = 0.f;
uvSet.xMax = 1.f;
uvSet.yMin = 0.f;
uvSet.yMax = 1.f;
if (!desc.x14_TEX.null()) { if (!desc.x14_TEX.null()) {
TLockedToken< CTexture > tex = desc.x14_TEX->GetValueTexture(x58_frameIdx); TLockedToken< CTexture > tex = desc.x14_TEX->GetValueTexture(x58_frameIdx);
tex->Load(GX_TEXMAP0, CTexture::kCM_Repeat); tex->Load(GX_TEXMAP0, CTexture::kCM_Repeat);