From dbb8857a39d413774b33f066b8506f882529e875 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 10 May 2019 01:24:16 +0200 Subject: [PATCH] 2d3d:: cone graphics for trees etc. --- floorshapes.cpp | 29 +++++++++++++++++++++++++++++ graph.cpp | 6 +++++- hyper.h | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/floorshapes.cpp b/floorshapes.cpp index de1e33fc..f382f5d6 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -500,6 +500,33 @@ 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) { + 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(geom3::WALL + (geom3::FLOOR-geom3::WALL) * (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); + return; + } color_t wcol0 = wcol; color_t wcol2 = gradient(0, wcol0, 0, .8, 1); - if(!qfi.fshape) qfi.fshape = &shFullFloor; draw_shapevec(c, V, qfi.fshape->levels[SIDE_WALL], darkena(wcol, 0, 0xFF), PPR::WALL); forCellIdEx(c2, i, c) if(!highwall(c2)) diff --git a/hyper.h b/hyper.h index 627d6135..70d5333f 100644 --- a/hyper.h +++ b/hyper.h @@ -4248,7 +4248,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]; + vector b, shadow, side[SIDEPARS], gpside[SIDEPARS][MAX_EDGE], levels[SIDEPARS], cone; basic_textureinfo tinf3; floorshape() { prio = PPR::FLOOR; pstrength = fstrength = 10; } };