[nostalgia/core] Specify a maximum for priority level

This commit is contained in:
Gary Talent 2023-12-19 23:06:14 -06:00
parent 0093778f64
commit 8dd6adc554
2 changed files with 5 additions and 2 deletions

View File

@ -23,6 +23,9 @@ struct Sprite {
unsigned spriteShape = 0; unsigned spriteShape = 0;
unsigned spriteSize = 0; unsigned spriteSize = 0;
unsigned flipX = 0; unsigned flipX = 0;
/**
* Valid priorities: 0-3
*/
unsigned priority = 0; unsigned priority = 0;
}; };

View File

@ -113,7 +113,7 @@ static void setSpriteBufferObject(
y *= -ymod; y *= -ymod;
x -= 1.f; x -= 1.f;
y += 1.f - ymod; y += 1.f - ymod;
auto const prif = static_cast<float>(priority) * 0.1f; auto const prif = static_cast<float>(priority) * 0.01f;
auto const textureRowf = static_cast<float>(textureRow); auto const textureRowf = static_cast<float>(textureRow);
float const L = flipX ? 1 : 0; float const L = flipX ? 1 : 0;
float const R = flipX ? 0 : 1; float const R = flipX ? 0 : 1;
@ -416,7 +416,7 @@ static void setSprite(
fY, fY,
s.tileIdx + i, s.tileIdx + i,
s.flipX, s.flipX,
s.priority, s.priority & 0b11,
vbo, vbo,
ebo); ebo);
++i; ++i;