Skip to content

Commit

Permalink
Merge pull request #92 from ThanatosGit/bmsmd-corrections
Browse files Browse the repository at this point in the history
Add tile type enum
  • Loading branch information
dyceron authored Oct 25, 2023
2 parents 1be332a + 8772063 commit fb052ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/mercury_engine_data_structures/formats/bmsmsd.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import functools

import construct
from construct.core import Const, Construct, Float32l, Hex, Int32sl, Int32ul, Struct
from construct.core import Const, Construct, Enum, Float32l, Hex, Int32sl, Int32ul, Struct

from mercury_engine_data_structures.common_types import CVector2D, CVector3D, StrId, make_vector
from mercury_engine_data_structures.formats import BaseResource
from mercury_engine_data_structures.game_check import Game

TileType = Enum(
Int32ul,
BLUE=1,
RED=2,
PURPLE=4
)

# BMSMSD
BMSMSD = Struct(
"_magic" / Const(b"MMSD"),
Expand All @@ -27,7 +34,7 @@
"top_right" / CVector2D,
),
"border_type" / Int32sl,
"tile_type" / Int32sl,
"tile_type" / TileType,
"icons" / make_vector(
Struct(
"actor_name" / StrId,
Expand Down
2 changes: 1 addition & 1 deletion tests/formats/test_bmsmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@


@pytest.mark.parametrize("bmsmsd_path", all_sr_bmsmsd)
def test_bmtun(samus_returns_tree, bmsmsd_path):
def test_bmsmsd(samus_returns_tree, bmsmsd_path):
parse_build_compare_editor(Bmsmsd, samus_returns_tree, bmsmsd_path)

0 comments on commit fb052ae

Please sign in to comment.