1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

2d3d:: added missing normalize and memory fix to chasmifyPoly

This commit is contained in:
Zeno Rogue 2019-05-09 22:24:42 +02:00
parent 360f95ce43
commit 7abbd6c07a

View File

@ -157,8 +157,9 @@ void chasmifyPoly(double fac, double fac2, int k) {
auto at = [&] (ld x, ld y) {
x *= (isize(points) - 1);
int zf = int(x);
if(zf == isize(points)) zf--;
x -= zf;
hpcpush(zshift(points[zf] + (points[zf+1] - points[zf]) * x, fac + (fac2-fac) * y));
hpcpush(zshift(normalize(points[zf] + (points[zf+1] - points[zf]) * x), fac + (fac2-fac) * y));
};
texture_order([&] (ld x, ld y) { at((1-x+y)/2, (1-x-y)/2); });
texture_order([&] (ld x, ld y) { at((1-x-y)/2, (1+x-y)/2); });