mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-03 18:22:49 +00:00
2d3d:: added missing normalize and memory fix to chasmifyPoly
This commit is contained in:
parent
360f95ce43
commit
7abbd6c07a
@ -157,8 +157,9 @@ void chasmifyPoly(double fac, double fac2, int k) {
|
|||||||
auto at = [&] (ld x, ld y) {
|
auto at = [&] (ld x, ld y) {
|
||||||
x *= (isize(points) - 1);
|
x *= (isize(points) - 1);
|
||||||
int zf = int(x);
|
int zf = int(x);
|
||||||
|
if(zf == isize(points)) zf--;
|
||||||
x -= 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); });
|
||||||
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); });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user