Skip to content

Commit

Permalink
(#112) fix quake2.Visibility.as_bytes()
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-biscuits committed Jul 1, 2023
1 parent 36a3789 commit 00afa6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bsp_tool/branches/id_software/quake2.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ def as_bytes(self) -> bytes:
# TODO: test
# TODO: reduce pvs & pas to a set of each unique flag sequence
# -- then index that fixed list of pvs/pas flags for extra compression
assert len(self.PVS) == len(self.PAS)
num_clusters = len(self.PVS)
compressed_pvs = [self.run_length_encode(d) for d in self.PVS]
compressed_pas = [self.run_length_encode(d) for d in self.PAS]
assert len(self.pvs) == len(self.pas)
num_clusters = len(self.pvs)
compressed_pvs = [self.run_length_encode(d) for d in self.pvs]
compressed_pas = [self.run_length_encode(d) for d in self.pas]
pvs_offsets = [4 + sum(map(len, compressed_pvs[:i])) for i in range(num_clusters)]
offset = pvs_offsets[-1] + len(compressed_pvs[-1])
pas_offsets = [offset + sum(map(len, compressed_pas[:i])) for i in range(num_clusters)]
Expand Down

0 comments on commit 00afa6a

Please sign in to comment.