From 17e40c2a36bd4253b28bfcc022553ac5f26b65f4 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sun, 25 Jun 2023 07:56:08 -0700 Subject: [PATCH] [oden] Texture coordinates go the right way --- src/lib.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e432dfef..c0e5aa6a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -404,27 +404,27 @@ impl State { GraphicsCommand::Sprite(sc) => { vertices.push(Vertex { position: [sc.x, sc.y, 0.0], + tex_coords: [sc.u, sc.v + sc.sh], + }); + vertices.push(Vertex { + position: [sc.x + sc.w, sc.y, 0.0], + tex_coords: [sc.u + sc.sw, sc.v + sc.sh], + }); + vertices.push(Vertex { + position: [sc.x, sc.y + sc.h, 0.0], + tex_coords: [sc.u, sc.v], + }); + vertices.push(Vertex { + position: [sc.x, sc.y + sc.h, 0.0], tex_coords: [sc.u, sc.v], }); vertices.push(Vertex { position: [sc.x + sc.w, sc.y, 0.0], - tex_coords: [sc.u + sc.sw, sc.v], - }); - vertices.push(Vertex { - position: [sc.x, sc.y + sc.h, 0.0], - tex_coords: [sc.u, sc.v + sc.sh], - }); - vertices.push(Vertex { - position: [sc.x, sc.y + sc.h, 0.0], - tex_coords: [sc.u, sc.v + sc.sh], - }); - vertices.push(Vertex { - position: [sc.x + sc.w, sc.y, 0.0], - tex_coords: [sc.u + sc.sw, sc.v], + tex_coords: [sc.u + sc.sw, sc.v + sc.sh], }); vertices.push(Vertex { position: [sc.x + sc.w, sc.y + sc.h, 0.0], - tex_coords: [sc.u + sc.sw, sc.v + sc.sh], + tex_coords: [sc.u + sc.sw, sc.v], }); }