feat(component): partially implement CCharacterComponent::RenderPrepSections

This commit is contained in:
fallenoak 2025-10-15 22:03:56 -05:00
parent 66d3579173
commit 23fb30c2fd
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 30 additions and 0 deletions

View File

@ -2,11 +2,17 @@
#include "model/CM2Model.hpp"
#include <storm/Memory.hpp>
int32_t s_bInRenderPrep = 0;
CCharacterComponent* CCharacterComponent::AllocComponent() {
// TODO ObjectAlloc
return STORM_NEW(CCharacterComponent);
}
void CCharacterComponent::CreateBaseTexture() {
// TODO
}
void CCharacterComponent::GeosRenderPrep() {
// TODO
@ -44,6 +50,10 @@ int32_t CCharacterComponent::ItemsLoaded(int32_t a2) {
return 1;
}
void CCharacterComponent::PrepSections() {
// TODO
}
int32_t CCharacterComponent::RenderPrep(int32_t a2) {
if (this->m_data.flags & 0x1) {
if (this->m_flags & 0x4) {
@ -73,7 +83,23 @@ int32_t CCharacterComponent::RenderPrep(int32_t a2) {
}
void CCharacterComponent::RenderPrepSections() {
s_bInRenderPrep = 1;
if (this->m_flags & 0x4) {
this->GeosRenderPrep();
}
if (!this->m_baseTexture) {
this->CreateBaseTexture();
}
this->PrepSections();
this->m_flags &= ~0x1;
// TODO
s_bInRenderPrep = 0;
}
int32_t CCharacterComponent::VariationsLoaded(int32_t a2) {

View File

@ -2,6 +2,7 @@
#define COMPONENT_C_CHARACTER_COMPONENT_HPP
#include "component/Types.hpp"
#include "gx/Texture.hpp"
#include <cstdint>
class CM2Model;
@ -50,11 +51,14 @@ class CCharacterComponent {
// Member variables
uint32_t m_flags = 0x1 | 0x2 | 0x4;
ComponentData m_data;
HTEXTURE m_baseTexture = nullptr;
// Member functions
void CreateBaseTexture();
void GeosRenderPrep();
void Init(ComponentData* data, const char* a3);
int32_t ItemsLoaded(int32_t a2);
void PrepSections();
int32_t RenderPrep(int32_t a2);
void RenderPrepSections();
int32_t VariationsLoaded(int32_t a2);