diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-05-25 20:30:57 -0400 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2024-05-25 20:30:57 -0400 |
| commit | 1838276436649def38f68f509ddf7be6ab7374ad (patch) | |
| tree | 789427590ba610a9697d29e546a25b8973ca5cdf /include/f | |
| parent | df526e388b39951947717c1e6d6fc081171c25a1 (diff) | |
fixup profile list and added headers. (d_profile also started)
Diffstat (limited to 'include/f')
| -rw-r--r-- | include/f/f_profile.h | 17 | ||||
| -rw-r--r-- | include/f/f_profile_name.h | 5 |
2 files changed, 15 insertions, 7 deletions
diff --git a/include/f/f_profile.h b/include/f/f_profile.h index fa85c7b6..43ee7750 100644 --- a/include/f/f_profile.h +++ b/include/f/f_profile.h @@ -4,6 +4,7 @@ // Ported from https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_profile.hpp #include "f/f_profile_name.h" +#include <common.h> /// @brief Creates a profile of a base with given values for execute and draw order. #define SPECIAL_BASE_PROFILE(profName, className, executeOrder, drawOrder, baseProperties) \ @@ -18,8 +19,8 @@ void *className##_classInit() { \ return new className(); \ } \ - const fProfile::fActorProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, \ - baseProperties, properties} + fProfile::fActorProfile_c g_profile_##profName = {&className##_classInit, executeOrder, drawOrder, baseProperties, \ + properties} /// @brief Creates a profile for a base, with the profile number as the priority for both the draw and execute order. /// @see SPECIAL_BASE_PROFILE @@ -29,8 +30,10 @@ /// @brief Creates a profile of an actor with default values. @see DEFAULT_BASE_PROFILE #define DEFAULT_ACTOR_PROFILE(profName, className, baseProperties, properties) \ SPECIAL_ACTOR_PROFILE(profName, className, fProfile::profName, fProfile::profName, baseProperties, properties); + /* + fProfile::fActorProfile_c g_profile_NAME = { *class_init() profName executreOrder @@ -60,6 +63,8 @@ namespace fProfile { /// @brief A set of basic information needed to construct a base. /// @details A profile consists of a pointer to a constructor function /// and a priority value for execution and drawing order. +typedef void *(ClassInitFunc)(); + struct fBaseProfile_c { void *(*mpClassInit)(); ///< The constructor function. u16 m_execute_order; ///< The execution priority of the base. @@ -69,11 +74,15 @@ struct fBaseProfile_c { /// @brief A set of basic information needed to construct an actor. /// @details In addition to the fields in fBaseProfile_c, it also contains some properties about the actor. -struct fActorProfile_c : fBaseProfile_c { +struct fActorProfile_c /* : fBaseProfile_c */ { + void *(*mpClassInit)(); ///< The constructor function. + u16 m_execute_order; ///< The execution priority of the base. + u16 m_draw_order; ///< The draw priority of the base. + u32 mBaseProperties; u32 mActorProperties; ///< Some actor-related properties. @todo Document the bitfield. }; -extern fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles. +extern const fBaseProfile_c *(*sProfileList)[NUMBER_OF_ACTORS]; ///< A list of all profiles. } // namespace fProfile diff --git a/include/f/f_profile_name.h b/include/f/f_profile_name.h index a2cf3427..8ca2e818 100644 --- a/include/f/f_profile_name.h +++ b/include/f/f_profile_name.h @@ -1,8 +1,6 @@ #ifndef F_PROFILE_NAME #define F_PROFILE_NAME -#include <common.h> - namespace fProfile { enum PROFILE_NAME_e { @@ -712,6 +710,7 @@ enum PROFILE_NAME_e { /* 703 */ NUMBER_OF_ACTORS, INVALID, }; -}; + +} #endif |
