MCPcopy Create free account
hub / github.com/demoth/jake2 / CM_WriteAreaBits

Method CM_WriteAreaBits

qcommon/src/main/java/jake2/qcommon/CM.java:1693–1713  ·  view source on GitHub ↗

CM_WriteAreaBits writes a length byte followed by a bit vector of all the areas that area in the same flood as the area parameter This is used by the client refreshes to cull visibility.

(byte[] buffer, int area)

Source from the content-addressed store, hash-verified

1691 * This is used by the client refreshes to cull visibility.
1692 */
1693 public int CM_WriteAreaBits(byte[] buffer, int area) {
1694 int i;
1695 int floodnum;
1696 int bytes;
1697
1698 bytes = (numareas + 7) >> 3;
1699
1700 if (map_noareas.value != 0) {
1701 // for debugging, send everything
1702 Arrays.fill(buffer, 0, bytes, (byte) 255);
1703 } else {
1704 Arrays.fill(buffer, 0, bytes, (byte) 0);
1705 floodnum = map_areas[area].floodnum;
1706 for (i = 0; i < numareas; i++) {
1707 if (map_areas[i].floodnum == floodnum || area == 0)
1708 buffer[i >> 3] |= 1 << (i & 7);
1709 }
1710 }
1711
1712 return bytes;
1713 }
1714
1715 /**
1716 * CM_WritePortalState writes the portal state to a savegame file.

Callers 1

SV_BuildClientFrameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected