From d07e6eb3862de0cd84f2d1d959940315211eb64a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 10 May 2019 03:16:40 +0200 Subject: [PATCH] 2d3d:: missing guards --- config.cpp | 2 ++ graph.cpp | 16 ++++++++++++++++ hypgraph.cpp | 10 ++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/config.cpp b/config.cpp index 1bba4008..7d7e03d7 100644 --- a/config.cpp +++ b/config.cpp @@ -1213,10 +1213,12 @@ void add_edit_wall_quality(char c) { dialog::bound_low(1); dialog::bound_up(128); dialog::reaction = [] { + #if MAXMDIM >= 4 if(floor_textures) { delete floor_textures; floor_textures = NULL; } + #endif need_reset_geometry = true; }; }); diff --git a/graph.cpp b/graph.cpp index 6d70acba..c4e8b6ad 100644 --- a/graph.cpp +++ b/graph.cpp @@ -3720,6 +3720,7 @@ int gridcolor(cell *c1, cell *c2) { #if CAP_SHAPES void pushdown(cell *c, int& q, const transmatrix &V, double down, bool rezoom, bool repriority) { + #if MAXMDIM >= 4 if(GDIM == 3) { for(int i=q; i (&*ptds[q++]); @@ -3729,6 +3730,7 @@ void pushdown(cell *c, int& q, const transmatrix &V, double down, bool rezoom, b } return; } + #endif // since we might be changing priorities, we have to make sure that we are sorting correctly if(down > 0 && repriority) { @@ -5016,9 +5018,11 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { c->land == laRedRock || vid.darkhepta || (c->land == laClearing && !BITRUNCATED))) { + #if MAXMDIM >= 4 if(DIM == 3 && WDIM == 2) queuepoly((*Vdp)*zpush(geom3::FLOOR), shHeptaMarker, wmblack ? 0x80808080 : 0x00000080); else + #endif queuepoly((*Vdp), shHeptaMarker, wmblack ? 0x80808080 : 0x00000080); } @@ -5138,7 +5142,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { case waLadder: if(DIM == 3) { + #if MAXMDIM >= 4 draw_shapevec(c, V * zpush(-geom3::human_height/20), shMFloor.levels[0], 0x804000FF, PPR::FLOOR+1); + #endif } else if(euclid) { draw_floorshape(c, V, shMFloor, 0x804000FF); @@ -5202,8 +5208,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { transmatrix V2 = V; if(wmescher && geosupport_football() == 2 && pseudohept(c) && c->land == laPalace) V2 = V * spin(M_PI / c->type); if(DIM == 3) { + #if MAXMDIM >= 4 draw_shapevec(c, V2 * zpush(-geom3::human_height/40), shMFloor.levels[0], darkena(winf[c->wall].color, 0, 0xFF)); draw_shapevec(c, V2 * zpush(-geom3::human_height/20), shMFloor2.levels[0], (!wmblack) ? darkena(fcol, 1, 0xFF) : darkena(0,1,0xFF)); + #endif } else { draw_floorshape(c, V2, shMFloor, darkena(winf[c->wall].color, 0, 0xFF)); @@ -5261,10 +5269,12 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { break; case waFan: + #if MAXMDIM >= 4 if(DIM == 3) for(int a=0; a<10; a++) queuepoly(V * zpush(geom3::FLOOR + (geom3::WALL - geom3::FLOOR) * a/10.) * spin(a *degree) * spintick(PURE ? -1000 : -500, 1/12.), shFan, darkena(wcol, 0, 0xFF)); else + #endif queuepoly(V * spintick(PURE ? -1000 : -500, 1/12.), shFan, darkena(wcol, 0, 0xFF)); break; @@ -5277,8 +5287,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { case waFireTrap: if(DIM == 3) { + #if MAXMDIM >= 4 draw_shapevec(c, V * zpush(-geom3::human_height/40), shMFloor.levels[0], darkena(0xC00000, 0, 0xFF)); draw_shapevec(c, V * zpush(-geom3::human_height/20), shMFloor2.levels[0], darkena(0x600000, 0, 0xFF)); + #endif } else { draw_floorshape(c, V, shMFloor, darkena(0xC00000, 0, 0xFF)); @@ -6172,14 +6184,18 @@ ld wall_radar(cell *c, transmatrix T) { void make_actual_view() { sphereflip = Id; + #if MAXMDIM >= 4 if(WDIM == 3 && !shmup::on && vid.yshift) { actual_view_transform = cpush(2, wall_radar(viewctr.at->c7, inverse(View))); return; } if(WDIM == 3) { actual_view_transform = Id; return; } + #endif if(sphereflipped()) sphereflip[DIM][DIM] = -1; actual_view_transform = ypush(vid.yshift) * sphereflip; + #if MAXMDIM >= 4 if(geom3::always3) actual_view_transform = zpush(+geom3::camera) * actual_view_transform; + #endif } transmatrix cview() { diff --git a/hypgraph.cpp b/hypgraph.cpp index 3b5aa742..969caf73 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1091,6 +1091,7 @@ void centerpc(ld aspd) { crystal::centerrug(aspd); #endif + #if MAXMDIM >= 4 if(shmup::on && vid.sspeed > -5 && DIM == 3) { int id = subscreens::in ? subscreens::current_player : 0; viewctr = shmup::pc[id]->base->master; @@ -1107,6 +1108,7 @@ void centerpc(ld aspd) { #endif return; } + #endif #if CAP_RACING if(racing::on && !racing::standard_centering) { @@ -1122,8 +1124,12 @@ void centerpc(ld aspd) { ors::unrotate(cwtV); ors::unrotate(View); transmatrix T = cwtV; - int sl = snakelevel(cwt.at); - if(sl) T = T * zpush(geom3::SLEV[sl] - geom3::FLOOR); + #if MAXMDIM >= 4 + if(GDIM == 3 && WDIM == 2) { + int sl = snakelevel(cwt.at); + if(sl) T = T * zpush(geom3::SLEV[sl] - geom3::FLOOR); + } + #endif hyperpoint H = inverse(actual_view_transform) * tC0(T); ld R = zero_d(DIM, H) ? 0 : hdist0(H); if(R < 1e-9) {