From 5bd90ecf2989965c4947c103ed67efa45ff115d1 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 20 Oct 2025 23:02:02 -0500 Subject: [PATCH] feat(component): create texture buffer in CCharacterComponent::Initialize --- src/component/CCharacterComponent.cpp | 10 ++++++++++ src/component/CCharacterComponent.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 117347c..e96330e 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -2,6 +2,7 @@ #include "component/Texture.hpp" #include "component/Util.hpp" #include "db/Db.hpp" +#include "gx/Texture.hpp" #include "model/CM2Model.hpp" #include "object/Types.hpp" #include @@ -11,6 +12,7 @@ st_race* CCharacterComponent::s_chrVarArray; uint32_t CCharacterComponent::s_chrVarArrayLength; EGxTexFormat CCharacterComponent::s_gxFormat; uint32_t CCharacterComponent::s_mipLevels; +MipBits* CCharacterComponent::s_textureBuffer; uint32_t CCharacterComponent::s_textureSize; int32_t s_bInRenderPrep = 0; @@ -58,6 +60,14 @@ void CCharacterComponent::Initialize(EGxTexFormat textureFormat, uint32_t textur CCharacterComponent::InitDbData(); // TODO + + CCharacterComponent::s_textureBuffer = TextureAllocMippedImg( + PIXEL_ARGB8888, + CCharacterComponent::s_textureSize, + CCharacterComponent::s_textureSize + ); + + // TODO } void CCharacterComponent::InitDbData() { diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index 1af0e11..f0cb545 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -9,6 +9,7 @@ class CACHEENTRY; class CharSectionsRec; class CM2Model; +struct MipBits; struct st_race; struct ComponentData { @@ -54,6 +55,7 @@ class CCharacterComponent { static uint32_t s_chrVarArrayLength; static EGxTexFormat s_gxFormat; static uint32_t s_mipLevels; + static MipBits* s_textureBuffer; static uint32_t s_textureSize; // Static functions