Initialize a room face structure.
| 605 | |
| 606 | // Initialize a room face structure. |
| 607 | void InitRoomFace(face *fp, int nverts) { |
| 608 | fp->flags = 0; |
| 609 | fp->num_verts = nverts; |
| 610 | fp->portal_num = -1; |
| 611 | fp->tmap = 0; |
| 612 | |
| 613 | #ifdef NEWEDITOR |
| 614 | ned_MarkTextureInUse(0, true); |
| 615 | #endif |
| 616 | |
| 617 | fp->lmi_handle = BAD_LMI_INDEX; |
| 618 | fp->special_handle = BAD_SPECIAL_FACE_INDEX; |
| 619 | fp->light_multiple = 4; |
| 620 | |
| 621 | fp->face_verts = (short *)RoomMemAlloc(nverts * sizeof(*fp->face_verts)); |
| 622 | ASSERT(fp->face_verts != NULL); |
| 623 | fp->face_uvls = (roomUVL *)RoomMemAlloc(nverts * sizeof(*fp->face_uvls)); |
| 624 | ASSERT(fp->face_uvls != NULL); |
| 625 | |
| 626 | ASSERT(fp->face_verts); |
| 627 | ASSERT(fp->face_uvls); |
| 628 | for (int i = 0; i < nverts; i++) |
| 629 | fp->face_uvls[i].alpha = 255; |
| 630 | } |
| 631 | |
| 632 | // Finds out if we are in a room or outside the mine (-1 if we are outside) |
| 633 | int FindPointRoom(vector *pnt) { |
no test coverage detected