1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-29 06:20:41 +00:00

fixed MAXMDIM guards

This commit is contained in:
Zeno Rogue 2019-11-03 14:19:11 +01:00
parent 02bb9d5ea5
commit 43bf7c5cfe
7 changed files with 28 additions and 17 deletions

View File

@ -406,8 +406,10 @@ struct hrmap_crystal : hrmap_standard {
bool crystal3() { return WDIM == 3; } bool crystal3() { return WDIM == 3; }
hrmap_crystal() { hrmap_crystal() {
if(crystal3()) reg3::generate(), cs.dim = 4; #if MAXMDIM >= 4
else cs.build(); if(crystal3()) reg3::generate(), cs.dim = 4; else
#endif
cs.build();
camelot_center = NULL; camelot_center = NULL;
} }

View File

@ -3791,6 +3791,8 @@ EX int ceiling_category(cell *c) {
} }
} }
#endif
EX void set_detail_level(const transmatrix& V) { EX void set_detail_level(const transmatrix& V) {
ld dist0 = hdist0(tC0(V)) - 1e-6; ld dist0 = hdist0(tC0(V)) - 1e-6;
if(vid.use_smart_range) detaillevel = 2; if(vid.use_smart_range) detaillevel = 2;
@ -3807,8 +3809,6 @@ EX void set_detail_level(const transmatrix& V) {
} }
} }
#endif
struct flashdata { struct flashdata {
int t; int t;
int size; int size;
@ -4455,7 +4455,9 @@ EX void drawthemap() {
for(int m=0; m<motypes; m++) if(isPrincess(eMonster(m))) for(int m=0; m<motypes; m++) if(isPrincess(eMonster(m)))
minf[m].name = princessgender() ? "Princess" : "Prince"; minf[m].name = princessgender() ? "Princess" : "Prince";
#if MAXMDIM >= 4
ray::in_use = ray::requested(); ray::in_use = ray::requested();
#endif
no_wall_rendering = ray::in_use; no_wall_rendering = ray::in_use;
// ray::comparison_mode = true; // ray::comparison_mode = true;
if(ray::comparison_mode) no_wall_rendering = false; if(ray::comparison_mode) no_wall_rendering = false;

View File

@ -1193,5 +1193,12 @@ EX ld raddif(ld a, ld b) {
return d; return d;
} }
EX int bucketer(ld x) {
return int(x * 10 + 100000.5) - 100000;
}
EX int bucketer(hyperpoint h) {
return bucketer(h[0]) + 1000 * bucketer(h[1]) + 1000000 * bucketer(h[2]);
}
} }

View File

@ -2011,16 +2011,14 @@ EX namespace dq {
drawqueue.emplace(h, T, band_shift); drawqueue.emplace(h, T, band_shift);
} }
#if MAXMDIM >= 4
EX set<int> visited_by_matrix; EX set<int> visited_by_matrix;
EX void enqueue_by_matrix(heptagon *h, const transmatrix& T) { EX void enqueue_by_matrix(heptagon *h, const transmatrix& T) {
if(!h) return; if(!h) return;
int b = reg3::bucketer(tC0(T)); int b = bucketer(tC0(T));
if(visited_by_matrix.count(b)) { return; } if(visited_by_matrix.count(b)) { return; }
visited_by_matrix.insert(b); visited_by_matrix.insert(b);
drawqueue.emplace(h, T, band_shift); drawqueue.emplace(h, T, band_shift);
} }
#endif
EX } EX }
EX bool do_draw(cell *c) { EX bool do_draw(cell *c) {

View File

@ -11,6 +11,8 @@ namespace hr {
EX namespace ray { EX namespace ray {
#if MAXMDIM >= 4
/** texture IDs */ /** texture IDs */
GLuint txConnections = 0, txWallcolor = 0, txTextureMap = 0; GLuint txConnections = 0, txWallcolor = 0, txTextureMap = 0;
@ -1046,6 +1048,13 @@ int readArgs() {
auto hook = addHook(hooks_args, 100, readArgs); auto hook = addHook(hooks_args, 100, readArgs);
#endif #endif
#endif
#if MAXMDIM == 3
EX always_false in_use;
EX always_false comparison_mode;
EX void reset_raycaster() { }
EX void cast() { }
#endif
EX } EX }
} }

View File

@ -28,14 +28,6 @@ EX namespace reg3 {
map<int, int> close_distances; map<int, int> close_distances;
EX int bucketer(ld x) {
return int(x * 10 + 100000.5) - 100000;
}
EX int bucketer(hyperpoint h) {
return bucketer(h[0]) + 1000 * bucketer(h[1]) + 1000000 * bucketer(h[2]);
}
EX int loop; EX int loop;
EX int face; EX int face;
@ -288,7 +280,7 @@ EX namespace reg3 {
void seek(set<int>& seen_matrices, set<int>& seen_codes, const transmatrix& at, int ccode, const hyperpoint checker) { void seek(set<int>& seen_matrices, set<int>& seen_codes, const transmatrix& at, int ccode, const hyperpoint checker) {
if(hdist0(tC0(at)) > 4) return; if(hdist0(tC0(at)) > 4) return;
int b = reg3::bucketer(tC0(at)); int b = bucketer(tC0(at));
if(seen_matrices.count(b)) return; if(seen_matrices.count(b)) return;
seen_matrices.insert(b); seen_matrices.insert(b);
for(int a=0; a<perm_group; a++) { for(int a=0; a<perm_group; a++) {

View File

@ -2,6 +2,7 @@
namespace hr { namespace hr {
#if MAXMDIM >= 4
EX ld camera_level; EX ld camera_level;
EX int get_skybrightness(int mul IS(1)) { EX int get_skybrightness(int mul IS(1)) {
@ -295,5 +296,5 @@ void celldrawer::draw_ceiling() {
} }
} }
} }
#endif
} }