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

2D3D:: Mirror Land ceiling draws halffloors correctly

This commit is contained in:
Zeno Rogue 2019-05-20 15:27:55 +02:00
parent f2d60f1647
commit 5436265311
3 changed files with 17 additions and 4 deletions

View File

@ -105,6 +105,10 @@ void shift_shape(hpcshape& sh, ld z) {
for(int i=sh.s; i<sh.e; i++) hpc[i] = zshift(hpc[i], z);
}
void shift_shape_orthogonally(hpcshape& sh, ld z) {
for(int i=sh.s; i<sh.e; i++) hpc[i] = orthogonal_move(hpc[i], z);
}
extern
hpcshape
shSemiFloorSide[SIDEPARS],
@ -122,7 +126,7 @@ hpcshape
shMercuryBridge[2],
shTriheptaSpecial[14],
shCross, shGiantStar[2], shLake, shMirror,
shHalfFloor[3], shHalfMirror[3],
shHalfFloor[6], shHalfMirror[3],
shGem[2], shStar, shDisk, shDiskT, shDiskS, shDiskM, shDiskSq, shRing,
shTinyBird, shTinyShark,
shEgg,
@ -1074,8 +1078,11 @@ void make_3d_models() {
make_ball(shNightStar, 0.75, 2);
if(WDIM == 2) {
for(int i=0; i<3; i++)
shift_shape(shHalfFloor[i], geom3::lev_to_factor(geom3::human_height * .01));
for(int i=0; i<3; i++) {
clone_shape(shHalfFloor[i], shHalfFloor[i+3]);
shift_shape_orthogonally(shHalfFloor[i], geom3::FLOOR - geom3::human_height * .007);
shift_shape_orthogonally(shHalfFloor[i+3], geom3::WALL + geom3::human_height * .007);
}
}
shift_shape(shBoatOuter, geom3::FLOOR);

View File

@ -5072,6 +5072,8 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
if(!wmblack) for(int d=0; d<c->type; d++) {
inmirrorcount+=d;
queuepolyat(V2 * spin(d*M_PI/S3), shHalfFloor[2], darkena(fcol, fd, 0xFF), PPR::FLOORa);
if(GDIM == 3 && camera_level > geom3::WALL)
queuepolyat(V2 * spin(d*M_PI/S3), shHalfFloor[5], darkena(fcol, fd, 0xFF), PPR::FLOORa);
inmirrorcount-=d;
}
if(GDIM == 3) {
@ -5092,8 +5094,12 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
if(!wmblack) {
inmirrorcount++;
queuepolyat(mirrorif(V2, !onleft), shHalfFloor[ct6], darkena(fcol, fd, 0xFF), PPR::FLOORa);
if(GDIM == 3 && camera_level > geom3::WALL)
queuepolyat(mirrorif(V2, !onleft), shHalfFloor[ct6+3], darkena(fcol, fd, 0xFF), PPR::FLOORa);
inmirrorcount--;
queuepolyat(mirrorif(V2, onleft), shHalfFloor[ct6], darkena(fcol, fd, 0xFF), PPR::FLOORa);
if(GDIM == 3 && camera_level > geom3::WALL)
queuepolyat(mirrorif(V2, onleft), shHalfFloor[ct6+3], darkena(fcol, fd, 0xFF), PPR::FLOORa);
}
if(GDIM == 3)

View File

@ -1672,7 +1672,7 @@ hpcshape
shMercuryBridge[2],
shTriheptaSpecial[14],
shCross, shGiantStar[2], shLake, shMirror,
shHalfFloor[3], shHalfMirror[3],
shHalfFloor[6], shHalfMirror[3],
shGem[2], shStar, shDisk, shDiskT, shDiskS, shDiskM, shDiskSq, shRing,
shTinyBird, shTinyShark,
shEgg,