|
@@ -33,9 +33,6 @@
|
|
|
namespace Rml {
|
|
namespace Rml {
|
|
|
namespace Core {
|
|
namespace Core {
|
|
|
|
|
|
|
|
-static bool read_texel_offset = false;
|
|
|
|
|
-static Vector2f texel_offset;
|
|
|
|
|
-
|
|
|
|
|
Geometry::Geometry(Element* _host_element)
|
|
Geometry::Geometry(Element* _host_element)
|
|
|
{
|
|
{
|
|
|
host_element = _host_element;
|
|
host_element = _host_element;
|
|
@@ -43,7 +40,6 @@ Geometry::Geometry(Element* _host_element)
|
|
|
|
|
|
|
|
texture = nullptr;
|
|
texture = nullptr;
|
|
|
|
|
|
|
|
- fixed_texcoords = false;
|
|
|
|
|
compile_attempted = false;
|
|
compile_attempted = false;
|
|
|
compiled_geometry = 0;
|
|
compiled_geometry = 0;
|
|
|
}
|
|
}
|
|
@@ -55,7 +51,6 @@ Geometry::Geometry(Context* _host_context)
|
|
|
|
|
|
|
|
texture = nullptr;
|
|
texture = nullptr;
|
|
|
|
|
|
|
|
- fixed_texcoords = false;
|
|
|
|
|
compile_attempted = false;
|
|
compile_attempted = false;
|
|
|
compiled_geometry = 0;
|
|
compiled_geometry = 0;
|
|
|
}
|
|
}
|
|
@@ -103,26 +98,6 @@ void Geometry::Render(const Vector2f& translation)
|
|
|
|
|
|
|
|
if (!compile_attempted)
|
|
if (!compile_attempted)
|
|
|
{
|
|
{
|
|
|
- if (!fixed_texcoords)
|
|
|
|
|
- {
|
|
|
|
|
- fixed_texcoords = true;
|
|
|
|
|
-
|
|
|
|
|
- if (!read_texel_offset)
|
|
|
|
|
- {
|
|
|
|
|
- read_texel_offset = true;
|
|
|
|
|
- texel_offset.x = render_interface->GetHorizontalTexelOffset();
|
|
|
|
|
- texel_offset.y = render_interface->GetVerticalTexelOffset();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Add a half-texel offset if required.
|
|
|
|
|
- if (texel_offset.x != 0 ||
|
|
|
|
|
- texel_offset.y != 0)
|
|
|
|
|
- {
|
|
|
|
|
- for (size_t i = 0; i < vertices.size(); ++i)
|
|
|
|
|
- vertices[i].position += texel_offset;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
compile_attempted = true;
|
|
compile_attempted = true;
|
|
|
compiled_geometry = render_interface->CompileGeometry(&vertices[0], (int) vertices.size(), &indices[0], (int) indices.size(), texture != nullptr ? texture->GetHandle(GetRenderInterface()) : 0);
|
|
compiled_geometry = render_interface->CompileGeometry(&vertices[0], (int) vertices.size(), &indices[0], (int) indices.size(), texture != nullptr ? texture->GetHandle(GetRenderInterface()) : 0);
|
|
|
|
|
|
|
@@ -180,7 +155,6 @@ void Geometry::Release(bool clear_buffers)
|
|
|
{
|
|
{
|
|
|
vertices.clear();
|
|
vertices.clear();
|
|
|
indices.clear();
|
|
indices.clear();
|
|
|
- fixed_texcoords = false;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|