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

Method CM_ReadPortalState

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

CM_ReadPortalState reads the portal state from a savegame file and recalculates the area connections.

(RandomAccessFile f)

Source from the content-addressed store, hash-verified

1735 * connections.
1736 */
1737 public void CM_ReadPortalState(RandomAccessFile f) {
1738
1739 //was: FS_Read(portalopen, sizeof(portalopen), f);
1740 int len = portalopen.length * 4;
1741
1742 byte buf[] = new byte[len];
1743
1744 FS.Read(buf, len, f);
1745
1746 ByteBuffer bb = ByteBuffer.wrap(buf);
1747 IntBuffer ib = bb.asIntBuffer();
1748
1749 for (int n = 0; n < portalopen.length; n++)
1750 portalopen[n] = ib.get() != 0;
1751
1752 FloodAreaConnections();
1753 }
1754
1755 /**
1756 * CM_HeadnodeVisible returns true if any leaf under headnode has a cluster that is potentially

Callers 1

SV_ReadLevelFileMethod · 0.80

Calls 3

ReadMethod · 0.95
FloodAreaConnectionsMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected