Skip to content

Commit

Permalink
Minor CUVElement progress
Browse files Browse the repository at this point in the history
  • Loading branch information
encounter committed Sep 18, 2024
1 parent 50bac36 commit c1e547c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Kyoto/Particles/CUVElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/Weapons/CDecal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1e547c

Please sign in to comment.