1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

fix compile bug

This commit is contained in:
Zeno Rogue 2023-12-02 19:34:06 +01:00
parent 68a3d20d83
commit 39ddc3dc33
2 changed files with 35 additions and 11 deletions

View File

@ -1566,21 +1566,21 @@ EX namespace ods {
dqi_poly npoly = *p;
npoly.offset = 0;
npoly.tab = &glcoords;
npoly.V = Id;
npoly.V = shiftless(Id);
npoly.tinf = p->tinf ? &stinf : NULL;
if(npoly.tinf) {
npoly.offset_texture = 0;
stinf.texture_id = p->tinf->texture_id;
stinf.tvertices.clear();
}
npoly.V = Id;
npoly.V = shiftless(Id);
glcoords.clear();
array<hyperpoint, 6> h;
if(0) for(int i=0; i<p->cnt; i+=3) {
for(int j=0; j<3; j++)
h[j] = p->V * glhr::gltopoint((*p->tab)[p->offset+i+j]);
h[j] = unshift(p->V) * glhr::gltopoint((*p->tab)[p->offset+i+j]);
for(int j=0; j<3; j++) {
glcoords.push_back(glhr::makevertex(h[j][0], h[j][1], h[j][2]));
@ -1591,15 +1591,15 @@ EX namespace ods {
if(1) for(int i=0; i<p->cnt; i+=3) {
for(int j=0; j<3; j++) {
hyperpoint o = p->V * glhr::gltopoint((*p->tab)[p->offset+i+j]);
shiftpoint o = p->V * glhr::gltopoint((*p->tab)[p->offset+i+j]);
if(nonisotropic || gproduct) {
o = lp_apply(inverse_exp(o, iTable, false));
o[3] = 1;
auto o1 = lp_apply(inverse_exp(o, pNORMAL));
o1[3] = 1;
dynamicval<eGeometry> g(geometry, gEuclid);
if(!project(o, h[j], h[j+3], global_projection == -1))
if(!project(o1, h[j], h[j+3], global_projection == -1))
goto next_i;
}
else if(!project(o, h[j], h[j+3], global_projection == -1))
else if(!project(unshift(o), h[j], h[j+3], global_projection == -1))
goto next_i;
}

View File

@ -184,10 +184,14 @@ EX namespace mapeditor {
if(drawing_tool && (cmode & sm::DRAW)) {
shiftpoint moh = full_mouseh();
dynamicval<ld> lw(vid.linewidth, vid.linewidth * dtwidth * 100);
if(holdmouse && mousekey == 'c')
if(holdmouse && mousekey == 'c') {
torus_rug_jump(moh, lstart);
queue_hcircle(rgpushxto0(lstart), hdist(lstart, moh));
else if(holdmouse && mousekey == 'l')
}
else if(holdmouse && mousekey == 'l') {
torus_rug_jump(moh, lstart);
queueline(lstart, moh, dtcolor, 4 + vid.linequality, PPR::LINE);
}
else if(!holdmouse) {
shiftmatrix T = rgpushxto0(moh);
queueline(T * xpush0(-.1), T * xpush0(.1), dtcolor);
@ -208,6 +212,9 @@ EX namespace mapeditor {
}
EX void dt_add_line(shiftpoint h1, shiftpoint h2, int maxl) {
torus_rug_jump(h2, h1);
if(hdist(h1, h2) > 1 && maxl > 0) {
shiftpoint h3 = mid(h1, h2);
dt_add_line(h1, h3, maxl-1);
@ -230,6 +237,7 @@ EX namespace mapeditor {
EX void dt_add_circle(shiftpoint h1, shiftpoint h2) {
cell *b = centerover;
torus_rug_jump(h2, h1);
auto d = hdist(h1, h2);
auto xh1 = inverse_shift(ggmatrix(b), h1);
@ -279,9 +287,25 @@ EX namespace mapeditor {
cfree = nullptr;
cfree_at = nullptr;
}
EX void torus_rug_jump(shiftpoint& h, shiftpoint last) {
if(!rug::rugged) return;
again:
auto C = ggmatrix(centerover);
auto T1 = inverse_shift(C, rgpushxto0(h));
for(int a=0; a<2; a++) for(int s: {-1, 1}) {
transmatrix T = eumove(s * euc::eu.optimal_axes[a]);
shiftpoint h1 = C * T * tC0(T1);
if(hdist(h1, last) < hdist(h, last) - 1e-6) { h = h1; goto again; }
}
}
EX void dt_add_free(shiftpoint h) {
if(cfree) torus_rug_jump(h, cfree_old * cfree->lh.back());
cell *b = centerover;
shiftmatrix T = rgpushxto0(h);
auto T1 = inverse_shift(ggmatrix(b), T);