feat(component): fully initialize CACHEENTRY

This commit is contained in:
fallenoak 2025-10-19 23:11:27 -05:00
parent 46e5ddca20
commit 872405e6f1
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 30 additions and 7 deletions

View File

@ -5,6 +5,23 @@ TSHashTable<CACHEENTRY, HASHKEY_NONE> s_cacheTable;
HASHKEY_NONE s_cacheKey; HASHKEY_NONE s_cacheKey;
uint32_t* s_entryHeap; 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() { void CACHEENTRY::AddRef() {
this->m_refCount++; this->m_refCount++;
} }

View File

@ -9,20 +9,26 @@ struct TCTEXTUREINFO {
uint16_t width; uint16_t width;
uint16_t height; uint16_t height;
uint32_t mipCount : 8; uint32_t mipCount : 8;
uint32_t alphaSize: 8; uint32_t alphaSize : 8;
uint32_t opaque : 1; uint32_t opaque : 1;
uint32_t pad : 15; uint32_t pad : 15;
TCTEXTUREINFO();
}; };
class CACHEENTRY : public TSHashObject<CACHEENTRY, HASHKEY_NONE> { class CACHEENTRY : public TSHashObject<CACHEENTRY, HASHKEY_NONE> {
public: public:
// Member variables // Member variables
CAsyncObject* m_asyncObject = nullptr; CAsyncObject* m_asyncObject;
TCTEXTUREINFO m_info;
char m_fileName[128]; char m_fileName[128];
uint32_t m_refCount = 0; uint32_t m_refCount;
uint32_t m_memHandle = 0; uint32_t m_memHandle;
uint32_t bitsB0 : 20;
uint32_t m_loaded : 1;
// Member functions // Member functions
CACHEENTRY();
void AddRef(); void AddRef();
}; };