3D:: movement in non-shmup

This commit is contained in:
? 2019-02-26 11:57:50 +01:00 committed by Zeno Rogue
parent 3188fb2e68
commit bc454d56cd
2 changed files with 23 additions and 5 deletions

View File

@ -91,13 +91,17 @@ movedir vectodir(const hyperpoint& P) {
void remission() {
if(!canmove && (cmode & sm::NORMAL)) showMissionScreen();
}
hyperpoint move_destination_vec(int d) {
if(DIM == 2) return spin(-d * M_PI/4) * tC0(pushone());
else return cspin(0, 2, d * M_PI/4) * tC0(pushone());
}
void movepckeydir(int d) {
DEBB(DF_GRAPH, (debugfile,"movepckeydir\n"));
// EUCLIDEAN
movedir md =
vectodir(spin(-d * M_PI/4) * tC0(pushone()));
movedir md = vectodir(move_destination_vec(d));
if(!canmove) movepcto(md), remission(); else movepcto(md);
}
@ -144,6 +148,7 @@ void calcMousedest() {
}
void mousemovement() {
if(DIM == 3) return;
calcMousedest();
if(!canmove) movepcto(mousedest), remission(); else movepcto(mousedest);
lmouseover = NULL;

View File

@ -5314,6 +5314,12 @@ void fallingMonsterAnimation(cell *c, eMonster m, int id) {
void queuecircleat(cell *c, double rad, color_t col) {
if(!c) return;
if(!gmatrix.count(c)) return;
if(DIM == 3) {
dynamicval<color_t> p(poly_outline, col);
for(int i=0; i<c->type; i++)
queuepolyat(gmatrix[c], shBinaryWall[i], 0, PPR::LINE);
return;
}
#if CAP_SHAPES
if(vid.stereo_mode || sphere) {
dynamicval<color_t> p(poly_outline, col);
@ -5442,7 +5448,7 @@ void drawMarkers() {
// process mouse
#if CAP_SHAPES
if((vid.axes == 4 || (vid.axes == 1 && !mousing)) && !shmup::on) {
if((vid.axes == 4 || (vid.axes == 1 && !mousing)) && !shmup::on && DIM == 2) {
if(multi::players == 1) {
forCellIdAll(c2, d, cwt.at) IG(c2) drawMovementArrows(c2, confusingGeometry() ? Gm(cwt.at) * calc_relative_matrix(c2, cwt.at, d) : Gm(c2));
}
@ -5456,6 +5462,12 @@ void drawMarkers() {
}
}
}
if(DIM == 3 && !inHighQual && !shmup::on && vid.axes) {
movedir md = vectodir(move_destination_vec(6));
cellwalker xc = cwt + md.d + wstep;
IG(xc.at) queuecircleat(xc.at, .8, getcs().uicolor);
}
#endif
}
@ -5803,6 +5815,7 @@ void drawthemap() {
void drawmovestar(double dx, double dy) {
if(viewdists) return;
if(DIM == 3) return;
DEBB(DF_GRAPH, (debugfile,"draw movestar\n"));
if(!playerfound) return;