Skip to content

Commit 7320c45

Browse files
author
Morgan Christiansson
committed
Fix vertical wrap triangle
1 parent 30021b8 commit 7320c45

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

CSurface.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,14 @@ void CSurface::DrawTriangleField(SDL_Surface* display, const DisplayRectangle& d
439439
// Odd rows have no I/O shift, P2 = (w-1, y) reads file(w-1, y) correctly.
440440
{
441441
const int w = static_cast<int>(width);
442+
MapNode tP1 = myMap.getVertex(0, y + 1);
443+
tP1.x = myMap.getVertex(w - 1, y + 1).x + triangleWidth;
442444
MapNode tP3 = myMap.getVertex(0, y);
443445
tP3.x = myMap.getVertex(w - 1, y).x + triangleWidth;
444446
DrawTriangle(display, displayRect, myMap, type,
445-
myMap.getVertex(0, y + 1), // P1 = SE(w-1, y) wraps to (0, y+1)
446-
myMap.getVertex(w - 1, y), // P2 = pt (reads usdTexture)
447-
tP3); // P3 = E(w-1, y) wraps to (0, y)
447+
tP1, // P1 = SE(w-1, y) with x-shifted
448+
myMap.getVertex(w - 1, y), // P2 = pt
449+
tP3); // P3 = E(w-1, y) with x-shifted
448450
}
449451
}
450452
}

0 commit comments

Comments
 (0)