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

Function BuildRoomListSub

Descent3/render.cpp:784–1065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782
783g3Point Combined_portal_points[MAX_VERTS_PER_FACE * 5];
784void BuildRoomListSub(int start_room_num, clip_wnd *wnd, int depth) {
785 room *rp = &Rooms[start_room_num];
786 int i, t;
787 if (Render_portals) {
788 rend_SetTextureType(TT_FLAT);
789 rend_SetAlphaType(AT_CONSTANT);
790 rend_SetAlphaValue(255);
791 rend_SetFlatColor(GR_RGB(255, 255, 255));
792
793 rend_DrawLine(wnd->left, wnd->top, wnd->right, wnd->top);
794 rend_DrawLine(wnd->right, wnd->top, wnd->right, wnd->bot);
795 rend_DrawLine(wnd->right, wnd->bot, wnd->left, wnd->bot);
796 rend_DrawLine(wnd->left, wnd->bot, wnd->left, wnd->top);
797 }
798 if (!Rooms_visited[start_room_num]) {
799 Render_list[N_render_rooms++] = start_room_num;
800 }
801
802 ASSERT(N_render_rooms < MAX_RENDER_ROOMS);
803#ifndef RELEASE
804 Mine_depth++;
805#endif
806 Rooms_visited[start_room_num] = 1;
807 Room_depth_list[start_room_num] = depth;
808 // If this room is a closed (non-seethrough) door, don't check any of its portals,
809 //...UNLESS this is the first room we're looking at (meaning the viewer is in this room)
810 if ((rp->flags & RF_DOOR) && (DoorwayGetPosition(rp) == 0.0) &&
811 !(Doors[rp->doorway_data->doornum].flags & DF_SEETHROUGH))
812 if (depth != 0)
813 return;
814
815 // Check all the portals for this room
816 for (t = 0; t < rp->num_portals; t++) {
817 portal *pp = &rp->portals[t];
818 int croom = pp->croom;
819 ASSERT(croom >= 0);
820
821 // If we are an external room portalizing into another external room, then skip!
822 if ((rp->flags & RF_EXTERNAL) && (Rooms[croom].flags & RF_EXTERNAL))
823 continue;
824
825 // Check if we can see through this portal, and if not, skip it
826 if (!RenderPastPortal(rp, pp))
827 continue;
828
829 // If this portal has been visited, skip it
830 if (Room_depth_list[croom] < Room_depth_list[start_room_num])
831 continue;
832
833 // Deal with external portals differently
834 int external_door_hack = 0;
835 if (rp->flags & RF_EXTERNAL && Rooms[croom].flags & RF_DOOR)
836 external_door_hack = 1;
837
838 // Get pointer to this portal's face
839 face *fp = &rp->faces[pp->portal_face];
840
841 // See if portal is facing toward us

Callers 1

BuildRoomListFunction · 0.85

Calls 15

RenderPastPortalFunction · 0.85
g3_RotatePointFunction · 0.85
g3_ClipPolygonFunction · 0.85
g3_FreeTempPointsFunction · 0.85
g3_ProjectPointFunction · 0.85
clip2dFunction · 0.85
CheckFogPortalExtentsFunction · 0.85
RotateAllExternalRoomsFunction · 0.85
MarkFacesForRenderingFunction · 0.85
rend_SetTextureTypeFunction · 0.50
rend_SetAlphaTypeFunction · 0.50

Tested by

no test coverage detected