mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 08:12:44 +03:00
feat(component): implement CCharacterComponent::CreateBaseTexture
This commit is contained in:
parent
ea034cb960
commit
ce0576b40d
@ -2,6 +2,7 @@
|
||||
#include "component/Texture.hpp"
|
||||
#include "component/Util.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "gx/Device.hpp"
|
||||
#include "gx/Texture.hpp"
|
||||
#include "model/CM2Model.hpp"
|
||||
#include "object/Types.hpp"
|
||||
@ -78,10 +79,37 @@ void CCharacterComponent::InitDbData() {
|
||||
// TODO CountFacialFeatures(varArrayLength, &CCharacterComponent::s_characterFacialHairStylesList);
|
||||
}
|
||||
|
||||
void CCharacterComponent::CreateBaseTexture() {
|
||||
void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CCharacterComponent::CreateBaseTexture() {
|
||||
auto dataFormat = this->m_textureFormat == GxTex_Dxt1
|
||||
? GxTex_Dxt1
|
||||
: GxTex_Argb8888;
|
||||
|
||||
CGxTexFlags flags = CGxTexFlags(GxTex_LinearMipLinear, 0, 0, 0, 0, 0, 1);
|
||||
if (GxDevApi() == GxApi_GLL) {
|
||||
flags.m_bit15 = 1;
|
||||
}
|
||||
|
||||
auto baseTexture = TextureCreate(
|
||||
CCharacterComponent::s_textureSize,
|
||||
CCharacterComponent::s_textureSize,
|
||||
this->m_textureFormat,
|
||||
dataFormat,
|
||||
flags,
|
||||
this,
|
||||
&CCharacterComponent::UpdateBaseTexture,
|
||||
"CharacterBaseSkin",
|
||||
1
|
||||
);
|
||||
|
||||
this->m_baseTexture = baseTexture;
|
||||
|
||||
// TODO this->m_data->m_model->ReplaceTexture(1, this->m_baseTexture);
|
||||
}
|
||||
|
||||
void CCharacterComponent::GeosRenderPrep() {
|
||||
// TODO
|
||||
|
||||
|
||||
@ -63,10 +63,12 @@ class CCharacterComponent {
|
||||
static void Initialize();
|
||||
static void Initialize(EGxTexFormat textureFormat, uint32_t textureLevel, int32_t thread, int32_t compress);
|
||||
static void InitDbData();
|
||||
static void UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels);
|
||||
|
||||
// Member variables
|
||||
uint32_t m_flags = 0x1 | 0x2 | 0x4;
|
||||
uint32_t m_sections = 0xFFFFFFFF;
|
||||
EGxTexFormat m_textureFormat = CCharacterComponent::s_gxFormat;
|
||||
ComponentData m_data;
|
||||
HTEXTURE m_baseTexture = nullptr;
|
||||
void* m_texture[NUM_COMPONENT_VARIATIONS * 3] = {};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user