Returns true if the external room is visible from the passed in portal
| 554 | |
| 555 | // Returns true if the external room is visible from the passed in portal |
| 556 | int ExternalRoomVisibleFromPortal(int index, clip_wnd *wnd) { |
| 557 | int i; |
| 558 | uint8_t code = 0xff; |
| 559 | g3Point pnt; |
| 560 | // This is a stupid hack to prevent really large buildings from popping in and out of view |
| 561 | if (External_room_project_net[index]) |
| 562 | return 1; |
| 563 | for (i = 0; i < 8; i++) { |
| 564 | pnt.p3_sx = External_room_corners[index][i].x; |
| 565 | pnt.p3_sy = External_room_corners[index][i].y; |
| 566 | pnt.p3_codes = 0; |
| 567 | code &= clip2d(&pnt, wnd); |
| 568 | } |
| 569 | if (code) |
| 570 | return 0; // building can't be seen from this portal |
| 571 | return 1; |
| 572 | } |
| 573 | |
| 574 | // Checks to see what faces intersect the passed in portal |
| 575 | void MarkFacesForRendering(int roomnum, clip_wnd *wnd) { |
no test coverage detected