NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
docgroup.h
1#pragma once
2// [This header file defines documentation groups for better categorization]
3
4/**
5 * @defgroup framework Framework
6 * @ingroup game
7 * @brief Manages processes across the game, forming the core of the game engine.
8 * @details
9 * ## Introduction
10 * In New Super Mario Bros. Wii, almost all game logic exists within individual processes. Each process
11 * represents a distinct unit of game behavior and encapsulates specific functionalities.
12 *
13 * Nintendo refers to these processes as bases. Each type of base is defined by a profile, which
14 * determines its behaviour (is it a Goomba, Mario, the HUD, or the abstract concept of a world map?) and
15 * establishes its priority relative to other base types. More details about profiles can be found
16 * @ref profile "here".
17 *
18 * Processes follow a hierarchical tree structure:
19 * - Each process can have multiple siblings and children; this allows creating complex and intricate
20 * relationships between bases. An example is the Hammer Bro: all the hammers it throws are siblings of
21 * each other, and the Hammer Bro is their parent.
22 * - The root process for all bases is the current scene; this allows the game to clean up after itself by
23 * deleting all processes when switching between scenes. Further information on this topic can be found
24 * @ref dScene_c "here".
25 *
26 * ## Base Implementation
27 * All bases are derived from the fBase_c class, which defines the core elements of a process to provide
28 * common behaviour across all bases (for more detailed information, please refer to the fBase_c
29 * documentation). Numerous subclasses supply additional features on top, allowing bases to implement
30 * complex behaviour relatively easily whilst avoiding duplicate code.
31 *
32 * @hint{When creating a base, consider researching the existing subclasses to avoid unnecessary
33 * reimplementations.}
34 *
35 * The lifecycle of a base consists of multiple operations, whose behaviour can be overridden at any
36 * point in the class hierarchy. Each operation has an @xlink{./classfManager__c.html#implementation,
37 * associated linked list}, containing all bases for which said operation is scheduled for the current
38 * frame.
39 *
40 * fBase_c defines four core operations:
41 * - @p create runs immediately after construction (generally only once), and can be used to set up the
42 * base or load resources for it.
43 * - @p execute serves as the base's own main loop, running every frame.
44 * - @p draw offers an alternative main loop specifically for rendering code. It also runs every frame.
45 * - @p delete runs immediately before destruction (generally only once), and can be used to deallocate
46 * resources or remove links to other bases.
47 *
48 * The fManager_c class is responsible for managing the execution cycle of each base. It also offers
49 * various utilities for searching for bases meeting specific criteria.
50 *
51 * @{
52 *
53 * @defgroup profile fProfile
54 * @brief A profile is a basic set of information needed to construct a base.
55 * @details
56 *
57 * There exist two kinds of profiles:
58 * - @ref fProfile::fBaseProfile_c "fBaseProfile_c": A basic profile that includes a constructor function
59 * and a value for execution/drawing priority. All @ref fBase_c::GROUP_TYPE_e "non-actor bases" utilize this
60 * profile type.
61 * - @ref fProfile::fActorProfile_c "fActorProfile_c": A specialized profile dedicated to
62 * @ref fBase_c::GROUP_TYPE_e::ACTOR "actor bases", featuring additional properties.
63 *
64 * The game maintains a @ref fProfile::sProfileList "list" of all profiles for base construction purposes.
65 *
66 * ## Profile Names
67 * Each profile has an @ref fProfile::PROFILE_NAME_e "associated name", which can be used to determine a
68 * base's profile and also acts as an index into the profile list. A list of all profile names in string
69 * form is also available, although unused.
70 *
71 * A @ref ProfileName "typedef" for profile names is provided to enhance code readability.
72 * @hint{The @ref fProfile::PROFILE_NAME_e "profile name list" can be used to look up a specific base, to
73 * see its components and aid in the implementation of custom bases.}
74 *
75 * ## Creating Profiles
76 * Use the following macros to create a profile:
77 * - Use ::BASE_PROFILE (or ::ACTOR_PROFILE) to use the priority values given by ::PROFILE_NAME_e (execute order)
78 * and @ref ::DRAW_ORDER::DRAW_ORDER_e "DRAW_ORDER_e" (draw order).
79 * - Use ::CUSTOM_BASE_PROFILE (or ::CUSTOM_ACTOR_PROFILE) if custom priority values are required.
80 *
81 * Addition of profiles (and their name) to the respective lists requires manual intervention.
82 *
83 * ## Unused Content
84 * A profile name in string form can be obtained by calling ::dProf_getName. This has no practical use
85 * (and is most likely a debug leftover), but it has greatly helped the research for official game
86 * entity names.
87 *
88 * @todo Add a link to the profile name list when it gets decompiled.
89 * @}
90 */