tr1/output: fix sprite UVs

Resolves #2672.
This commit is contained in:
Marcin Kurczewski 2025-04-07 12:34:19 +02:00
parent 264c18c1c8
commit 8cde0e45e2
2 changed files with 5 additions and 4 deletions

View file

@ -9,6 +9,7 @@
- fixed sprites rendering black if no shade value is assigned in the level (#2701, regression from 4.9)
- fixed being stuck on the Restart Level page if using save crystals and F5 is pressed when no saves are present (#2700, regression from 4.8.2)
- fixed being stuck on the Exit to Title page if using save crystals and a new save is made when there were previously none, and then F5 is pressed (#2700, regression from 4.9)
- fixed the sprite UVs to restore the right and bottom edge pixels (regression from 4.8)
- improved rendering performance
- removed the pretty pixels options (it's now always enabled, #2258)

View file

@ -201,8 +201,8 @@ static void M_FillAtlasSpriteSize(const int32_t i)
const float adj = 0.1 / 256.0f;
const float u0 = (sprite->offset & 0xFF) / 256.0f + adj;
const float v0 = (sprite->offset >> 8) / 256.0f + adj;
const float u1 = u0 + (sprite->width >> 8) / 256.0f - 2 * adj;
const float v1 = v0 + (sprite->height >> 8) / 256.0f - 2 * adj;
const float u1 = u0 + sprite->width / 65536.0f - 2 * adj;
const float v1 = v0 + sprite->height / 65536.0f - 2 * adj;
size->x0 = u0;
size->y0 = v0;
size->x1 = u1;
@ -226,8 +226,8 @@ static void M_FillSpriteUVW(const int32_t i)
const float adj = 0.1 / 256.0f;
const float u0 = (sprite->offset & 0xFF) / 256.0f + adj;
const float v0 = (sprite->offset >> 8) / 256.0f + adj;
const float u1 = u0 + (sprite->width >> 8) / 256.0f - 2 * adj;
const float v1 = v0 + (sprite->height >> 8) / 256.0f - 2 * adj;
const float u1 = u0 + sprite->width / 65536.0f - 2 * adj;
const float v1 = v0 + sprite->height / 65536.0f - 2 * adj;
M_UVW *const corners = m_Priv.uvws.data_sprites[i].corners;
// clang-format off
corners[0].u = u0; corners[0].v = v0; corners[0].w = sprite->tex_page;