diff --git a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp b/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp index 5f246dd1..d47763cd 100644 --- a/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp +++ b/src/nostalgia/modules/core/include/nostalgia/core/gfx.hpp @@ -23,6 +23,9 @@ struct Sprite { unsigned spriteShape = 0; unsigned spriteSize = 0; unsigned flipX = 0; + /** + * Valid priorities: 0-3 + */ unsigned priority = 0; }; diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/core/src/opengl/gfx.cpp index 30b20b44..5931c02c 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/core/src/opengl/gfx.cpp @@ -113,7 +113,7 @@ static void setSpriteBufferObject( y *= -ymod; x -= 1.f; y += 1.f - ymod; - auto const prif = static_cast(priority) * 0.1f; + auto const prif = static_cast(priority) * 0.01f; auto const textureRowf = static_cast(textureRow); float const L = flipX ? 1 : 0; float const R = flipX ? 0 : 1; @@ -416,7 +416,7 @@ static void setSprite( fY, s.tileIdx + i, s.flipX, - s.priority, + s.priority & 0b11, vbo, ebo); ++i;