mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-26 21:37:02 +00:00
2d3d:: missing guards
This commit is contained in:
parent
70cd6c0669
commit
d07e6eb386
@ -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;
|
||||
};
|
||||
});
|
||||
|
16
graph.cpp
16
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<isize(ptds); i++) {
|
||||
auto pp = dynamic_cast<dqi_poly*> (&*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() {
|
||||
|
10
hypgraph.cpp
10
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user