diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index a5ec044e9d..d8aa81df06 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -3,6 +3,7 @@ #include "color.h" #include "gfx.h" #include "sfx.h" +#include "z64transition.h" typedef enum TransitionCircleDirection { /* 0 */ TRANS_CIRCLE_DIR_IN, diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c index 80dc643430..6624a4373c 100644 --- a/src/code/z_fbdemo_triforce.c +++ b/src/code/z_fbdemo_triforce.c @@ -1,6 +1,8 @@ #include "transition_triforce.h" #include "printf.h" +#include "z64math.h" +#include "z64transition_instances.h" #include "assets/code/fbdemo_triforce/code.c" diff --git a/tools/assets/extract/extase/__init__.py b/tools/assets/extract/extase/__init__.py index 9320879c48..a40c9765c2 100644 --- a/tools/assets/extract/extase/__init__.py +++ b/tools/assets/extract/extase/__init__.py @@ -8,7 +8,7 @@ import enum import reprlib import io -from typing import TYPE_CHECKING, Sequence, Optional, Union, Any +from typing import TYPE_CHECKING, Sequence, Optional, Union, Any, Iterable from pprint import pprint @@ -641,13 +641,6 @@ class File: with self.source_c_path.open("w") as c: with self.source_h_path.open("w") as h: - # TODO rework how files to include are picked - headers_includes = ( - '#include "ultra64.h"\n', - '#include "z64.h"\n', - '#include "segment_symbols.h"\n', - ) - # Paths to files to be included file_include_paths_complete: list[Path] = [] file_include_paths_complete.append(self.source_h_path) @@ -672,11 +665,25 @@ class File: path = path_complete file_include_paths.append(path) - c.writelines(headers_includes) - c.write("\n") + included_headers_in_c = set() + included_headers_in_h = set() + + for resource in self._resources: + incls = resource.get_c_includes() + assert not isinstance(incls, str) + included_headers_in_c.update(incls) + + incls = resource.get_h_includes() + assert not isinstance(incls, str) + included_headers_in_h.update(incls) + for file_include_path in file_include_paths: c.write(f'#include "{file_include_path}"\n') c.write("\n") + c.writelines( + f'#include "{_h}"\n' for _h in sorted(included_headers_in_c) + ) + c.write("\n") INCLUDE_GUARD = self.source_file_name.upper() + "_H" @@ -687,7 +694,9 @@ class File: "\n", ) ) - h.writelines(headers_includes) + h.writelines( + f'#include "{_h}"\n' for _h in sorted(included_headers_in_h) + ) h.write("\n") if not self._is_resources_sorted: @@ -937,6 +946,12 @@ class Resource(abc.ABC): self.extract_to_path = extract_to_path self.inc_c_path = inc_c_path + def get_c_includes(self) -> Iterable[str]: + return () + + def get_h_includes(self) -> Iterable[str]: + return () + @abc.abstractmethod def write_extracted(self, memory_context: "MemoryContext") -> None: """Write the extracted resource data to self.extract_to_path""" @@ -1037,6 +1052,9 @@ class ZeroPaddingResource(Resource): def get_c_reference(self, resource_offset): raise ValueError("Referencing zero padding should not happen") + def get_c_includes(self): + return ("ultra64.h",) + def write_extracted(self, memory_context): # No need to extract zeros pass @@ -1073,6 +1091,9 @@ class BinaryBlobResource(Resource): def get_filename_stem(self): return super().get_filename_stem() + ".u8" + def get_h_includes(self): + return ("ultra64.h",) + def write_extracted(self, memory_context): data = self.file.data[self.range_start : self.range_end] assert len(data) == self.range_end - self.range_start diff --git a/tools/assets/extract/extase/cdata_resources.py b/tools/assets/extract/extase/cdata_resources.py index 3c5ce74c23..467d39897a 100644 --- a/tools/assets/extract/extase/cdata_resources.py +++ b/tools/assets/extract/extase/cdata_resources.py @@ -420,6 +420,9 @@ class Vec3sArrayResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64math.h",) + class S16ArrayResource(CDataResource): @@ -447,6 +450,9 @@ class S16ArrayResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("ultra64.h",) + cdata_ext_Vec3f = CDataExt_Struct( ( diff --git a/tools/assets/extract/extase_oot64/animation_resources.py b/tools/assets/extract/extase_oot64/animation_resources.py index a05b5eb912..ec7e4bbac3 100644 --- a/tools/assets/extract/extase_oot64/animation_resources.py +++ b/tools/assets/extract/extase_oot64/animation_resources.py @@ -49,6 +49,9 @@ class AnimationFrameDataResource(CDataResource, can_size_be_unknown=True): else: raise ValueError() + def get_h_includes(self): + return ("ultra64.h",) + class AnimationJointIndicesResource(CDataResource, can_size_be_unknown=True): elem_cdata_ext = CDataExt_Struct( @@ -80,6 +83,9 @@ class AnimationJointIndicesResource(CDataResource, can_size_be_unknown=True): else: raise ValueError() + def get_h_includes(self): + return ("z64animation.h",) + class AnimationResource(CDataResource): def write_frameData( @@ -194,3 +200,6 @@ class AnimationResource(CDataResource): def get_c_declaration_base(self): return f"AnimationHeader {self.symbol_name}" + + def get_h_includes(self): + return ("z64animation.h",) diff --git a/tools/assets/extract/extase_oot64/collision_resources.py b/tools/assets/extract/extase_oot64/collision_resources.py index f6ababd0c8..1c8558676e 100644 --- a/tools/assets/extract/extase_oot64/collision_resources.py +++ b/tools/assets/extract/extase_oot64/collision_resources.py @@ -55,6 +55,9 @@ class CollisionVtxListResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64math.h",) + class CollisionPolyListResource(CDataResource): def write_vtxData( @@ -160,6 +163,9 @@ class CollisionPolyListResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64bgcheck.h",) + class CollisionSurfaceTypeListResource(CDataResource): def write_data( @@ -263,6 +269,9 @@ class CollisionSurfaceTypeListResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64bgcheck.h",) + class BgCamFuncDataResource(CDataResource): element_cdata_ext = cdata_ext_Vec3s @@ -287,6 +296,9 @@ class BgCamFuncDataResource(CDataResource): index = resource_offset // self.element_cdata_ext.size return f"&{self.symbol_name}[{index}]" + def get_h_includes(self): + return ("z64math.h",) + class CollisionBgCamListResource(CDataResource): def write_bgCamFuncData( @@ -381,6 +393,12 @@ class CollisionBgCamListResource(CDataResource): else: raise ValueError() + def get_c_includes(self): + return ("z64camera.h",) + + def get_h_includes(self): + return ("z64bgcheck.h",) + class CollisionWaterBoxesResource(CDataResource): elem_cdata_ext = CDataExt_Struct( @@ -414,6 +432,9 @@ class CollisionWaterBoxesResource(CDataResource): else: raise ValueError + def get_h_includes(self): + return ("z64bgcheck.h",) + def transfer_HACK_IS_STATIC_ON(source, dest): if hasattr(source, "HACK_IS_STATIC_ON"): @@ -737,3 +758,9 @@ class CollisionResource(CDataResource): return f"&{self.symbol_name}" else: raise ValueError() + + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("z64bgcheck.h",) diff --git a/tools/assets/extract/extase_oot64/dlist_resources.py b/tools/assets/extract/extase_oot64/dlist_resources.py index 32ca8d5328..d883f1907b 100644 --- a/tools/assets/extract/extase_oot64/dlist_resources.py +++ b/tools/assets/extract/extase_oot64/dlist_resources.py @@ -105,6 +105,9 @@ class MtxResource(CDataResource): else: raise ValueError + def get_h_includes(self): + return ("ultra64.h",) + class VtxArrayResource(CDataResource): def write_elem(resource, memory_context, v, wctx: CDataExtWriteContext): @@ -155,6 +158,12 @@ class VtxArrayResource(CDataResource): index = resource_offset // self.element_cdata_ext.size return f"&{self.symbol_name}[{index}]" + def get_c_includes(self): + return ("gfx.h",) + + def get_h_includes(self): + return ("ultra64.h",) + from ...n64 import G_IM_FMT, G_IM_SIZ, G_TT, G_MDSFT_TEXTLUT from ... import n64texconv @@ -491,6 +500,9 @@ class TextureResource(Resource): ) super().write_c_declaration(h) + def get_h_includes(self): + return ("ultra64.h",) + @reprlib.recursive_repr() def __repr__(self): return super().__repr__().removesuffix(")") + ( @@ -1467,6 +1479,15 @@ class DListResource(Resource, can_size_be_unknown=True): if not self.braces_in_source: f.write(b"}\n") + def get_c_includes(self): + return ( + # TODO these are not always needed: + "sys_matrix.h", # for gIdentityMtx + ) + + def get_h_includes(self): + return ("ultra64.h",) + def report_gfx_segmented(resource: Resource, memory_context: "MemoryContext", v): assert isinstance(v, int) diff --git a/tools/assets/extract/extase_oot64/misc_resources.py b/tools/assets/extract/extase_oot64/misc_resources.py index c160bb3942..6f5f3a8265 100644 --- a/tools/assets/extract/extase_oot64/misc_resources.py +++ b/tools/assets/extract/extase_oot64/misc_resources.py @@ -42,8 +42,6 @@ class CutsceneResource(Resource, can_size_be_unknown=True): def write_extracted(self, memory_context): with self.extract_to_path.open("w") as f: - # TODO move include at the top of the file - f.write('#include "z64cutscene_commands.h"\n') if not self.braces_in_source: f.write("{\n") f.write(self.cs_source) @@ -52,3 +50,14 @@ class CutsceneResource(Resource, can_size_be_unknown=True): def get_c_declaration_base(self): return f"CutsceneData {self.symbol_name}[]" + + def get_c_includes(self): + return ( + "z64cutscene_commands.h", + # TODO these are not always needed: + "z64ocarina.h", # for OCARINA_ACTION_* + "z64player.h", # for PLAYER_CUEID_* + ) + + def get_h_includes(self): + return ("z64cutscene.h",) diff --git a/tools/assets/extract/extase_oot64/playeranim_resources.py b/tools/assets/extract/extase_oot64/playeranim_resources.py index b159d8a67a..b002f91ff9 100644 --- a/tools/assets/extract/extase_oot64/playeranim_resources.py +++ b/tools/assets/extract/extase_oot64/playeranim_resources.py @@ -34,6 +34,9 @@ class PlayerAnimationDataResource(CDataArrayResource): def get_c_declaration_base(self): return f"s16 {self.symbol_name}[{self.frame_count_name} * (PLAYER_LIMB_MAX * 3 + 1)]" + def get_h_includes(self): + return ("ultra64.h", "z64player.h") + class PlayerAnimationResource(CDataResource): @@ -94,3 +97,6 @@ class PlayerAnimationResource(CDataResource): def get_c_declaration_base(self): return f"LinkAnimationHeader {self.symbol_name}" + + def get_h_includes(self): + return ("z64animation.h",) diff --git a/tools/assets/extract/extase_oot64/room_shape_resources.py b/tools/assets/extract/extase_oot64/room_shape_resources.py index c023803572..740adbf72d 100644 --- a/tools/assets/extract/extase_oot64/room_shape_resources.py +++ b/tools/assets/extract/extase_oot64/room_shape_resources.py @@ -112,6 +112,9 @@ class RoomShapeNormalEntryArrayResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"RoomShapeDListsEntry {self.symbol_name}[{self.length_name}]" + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeNormalResource(CDataResource): def write_numEntries( @@ -184,6 +187,12 @@ class RoomShapeNormalResource(CDataResource): else: raise ValueError + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeDListsEntryResource(CDataResource): cdata_ext = cdata_ext_RoomShapeDListsEntry @@ -197,6 +206,9 @@ class RoomShapeDListsEntryResource(CDataResource): else: raise ValueError + def get_h_includes(self): + return ("z64room.h",) + def report_RoomShapeImageBase_entry(resource, memory_context: "MemoryContext", v): assert isinstance(v, int) @@ -271,6 +283,12 @@ class JFIFResource(Resource): else: raise ValueError + def get_h_includes(self): + return ( + "ultra64.h", + "gfx.h", # for SCREEN_WIDTH, SCREEN_HEIGHT + ) + class RoomShapeImageSingleResource(CDataResource): def report_source(resource, memory_context: "MemoryContext", v): @@ -324,6 +342,9 @@ class RoomShapeImageSingleResource(CDataResource): else: raise ValueError + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeImageMultiBgEntryArrayResource(CDataArrayNamedLengthResource): def report_source(resource, memory_context: "MemoryContext", v): @@ -373,6 +394,9 @@ class RoomShapeImageMultiBgEntryArrayResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"RoomShapeImageMultiBgEntry {self.name}[{self.length_name}]" + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeImageMultiResource(CDataResource): def write_numBackgrounds( @@ -437,6 +461,9 @@ class RoomShapeImageMultiResource(CDataResource): else: raise ValueError + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeCullableEntryArrayResource(CDataArrayNamedLengthResource): elem_cdata_ext = CDataExt_Struct( @@ -451,6 +478,9 @@ class RoomShapeCullableEntryArrayResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"RoomShapeCullableEntry {self.symbol_name}[{self.length_name}]" + def get_h_includes(self): + return ("z64room.h",) + class RoomShapeCullableResource(CDataResource): def write_numEntries( @@ -522,3 +552,6 @@ class RoomShapeCullableResource(CDataResource): return f"&{self.symbol_name}" else: raise ValueError + + def get_h_includes(self): + return ("z64room.h",) diff --git a/tools/assets/extract/extase_oot64/scene_commands_resource.py b/tools/assets/extract/extase_oot64/scene_commands_resource.py index 12f92e146f..a02e6417b9 100644 --- a/tools/assets/extract/extase_oot64/scene_commands_resource.py +++ b/tools/assets/extract/extase_oot64/scene_commands_resource.py @@ -631,6 +631,17 @@ class SceneCommandsResource(Resource, can_size_be_unknown=True): else: raise ValueError + def get_c_includes(self): + return ( + "array_count.h", + # TODO these are not always needed: + "sequence.h", # for NATURE_ID_* and NA_BGM_* + "z64skybox.h", # for SKYBOX_* + ) + + def get_h_includes(self): + return ("z64scene.h",) + class AltHeadersResource(CDataArrayResource): def report_elem(resource, memory_context: "MemoryContext", v): @@ -699,3 +710,6 @@ class AltHeadersResource(CDataArrayResource): def get_c_declaration_base(self): return f"SceneCmd* {self.symbol_name}[]" + + def get_h_includes(self): + return ("z64scene.h",) diff --git a/tools/assets/extract/extase_oot64/scene_rooms_resources.py b/tools/assets/extract/extase_oot64/scene_rooms_resources.py index d361c6cf97..aabab9b79e 100644 --- a/tools/assets/extract/extase_oot64/scene_rooms_resources.py +++ b/tools/assets/extract/extase_oot64/scene_rooms_resources.py @@ -75,6 +75,12 @@ class ActorEntryListResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"ActorEntry {self.symbol_name}[{self.length_name}]" + def get_c_includes(self): + return ("z64actor.h",) + + def get_h_includes(self): + return ("z64scene.h",) + class ObjectListResource(CDataArrayNamedLengthResource): elem_cdata_ext = CDataExt_Value("h").set_write_str_v( @@ -84,6 +90,12 @@ class ObjectListResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"s16 {self.symbol_name}[{self.length_name}]" + def get_c_includes(self): + return ("z64object.h",) + + def get_h_includes(self): + return ("ultra64.h",) + def write_RomFile( resource, memory_context: "MemoryContext", v, wctx: CDataExtWriteContext @@ -113,6 +125,13 @@ class RoomListResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"RomFile {self.symbol_name}[{self.length_name}]" + def get_c_includes(self): + # TODO use DECLARE_ROM_SEGMENT to declare rooms rom files + return ("segment_symbols.h",) + + def get_h_includes(self): + return ("romfile.h",) + class SpawnListResource(CDataArrayResource): elem_cdata_ext = CDataExt_Struct( @@ -236,6 +255,9 @@ class SpawnListResource(CDataArrayResource): def get_c_declaration_base(self): return f"Spawn {self.symbol_name}[]" + def get_h_includes(self): + return ("z64scene.h",) + class ExitListResource(CDataArrayResource): elem_cdata_ext = CDataExt_Value("h").set_write_str_v( @@ -247,6 +269,9 @@ class ExitListResource(CDataArrayResource): def get_c_declaration_base(self): return f"s16 {self.symbol_name}[]" + def get_h_includes(self): + return ("ultra64.h",) + class EnvLightSettingsListResource(CDataArrayNamedLengthResource): # TODO formatting @@ -266,6 +291,9 @@ class EnvLightSettingsListResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"EnvLightSettings {self.symbol_name}[{self.length_name}]" + def get_h_includes(self): + return ("z64environment.h",) + class TransitionActorEntryListResource(CDataArrayNamedLengthResource): def write_elem(resource, memory_context, v, wctx: CDataExtWriteContext): @@ -339,6 +367,12 @@ class TransitionActorEntryListResource(CDataArrayNamedLengthResource): def get_c_declaration_base(self): return f"TransitionActorEntry {self.symbol_name}[{self.length_name}]" + def get_c_includes(self): + return ("z64actor.h",) + + def get_h_includes(self): + return ("z64scene.h",) + class PathListResource(CDataArrayResource): def report_elem(resource, memory_context: "MemoryContext", v): @@ -394,3 +428,6 @@ class PathListResource(CDataArrayResource): def get_c_declaration_base(self): return f"Path {self.symbol_name}[]" + + def get_h_includes(self): + return ("z64path.h",) diff --git a/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py b/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py index ba902dd3f3..056e49762b 100644 --- a/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py +++ b/tools/assets/extract/extase_oot64/skelanime_legacy_resources.py @@ -78,6 +78,9 @@ class LegacyLimbResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64animation_legacy.h",) + class LegacyJointKeyArrayResource(CDataArrayResource): elem_cdata_ext = CDataExt_Struct( @@ -100,6 +103,9 @@ class LegacyJointKeyArrayResource(CDataArrayResource): else: raise ValueError() + def get_h_includes(self): + return ("z64animation_legacy.h",) + class LegacyAnimationResource(CDataResource): @@ -200,7 +206,13 @@ class LegacyAnimationResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64animation_legacy.h",) + class LegacyLimbsArrayResource(skeleton_resources.LimbsArrayResourceABC): limb_type = LegacyLimbResource c_limb_type = "LegacyLimb" + + def get_h_includes(self): + return ("z64animation_legacy.h",) diff --git a/tools/assets/extract/extase_oot64/skelcurve_resources.py b/tools/assets/extract/extase_oot64/skelcurve_resources.py index e422542777..4b140c2568 100644 --- a/tools/assets/extract/extase_oot64/skelcurve_resources.py +++ b/tools/assets/extract/extase_oot64/skelcurve_resources.py @@ -46,6 +46,9 @@ class KnotCountsArrayResource(CDataResource, can_size_be_unknown=True): else: raise ValueError() + def get_h_includes(self): + return ("ultra64.h",) + class CurveInterpKnotArrayResource(CDataResource, can_size_be_unknown=True): elem_cdata_ext = CDataExt_Struct( @@ -79,6 +82,9 @@ class CurveInterpKnotArrayResource(CDataResource, can_size_be_unknown=True): else: raise ValueError() + def get_h_includes(self): + return ("z64curve.h",) + class ConstantDataArrayResource(CDataResource, can_size_be_unknown=True): elem_cdata_ext = CDataExt_Value.s16 @@ -104,6 +110,9 @@ class ConstantDataArrayResource(CDataResource, can_size_be_unknown=True): else: raise ValueError() + def get_h_includes(self): + return ("ultra64.h",) + class CurveAnimationHeaderResource(CDataResource): def report_knotCounts(resource, memory_context: "MemoryContext", v): @@ -244,6 +253,9 @@ class CurveAnimationHeaderResource(CDataResource): def get_c_reference(self, resource_offset: int): raise ValueError() + def get_h_includes(self): + return ("z64curve.h",) + class SkelCurveLimbResource(CDataResource): cdata_ext = CDataExt_Struct( @@ -270,6 +282,9 @@ class SkelCurveLimbResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64curve.h",) + class SkelCurveLimbArrayResource(CDataResource): def report_limb_element(resource, memory_context: "MemoryContext", v): @@ -312,6 +327,9 @@ class SkelCurveLimbArrayResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64curve.h",) + class CurveSkeletonHeaderResource(CDataResource): def report_limbs(resource, memory_context: "MemoryContext", v): @@ -355,3 +373,6 @@ class CurveSkeletonHeaderResource(CDataResource): def get_c_reference(self, resource_offset: int): raise ValueError() + + def get_h_includes(self): + return ("z64curve.h",) diff --git a/tools/assets/extract/extase_oot64/skeleton_resources.py b/tools/assets/extract/extase_oot64/skeleton_resources.py index 08611263fd..a3459d1172 100644 --- a/tools/assets/extract/extase_oot64/skeleton_resources.py +++ b/tools/assets/extract/extase_oot64/skeleton_resources.py @@ -74,6 +74,9 @@ class StandardLimbResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64animation.h",) + class LODLimbResource(CDataResource): cdata_ext = CDataExt_Struct( @@ -107,6 +110,9 @@ class LODLimbResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64animation.h",) + class LimbsArrayResourceABC(CDataArrayResource): limb_type: type[CDataResource] @@ -289,6 +295,12 @@ class SkeletonResourceABC(SkeletonResourceBaseABC): def get_c_declaration_base(self): return f"SkeletonHeader {self.symbol_name}" + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("z64animation.h",) + class SkeletonNormalResource(SkeletonResourceABC): limbs_array_type = StandardLimbsArrayResource @@ -329,6 +341,12 @@ class SkeletonFlexResourceABC(SkeletonResourceBaseABC): def get_c_declaration_base(self): return f"FlexSkeletonHeader {self.symbol_name}" + def get_c_includes(self): + return ("array_count.h",) + + def get_h_includes(self): + return ("z64animation.h",) + class SkeletonFlexResource(SkeletonFlexResourceABC): skeleton_type = SkeletonNormalResource diff --git a/tools/assets/extract/extase_oot64/skeleton_skin_resources.py b/tools/assets/extract/extase_oot64/skeleton_skin_resources.py index e5a1d58635..b1ad1e5b3a 100644 --- a/tools/assets/extract/extase_oot64/skeleton_skin_resources.py +++ b/tools/assets/extract/extase_oot64/skeleton_skin_resources.py @@ -37,6 +37,9 @@ class SkinVertexArrayResource(CDataArrayResource): def get_c_declaration_base(self): return f"SkinVertex {self.symbol_name}[]" + def get_h_includes(self): + return ("z64skin.h",) + class SkinTransformationArrayResource(CDataArrayResource): elem_cdata_ext = CDataExt_Struct( @@ -54,6 +57,9 @@ class SkinTransformationArrayResource(CDataArrayResource): def get_c_declaration_base(self): return f"SkinTransformation {self.symbol_name}[]" + def get_h_includes(self): + return ("z64skin.h",) + class SkinLimbModifArrayResource(CDataArrayResource): def report_elem(resource, memory_context: "MemoryContext", v): @@ -125,6 +131,9 @@ class SkinLimbModifArrayResource(CDataArrayResource): def get_c_declaration_base(self): return f"SkinLimbModif {self.symbol_name}[]" + def get_h_includes(self): + return ("z64skin.h",) + class SkinAnimatedLimbDataResource(CDataResource): def report_limbModifications(resource, memory_context: "MemoryContext", v): @@ -176,6 +185,9 @@ class SkinAnimatedLimbDataResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64skin.h",) + class SkinLimbResource(CDataResource): def report_segment(resource, memory_context: "MemoryContext", v): @@ -254,6 +266,9 @@ class SkinLimbResource(CDataResource): else: raise ValueError() + def get_h_includes(self): + return ("z64skin.h",) + class SkinLimbsArrayResource(skeleton_resources.LimbsArrayResourceABC): limb_type = SkinLimbResource