Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BorderType enum to bmsmsd #139

Merged
merged 3 commits into from
May 14, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/mercury_engine_data_structures/formats/bmsmsd.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import functools

import construct
from construct.core import Const, Construct, Enum, Float32l, Hex, Int32sl, Int32ul, Struct
from construct.core import Const, Construct, Enum, FlagsEnum, 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

BorderType = FlagsEnum(Int32sl,
TOP=1,
BOTTOM=2,
LEFT=4,
RIGHT=8,
OPEN_TOP=16,
OPEN_BOTTOM=32,
OPEN_LEFT=64,
OPEN_RIGHT=128,
)

TileType = Enum(
Int32ul,
NORMAL=1,
Expand All @@ -20,6 +31,7 @@
Int32sl,
METROID=-1,
ACTOR=0,
SHIP=1,
ENERGY_CLOUD=2,
DOOR=3,
CHOZO_SEAL=4,
Expand All @@ -45,7 +57,7 @@
"bottom_left" / CVector2D,
"top_right" / CVector2D,
),
"border_type" / Int32sl,
"border_type" / BorderType,
"tile_type" / TileType,
dyceron marked this conversation as resolved.
Show resolved Hide resolved
"icons" / make_vector(
Struct(
Expand Down