MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CM_WriteAreaBits

Function CM_WriteAreaBits

code/qcommon/cm_test.cpp:636–663  ·  view source on GitHub ↗

================= 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 ================= */

Source from the content-addressed store, hash-verified

634=================
635*/
636int 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
665void CM_SnapPVS(vec3_t origin,byte *buffer)
666{

Callers 2

CM_SnapPVSFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected