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

Function RenderPastPortal

Descent3/render.cpp:258–273  ·  view source on GitHub ↗

Determine if you should render through a portal Parameters: rp - the room the portal is in pp - the portal we're checking Returns: true if you should render the room to which the portal connects

Source from the content-addressed store, hash-verified

256// pp - the portal we're checking
257// Returns: true if you should render the room to which the portal connects
258static inline bool RenderPastPortal(room *rp, portal *pp) {
259 // If we don't render the portal's faces, then we see through it
260 if (!(pp->flags & PF_RENDER_FACES))
261 return 1;
262 if (!UseHardware) // Don't render alpha stuff in software
263 return 0;
264 // Check if the face's texture has transparency
265 face *fp = &rp->faces[pp->portal_face];
266 if (GameTextures[fp->tmap].flags & TF_PROCEDURAL)
267 return 1;
268 int bm_handle = GetTextureBitmap(fp->tmap, 0);
269 if (GetFaceAlpha(fp, bm_handle))
270 return 1; // Face has alpha or transparency, so we can see through it
271 else
272 return 0; // Not transparent, so no render past
273}
274
275// used during rendering as count of items in render_list[]
276int N_render_rooms;

Callers 2

BuildRoomListSubFunction · 0.85
BuildMirroredRoomListSubFunction · 0.85

Calls 2

GetTextureBitmapFunction · 0.85
GetFaceAlphaFunction · 0.70

Tested by

no test coverage detected