From 8498d8d80251378790604dc3d2dcb9d0206284f3 Mon Sep 17 00:00:00 2001 From: Steven Franklin Date: Thu, 14 Mar 2024 03:33:31 -0500 Subject: [PATCH 1/5] polycollection2d fix - im stupid, turns out it's a vec3 for the vPos's offset and it also applies to POLYCOLLECTION2D and presumably CIRCLE as well... --- .../formats/collision.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mercury_engine_data_structures/formats/collision.py b/src/mercury_engine_data_structures/formats/collision.py index b9db2502..290fbc5a 100644 --- a/src/mercury_engine_data_structures/formats/collision.py +++ b/src/mercury_engine_data_structures/formats/collision.py @@ -2,7 +2,7 @@ from construct import Array, Flag, Hex, IfThenElse, Int16ul, Rebuild, Struct from mercury_engine_data_structures import game_check -from mercury_engine_data_structures.common_types import CVector2D, Float, UInt, make_vector +from mercury_engine_data_structures.common_types import CVector2D, CVector3D, Float, UInt, make_vector from mercury_engine_data_structures.construct_extensions.misc import OptionalValue from mercury_engine_data_structures.game_check import Game @@ -38,14 +38,11 @@ collision_formats = { "AABOX2D": Struct( - center=CVector2D, - unk=Float, + offset=CVector3D, size=CVector2D, ), "CIRCLE": Struct( - value1=Float, - value2=Float, - value3=Float, + offset=CVector3D, size=Float, ), "CAPSULE2D": Struct( @@ -56,9 +53,7 @@ value5=Float, ), "POLYCOLLECTION2D": Struct( - unknown1=UInt, - unknown2=UInt, - unknown3=UInt, + offset=CVector3D, polys=make_vector(CollisionPoly), total_boundings=Array(4, Float), binary_search_trees=OptionalValue(make_vector(BinarySearchTree)), From 825a68f6905b6b1915db358eacdc795a82b9ab4c Mon Sep 17 00:00:00 2001 From: Steven Franklin Date: Thu, 14 Mar 2024 03:39:41 -0500 Subject: [PATCH 2/5] review fixes --- src/mercury_engine_data_structures/formats/collision.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mercury_engine_data_structures/formats/collision.py b/src/mercury_engine_data_structures/formats/collision.py index 290fbc5a..d18a0caa 100644 --- a/src/mercury_engine_data_structures/formats/collision.py +++ b/src/mercury_engine_data_structures/formats/collision.py @@ -38,11 +38,11 @@ collision_formats = { "AABOX2D": Struct( - offset=CVector3D, + position=CVector3D, size=CVector2D, ), "CIRCLE": Struct( - offset=CVector3D, + position=CVector3D, size=Float, ), "CAPSULE2D": Struct( @@ -53,7 +53,7 @@ value5=Float, ), "POLYCOLLECTION2D": Struct( - offset=CVector3D, + position=CVector3D, polys=make_vector(CollisionPoly), total_boundings=Array(4, Float), binary_search_trees=OptionalValue(make_vector(BinarySearchTree)), From f58fb54148c42e7cd6b84e7c66db891c97cf2073 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 7 Apr 2024 02:24:06 +0200 Subject: [PATCH 3/5] fix linter warnings --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 37d83202..f2900ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,8 +63,8 @@ filterwarnings = [ [tool.ruff] line-length = 120 -select = ["E", "F", "W", "C90", "I", "UP"] -src = ["src"] +lint.select = ["E", "F", "W", "C90", "I", "UP"] +lint.src = ["src"] # Version to target for generated code. target-version = "py38" @@ -72,4 +72,4 @@ target-version = "py38" [tool.ruff.mccabe] # Flag errors (`C901`) whenever the complexity level exceeds 25. # Defaults to 10, but we're being very flexible right now -max-complexity = 25 \ No newline at end of file +max-complexity = 25 From fad72a4d17cb5ea872086041c5308118d21da001 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 7 Apr 2024 02:25:54 +0200 Subject: [PATCH 4/5] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f2900ee7..13af622b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,13 +63,13 @@ filterwarnings = [ [tool.ruff] line-length = 120 -lint.select = ["E", "F", "W", "C90", "I", "UP"] +select = ["E", "F", "W", "C90", "I", "UP"] lint.src = ["src"] # Version to target for generated code. target-version = "py38" -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] # Flag errors (`C901`) whenever the complexity level exceeds 25. # Defaults to 10, but we're being very flexible right now max-complexity = 25 From 7c8a7e9257af30f5f74044ffa2820b1b571ae992 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 7 Apr 2024 02:27:01 +0200 Subject: [PATCH 5/5] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 13af622b..23a83c5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,8 +63,8 @@ filterwarnings = [ [tool.ruff] line-length = 120 -select = ["E", "F", "W", "C90", "I", "UP"] -lint.src = ["src"] +lint.select = ["E", "F", "W", "C90", "I", "UP"] +src = ["src"] # Version to target for generated code. target-version = "py38"