MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ExternalRoomVisibleFromPortal

Function ExternalRoomVisibleFromPortal

Descent3/render.cpp:556–572  ·  view source on GitHub ↗

Returns true if the external room is visible from the passed in portal

Source from the content-addressed store, hash-verified

554
555// Returns true if the external room is visible from the passed in portal
556int 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
575void MarkFacesForRendering(int roomnum, clip_wnd *wnd) {

Callers 1

BuildRoomListSubFunction · 0.85

Calls 1

clip2dFunction · 0.85

Tested by

no test coverage detected