Graphics: Add origin to all sprite-based renderables (and made it a factor)

This commit is contained in:
SirLynix
2022-12-17 14:48:50 +01:00
parent 0537be3201
commit d4422c4102
12 changed files with 98 additions and 38 deletions

View File

@@ -27,6 +27,7 @@ namespace Nz
m_layers(materialCount),
m_mapSize(mapSize),
m_tileSize(tileSize),
m_origin(0.f, 0.f),
m_isometricModeEnabled(false),
m_shouldRebuildVertices(false)
{
@@ -120,9 +121,8 @@ namespace Nz
m_vertices.resize(spriteCount * 4);
VertexStruct_XYZ_Color_UV* vertexPtr = reinterpret_cast<VertexStruct_XYZ_Color_UV*>(m_vertices.data());
Vector3f originShift = m_origin * GetSize();
float topCorner = m_tileSize.y * (m_mapSize.y - 1);
Vector3f originShift = m_origin * GetSize();
for (const Layer& layer : m_layers)
{