-
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.
Showing
3 changed files
with
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from construct.core import ( | ||
Const, | ||
Flag, | ||
Struct, | ||
Terminated, | ||
) | ||
|
||
from mercury_engine_data_structures.base_resource import BaseResource | ||
from mercury_engine_data_structures.common_types import StrId, VersionAdapter, make_dict, make_vector | ||
|
||
if TYPE_CHECKING: | ||
from construct import Construct | ||
|
||
from mercury_engine_data_structures.game_check import Game | ||
|
||
Camera_Subarea_Setup = Struct( | ||
"environment_preset" / StrId, # bmsev | ||
"sound" / StrId, # bmses | ||
|
||
# the following 3 are almost always none, possibly extra groups? | ||
"unk2" / StrId, # lg or eg, only used in cockpit/credits scenarios | ||
"entity_group" / StrId, | ||
"block_group" / StrId, | ||
|
||
"cc_names" / make_vector(StrId), | ||
"actors_in_scenario" / make_vector(StrId), | ||
"cutscenes" / make_vector(StrId), # bmscu files | ||
"collision_layer" / StrId, # bmscd: entry in collision_layer | ||
"unk9" / Flag, | ||
) # fmt: skip | ||
|
||
CollisionCamera = Struct("setups" / make_dict(Camera_Subarea_Setup)) | ||
|
||
BMSSA = Struct( | ||
"_magic" / Const(b"MSSA"), | ||
"version" / VersionAdapter("1.22.0"), | ||
"cameras" / make_dict(CollisionCamera), | ||
Terminated, | ||
) | ||
|
||
|
||
class Bmssa(BaseResource): | ||
@classmethod | ||
def construct_class(cls, target_game: Game) -> Construct: | ||
return BMSSA |
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 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
from tests.test_lib import parse_build_compare_editor_parsed | ||
|
||
from mercury_engine_data_structures import samus_returns_data | ||
from mercury_engine_data_structures.formats.bmssa import Bmssa | ||
|
||
|
||
@pytest.mark.parametrize("bmssa_path", samus_returns_data.all_files_ending_with(".bmssa")) | ||
def test_compare_bmssa_msr(samus_returns_tree, bmssa_path): | ||
parse_build_compare_editor_parsed(Bmssa, samus_returns_tree, bmssa_path) |