#include "classes.h" // 007210d0 void GridEntity_Wall::BeginBatches() { void *room; char *pathBuffer; char *ptr; uint32_t size; std_string dungeonAnm2Path; std_string bossDungeonAnm2Path; uint32_t local_14; void *local_10; uint8_t *puStack_c; uint32_t local_8; Game *game; uint32_t pathCapacity; void *savedExceptionList; savedExceptionList = ExceptionList; game = g_game; local_8 = 0xffffffff; puStack_c = &LAB_00afcd0d; local_10 = ExceptionList; local_14 = __security_cookie ^ GHIDRA_UINT(&(&bossDungeonAnm2Path)[1]._size); ExceptionList = &local_10; this->_collisionClass = 4; room = game->_room; if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) { *GHIDRA_CAST((GHIDRA_CAST(room) + this->_gridIndex * 4 + 0x76c)) = 1000; room = game->_room; } if (*GHIDRA_CAST((GHIDRA_CAST(room) + 8)) != 0x10) { ExceptionList = savedExceptionList; return; } if (*GHIDRA_CAST((GHIDRA_CAST(room) + 0x1d18)) == 0x37) { bossDungeonAnm2Path._size = 0; bossDungeonAnm2Path._capacity = 0xf; bossDungeonAnm2Path._buf[0] = '\0'; bossDungeonAnm2Path._buf[1] = '\0'; bossDungeonAnm2Path._buf[2] = '\0'; bossDungeonAnm2Path._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(bossDungeonAnm2Path._buf)) + 0x0))) = msvc::_Allocate(0x30); bossDungeonAnm2Path._size = 0x26; bossDungeonAnm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bossDungeonAnm2Path._buf))) + 0x0))),"gfx/grid/Tiles_Itemdungeon_Gideon.anm2", 0x27); local_8 = 0; } else { if (*GHIDRA_CAST((GHIDRA_CAST(room) + 0x1d18)) != 0x38) { dungeonAnm2Path._size = 0; dungeonAnm2Path._capacity = 0xf; dungeonAnm2Path._buf[0] = '\0'; dungeonAnm2Path._buf[1] = '\0'; dungeonAnm2Path._buf[2] = '\0'; dungeonAnm2Path._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(dungeonAnm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20); dungeonAnm2Path._size = 0x1f; dungeonAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(dungeonAnm2Path._buf))) + 0x0))),"gfx/grid/Tiles_Itemdungeon.anm2",0x20); local_8 = 2; (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&dungeonAnm2Path,1); if (dungeonAnm2Path._capacity < 0x10) { ExceptionList = local_10; return; } pathBuffer = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(dungeonAnm2Path._buf))) + 0x0))); pathCapacity = dungeonAnm2Path._capacity; goto LAB_007211c8; } bossDungeonAnm2Path._size = 0; bossDungeonAnm2Path._capacity = 0xf; bossDungeonAnm2Path._buf[0] = '\0'; bossDungeonAnm2Path._buf[1] = '\0'; bossDungeonAnm2Path._buf[2] = '\0'; bossDungeonAnm2Path._buf[3] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(bossDungeonAnm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20); bossDungeonAnm2Path._size = 0x1a; bossDungeonAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bossDungeonAnm2Path._buf))) + 0x0))),"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 1; } (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&bossDungeonAnm2Path,1); if (bossDungeonAnm2Path._capacity < 0x10) { ExceptionList = local_10; return; } pathBuffer = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bossDungeonAnm2Path._buf))) + 0x0))); pathCapacity = bossDungeonAnm2Path._capacity; LAB_007211c8: size = pathCapacity + 1; ptr = pathBuffer; if (0xfff < size) { ptr = *GHIDRA_CAST((pathBuffer + -4)); size = pathCapacity + 0x24; if (GHIDRA_CAST(0x1f) < pathBuffer + (-4 - GHIDRA_INT(ptr))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,size); ExceptionList = local_10; return; } // 00721310 void GridEntity_Wall::guard_check_icall() { uint8_t isAnimSet; uint32_t row; void *gridBelow; uint32_t column; int iVar1; void *pvVar2; char *anim; Vector local_34; uint8_t animNameBuf [32]; uint32_t local_c; uint32_t gridWidth; Room *room; local_c = __security_cookie ^ GHIDRA_UINT(&local_34); room = g_game->_room; if (room->_roomType != 0x10) { return; } if (room->_backdropType != 0x38) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 1) { anim = "Decoration1"; } else if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 2) { anim = "Decoration2"; } else { local_34.x = (float)(this->_gridIndex % room->_gridWidth) * 40.0 + 40.0 + 0.0; local_34.y = ((float)(this->_gridIndex / room->_gridWidth) * 40.0 + 120.0) - 40.0; (GHIDRA_CAST((room)))->Room::GetGridEntityFromPos(&local_34); Random(); sprintf_s(animNameBuf,0x1f,&DAT_00b69520); anim = GHIDRA_CAST(animNameBuf); } (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),0); return; } gridWidth = room->_gridWidth; row = GHIDRA_UINT(this->_gridIndex) / gridWidth; column = GHIDRA_UINT(this->_gridIndex) % gridWidth; iVar1 = row - 1; if ((((GHIDRA_INT(column) < 0) || (GHIDRA_INT(gridWidth) <= GHIDRA_INT(column))) || (iVar1 < 0)) || (room->_gridHeight <= iVar1)) { pvVar2 = (void *)0x0; if ((-1 < GHIDRA_INT(column)) && (GHIDRA_INT(column) < GHIDRA_INT(gridWidth))) goto LAB_00721391; } else { iVar1 = gridWidth * iVar1 + column; if (iVar1 < 0) { pvVar2 = (void *)0x0; } else { pvVar2 = room->_gridEntities[iVar1]; } LAB_00721391: iVar1 = row + 1; if (((-1 < iVar1) && (iVar1 < room->_gridHeight)) && (iVar1 = gridWidth * iVar1 + column, -1 < iVar1)) { gridBelow = room->_gridEntities[iVar1]; goto LAB_007213a9; } } gridBelow = (void *)0x0; LAB_007213a9: local_34.x = 1.676745e-38; if (((pvVar2 == (void *)0x0) || (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 4)) == 1)) || (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 4)) == 0x13)) { local_34.x = 1.6767439e-38; } else if (((gridBelow == (void *)0x0) || (*GHIDRA_CAST((GHIDRA_CAST(gridBelow) + 4)) == 1)) || (*GHIDRA_CAST((GHIDRA_CAST(gridBelow) + 4)) == 0x13)) { local_34.x = 1.676754e-38; } pvVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(local_34.x)); if (pvVar2 != (void *)0x0) { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x30)); isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34.x),1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)(GHIDRA_INT(column) % iVar1)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; return; } } return; }