| 783 | } |
| 784 | |
| 785 | float EBNode_DetermineMaxSizeForEdge(int spnt, int sroom, int epnt, int eroom) { |
| 786 | bn_list *snlist; |
| 787 | snlist = BNode_GetBNListPtr(sroom); |
| 788 | bn_list *enlist; |
| 789 | enlist = BNode_GetBNListPtr(eroom); |
| 790 | |
| 791 | float size = 0.0f; |
| 792 | fvi_info hit_info; |
| 793 | fvi_query fq; |
| 794 | int fate; |
| 795 | |
| 796 | // shoot a ray from the light position to the current vertex |
| 797 | fq.flags = FQ_IGNORE_RENDER_THROUGH_PORTALS; |
| 798 | fq.thisobjnum = -1; |
| 799 | fq.ignore_obj_list = NULL; |
| 800 | |
| 801 | do { |
| 802 | fq.p0 = &snlist->nodes[spnt].pos; |
| 803 | fq.p1 = &enlist->nodes[epnt].pos; |
| 804 | fq.startroom = (sroom > Highest_room_index && sroom <= Highest_room_index + 8) |
| 805 | ? GetTerrainRoomFromPos(&snlist->nodes[spnt].pos) |
| 806 | : sroom; |
| 807 | fq.rad = size; |
| 808 | |
| 809 | fate = fvi_FindIntersection(&fq, &hit_info); |
| 810 | |
| 811 | if (fate == HIT_NONE) { |
| 812 | fq.p0 = &enlist->nodes[epnt].pos; |
| 813 | fq.p1 = &snlist->nodes[spnt].pos; |
| 814 | fq.startroom = (eroom > Highest_room_index && eroom <= Highest_room_index + 8) |
| 815 | ? GetTerrainRoomFromPos(&enlist->nodes[epnt].pos) |
| 816 | : eroom; |
| 817 | fq.rad = size; |
| 818 | |
| 819 | fate = fvi_FindIntersection(&fq, &hit_info); |
| 820 | } |
| 821 | |
| 822 | if (fate == HIT_NONE) { |
| 823 | size += 1.0f; |
| 824 | } |
| 825 | } while (fate == HIT_NONE && size < MAX_BNODE_SIZE + 1.0f); |
| 826 | |
| 827 | return (size - 1.0f); |
| 828 | } |
| 829 | |
| 830 | void EBNode_AutoEdgeNode(int spnt, int sroom) { |
| 831 | BNode_verified = false; |
no test coverage detected