Skip to content

Commit

Permalink
Add length: property to gfx/vtx (#334)
Browse files Browse the repository at this point in the history
* Add length: property to gfx/vtx & improve yaml merging

* 1 bird
  • Loading branch information
ethteck authored Feb 3, 2024
1 parent ca03222 commit 312db7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/splat/segtypes/n64/gfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import re
from typing import Optional
from typing import Dict, List, Optional, Union

from pathlib import Path

Expand Down Expand Up @@ -275,3 +275,9 @@ def should_scan(self) -> bool:

def should_split(self) -> bool:
return self.extract and options.opts.is_mode_active("gfx")

@staticmethod
def estimate_size(yaml: Union[Dict, List]) -> Optional[int]:
if isinstance(yaml, dict) and "length" in yaml:
return yaml["length"] * 0x10
return None
8 changes: 7 additions & 1 deletion src/splat/segtypes/n64/vtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import struct
from pathlib import Path
from typing import Optional
from typing import Dict, List, Optional, Union

from ...util import options, log

Expand Down Expand Up @@ -100,3 +100,9 @@ def should_scan(self) -> bool:

def should_split(self) -> bool:
return self.extract and options.opts.is_mode_active("vtx")

@staticmethod
def estimate_size(yaml: Union[Dict, List]) -> Optional[int]:
if isinstance(yaml, dict) and "length" in yaml:
return yaml["length"] * 0x10
return None

0 comments on commit 312db7a

Please sign in to comment.