Graphics: Set default sprites size to the base color texture size, if any
This commit is contained in:
parent
6508b84e5c
commit
c144435d4a
|
|
@ -18,9 +18,11 @@ namespace Nz
|
||||||
m_color(Color::White()),
|
m_color(Color::White()),
|
||||||
m_orientation(orientation),
|
m_orientation(orientation),
|
||||||
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
||||||
m_origin(0.f, 0.f),
|
m_origin(0.f, 0.f)
|
||||||
m_size(64.f)
|
|
||||||
{
|
{
|
||||||
|
Vector2ui size = Vector2ui(GetTextureSize());
|
||||||
|
m_size = (orientation == Orientation::Horizontal) ? size.x : size.y;
|
||||||
|
|
||||||
UpdateVertices();
|
UpdateVertices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ namespace Nz
|
||||||
m_material(std::move(material)),
|
m_material(std::move(material)),
|
||||||
m_color(Color::White()),
|
m_color(Color::White()),
|
||||||
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
||||||
m_origin(0.f, 0.f),
|
m_origin(0.f, 0.f)
|
||||||
m_size(64.f, 64.f)
|
|
||||||
{
|
{
|
||||||
|
m_size = Vector2f(Vector2ui(GetTextureSize()));
|
||||||
UpdateVertices();
|
UpdateVertices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ namespace Nz
|
||||||
m_material(std::move(material)),
|
m_material(std::move(material)),
|
||||||
m_color(Color::White()),
|
m_color(Color::White()),
|
||||||
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
m_textureCoords(0.f, 0.f, 1.f, 1.f),
|
||||||
m_origin(0.f, 0.f),
|
m_origin(0.f, 0.f)
|
||||||
m_size(64.f, 64.f)
|
|
||||||
{
|
{
|
||||||
m_cornerColor.fill(Color::White());
|
m_cornerColor.fill(Color::White());
|
||||||
|
m_size = Vector2f(Vector2ui(GetTextureSize()));
|
||||||
|
|
||||||
UpdateVertices();
|
UpdateVertices();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue