#include "classes.h" // 00407a60 LayerState::~LayerState() { char isLastRef; int in_ECX; void *local_10; uint8_t *puStack_c; uint32_t local_8; puStack_c = &LAB_00af09f0; local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; if (*GHIDRA_CAST((in_ECX + 0x9c)) != GHIDRA_CAST(0x0)) { isLastRef = (**(code **)(**GHIDRA_CAST((in_ECX + 0x9c)) + 0xc)) (__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(in_ECX + 0x98); } } (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 8)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; return; } // 00408590 void * LayerState::GetTexture(void *outTexture) { int iVar1; int iVar2; int *texture; texture = GHIDRA_CAST(this->_spriteSheet); if (texture != GHIDRA_CAST(0x0)) { iVar1 = this->_minFilterMode; if (((texture[0xc] != iVar1) || (texture[0xd] != this->_magFilterMode)) && ((iVar2 = this->_magFilterMode, iVar1 != texture[0xc] || (iVar2 != texture[0xd])))) { (**(code **)(*texture + 0x44))(iVar1,iVar2); texture[0xc] = iVar1; texture[0xd] = iVar2; texture = GHIDRA_CAST(this->_spriteSheet); } iVar1 = this->_wrapSMode; if (((texture[0xe] != iVar1) || (texture[0xf] != this->_wrapTMode)) && ((iVar2 = this->_wrapTMode, iVar1 != texture[0xe] || (iVar2 != texture[0xf])))) { (**(code **)(*texture + 0x48))(iVar1,iVar2); texture[0xe] = iVar1; texture[0xf] = iVar2; } } (GHIDRA_CAST((outTexture)))->KAGE::SmartPointer::operator_assign(&this->_spriteSheet); return outTexture; } // 00408640 void LayerState::SetTexture(void *texture, void *textureRefCount) { char isLastRef; uint32_t uVar1; void *local_10; uint8_t *puStack_c; uint32_t local_8; puStack_c = &LAB_00af0b1d; local_10 = ExceptionList; uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; ExceptionList = &local_10; local_8 = 0; if (texture != (void *)0x0) { this->_minFilterMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x30)); this->_magFilterMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x34)); this->_wrapSMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x38)); this->_wrapTMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x3c)); } (GHIDRA_CAST((&this->_spriteSheet)))->KAGE::SmartPointer::operator_assign(&texture); local_8 = 1; if (textureRefCount != (void *)0x0) { isLastRef = (**(code **)(*GHIDRA_CAST(textureRefCount) + 0xc))(uVar1); if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(&texture); } } ExceptionList = local_10; return; }