1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 15:39:54 +00:00

2d3d:: smaller cones for fires/bonfires/buoys/thumpers

This commit is contained in:
Zeno Rogue 2019-05-12 20:10:01 +02:00
parent 33e42d9ed6
commit dea2073714
3 changed files with 37 additions and 30 deletions

View File

@ -501,11 +501,14 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
} }
} }
sizeto(fsh.cone, id); for(int co=0; co<2; co++) {
bshape(fsh.cone[id], fsh.prio); sizeto(fsh.cone[co], id);
bshape(fsh.cone[co][id], fsh.prio);
last->flags |= POLY_TRIANGLES; last->flags |= POLY_TRIANGLES;
last->tinf = &fsh.tinf3; last->tinf = &fsh.tinf3;
last->texture_offset = 0; 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 CAP_BT
if(binarytiling) if(binarytiling)
for(int t=0; t<c->type; t++) for(int t=0; t<c->type; t++)
@ -513,7 +516,7 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
using namespace hyperpoint_vec; using namespace hyperpoint_vec;
hyperpoint left = binary::get_corner_horo_coordinates(c, t); hyperpoint left = binary::get_corner_horo_coordinates(c, t);
hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); 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); hpcpush(rgpushxto0(binary::get_horopoint(left * x + right * y)) * zpush(top + h * (x+y)) * C0);
}); });
else else
#endif #endif
@ -524,7 +527,8 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
using namespace hyperpoint_vec; using namespace hyperpoint_vec;
hyperpoint v1 = hpc[s+t] - C0; hyperpoint v1 = hpc[s+t] - C0;
hyperpoint v2 = hpc[s+t+1] - C0; hyperpoint v2 = hpc[s+t+1] - C0;
texture_order([&] (ld x, ld y) { hpcpush(rgpushxto0(normalize(C0 + v1 * x + v2 * y))*zpush(geom3::WALL + (geom3::FLOOR-geom3::WALL) * (x+y))*C0); }); texture_order([&] (ld x, ld y) { hpcpush(rgpushxto0(normalize(C0 + v1 * x + v2 * y))*zpush(top + h * (x+y))*C0); });
}
} }
} }
@ -547,8 +551,11 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
fsh.gpside[l][e] = shFullFloor.gpside[l][e]; fsh.gpside[l][e] = shFullFloor.gpside[l][e];
for(auto& li: fsh.gpside[l][e]) li.tinf = &fsh.tinf3; for(auto& li: fsh.gpside[l][e]) li.tinf = &fsh.tinf3;
} }
fsh.cone = shFullFloor.cone; fsh.cone[0] = shFullFloor.cone[0];
for(auto& li: fsh.cone) li.tinf = &fsh.tinf3; fsh.cone[1] = shFullFloor.cone[1];
for(int c=0; c<2; c++)
for(auto& li: fsh.cone[c])
li.tinf = &fsh.tinf3;
} }
} }
finishshape(); finishshape();

View File

@ -3974,7 +3974,7 @@ void draw_wall(cell *c, const transmatrix& V, color_t wcol, color_t& zcol, int c
if(DIM == 3 && WDIM == 2) { if(DIM == 3 && WDIM == 2) {
if(!qfi.fshape) qfi.fshape = &shFullFloor; if(!qfi.fshape) qfi.fshape = &shFullFloor;
if(conegraph(c)) { if(conegraph(c)) {
draw_shapevec(c, V, qfi.fshape->cone, darkena(wcol, 0, 0xFF), PPR::WALL); draw_shapevec(c, V, qfi.fshape->cone[0], darkena(wcol, 0, 0xFF), PPR::WALL);
return; return;
} }
color_t wcol0 = wcol; color_t wcol0 = wcol;
@ -5512,7 +5512,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
case waBarrier: case waBarrier:
if(c->land == laOceanWall && wmescher && wmspatial) { if(c->land == laOceanWall && wmescher && wmspatial) {
if(GDIM == 3 && qfi.fshape) { 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; break;
} }
const int layers = 2 << detaillevel; const int layers = 2 << detaillevel;
@ -5586,7 +5586,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
else if(c->wall == waExplosiveBarrel) { else if(c->wall == waExplosiveBarrel) {
if(DIM == 3 && qfi.fshape) { 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; break;
} }
const int layers = 2 << detaillevel; const int layers = 2 << detaillevel;
@ -5600,7 +5600,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
auto V2 = V; auto V2 = V;
if(hasTimeout(c)) V2 = V2 * spintick(c->land == laPower ? 5000 : 500); if(hasTimeout(c)) V2 = V2 * spintick(c->land == laPower ? 5000 : 500);
if(GDIM == 3 && qfi.fshape) 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)); else queuepoly(V2, shStar, darkena(wcol, 0, 0xF0));
if(isFire(c) && rand() % 300 < ticks - lastt) if(isFire(c) && rand() % 300 < ticks - lastt)
drawParticle(c, wcol, 75); drawParticle(c, wcol, 75);

View File

@ -4249,7 +4249,7 @@ struct floorshape {
int pstrength; // pattern strength in 3D int pstrength; // pattern strength in 3D
int fstrength; // frame strength in 3D int fstrength; // frame strength in 3D
PPR prio; PPR prio;
vector<hpcshape> b, shadow, side[SIDEPARS], gpside[SIDEPARS][MAX_EDGE], levels[SIDEPARS], cone; vector<hpcshape> b, shadow, side[SIDEPARS], gpside[SIDEPARS][MAX_EDGE], levels[SIDEPARS], cone[2];
basic_textureinfo tinf3; basic_textureinfo tinf3;
floorshape() { prio = PPR::FLOOR; pstrength = fstrength = 10; } floorshape() { prio = PPR::FLOOR; pstrength = fstrength = 10; }
}; };