1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

fixed spiral/hilbert tracks

This commit is contained in:
Zeno Rogue 2024-08-18 21:17:50 +02:00
parent 4e450d4330
commit 9d680953e2

View File

@ -613,7 +613,7 @@ struct complex_surface {
hyperpoint cur;
map<pair<int, int>, surface_fun> blocks;
static transmatrix flatpush(hyperpoint h) { return rgpushxto0(point31(h[0], h[1], rot_plane(h))); }
static transmatrix flatpush(hyperpoint h) { return rgpushxto0(point31(h[0], h[1], 0)); }
static transmatrix hpush(hyperpoint h) { h[1] = 0; h[2] = 0; return flatpush(h); }
static transmatrix vpush(hyperpoint h) { h[0] = 0; h[2] = 0; return flatpush(h); }
@ -751,7 +751,7 @@ struct complex_surface {
ld get(hyperpoint h) {
int ax = int(floor(h[0] / 4));
int ay = int(floor(h[1] / 4));
if(blocks.count({ax, ay})) return blocks[{ax, ay}] (h);
if(blocks.count({ax, ay})) return blocks[{ax, ay}] (h) + h[0] * h[1] / 2;
return 0;
}