diff --git a/floorshapes.cpp b/floorshapes.cpp index 93e5685f..e0611f00 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -501,30 +501,34 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) { } } - sizeto(fsh.cone, id); - bshape(fsh.cone[id], fsh.prio); - last->flags |= POLY_TRIANGLES; - last->tinf = &fsh.tinf3; - last->texture_offset = 0; - #if CAP_BT - if(binarytiling) - for(int t=0; ttype; t++) - texture_order([&] (ld x, ld y) { + for(int co=0; co<2; co++) { + sizeto(fsh.cone[co], id); + bshape(fsh.cone[co][id], fsh.prio); + last->flags |= POLY_TRIANGLES; + last->tinf = &fsh.tinf3; + last->texture_offset = 0; + ld h = (geom3::FLOOR - geom3::WALL) / (co+1); + ld top = co ? (geom3::FLOOR + geom3::WALL) / 2 : geom3::WALL; + #if CAP_BT + if(binarytiling) + for(int t=0; ttype; t++) + texture_order([&] (ld x, ld y) { + using namespace hyperpoint_vec; + hyperpoint left = binary::get_corner_horo_coordinates(c, t); + hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); + hpcpush(rgpushxto0(binary::get_horopoint(left * x + right * y)) * zpush(top + h * (x+y)) * C0); + }); + else + #endif + if(1) { + int s = fsh.b[id].s; + int e = fsh.b[id].e-1; + for(int t=0; tcone, darkena(wcol, 0, 0xFF), PPR::WALL); + draw_shapevec(c, V, qfi.fshape->cone[0], darkena(wcol, 0, 0xFF), PPR::WALL); return; } color_t wcol0 = wcol; @@ -5512,7 +5512,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { case waBarrier: if(c->land == laOceanWall && wmescher && wmspatial) { if(GDIM == 3 && qfi.fshape) { - draw_shapevec(c, V, qfi.fshape->cone, darkena(wcol, 0, 0xFF), PPR::WALL); + draw_shapevec(c, V, qfi.fshape->cone[1], darkena(wcol, 0, 0xFF), PPR::WALL); break; } const int layers = 2 << detaillevel; @@ -5586,7 +5586,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { else if(c->wall == waExplosiveBarrel) { if(DIM == 3 && qfi.fshape) { - draw_shapevec(c, V, qfi.fshape->cone, 0xD00000FF, PPR::REDWALL); + draw_shapevec(c, V, qfi.fshape->cone[1], 0xD00000FF, PPR::REDWALL); break; } const int layers = 2 << detaillevel; @@ -5600,7 +5600,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { auto V2 = V; if(hasTimeout(c)) V2 = V2 * spintick(c->land == laPower ? 5000 : 500); if(GDIM == 3 && qfi.fshape) - draw_shapevec(c, V2, qfi.fshape->cone, darkena(wcol, 0, 0xF0), PPR::WALL); + draw_shapevec(c, V2, qfi.fshape->cone[1], darkena(wcol, 0, 0xF0), PPR::WALL); else queuepoly(V2, shStar, darkena(wcol, 0, 0xF0)); if(isFire(c) && rand() % 300 < ticks - lastt) drawParticle(c, wcol, 75); diff --git a/hyper.h b/hyper.h index af4fea8c..e68ded5e 100644 --- a/hyper.h +++ b/hyper.h @@ -4249,7 +4249,7 @@ struct floorshape { int pstrength; // pattern strength in 3D int fstrength; // frame strength in 3D PPR prio; - vector b, shadow, side[SIDEPARS], gpside[SIDEPARS][MAX_EDGE], levels[SIDEPARS], cone; + vector b, shadow, side[SIDEPARS], gpside[SIDEPARS][MAX_EDGE], levels[SIDEPARS], cone[2]; basic_textureinfo tinf3; floorshape() { prio = PPR::FLOOR; pstrength = fstrength = 10; } };