From a55ed32fa1fdf63b09c3d03c914722efbf6c0a6d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 3 Jan 2023 20:51:29 +0100 Subject: [PATCH] adjusted bringris to use mproduct and mhybrid --- rogueviz/bringris.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rogueviz/bringris.cpp b/rogueviz/bringris.cpp index 823c233b..7d917137 100644 --- a/rogueviz/bringris.cpp +++ b/rogueviz/bringris.cpp @@ -386,7 +386,7 @@ int down_dir() { return nil ? 4 : sol ? 0 : cwt.at->type-1; } int up_dir() { return nil ? 1 : sol ? 6 : cwt.at->type-2; } cell *get_at(cell *lev, int z) { - if(prod) + if(mproduct) return hybrid::get_at(lev, z); else { // auto co = nilv::get_coord(lev->master); @@ -400,7 +400,7 @@ cell *get_at(cell *lev, int z) { } int get_z(cell* c) { - if(prod) + if(mproduct) return hybrid::get_where(c).second; else if(nil) return nilv::get_coord(c->master)[1]; @@ -411,7 +411,7 @@ int get_z(cell* c) { } pair get_where(cell *what) { - if(prod) + if(mproduct) return hybrid::get_where(what); else { int z = get_z(what); @@ -444,12 +444,12 @@ cellwalker flatspin(cellwalker cw, int i) { if(solnil) cw.spin = i; else - cw.spin = gmod(cw.spin + (cw.mirrored ? -i : i), cw.at->type - (hybri ? 2 : 0)); + cw.spin = gmod(cw.spin + (cw.mirrored ? -i : i), cw.at->type - (mhybrid ? 2 : 0)); return cw; } int add_dir(cellwalker orig, int i, int sym = 0) { - if(prod) { + if(mproduct) { if(i >= orig.at->type-2) { if(sym&2) i ^= (orig.at->type-1) ^ (orig.at->type-2); return i; @@ -463,7 +463,7 @@ int add_dir(cellwalker orig, int i, int sym = 0) { } cellwalker add(cellwalker orig, int i, int sym = 0) { - if(prod) { + if(mproduct) { if(i >= orig.at->type-2) { if(sym&2) i ^= (orig.at->type-1) ^ (orig.at->type-2); orig.at = orig.at->cmove(i); @@ -496,7 +496,7 @@ vector build_shape_matrices(const code_t& code, cellwalker start, i int penalty(const vector& shape, const code_t& code) { int p = 0; - if(prod) { + if(mproduct) { int bad = shape[0].at->type-1; for(auto co: code) if(co.second == bad) p += 1000; @@ -530,7 +530,7 @@ int penalty(const vector& shape, const code_t& code) { bool builds(const vector& shape, const code_t& code, int sym = 0, int eliminate = -1) { if(isize(shape) != isize(code)+1) return false; - int ori = (solnil) ? 1 : prod ? shape[0].at->type-2 : shape[0].at->type; + int ori = (solnil) ? 1 : mproduct ? shape[0].at->type-2 : shape[0].at->type; for(auto sh: shape) for(int i=0; i shape2 = build_from(code, cellwalker(sh.at, i), sym); if(eliminate != -1) seen_blocks.emplace(as_set(shape2), eliminate); @@ -958,7 +958,7 @@ cell *shift_block_target(int dir) { void shift_block(int dir, bool camera_only) { int t = currentmap->gamestart()->type; - if(prod) t -= 2; + if(mproduct) t -= 2; if(!camera_only) remove_shape(); @@ -1025,7 +1025,7 @@ void create_matrices() { cell *c1 = c->cmove(i); dq::enqueue_by_matrix_c(c1, optimized_shift(V * currentmap->adj(c, i))); }; - if(prod) { + if(mproduct) { for(int i=0; itype-2; i++) go(i); } else if(sol) { @@ -1937,7 +1937,7 @@ void create_game() { out_level.clear(); well_center = nullptr; - if(!prod && !solnil) { + if(!mproduct && !solnil) { println(hlog, "need product or Solnil geometry"); exit(1); }