From b0c34c4f2c5eeccec1487bdb06968872e2772a3f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 9 May 2022 14:53:41 +0200 Subject: [PATCH] added CAP_RAY guard to intra stuff --- cell.cpp | 2 +- geometry.cpp | 2 +- hypgraph.cpp | 2 +- intra.cpp | 6 +++++- mapeditor.cpp | 14 +++++++------- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/cell.cpp b/cell.cpp index 68b3cb12..536e598b 100644 --- a/cell.cpp +++ b/cell.cpp @@ -1295,7 +1295,7 @@ EX vector build_shortest_path(cell *c1, cell *c2) { } EX void clearCellMemory() { - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY if(intra::in) { intra::erase_all_maps(); return; diff --git a/geometry.cpp b/geometry.cpp index 13b9c642..a1b99d16 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1219,7 +1219,7 @@ EX string cgi_string() { return s; } -#if MAXMDIM >= 4 +#if MAXMDIM >= 4 && CAP_RAY #define IFINTRA(x,y) x #else #define IFINTRA(x,y) y diff --git a/hypgraph.cpp b/hypgraph.cpp index 06b45a3b..bb654cd5 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -3012,7 +3012,7 @@ EX void shift_view(hyperpoint H) { static bool recursive = false; if(!recursive && intra::in) { dynamicval r(recursive, true); - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY intra::shift_view_portal(H); #endif return; diff --git a/intra.cpp b/intra.cpp index 26103465..6d321508 100644 --- a/intra.cpp +++ b/intra.cpp @@ -6,7 +6,7 @@ EX namespace intra { EX bool in; -#if MAXMDIM >= 4 +#if CAP_RAY && MAXMDIM >= 4 #if HDR /** information per every space connected with intra-portals */ struct intra_data { @@ -931,11 +931,15 @@ EX void handle() { #else if(false) {} #endif + #if CAP_RAY else { transmatrix M = ray::mirrorize(currentmap->ray_iadj(on_floor_of, floor_dir)); M = ToOld * M * inverse(ToOld); return mid(at, M * at); } + #else + else return at; + #endif }; hyperpoint at = tC0(inverse(View)); diff --git a/mapeditor.cpp b/mapeditor.cpp index 8c3d1710..59e21ea7 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -717,7 +717,7 @@ EX namespace mapstream { } addToQueue(save_start()); - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY if(intra::in) intra::prepare_need_to_save(); #endif for(int i=0; iwparam); f.write(c->landparam); f.write_char(c->stuntime); f.write_char(c->hitpoints); bool blocked = false; - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY if(intra::in && isWall3(c) && !intra::need_to_save.count(c)) blocked = true; #endif if(!blocked) @@ -796,7 +796,7 @@ EX namespace mapstream { for(int i=0; i= 4 + #if MAXMDIM >= 4 && CAP_RAY if(intra::in) { for(int i=0; i= 4 + #if MAXMDIM >= 4 && CAP_RAY if(intra::in) { while(true) { char k = f.get(); @@ -1100,14 +1100,14 @@ EX namespace mapstream { if(!f.f) return false; f.write(f.vernum); f.write(dual::state); - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY int q = intra::in ? isize(intra::data) : 0; f.write(q); #else int q = 0; #endif if(q) { - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY intra::prepare_to_save(); int qp = isize(intra::portals_to_save); f.write(qp); @@ -1148,7 +1148,7 @@ EX namespace mapstream { if(q) { int qp; f.read(qp); - #if MAXMDIM >= 4 + #if MAXMDIM >= 4 && CAP_RAY intra::portals_to_save.resize(qp); for(auto& ps: intra::portals_to_save) { f.read(ps.spin);