mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
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:
parent
b17cfbe4bc
commit
9b9e7ccaf2
@ -2520,6 +2520,8 @@ void celldrawer::draw_gravity_particles() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX shiftmatrix ocwtV;
|
||||||
|
|
||||||
void celldrawer::draw() {
|
void celldrawer::draw() {
|
||||||
|
|
||||||
cells_drawn++;
|
cells_drawn++;
|
||||||
@ -2557,13 +2559,14 @@ void celldrawer::draw() {
|
|||||||
cellwalker cw(c);
|
cellwalker cw(c);
|
||||||
cellwalker cw2 = mirror::reflect(cw);
|
cellwalker cw2 = mirror::reflect(cw);
|
||||||
int cmc = (cw2.mirrored == cw.mirrored) ? 2 : 1;
|
int cmc = (cw2.mirrored == cw.mirrored) ? 2 : 1;
|
||||||
|
if(inmirrorcount == 0) ocwtV = cwtV;
|
||||||
inmirrorcount += cmc;
|
inmirrorcount += cmc;
|
||||||
draw_grid();
|
draw_grid();
|
||||||
if(cw2.mirrored != cw.mirrored) V = V * Mirror;
|
if(cw2.mirrored != cw.mirrored) V = V * Mirror;
|
||||||
if(cw2.spin) V = V * spin(2*M_PI*cw2.spin/cw2.at->type);
|
if(cw2.spin) V = V * spin(2*M_PI*cw2.spin/cw2.at->type);
|
||||||
cw2.spin = 0;
|
cw2.spin = 0;
|
||||||
dynamicval<shiftmatrix> dc(cwtV, cwtV);
|
dynamicval<shiftmatrix> dc(cwtV, cwtV);
|
||||||
cwtV = V * inverse_shift(gmatrix0[c], cwtV);
|
cwtV = V * inverse_shift(ggmatrix(cw2.at), cwtV);
|
||||||
drawcell(cw2.at, V);
|
drawcell(cw2.at, V);
|
||||||
inmirrorcount -= cmc;
|
inmirrorcount -= cmc;
|
||||||
return;
|
return;
|
||||||
|
@ -2729,7 +2729,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
|
|||||||
if(inmirrorcount&1) mirr = !mirr;
|
if(inmirrorcount&1) mirr = !mirr;
|
||||||
col = mirrorcolor(geometry == gElliptic ? det(Vs.T) < 0 : mirr);
|
col = mirrorcolor(geometry == gElliptic ? det(Vs.T) < 0 : mirr);
|
||||||
if(!mouseout() && !nospins && GDIM == 2) {
|
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);
|
queuestr(P2, 10, "x", 0xFF00);
|
||||||
}
|
}
|
||||||
if(!nospins && flipplayer) Vs = Vs * pispin;
|
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);
|
drawPlayerEffects(Vs, c, true);
|
||||||
if(!mmmon) return 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()) {
|
if(hide_player()) {
|
||||||
first_cell_to_draw = false;
|
first_cell_to_draw = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user