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 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);
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;
#endif
}

View File

@ -577,13 +577,13 @@ void dqi_poly::gldraw() {
if((flags & POLY_CCONVEX) && !(flags & POLY_VCONVEX)) {
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]);
for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i]), line_vertices.push_back(v2[i+1]);
}
else {
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]);
for(int i=1; i<cnt; i++) line_vertices.push_back(v2[i-1]), line_vertices.push_back(v2[i]);
}

View File

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

View File

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