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

Method CM_DecompressVis

qcommon/src/main/java/jake2/qcommon/CM.java:1547–1582  ·  view source on GitHub ↗
(byte[] in, int offset, byte[] out)

Source from the content-addressed store, hash-verified

1545 * =================== CM_DecompressVis ===================
1546 */
1547 public void CM_DecompressVis(byte[] in, int offset, byte[] out) {
1548 int c;
1549
1550 int row;
1551
1552 row = (numclusters + 7) >> 3;
1553 int outp = 0;
1554 int inp = offset;
1555
1556 if (in == null || numvisibility == 0) { // no vis info, so make all
1557 // visible
1558 while (row != 0) {
1559 out[outp++] = (byte) 0xFF;
1560 row--;
1561 }
1562 return;
1563 }
1564
1565 do {
1566 if (in[inp] != 0) {
1567 out[outp++] = in[inp++];
1568 continue;
1569 }
1570
1571 c = in[inp + 1] & 0xFF;
1572 inp += 2;
1573 if (outp + c > row) {
1574 c = row - (outp);
1575 Com.DPrintf("warning: Vis decompression overrun\n");
1576 }
1577 while (c != 0) {
1578 out[outp++] = 0;
1579 c--;
1580 }
1581 } while (outp < row);
1582 }
1583
1584 public byte[] pvsrow = new byte[Defines.MAX_MAP_LEAFS / 8];
1585

Callers 2

CM_ClusterPVSMethod · 0.95
CM_ClusterPHSMethod · 0.95

Calls 1

DPrintfMethod · 0.95

Tested by

no test coverage detected