feat(component): add CCharacterComponent::s_chrVarArray

This commit is contained in:
fallenoak 2025-10-16 08:57:30 -05:00
parent 342bb6345f
commit fdd2b02867
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 36 additions and 0 deletions

View File

@ -2,6 +2,8 @@
#include "model/CM2Model.hpp"
#include <storm/Memory.hpp>
st_race* CCharacterComponent::s_chrVarArray;
int32_t s_bInRenderPrep = 0;
CCharacterComponent* CCharacterComponent::AllocComponent() {

View File

@ -7,6 +7,8 @@
class CM2Model;
struct st_race;
struct ComponentData {
int32_t raceID = 0;
int32_t sexID = 0;
@ -45,6 +47,9 @@ struct ComponentData {
class CCharacterComponent {
public:
// Static variables
static st_race* s_chrVarArray;
// Static functions
static CCharacterComponent* AllocComponent();
static void Initialize();

29
src/component/Util.hpp Normal file
View File

@ -0,0 +1,29 @@
#ifndef COMPONENT_UTIL_HPP
#define COMPONENT_UTIL_HPP
#include "component/Types.hpp"
#include <cstdint>
class CharSectionsRec;
struct st_variation;
struct st_color {
CharSectionsRec* rec;
};
struct st_race {
// The use of "section" here refers to the groups of variations represented in
// COMPONENT_VARIATIONS. It does NOT refer to COMPONENT_SECTIONS.
struct {
uint32_t variationCount;
st_variation* variationArray;
} sections[NUM_COMPONENT_VARIATIONS];
};
struct st_variation {
uint32_t colorCount;
st_color* colorArray;
};
#endif