texture:: texture ghosts are now shown correctly

This commit is contained in:
Zeno Rogue 2019-01-03 15:12:45 +01:00
parent 34d4223bed
commit 7a589090d3
3 changed files with 39 additions and 34 deletions

View File

@ -3583,6 +3583,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
draw_qfi(c, V, 0xFFFFFFFF);
return;
}
if((cmode & sm::DRAW) && texture::config.tstate == texture::tsActive && !mouseout() && c)
mapeditor::draw_texture_ghosts(c, V);
#endif
bool orig = false;

View File

@ -1204,7 +1204,7 @@ namespace mapeditor {
static const int USERSHAPEGROUPS = 4;
bool haveUserShape(eShapegroup group, int id);
void draw_texture_ghosts(cell *c, const transmatrix& V);
}
struct renderbuffer;

View File

@ -1681,32 +1681,12 @@ namespace mapeditor {
#endif
}
bool drawUserShape(const transmatrix& V, eShapegroup group, int id, color_t color, cell *c, PPR prio) {
#if !CAP_EDIT
return false;
#else
// floors handled separately
if(c && c == drawcell && editingShape(group, id) && group != sgFloor)
drawtrans = V;
usershape *us = usershapes[group][id];
if(us) {
for(int i=0; i<USERLAYERS; i++) {
if(i != dslayer && onelayeronly) continue;
usershapelayer& ds(us->d[i]);
hpcshape& sh(ds.sh);
if(sh.s != sh.e)
queuepolyat(V, sh, ds.color ? ds.color : color, prio);
}
}
if(cmode & sm::DRAW) {
#if CAP_TEXTURE
if(texture::config.tstate == texture::tsActive && lmouseover && !mouseout() && (lstartcell || !holdmouse) && c) {
void draw_texture_ghosts(cell *c, const transmatrix& V) {
if(!c) return;
if(holdmouse && !lstartcell) return;
cell *ls = lstartcell ? lstartcell : lmouseover;
if(!ls) return;
auto sio = patterns::getpatterninfo0(ls);
auto sih = patterns::getpatterninfo0(c);
@ -1734,7 +1714,29 @@ namespace mapeditor {
}
}
}
#endif
bool drawUserShape(const transmatrix& V, eShapegroup group, int id, color_t color, cell *c, PPR prio) {
#if !CAP_EDIT
return false;
#else
// floors handled separately
if(c && c == drawcell && editingShape(group, id) && group != sgFloor)
drawtrans = V;
usershape *us = usershapes[group][id];
if(us) {
for(int i=0; i<USERLAYERS; i++) {
if(i != dslayer && onelayeronly) continue;
usershapelayer& ds(us->d[i]);
hpcshape& sh(ds.sh);
if(sh.s != sh.e)
queuepolyat(V, sh, ds.color ? ds.color : color, prio);
}
}
if(cmode & sm::DRAW) {
if(mapeditor::editingShape(group, id)) {