fixed shmup in euc_in_nil and euc_in_sl2

This commit is contained in:
Zeno Rogue 2023-01-07 22:51:46 +01:00
parent 8e49baef0e
commit 4351f99432
2 changed files with 9 additions and 4 deletions

View File

@ -2043,6 +2043,11 @@ EX transmatrix default_spin() {
return cspin90(0, 1) * cgi.intermediate_to_logical_scaled;
}
EX bool shmup_inverted() {
if(!embedded_plane) return false;
return (vid.wall_height < 0) ^ (geom3::euc_in_nil() || geom3::euc_in_sl2());
}
EX void centerpc(ld aspd) {
if(subscreens::split([=] () {centerpc(aspd);})) return;
@ -2073,11 +2078,11 @@ EX void centerpc(ld aspd) {
else {
adjust_eye(T, pc->base, +1);
}
View = iview_inverse(T);
if(gproduct) NLP = ortho_inverse(pc->ori);
if(WDIM == 2) {
if(vid.wall_height < 0) rotate_view(cspin180(2, 1));
if(shmup_inverted()) rotate_view(cspin180(2, 1));
if(gproduct)
rotate_view( cspin(2, 1, -90._deg - shmup::playerturny[id]) * cspin90(0, 1));
else

View File

@ -885,7 +885,7 @@ void movePlayer(monster *m, int delta) {
godir[cpid] = 0;
if(embedded_plane && vid.wall_height < 0) mdx = -mdx;
if(shmup_inverted()) mdx = -mdx;
if(WDIM == 2 && GDIM == 3 && (mdx || mdy)) {
double mdd = hypot(mdx, mdy);
@ -936,7 +936,7 @@ void movePlayer(monster *m, int delta) {
}
#endif
if(embedded_plane && vid.wall_height < 0) playerturn[cpid] = -playerturn[cpid];
if(shmup_inverted()) playerturn[cpid] = -playerturn[cpid];
if(playerturn[cpid] && canmove && !blown && WDIM == 2) {
m->swordangle -= playerturn[cpid];