From 518cabd99116f2ec269d5ae5d45a5da7d2a2549b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 25 Feb 2015 21:25:49 -0800 Subject: [PATCH] Correct vertex preview of throughmode rects. The texture was not highlighted correctly, since we didn't normalize all coords. --- Windows/GEDebugger/VertexPreview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Windows/GEDebugger/VertexPreview.cpp b/Windows/GEDebugger/VertexPreview.cpp index 20582d2e2c..1c18fd79f5 100644 --- a/Windows/GEDebugger/VertexPreview.cpp +++ b/Windows/GEDebugger/VertexPreview.cpp @@ -106,8 +106,8 @@ static void ExpandRectangles(std::vector &vertices, std::vector< u16 v = 0; GPUDebugVertex *vert = &newVerts[0]; u16 *ind = &newInds[0]; - for (size_t i = 0, end = numInds; i < end; i += 2) { - const auto &orig_tl = useInds ? vertices[indices[i]] : vertices[i]; + for (size_t i = 0; i < numInds; i += 2) { + const auto &orig_tl = useInds ? vertices[indices[i + 0]] : vertices[i + 0]; const auto &orig_br = useInds ? vertices[indices[i + 1]] : vertices[i + 1]; vert[0] = orig_br; @@ -219,7 +219,7 @@ void CGEDebugger::UpdatePrimPreview(u32 op) { // TODO: Probably there's a better way and place to do this. u16 minIndex = 0; - u16 maxIndex = count; + u16 maxIndex = count - 1; if (!indices.empty()) { minIndex = 0xFFFF; maxIndex = 0; @@ -235,7 +235,7 @@ void CGEDebugger::UpdatePrimPreview(u32 op) { const float invTexWidth = 1.0f / gstate_c.curTextureWidth; const float invTexHeight = 1.0f / gstate_c.curTextureHeight; - for (u16 i = minIndex; i < maxIndex; ++i) { + for (u16 i = minIndex; i <= maxIndex; ++i) { vertices[i].u *= invTexWidth; vertices[i].v *= invTexHeight; if (vertices[i].u > 1.0f || vertices[i].u < 0.0f)