Skip to content

Commit

Permalink
(Titanfall Engine)(#86) GeoSet.primitive is a good name
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-biscuits committed Sep 20, 2024
1 parent d9f1206 commit d8576ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
20 changes: 11 additions & 9 deletions bsp_tool/branches/respawn/titanfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,16 +500,18 @@ class Cubemap(base.Struct): # LUMP 42 (002A)

class GeoSet(base.Struct): # LUMP 87 (0057)
# Parallel w/ GeoSetBounds
straddle_group: int # CMGrid counts straddle groups
num_primitives: int # start from primitive.index?
bitfield: List[int]
# bitfield.type: PrimitiveType # doesn't match children?
# bitfield.first_primitive: int # index into Primitives
# bitfield.unique_contents: int # index into UniqueContents
__slots__ = ["straddle_group", "num_primitives", "bitfield"]
straddle_group: int
# if == 0: only touches parent GridCell
# if != 0: touches multiple GridCells & might be cached already
num_primitives: int # special case if 1 (see below)
primitive: List[int]
# primitive.type: PrimitiveType # 0 if num_primitives > 1
# primitive.index: int # index into Primitives if num_primitives > 1
# primitive.unique_contents: int # index into UniqueContents
__slots__ = ["straddle_group", "num_primitives", "primitive"]
_format = "2HI"
_bitfields = {"bitfield": {"type": 8, "first_primitive": 16, "unique_contents": 8}}
_classes = {"bitfield.type": PrimitiveType}
_bitfields = {"primitive": {"type": 8, "index": 16, "unique_contents": 8}}
_classes = {"primitive.type": PrimitiveType}


# NOTE: only one 28 byte entry per file
Expand Down
16 changes: 8 additions & 8 deletions bsp_tool/branches/respawn/titanfall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ class GeoSet(base.Struct): # LUMP 87 (0057)
straddle_group: int
# if == 0: only touches parent GridCell
# if != 0: touches multiple GridCells & might be cached already
num_primitives: int
bitfield: List[int]
# bitfield.type: PrimitiveType # doesn't match children?
# bitfield.index: int # index into Primitives
# bitfield.unique_contents: int # index into UniqueContents
__slots__ = ["straddle_group", "num_primitives", "bitfield"]
num_primitives: int # special case if 1 (see below)
primitive: List[int]
# primitive.type: PrimitiveType # 0 if num_primitives > 1
# primitive.index: int # index into Primitives if num_primitives > 1
# primitive.unique_contents: int # index into UniqueContents
__slots__ = ["straddle_group", "num_primitives", "primitive"]
_format = "2HI"
_bitfields = {"bitfield": {"type": 8, "first_primitive": 16, "unique_contents": 8}}
_classes = {"bitfield.type": PrimitiveType}
_bitfields = {"primitive": {"type": 8, "index": 16, "unique_contents": 8}}
_classes = {"primitive.type": PrimitiveType}


class LightmapPage(base.Struct): # LUMP 122 (007A)
Expand Down

0 comments on commit d8576ab

Please sign in to comment.