mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-14 04:37:10 +00:00
texture:: texture ghosts are now shown correctly
This commit is contained in:
@@ -3583,6 +3583,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
draw_qfi(c, V, 0xFFFFFFFF);
|
draw_qfi(c, V, 0xFFFFFFFF);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((cmode & sm::DRAW) && texture::config.tstate == texture::tsActive && !mouseout() && c)
|
||||||
|
mapeditor::draw_texture_ghosts(c, V);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool orig = false;
|
bool orig = false;
|
||||||
|
|||||||
2
hyper.h
2
hyper.h
@@ -1204,7 +1204,7 @@ namespace mapeditor {
|
|||||||
static const int USERSHAPEGROUPS = 4;
|
static const int USERSHAPEGROUPS = 4;
|
||||||
|
|
||||||
bool haveUserShape(eShapegroup group, int id);
|
bool haveUserShape(eShapegroup group, int id);
|
||||||
|
void draw_texture_ghosts(cell *c, const transmatrix& V);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct renderbuffer;
|
struct renderbuffer;
|
||||||
|
|||||||
@@ -1681,6 +1681,40 @@ namespace mapeditor {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
if(sio.id == sih.id) {
|
||||||
|
if(c == ls)
|
||||||
|
textrans = inverse(V * applyPatterndir(ls, sio));
|
||||||
|
|
||||||
|
transmatrix mh = textrans * rgpushxto0(mouseh);
|
||||||
|
transmatrix ml = textrans * rgpushxto0(lstart);
|
||||||
|
|
||||||
|
for(int j=0; j<=texture::texturesym; j++)
|
||||||
|
for(int i=0; i<c->type; i += sih.symmetries) {
|
||||||
|
transmatrix M2 = V * applyPatterndir(c, sih) * spin(2*M_PI*i/c->type);
|
||||||
|
if(j) M2 = M2 * Mirror;
|
||||||
|
switch(holdmouse ? mousekey : 'd') {
|
||||||
|
case 'c':
|
||||||
|
queue_hcircle(M2 * ml, hdist(lstart, mouseh));
|
||||||
|
break;
|
||||||
|
case 'l':
|
||||||
|
queueline(M2 * mh * C0, M2 * ml * C0, texture::config.paint_color, 4 + vid.linequality, PPR::LINE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
queue_hcircle(M2 * mh, texture::penwidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool drawUserShape(const transmatrix& V, eShapegroup group, int id, color_t color, cell *c, PPR prio) {
|
bool drawUserShape(const transmatrix& V, eShapegroup group, int id, color_t color, cell *c, PPR prio) {
|
||||||
#if !CAP_EDIT
|
#if !CAP_EDIT
|
||||||
return false;
|
return false;
|
||||||
@@ -1704,38 +1738,6 @@ namespace mapeditor {
|
|||||||
|
|
||||||
if(cmode & sm::DRAW) {
|
if(cmode & sm::DRAW) {
|
||||||
|
|
||||||
#if CAP_TEXTURE
|
|
||||||
if(texture::config.tstate == texture::tsActive && lmouseover && !mouseout() && (lstartcell || !holdmouse) && c) {
|
|
||||||
cell *ls = lstartcell ? lstartcell : lmouseover;
|
|
||||||
auto sio = patterns::getpatterninfo0(ls);
|
|
||||||
auto sih = patterns::getpatterninfo0(c);
|
|
||||||
|
|
||||||
if(sio.id == sih.id) {
|
|
||||||
if(c == ls)
|
|
||||||
textrans = inverse(V * applyPatterndir(ls, sio));
|
|
||||||
|
|
||||||
transmatrix mh = textrans * rgpushxto0(mouseh);
|
|
||||||
transmatrix ml = textrans * rgpushxto0(lstart);
|
|
||||||
|
|
||||||
for(int j=0; j<=texture::texturesym; j++)
|
|
||||||
for(int i=0; i<c->type; i += sih.symmetries) {
|
|
||||||
transmatrix M2 = V * applyPatterndir(c, sih) * spin(2*M_PI*i/c->type);
|
|
||||||
if(j) M2 = M2 * Mirror;
|
|
||||||
switch(holdmouse ? mousekey : 'd') {
|
|
||||||
case 'c':
|
|
||||||
queue_hcircle(M2 * ml, hdist(lstart, mouseh));
|
|
||||||
break;
|
|
||||||
case 'l':
|
|
||||||
queueline(M2 * mh * C0, M2 * ml * C0, texture::config.paint_color, 4 + vid.linequality, PPR::LINE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
queue_hcircle(M2 * mh, texture::penwidth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(mapeditor::editingShape(group, id)) {
|
if(mapeditor::editingShape(group, id)) {
|
||||||
|
|
||||||
/* for(int a=0; a<isize(ds.list); a++) {
|
/* for(int a=0; a<isize(ds.list); a++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user