From 872405e6f1848feb6a00a414c768f0b3239b70ba Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 19 Oct 2025 23:11:27 -0500 Subject: [PATCH] feat(component): fully initialize CACHEENTRY --- src/component/Texture.cpp | 17 +++++++++++++++++ src/component/Texture.hpp | 20 +++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/component/Texture.cpp b/src/component/Texture.cpp index ab220f7..8a349f7 100644 --- a/src/component/Texture.cpp +++ b/src/component/Texture.cpp @@ -5,6 +5,23 @@ TSHashTable s_cacheTable; HASHKEY_NONE s_cacheKey; uint32_t* s_entryHeap; +TCTEXTUREINFO::TCTEXTUREINFO() { + this->width = 0; + this->height = 0; + this->mipCount = 0; + this->alphaSize = 0; + this->opaque = 1; +} + +CACHEENTRY::CACHEENTRY() { + this->m_asyncObject = nullptr; + this->m_fileName[0] = '\0'; + this->m_refCount = 0; + this->m_memHandle = 0; + this->bitsB0 = 0; + this->m_loaded = 0; +} + void CACHEENTRY::AddRef() { this->m_refCount++; } diff --git a/src/component/Texture.hpp b/src/component/Texture.hpp index 732361c..b81e125 100644 --- a/src/component/Texture.hpp +++ b/src/component/Texture.hpp @@ -8,21 +8,27 @@ class CAsyncObject; struct TCTEXTUREINFO { uint16_t width; uint16_t height; - uint32_t mipCount : 8; - uint32_t alphaSize: 8; - uint32_t opaque : 1; - uint32_t pad : 15; + uint32_t mipCount : 8; + uint32_t alphaSize : 8; + uint32_t opaque : 1; + uint32_t pad : 15; + + TCTEXTUREINFO(); }; class CACHEENTRY : public TSHashObject { public: // Member variables - CAsyncObject* m_asyncObject = nullptr; + CAsyncObject* m_asyncObject; + TCTEXTUREINFO m_info; char m_fileName[128]; - uint32_t m_refCount = 0; - uint32_t m_memHandle = 0; + uint32_t m_refCount; + uint32_t m_memHandle; + uint32_t bitsB0 : 20; + uint32_t m_loaded : 1; // Member functions + CACHEENTRY(); void AddRef(); };