diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 83b1d53..65a99d1 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -1048,21 +1048,6 @@ void CCharacterComponent::GeosRenderPrep() { this->m_flags &= ~0x4; } -void CCharacterComponent::GetPreferences(CharacterPreferences* preferences) { - if (!preferences) { - return; - } - - preferences->raceID = this->m_data.raceID; - preferences->sexID = this->m_data.sexID; - preferences->classID = this->m_data.classID; - preferences->hairColorID = this->m_data.hairColorID; - preferences->skinColorID = this->m_data.skinColorID; - preferences->faceID = this->m_data.faceID; - preferences->facialHairStyleID = this->m_data.facialHairStyleID; - preferences->hairStyleID = this->m_data.hairStyleID; -} - CharSectionsRec* CCharacterComponent::GetSectionsRecord(COMPONENT_VARIATIONS sectionIndex, int32_t variationIndex, int32_t colorIndex, bool* found) { return ComponentGetSectionsRecord( CCharacterComponent::s_chrVarArray, diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index e6af43a..e0b3a61 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -1,6 +1,7 @@ #ifndef COMPONENT_C_CHARACTER_COMPONENT_HPP #define COMPONENT_C_CHARACTER_COMPONENT_HPP +#include "component/ComponentData.hpp" #include "component/Types.hpp" #include "gx/Texture.hpp" #include "object/Types.hpp" @@ -87,7 +88,6 @@ class CCharacterComponent { void CreateBaseTexture(); void* CreateTexture(const ItemDisplayInfoRec* displayRec, int32_t section); void GeosRenderPrep(); - void GetPreferences(CharacterPreferences* preferences); CharSectionsRec* GetSectionsRecord(COMPONENT_VARIATIONS sectionIndex, int32_t variationIndex, int32_t colorIndex, bool* found); int32_t Init(ComponentData* data, const char* a3); int32_t ItemsLoaded(int32_t a2); diff --git a/src/component/ComponentData.cpp b/src/component/ComponentData.cpp new file mode 100644 index 0000000..654c561 --- /dev/null +++ b/src/component/ComponentData.cpp @@ -0,0 +1,17 @@ +#include "component/ComponentData.hpp" +#include "component/Types.hpp" + +void ComponentData::GetPreferences(CharacterPreferences* preferences) { + if (!preferences) { + return; + } + + preferences->raceID = this->raceID; + preferences->sexID = this->sexID; + preferences->classID = this->classID; + preferences->hairColorID = this->hairColorID; + preferences->skinColorID = this->skinColorID; + preferences->faceID = this->faceID; + preferences->facialHairStyleID = this->facialHairStyleID; + preferences->hairStyleID = this->hairStyleID; +} diff --git a/src/component/ComponentData.hpp b/src/component/ComponentData.hpp new file mode 100644 index 0000000..3a8e1ec --- /dev/null +++ b/src/component/ComponentData.hpp @@ -0,0 +1,48 @@ +#ifndef COMPONENT_COMPONENT_DATA_HPP +#define COMPONENT_COMPONENT_DATA_HPP + +#include "component/Types.hpp" +#include +#include + +class CM2Model; + +struct ComponentData { + int32_t raceID = 0; + int32_t sexID = 0; + int32_t classID = 0; + int32_t hairColorID = 0; + int32_t skinColorID = 0; + int32_t faceID = 0; + int32_t facialHairStyleID = 0; + int32_t hairStyleID = 0; + CM2Model* model = nullptr; + uint32_t flags = 0x0; + char npcBakedTexturePath[STORM_MAX_PATH] = { '\0' }; + + uint32_t geosets[NUM_GEOSET] = { + 001, + 101, + 201, + 301, + 401, + 501, + 601, + 702, + 801, + 901, + 1001, + 1101, + 1201, + 1301, + 1401, + 1501, + 1601, + 1701, + 1801, + }; + + void GetPreferences(CharacterPreferences* preferences); +}; + +#endif diff --git a/src/component/Types.hpp b/src/component/Types.hpp index 0cd8e02..a07713f 100644 --- a/src/component/Types.hpp +++ b/src/component/Types.hpp @@ -102,40 +102,4 @@ struct CharacterPreferences { int32_t hairStyleID; }; -struct ComponentData { - int32_t raceID = 0; - int32_t sexID = 0; - int32_t classID = 0; - int32_t hairColorID = 0; - int32_t skinColorID = 0; - int32_t faceID = 0; - int32_t facialHairStyleID = 0; - int32_t hairStyleID = 0; - CM2Model* model = nullptr; - uint32_t flags = 0x0; - char npcBakedTexturePath[STORM_MAX_PATH] = { '\0' }; - - uint32_t geosets[NUM_GEOSET] = { - 001, - 101, - 201, - 301, - 401, - 501, - 601, - 702, - 801, - 901, - 1001, - 1101, - 1201, - 1301, - 1401, - 1501, - 1601, - 1701, - 1801, - }; -}; - #endif diff --git a/src/component/Util.cpp b/src/component/Util.cpp index 63d679f..ab701bc 100644 --- a/src/component/Util.cpp +++ b/src/component/Util.cpp @@ -1,4 +1,5 @@ #include "component/Util.hpp" +#include "component/ComponentData.hpp" #include "component/Types.hpp" #include "db/Db.hpp" #include "object/Types.hpp"