1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-04 18:52:51 +00:00

added some missing guards

This commit is contained in:
Zeno Rogue 2020-07-30 02:29:59 +02:00
parent 9d0a252d14
commit ecbd8806e7
4 changed files with 9 additions and 5 deletions

View File

@ -1299,9 +1299,9 @@ EX void check_orientation() {
} }
transmatrix next_orientation = MirrorX * getOrientation(); transmatrix next_orientation = MirrorX * getOrientation();
transmatrix T = inverse(next_orientation) * last_orientation; transmatrix T = inverse(next_orientation) * last_orientation;
if(mode == 1) unrotate(View), unrotate(cwtV); if(mode == 1) unrotate(View), unrotate(cwtV.T);
relative_matrix = change_geometry(T); relative_matrix = change_geometry(T);
if(mode == 1) rerotate(View), rerotate(cwtV); if(mode == 1) rerotate(View), rerotate(cwtV.T);
if(mode == 2) View = relative_matrix * View, last_orientation = next_orientation; if(mode == 2) View = relative_matrix * View, last_orientation = next_orientation;
#endif #endif
} }

View File

@ -577,13 +577,13 @@ void dqi_poly::gldraw() {
if((flags & POLY_CCONVEX) && !(flags & POLY_VCONVEX)) { if((flags & POLY_CCONVEX) && !(flags & POLY_VCONVEX)) {
vector<glvertex> v2(cnt+1); vector<glvertex> v2(cnt+1);
for(int i=0; i<cnt+1; i++) v2[i] = glhr::pointtogl( V * glhr::gltopoint( v[offset+i-1] ) ); for(int i=0; i<cnt+1; i++) v2[i] = glhr::pointtogl( V.T * glhr::gltopoint( v[offset+i-1] ) );
if(color) for(int i=0; i<cnt; i++) triangle_vertices.push_back(v2[0]), triangle_vertices.push_back(v2[i]), triangle_vertices.push_back(v2[i+1]); if(color) for(int i=0; i<cnt; i++) triangle_vertices.push_back(v2[0]), triangle_vertices.push_back(v2[i]), triangle_vertices.push_back(v2[i+1]);
for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i]), line_vertices.push_back(v2[i+1]); for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i]), line_vertices.push_back(v2[i+1]);
} }
else { else {
vector<glvertex> v2(cnt); vector<glvertex> v2(cnt);
for(int i=0; i<cnt; i++) v2[i] = glhr::pointtogl( V * glhr::gltopoint( v[offset+i] ) ); for(int i=0; i<cnt; i++) v2[i] = glhr::pointtogl( V.T * glhr::gltopoint( v[offset+i] ) );
if(color) for(int i=2; i<cnt-1; i++) triangle_vertices.push_back(v2[0]), triangle_vertices.push_back(v2[i-1]), triangle_vertices.push_back(v2[i]); if(color) for(int i=2; i<cnt-1; i++) triangle_vertices.push_back(v2[0]), triangle_vertices.push_back(v2[i-1]), triangle_vertices.push_back(v2[i]);
for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i-1]), line_vertices.push_back(v2[i]); for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i-1]), line_vertices.push_back(v2[i]);
} }

View File

@ -1270,9 +1270,11 @@ void hrmap::draw_at(cell *at, const shiftmatrix& where) {
drawcell(c, V); drawcell(c, V);
if(in_wallopt() && isWall3(c) && isize(dq::drawqueue) > 1000) continue; if(in_wallopt() && isWall3(c) && isize(dq::drawqueue) > 1000) continue;
#if MAXMDIM >= 4
if(reg3::ultra_mirror_in()) if(reg3::ultra_mirror_in())
for(auto& T: cgi.ultra_mirrors) for(auto& T: cgi.ultra_mirrors)
enq(c, optimized_shift(V * T)); enq(c, optimized_shift(V * T));
#endif
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
// note: need do cmove before c.spin // note: need do cmove before c.spin

View File

@ -156,6 +156,7 @@ EX namespace mapeditor {
EX void clear_dtshapes() { dtshapes.clear(); } EX void clear_dtshapes() { dtshapes.clear(); }
EX void draw_dtshapes() { EX void draw_dtshapes() {
#if CAP_EDIT
for(auto& shp: dtshapes) { for(auto& shp: dtshapes) {
if(shp == nullptr) continue; if(shp == nullptr) continue;
auto& sh = *shp; auto& sh = *shp;
@ -179,6 +180,7 @@ EX namespace mapeditor {
queueline(T * ypush0(-.1), T * ypush0(.1), dtcolor); queueline(T * ypush0(-.1), T * ypush0(.1), dtcolor);
} }
} }
#endif
} }
/** dtshapes takes ownership of sh */ /** dtshapes takes ownership of sh */