1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-22 21:23:18 +00:00

product:: virtualRebase

This commit is contained in:
Zeno Rogue 2019-08-20 16:08:15 +02:00
parent 201098efe9
commit 6c75c2687d

View File

@ -242,6 +242,17 @@ struct horo_distance {
template<class T, class U>
void virtualRebase(cell*& base, T& at, bool tohex, const U& check) {
if(prod) {
auto w = product::get_where(base);
auto d = product_decompose(check(at)).first;
at = mscale(at, -d);
product::in_underlying_map([&] { virtualRebase(w.first, at, tohex, check); });
if(d > cgi.plevel / 2) { w.second++; d -= cgi.plevel; }
if(d < -cgi.plevel / 2) { w.second--; d += cgi.plevel; }
at = mscale(at, +d);
base = product::get_at(w.first, w.second);
return;
}
if((euclid || sphere) && WDIM == 2) {
again:
if(euwrap) for(int i=0; i<6; i++) {