3d:: mapeditor works

This commit is contained in:
? 2019-02-26 14:56:07 +01:00 committed by Zeno Rogue
parent 5c2cb1de76
commit b0c21f0626
3 changed files with 17 additions and 6 deletions

View File

@ -2983,6 +2983,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
break;
case laCanvas:
fcol = c->landparam;
if(c->wall == waWaxWall) wcol = c->landparam;
break;
case laPalace:
fcol = floorcolors[c->land];
@ -5244,9 +5245,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
#if CAP_EDIT
if((cmode & sm::MAP) && lmouseover && darken == 0 &&
!mouseout() &&
(DIM == 3 || !mouseout()) &&
(patterns::whichPattern ? patterns::getpatterninfo0(c).id == patterns::getpatterninfo0(lmouseover).id : c == lmouseover)) {
queuecircle(V, .78, 0x00FFFFFF);
queuecircleat(c, .78, 0x00FFFFFF);
}
mapeditor::drawGhosts(c, V, ctype);
@ -5357,7 +5358,7 @@ void queuecircleat(cell *c, double rad, color_t col) {
#define MOBON true
#endif
cell *mouseover3() {
cell *forwardcell() {
movedir md = vectodir(move_destination_vec(6));
cellwalker xc = cwt + md.d + wstep;
return xc.at;
@ -5476,7 +5477,7 @@ void drawMarkers() {
}
if(DIM == 3 && !inHighQual && !shmup::on && vid.axes) {
cell *c = mouseover3();
cell *c = forwardcell();
IG(c) queuecircleat(c, .8, getcs().uicolor);
}
#endif
@ -5624,7 +5625,16 @@ transmatrix cview() {
}
void precise_mouseover() {
if(DIM == 3) { mouseover2 = viewctr.at->c7; mouseover = mouseover3(); return; }
if(DIM == 3) {
mouseover2 = mouseover = viewctr.at->c7;
ld best = HUGE_VAL;
hyperpoint h = cpush(2, 1) * C0;
forCellEx(c1, mouseover2) {
ld dist = hdist(tC0(ggmatrix(c1)), h);
if(dist < best) mouseover = c1, best = dist;
}
return;
}
if(!mouseover) return;
cell *omouseover = mouseover;
for(int loop = 0; loop < 10; loop++) {

View File

@ -994,6 +994,7 @@ bool displayfrSP(int x, int y, int sh, int b, int size, const string &s, color_t
bool outofmap(hyperpoint h);
void applymodel(hyperpoint H, hyperpoint& Hscr);
void drawCircle(int x, int y, int size, color_t color, color_t fillcolor = 0);
void queuecircleat(cell *c, double rad, color_t col);
void fixcolor(int& col);
ld displayspin(cell *c, int d);
bool non_spatial_model();

View File

@ -734,7 +734,7 @@ namespace mapeditor {
break;
case 6:
c->land = laCanvas;
c->wall = waNone;
c->wall = DIM == 3 ? waWaxWall : waNone;
c->landparam = paintwhat >> 8;
break;
case 4: