1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 22:39:53 +00:00

2d3d:: graphics for branches, barrels, and firetraps

This commit is contained in:
Zeno Rogue 2019-05-10 02:45:33 +02:00
parent be032e0f03
commit 8b018dd59d

View File

@ -5128,11 +5128,11 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
break; break;
case waSolidBranch: case waSolidBranch:
queuepoly(V, shSolidBranch, darkena(wcol, 0, 0xFF)); queuepoly(DIM == 3 ? mscale(V, geom3::BODY) : V, shSolidBranch, darkena(wcol, 0, 0xFF));
break; break;
case waWeakBranch: case waWeakBranch:
queuepoly(V, shWeakBranch, darkena(wcol, 0, 0xFF)); queuepoly(DIM == 3 ? mscale(V, geom3::BODY) : V, shWeakBranch, darkena(wcol, 0, 0xFF));
break; break;
case waLadder: case waLadder:
@ -5274,8 +5274,15 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
break; break;
case waFireTrap: case waFireTrap:
if(DIM == 3) {
draw_shapevec(c, V * zpush(-geom3::human_height/40), shMFloor.levels[0], darkena(0xC00000, 0, 0xFF));
draw_shapevec(c, V * zpush(-geom3::human_height/20), shMFloor2.levels[0], darkena(0x600000, 0, 0xFF));
}
else {
draw_floorshape(c, V, shMFloor, darkena(0xC00000, 0, 0xFF)); draw_floorshape(c, V, shMFloor, darkena(0xC00000, 0, 0xFF));
draw_floorshape(c, V, shMFloor2, darkena(0x600000, 0, 0xFF)); draw_floorshape(c, V, shMFloor2, darkena(0x600000, 0, 0xFF));
}
if(c->wparam >= 1) if(c->wparam >= 1)
queuepoly(mscale(V, geom3::FLOOR), shDisk, darkena(trapcol[c->wparam&3], 0, 0xFF)); queuepoly(mscale(V, geom3::FLOOR), shDisk, darkena(trapcol[c->wparam&3], 0, 0xFF));
break; break;
@ -5362,6 +5369,10 @@ 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) {
draw_shapevec(c, V, qfi.fshape->cone, 0xD00000FF, PPR::REDWALL);
break;
}
const int layers = 2 << detaillevel; const int layers = 2 << detaillevel;
for(int z=1; z<=layers; z++) { for(int z=1; z<=layers; z++) {
double zg = zgrad0(0, geom3::actual_wall_height(), z, layers); double zg = zgrad0(0, geom3::actual_wall_height(), z, layers);