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

Function CheckTransparentPoint

Descent3/room.cpp:1068–1090  ·  view source on GitHub ↗

Check if a particular point on a wall is a transparent pixel Parameters: pnt - the point we're checking rp - pointer to the room that pnt is in facenum - the face that pnt is on Returns: true if can pass through the given point, else 0

Source from the content-addressed store, hash-verified

1066// facenum - the face that pnt is on
1067// Returns: true if can pass through the given point, else 0
1068int CheckTransparentPoint(const vector *pnt, const room *rp, const int facenum) {
1069 int bm_handle;
1070 face *fp = &rp->faces[facenum];
1071 float u, v;
1072 int w, h, x, y;
1073
1074 return false;
1075
1076 // Get the UV coordindates of the point we hit
1077 FindPointUV(&u, &v, pnt, rp, fp);
1078
1079 // Get pointer to the bitmap data
1080 bm_handle = GetTextureBitmap(fp->tmap, 0);
1081
1082 // Get x & y coordindates (in bitmap) of check point
1083 w = bm_w(bm_handle, 0);
1084 h = bm_h(bm_handle, 0);
1085 x = ((int)(u * w)) % w;
1086 y = ((int)(v * h)) % h;
1087
1088 // Return true if the check point is transparent
1089 return bm_pixel_transparent(bm_handle, x, y);
1090}
1091
1092// Computes a bounding sphere for the current room
1093// Parameters: center - filled in with the center point of the sphere

Callers 1

fvi_roomFunction · 0.85

Calls 5

FindPointUVFunction · 0.85
GetTextureBitmapFunction · 0.85
bm_wFunction · 0.85
bm_hFunction · 0.85
bm_pixel_transparentFunction · 0.85

Tested by

no test coverage detected