mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-11-03 23:33:01 +00:00 
			
		
		
		
	added CAP_RAY guard to intra stuff
This commit is contained in:
		
							
								
								
									
										2
									
								
								cell.cpp
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								cell.cpp
									
									
									
									
									
								
							@@ -1295,7 +1295,7 @@ EX vector<cell*> build_shortest_path(cell *c1, cell *c2) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
EX void clearCellMemory() {
 | 
					EX void clearCellMemory() {
 | 
				
			||||||
  #if MAXMDIM >= 4
 | 
					  #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
  if(intra::in) {
 | 
					  if(intra::in) {
 | 
				
			||||||
    intra::erase_all_maps();
 | 
					    intra::erase_all_maps();
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1219,7 +1219,7 @@ EX string cgi_string() {
 | 
				
			|||||||
  return s;
 | 
					  return s;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if MAXMDIM >= 4
 | 
					#if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
#define IFINTRA(x,y) x
 | 
					#define IFINTRA(x,y) x
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#define IFINTRA(x,y) y
 | 
					#define IFINTRA(x,y) y
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3012,7 +3012,7 @@ EX void shift_view(hyperpoint H) {
 | 
				
			|||||||
  static bool recursive = false;
 | 
					  static bool recursive = false;
 | 
				
			||||||
  if(!recursive && intra::in) {
 | 
					  if(!recursive && intra::in) {
 | 
				
			||||||
    dynamicval<bool> r(recursive, true);
 | 
					    dynamicval<bool> r(recursive, true);
 | 
				
			||||||
    #if MAXMDIM >= 4
 | 
					    #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
    intra::shift_view_portal(H);
 | 
					    intra::shift_view_portal(H);
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@ EX namespace intra {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
EX bool in;
 | 
					EX bool in;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if MAXMDIM >= 4
 | 
					#if CAP_RAY && MAXMDIM >= 4
 | 
				
			||||||
#if HDR
 | 
					#if HDR
 | 
				
			||||||
/** information per every space connected with intra-portals */
 | 
					/** information per every space connected with intra-portals */
 | 
				
			||||||
struct intra_data {
 | 
					struct intra_data {
 | 
				
			||||||
@@ -931,11 +931,15 @@ EX void handle() {
 | 
				
			|||||||
    #else
 | 
					    #else
 | 
				
			||||||
    if(false) {}
 | 
					    if(false) {}
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
 | 
					    #if CAP_RAY
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
      transmatrix M = ray::mirrorize(currentmap->ray_iadj(on_floor_of, floor_dir));
 | 
					      transmatrix M = ray::mirrorize(currentmap->ray_iadj(on_floor_of, floor_dir));
 | 
				
			||||||
      M = ToOld * M * inverse(ToOld);
 | 
					      M = ToOld * M * inverse(ToOld);
 | 
				
			||||||
      return mid(at, M * at);
 | 
					      return mid(at, M * at);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    #else
 | 
				
			||||||
 | 
					    else return at;
 | 
				
			||||||
 | 
					    #endif
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  hyperpoint at = tC0(inverse(View));
 | 
					  hyperpoint at = tC0(inverse(View));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -717,7 +717,7 @@ EX namespace mapstream {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    addToQueue(save_start());
 | 
					    addToQueue(save_start());
 | 
				
			||||||
    #if MAXMDIM >= 4
 | 
					    #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
    if(intra::in) intra::prepare_need_to_save();
 | 
					    if(intra::in) intra::prepare_need_to_save();
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
    for(int i=0; i<isize(cellbyid); i++) {
 | 
					    for(int i=0; i<isize(cellbyid); i++) {
 | 
				
			||||||
@@ -762,7 +762,7 @@ EX namespace mapstream {
 | 
				
			|||||||
      f.write(c->wparam); f.write(c->landparam);
 | 
					      f.write(c->wparam); f.write(c->landparam);
 | 
				
			||||||
      f.write_char(c->stuntime); f.write_char(c->hitpoints);
 | 
					      f.write_char(c->stuntime); f.write_char(c->hitpoints);
 | 
				
			||||||
      bool blocked = false;
 | 
					      bool blocked = false;
 | 
				
			||||||
      #if MAXMDIM >= 4
 | 
					      #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
      if(intra::in && isWall3(c) && !intra::need_to_save.count(c)) blocked = true;
 | 
					      if(intra::in && isWall3(c) && !intra::need_to_save.count(c)) blocked = true;
 | 
				
			||||||
      #endif
 | 
					      #endif
 | 
				
			||||||
      if(!blocked)
 | 
					      if(!blocked)
 | 
				
			||||||
@@ -796,7 +796,7 @@ EX namespace mapstream {
 | 
				
			|||||||
      for(int i=0; i<multi::players; i++)
 | 
					      for(int i=0; i<multi::players; i++)
 | 
				
			||||||
        f.write(cellids[multi::player[i].at]);
 | 
					        f.write(cellids[multi::player[i].at]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #if MAXMDIM >= 4
 | 
					    #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
    if(intra::in) {
 | 
					    if(intra::in) {
 | 
				
			||||||
      for(int i=0; i<isize(intra::portals_to_save); i++) {
 | 
					      for(int i=0; i<isize(intra::portals_to_save); i++) {
 | 
				
			||||||
        auto& p = intra::portals_to_save[i];
 | 
					        auto& p = intra::portals_to_save[i];
 | 
				
			||||||
@@ -1040,7 +1040,7 @@ EX namespace mapstream {
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #if MAXMDIM >= 4
 | 
					    #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
    if(intra::in) {
 | 
					    if(intra::in) {
 | 
				
			||||||
      while(true) {
 | 
					      while(true) {
 | 
				
			||||||
        char k = f.get<char>();
 | 
					        char k = f.get<char>();
 | 
				
			||||||
@@ -1100,14 +1100,14 @@ EX namespace mapstream {
 | 
				
			|||||||
    if(!f.f) return false;
 | 
					    if(!f.f) return false;
 | 
				
			||||||
    f.write(f.vernum);
 | 
					    f.write(f.vernum);
 | 
				
			||||||
    f.write(dual::state);
 | 
					    f.write(dual::state);
 | 
				
			||||||
    #if MAXMDIM >= 4
 | 
					    #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
    int q = intra::in ? isize(intra::data) : 0;
 | 
					    int q = intra::in ? isize(intra::data) : 0;
 | 
				
			||||||
    f.write(q);
 | 
					    f.write(q);
 | 
				
			||||||
    #else
 | 
					    #else
 | 
				
			||||||
    int q = 0;
 | 
					    int q = 0;
 | 
				
			||||||
    #endif
 | 
					    #endif
 | 
				
			||||||
    if(q) {
 | 
					    if(q) {
 | 
				
			||||||
      #if MAXMDIM >= 4
 | 
					      #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
      intra::prepare_to_save();
 | 
					      intra::prepare_to_save();
 | 
				
			||||||
      int qp = isize(intra::portals_to_save);
 | 
					      int qp = isize(intra::portals_to_save);
 | 
				
			||||||
      f.write(qp);
 | 
					      f.write(qp);
 | 
				
			||||||
@@ -1148,7 +1148,7 @@ EX namespace mapstream {
 | 
				
			|||||||
    if(q) {
 | 
					    if(q) {
 | 
				
			||||||
      int qp;
 | 
					      int qp;
 | 
				
			||||||
      f.read(qp);
 | 
					      f.read(qp);
 | 
				
			||||||
      #if MAXMDIM >= 4
 | 
					      #if MAXMDIM >= 4 && CAP_RAY
 | 
				
			||||||
      intra::portals_to_save.resize(qp);
 | 
					      intra::portals_to_save.resize(qp);
 | 
				
			||||||
      for(auto& ps: intra::portals_to_save) {
 | 
					      for(auto& ps: intra::portals_to_save) {
 | 
				
			||||||
        f.read(ps.spin);
 | 
					        f.read(ps.spin);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user