chore(build): split out component lib

This commit is contained in:
fallenoak committed 2025-10-14 11:39:06 -05:00
1 parent 4dd9dfbd78
commit 84c351c621
6 files changed
+24 -4

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
#include "component/CCharacterComponent.hpp"
#include "model/CM2Model.hpp"
#include <storm/Memory.hpp>
CCharacterComponent* CCharacterComponent::AllocComponent() {
// TODO ObjectAlloc
return STORM_NEW(CCharacterComponent);
}
void CCharacterComponent::GeosRenderPrep() {
// TODO
// Default all sections (0 - 2000) to hidden
this->m_data.model->SetGeometryVisible(0, 2000, 0);
// Show base "skin" section (0)
this->m_data.model->SetGeometryVisible(0, 0, 1);
// TODO
this->m_flags &= ~0x4;
}
void CCharacterComponent::Init(ComponentData* data, const char* a3) {
if (data->model) {
data->model->Release();
}
this->m_data = *data;
// TODO
}
void CCharacterComponent::RenderPrep(int32_t a2) {
if (this->m_data.flags & 0x1) {
if (this->m_flags & 0x4) {
this->GeosRenderPrep();
}
return;
}
// TODO
}
+37
View File
@@ -0,0 +1,37 @@
#ifndef COMPONENT_C_CHARACTER_COMPONENT_HPP
#define COMPONENT_C_CHARACTER_COMPONENT_HPP
#include <cstdint>
class CM2Model;
struct ComponentData {
int32_t raceID = 0;
int32_t sexID = 0;
int32_t classID = 0;
int32_t hairColorID = 0;
int32_t skinID = 0;
int32_t faceID = 0;
int32_t facialHairStyleID = 0;
int32_t hairStyleID = 0;
CM2Model* model = nullptr;
uint32_t flags = 0x0;
uint8_t byte28 = 0;
};
class CCharacterComponent {
public:
// Static functions
static CCharacterComponent* AllocComponent();
// Member variables
uint32_t m_flags = 0x1 | 0x2 | 0x4;
ComponentData m_data;
// Member functions
void GeosRenderPrep();
void Init(ComponentData* data, const char* a3);
void RenderPrep(int32_t a2);
};
#endif
+18
View File
@@ -0,0 +1,18 @@
file(GLOB PRIVATE_SOURCES "*.cpp")
add_library(component STATIC
${PRIVATE_SOURCES}
)
target_include_directories(component
PRIVATE
${CMAKE_SOURCE_DIR}/src
)
target_link_libraries(component
PRIVATE
db
model
PUBLIC
storm
)