-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cfcfb3
commit c577613
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import construct | ||
from construct import ( | ||
Array, | ||
Const, | ||
Construct, | ||
Float32l, | ||
Int16ul, | ||
Int32ul, | ||
Struct, | ||
) | ||
|
||
from mercury_engine_data_structures.common_types import StrId, make_vector | ||
from mercury_engine_data_structures.formats import BaseResource | ||
from mercury_engine_data_structures.game_check import Game | ||
|
||
VectorArray = Array(3, Float32l) | ||
|
||
BMSEM = Struct( | ||
_magic=Const(b"MSEM"), | ||
unk1=Int16ul, | ||
unk2=Int16ul, | ||
things= make_vector(Struct( | ||
"layer_name" / StrId, | ||
"objects" / make_vector(Struct( | ||
"whatever_name" / StrId, | ||
# "unk1" / Int32ul | ||
"inner_things" / make_vector(Struct( | ||
"first_part" / StrId, | ||
"second_part" / StrId, | ||
"unk3" / Int32ul, | ||
"unk4" / Int32ul, | ||
"unk6" / Int32ul, | ||
"unk7" / Int32ul | ||
)) | ||
)) | ||
)), | ||
rest=construct.GreedyBytes, | ||
) | ||
|
||
class Bmsem(BaseResource): | ||
@classmethod | ||
def construct_class(cls, target_game: Game) -> Construct: | ||
return BMSEM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
from tests.test_lib import parse_build_compare_editor | ||
|
||
from mercury_engine_data_structures import samus_returns_data | ||
from mercury_engine_data_structures.formats.bmsem import Bmsem | ||
|
||
all_sr_bmsmsd = [name for name in samus_returns_data.all_name_to_asset_id().keys() | ||
if name.endswith(".bmsem")] | ||
|
||
@pytest.mark.parametrize("bmsmsd_path", all_sr_bmsmsd) | ||
def test_bmsem(samus_returns_tree, bmsmsd_path): | ||
parse_build_compare_editor(Bmsem, samus_returns_tree, bmsmsd_path, print_data=True) |