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

Function GetFaceAlpha

physics/findintersection.cpp:4413–4436  ·  view source on GitHub ↗

Determines if a face draws with alpha blending Parameters: fp - pointer to the face in question bm_handle - the handle for the bitmap for this frame, or -1 if don't care about transparence Returns: bitmask describing the alpha blending for the face the return bits are the ATF_ flags in renderer.h

Source from the content-addressed store, hash-verified

4411// transparence Returns: bitmask describing the alpha blending for the face
4412// the return bits are the ATF_ flags in renderer.h
4413inline int GetFaceAlpha(face *fp, int bm_handle) {
4414 int ret = AT_ALWAYS;
4415 if (GameTextures[fp->tmap].flags & TF_SATURATE) {
4416 if (fp->flags & FF_VERTEX_ALPHA)
4417 ret = AT_SATURATE_TEXTURE_VERTEX;
4418 else
4419 ret = AT_SATURATE_TEXTURE;
4420 } else {
4421 // Check the face's texture for an alpha value
4422 if (GameTextures[fp->tmap].alpha < 1.0)
4423 ret |= ATF_CONSTANT;
4424
4425 // Someday we'll probably check the bitmap's alpha, too
4426 // Check for vertex alpha flag
4427 if (fp->flags & FF_VERTEX_ALPHA)
4428 ret |= ATF_VERTEX;
4429
4430 // Check for transparency
4431 if (GameBitmaps[bm_handle].format != BITMAP_FORMAT_4444 && GameTextures[fp->tmap].flags & TF_TMAP2)
4432 ret |= ATF_TEXTURE;
4433 }
4434
4435 return ret;
4436}
4437
4438bool PhysPastPortal(const room *rp, portal *pp) {
4439 // If we don't render the portal's faces, then we see through it

Callers 1

PhysPastPortalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected