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
| 256 | // pp - the portal we're checking |
| 257 | // Returns: true if you should render the room to which the portal connects |
| 258 | static 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[] |
| 276 | int N_render_rooms; |
no test coverage detected