================= CM_WriteAreaBits Writes a bit vector of all the areas that are in the same flood as the area parameter Returns the number of bytes needed to hold all the bits. The bits are OR'd in, so you can CM_WriteAreaBits from multiple viewpoints and get the union of all visible areas. This is used to cull non-visible entities from snapshots ================= */
| 634 | ================= |
| 635 | */ |
| 636 | int CM_WriteAreaBits (byte *buffer, int area) |
| 637 | { |
| 638 | int i; |
| 639 | int floodnum; |
| 640 | int bytes; |
| 641 | |
| 642 | bytes = (cmg.numAreas+7)>>3; |
| 643 | |
| 644 | #ifndef BSPC |
| 645 | if (cm_noAreas->integer || area == -1) |
| 646 | #else |
| 647 | if ( area == -1) |
| 648 | #endif |
| 649 | { // for debugging, send everything |
| 650 | memset (buffer, 255, bytes); |
| 651 | } |
| 652 | else |
| 653 | { |
| 654 | floodnum = cmg.areas[area].floodnum; |
| 655 | for (i=0 ; i<cmg.numAreas ; i++) |
| 656 | { |
| 657 | if (cmg.areas[i].floodnum == floodnum || area == -1) |
| 658 | buffer[i>>3] |= 1<<(i&7); |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | return bytes; |
| 663 | } |
| 664 | |
| 665 | void CM_SnapPVS(vec3_t origin,byte *buffer) |
| 666 | { |
no outgoing calls
no test coverage detected