fixed errors with mirrors walls: monsters face the player correctly; mimics in mirrors display their X-signs correctly; player in mirror displays their X sign while previously they did not

This commit is contained in:
Zeno Rogue 2020-09-16 19:48:25 +02:00
parent b17cfbe4bc
commit 9b9e7ccaf2
2 changed files with 11 additions and 2 deletions

View File

@ -2520,6 +2520,8 @@ void celldrawer::draw_gravity_particles() {
}
}
EX shiftmatrix ocwtV;
void celldrawer::draw() {
cells_drawn++;
@ -2557,13 +2559,14 @@ void celldrawer::draw() {
cellwalker cw(c);
cellwalker cw2 = mirror::reflect(cw);
int cmc = (cw2.mirrored == cw.mirrored) ? 2 : 1;
if(inmirrorcount == 0) ocwtV = cwtV;
inmirrorcount += cmc;
draw_grid();
if(cw2.mirrored != cw.mirrored) V = V * Mirror;
if(cw2.spin) V = V * spin(2*M_PI*cw2.spin/cw2.at->type);
cw2.spin = 0;
dynamicval<shiftmatrix> dc(cwtV, cwtV);
cwtV = V * inverse_shift(gmatrix0[c], cwtV);
cwtV = V * inverse_shift(ggmatrix(cw2.at), cwtV);
drawcell(cw2.at, V);
inmirrorcount -= cmc;
return;

View File

@ -2729,7 +2729,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
if(inmirrorcount&1) mirr = !mirr;
col = mirrorcolor(geometry == gElliptic ? det(Vs.T) < 0 : mirr);
if(!mouseout() && !nospins && GDIM == 2) {
shiftpoint P2 = Vs * inverse_shift(cwtV, mouseh);
shiftpoint P2 = Vs * inverse_shift(inmirrorcount ? ocwtV : cwtV, mouseh);
queuestr(P2, 10, "x", 0xFF00);
}
if(!nospins && flipplayer) Vs = Vs * pispin;
@ -2852,6 +2852,12 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
drawPlayerEffects(Vs, c, true);
if(!mmmon) return true;
if(inmirrorcount && !mouseout() && !nospins && GDIM == 2) {
hyperpoint h = inverse_shift(ocwtV, mouseh);
if(flipplayer) h = pispin * h;
shiftpoint P2 = Vs * h;
queuestr(P2, 10, "x", 0xFF00);
}
if(hide_player()) {
first_cell_to_draw = false;