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
| 1066 | // facenum - the face that pnt is on |
| 1067 | // Returns: true if can pass through the given point, else 0 |
| 1068 | int 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 |
no test coverage detected