From e23382ac7523652a910041785e299bc18c2a858f Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 18 Aug 2021 16:52:02 +0200 Subject: [PATCH] Fix mesh indices. --- prop_mesher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prop_mesher.cpp b/prop_mesher.cpp index 5fa37fc..15112cc 100644 --- a/prop_mesher.cpp +++ b/prop_mesher.cpp @@ -547,6 +547,8 @@ void PropMesher::add_tiled_wall_simple(const int width, const int height, const } void PropMesher::add_tiled_wall_mesh_rect_simple(const int x, const int y, const Transform &transform, const Rect2 &texture_rect) { + int vc = get_vertex_count(); + //x + 1, y add_normal(transform.xform(Vector3(0, 0, -1))); add_uv(transform_uv(Vector2(1, 1), texture_rect)); @@ -567,7 +569,6 @@ void PropMesher::add_tiled_wall_mesh_rect_simple(const int x, const int y, const add_uv(transform_uv(Vector2(1, 0), texture_rect)); add_vertex(transform.xform(Vector3(x + 1, y + 1, 0))); - int vc = get_vertex_count(); add_indices(vc + 2); add_indices(vc + 1); add_indices(vc + 0);