From 6d6766663bc3f8df72809798c113ea7799a06134 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Wed, 25 Jan 2023 11:15:14 +0100 Subject: [PATCH] Realized we can include the UV offsets into the UVs stored in the exported map file, so we don't need to add those at runtime. Easy performance win. --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index f5c166a..68b6a4b 100644 --- a/main.cpp +++ b/main.cpp @@ -187,8 +187,8 @@ int process_faces(const world_t* world, const std::vector& tex if (minT < 0 || maxT > 1) t = (t - minT) / tRange; // Rescale the UVs to the dimensions of the mipmap we've selected for our texture atlas - faceVertex.u = (unsigned char)(s * (ps1tex.w - 1)); - faceVertex.v = (unsigned char)(t * (ps1tex.h - 1)); + faceVertex.u = (unsigned char)(s * (ps1tex.w - 1)) + ps1tex.uoffs; + faceVertex.v = (unsigned char)(t * (ps1tex.h - 1)) + ps1tex.voffs; outFaceVertices.push_back(faceVertex); }