Skip to content

Commit

Permalink
Fixed room object AO shadows for rotated buildings
Browse files Browse the repository at this point in the history
  • Loading branch information
fegennari committed Apr 1, 2024
1 parent 52d6e16 commit 96b2bff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/building_room_item_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,6 +1969,10 @@ void building_room_geom_t::draw(brg_batch_draw_t *bbd, shader_t &s, shader_t &am
float rscale(0.5 + 0.5*(1.0 - ao_shadow)); // 0.5 will be the size of the object; dense shadow is sharper/smaller radius
if (i->type == TYPE_CASHREG || i->type == TYPE_PARK_SPACE) {rscale *= 0.75;} // bcube is larger than it should be for cash registers and parked cars
set_z_plane_rect_pts(point(i->xc(), i->yc(), (i->z1() + ao_z_off)), rscale*i->dx(), rscale*i->dy(), pts);

if (is_rotated) {
for (unsigned n = 0; n < 4; ++n) {building.do_xy_rotate(building_center, pts[n]);}
}
ao_qbd.add_quad_pts(pts, colorRGBA(0, 0, 0, ao_shadow), plus_z);
}
}
Expand Down

0 comments on commit 96b2bff

Please sign in to comment.