Files
isaac-port/generated-src/minimap.cpp
T
shweetandClaude Opus 5.5 9d4d4f5c64 Build 29: zero-length placeholder structs, generated-src with standard types
--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:41:34 -05:00

2710 lines
127 KiB
C++

#include "classes.h"
// 0098b1d0
Minimap::~Minimap()
{
char isLastRef;
uint32_t uVar1;
uint32_t extraout_ECX;
uint32_t uVar2;
uint32_t extraout_ECX_00;
uint64_t *allocatedBytes;
int i;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
void *frameBlock;
uint64_t prevAllocatedBytes;
local_8 = 0xffffffff;
puStack_c = &LAB_00b0d410;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x614))))))->KAGE::SmartPointer::reset((void *)0x0);
i = 2;
uVar2 = extraout_ECX;
do {
KAGE::SmartPointer<RenderTargetBase>::reset(uVar2);
i = i + -1;
uVar2 = extraout_ECX_00;
} while (i != 0);
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x618)))) != GHIDRA_CAST<int *>(0x0)) {
local_8 = i;
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x618)))) + 0xc))(uVar1);
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x614))));
}
}
local_8 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_iconsSprite)))->ANM2::Reset();
frameBlock = (this->_iconsSprite)._overlayAnimState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_iconsSprite)._overlayAnimState._layerFrames = (void *)0x0;
}
frameBlock = (this->_iconsSprite)._overlayAnimState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_iconsSprite)._overlayAnimState._nullLayerFrames = (void *)0x0;
}
frameBlock = (this->_iconsSprite)._animState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_iconsSprite)._animState._layerFrames = (void *)0x0;
}
frameBlock = (this->_iconsSprite)._animState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_iconsSprite)._animState._nullLayerFrames = (void *)0x0;
}
(GHIDRA_CAST<msvc::string *>(((this->_iconsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_iconsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 6;
(GHIDRA_CAST<ANM2 *>((&this->_hudPickupSprite)))->ANM2::Reset();
frameBlock = (this->_hudPickupSprite)._overlayAnimState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_hudPickupSprite)._overlayAnimState._layerFrames = (void *)0x0;
}
frameBlock = (this->_hudPickupSprite)._overlayAnimState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_hudPickupSprite)._overlayAnimState._nullLayerFrames = (void *)0x0;
}
frameBlock = (this->_hudPickupSprite)._animState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_hudPickupSprite)._animState._layerFrames = (void *)0x0;
}
frameBlock = (this->_hudPickupSprite)._animState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_hudPickupSprite)._animState._nullLayerFrames = (void *)0x0;
}
(GHIDRA_CAST<msvc::string *>(((this->_hudPickupSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_hudPickupSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0xb;
(GHIDRA_CAST<ANM2 *>((&this->_itemIconsSprite)))->ANM2::Reset();
frameBlock = (this->_itemIconsSprite)._overlayAnimState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_itemIconsSprite)._overlayAnimState._layerFrames = (void *)0x0;
}
frameBlock = (this->_itemIconsSprite)._overlayAnimState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_itemIconsSprite)._overlayAnimState._nullLayerFrames = (void *)0x0;
}
frameBlock = (this->_itemIconsSprite)._animState._layerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_itemIconsSprite)._animState._layerFrames = (void *)0x0;
}
frameBlock = (this->_itemIconsSprite)._animState._nullLayerFrames;
if (frameBlock != (void *)0x0) {
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(frameBlock) + -4));
prevAllocatedBytes = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar1;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar1));
free((void *)(GHIDRA_INT(frameBlock) + -4));
(this->_itemIconsSprite)._animState._nullLayerFrames = (void *)0x0;
}
(GHIDRA_CAST<msvc::string *>(((this->_itemIconsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_itemIconsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0xffffffff;
_eh_vector_destructor_iterator_(this->_config,0x160,2,FUN_0098b130);
ExceptionList = local_10;
return;
}
// 0098b570
Vector * Minimap::GetDisplayedSize(Vector *buffer)
{
float hudAlpha;
hudAlpha = (GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::get_hud_alpha();
if (0.0 < hudAlpha * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2d0))))) {
buffer->x = this->_config[1]._size2.y - this->_config[1]._size1.y;
buffer->y = this->_config[1]._alpha - this->_config[1]._size2.x;
return buffer;
}
buffer->x = 47.0;
buffer->y = 47.0;
return buffer;
}
// 0098b5e0
void Minimap::refresh_room_icons()
{
void **ppvVar1;
RNG *pRVar2;
RNG *pRVar3;
Minimap *pMVar4;
uint8_t bVar5;
uint32_t *renderTargetEntry;
uint32_t uVar6;
RoomDescriptor *pRVar7;
uint32_t uVar8;
float fVar9;
uint8_t *pbVar10;
uint8_t *pbVar11;
void *pvVar12;
uint32_t extraout_ECX;
int iVar13;
AnimationState *lastState;
float fVar14;
int *savedEntry;
Minimap *pMVar15;
float fVar16;
int iVar17;
char *roomIconName;
bool isOutlineVisible;
RNG *pRVar18;
double dVar19;
uint64_t uVar20;
RNG local_c8;
uint8_t local_b8 [12];
float local_ac;
Vector roomIconPos;
ANM2 *iconSpriteRef;
uint32_t keyIconFrame;
uint32_t pillIconFrame;
uint32_t chestIconFrame;
uint32_t heartIconFrame;
uint32_t local_8c;
RoomDescriptor *local_88;
float startRow;
float iconSlot;
float local_7c;
RoomDescriptor *roomList;
Vector local_74;
uint8_t *local_6c;
int *local_68;
float local_64;
float cellStepY;
float local_5c;
Vector local_58;
void *roomGrid;
uint8_t *local_4c;
uint8_t *local_48;
int iconSpriteOwner;
float cellX;
float cellStepX;
uint8_t *startCol;
RNG *local_34;
Minimap *self;
uint8_t *local_2c;
Vector quadIconOffsets [4];
float cellHeight;
float cellWidth;
ANM2 *iconSprite;
float maxIcons;
int roomShape;
pRVar7 = g_game->_roomList;
DAT_00c33910 = 0;
roomGrid = g_game->_currentRoomMap;
iconSpriteOwner = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[0])) + 0x144))));
iconSpriteRef = GHIDRA_CAST<ANM2 *>((iconSpriteOwner + 0x500));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x0))) = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))) = 0;
roomList = pRVar7;
self = this;
msvc::vector::resize(local_b8);
renderTargetEntry = msvc::deque::back();
if (GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
*GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
}
*renderTargetEntry = g_graphicsManager_renderTarget;
KAGE_Graphics::SetRenderTarget
(&DAT_00c798e0,(void *)this->_config[0]._mapSprite._championColor._offset[2],0);
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
g_graphicsManager_blendMode[1] = 1;
g_graphicsManager_blendMode[0] = 0;
if ((g_graphicsManager_flags & 4) == 0) {
g_graphicsManager_blendMode[1] = 6;
}
g_graphicsManager_blendMode[2] = 7;
g_graphicsManager_blendMode[3] = 1;
g_graphicsManager_blendMode[4] = 7;
uVar6 = g_game->_currentRoomIdx;
if (GHIDRA_INT(uVar6) < 0) {
_glfw_context_reset();
pop_render_target();
}
else {
if (g_game->_challenge == 0x20) {
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4));
local_c8._seed = 0;
if (iVar13 != 0) {
local_c8._seed = *GHIDRA_CAST<int *>((iVar13 + 0x58));
}
local_c8._shift1 = 1;
local_c8._shift2 = 5;
local_c8._shift3 = 0x10;
uVar6 = (GHIDRA_CAST<RNG *>((&local_c8)))->RNG::RandomInt(g_game->_nbRooms);
uVar6 = pRVar7[uVar6].SafeGridIndex;
}
fVar9 = this->_config[0]._vec1.x;
if (GHIDRA_INT(uVar6) < 1) {
uVar6 = 0;
}
local_5c = (float)0xa9;
if (GHIDRA_INT(uVar6) < 0xa9) {
local_5c = (float)uVar6;
}
local_88 = pRVar7 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(local_5c) * 4));
if (0xd < GHIDRA_INT(fVar9)) {
fVar9 = 1.82169e-44;
}
this->_config[0]._vec1.x = fVar9;
fVar14 = this->_config[0]._vec1.y;
if (0xd < GHIDRA_INT(fVar14)) {
fVar14 = 1.82169e-44;
}
this->_config[0]._vec1.y = fVar14;
pbVar10 = GHIDRA_CAST<uint8_t *>((((GHIDRA_INT(local_5c) / 0xd) * -0xd - GHIDRA_INT(fVar9) / 2) + GHIDRA_INT(local_5c)));
if (0xd - GHIDRA_INT(fVar9) < GHIDRA_INT(pbVar10)) {
pbVar10 = GHIDRA_CAST<uint8_t *>((0xd - GHIDRA_INT(fVar9)));
}
startCol = GHIDRA_CAST<uint8_t *>(0x0);
if (0 < GHIDRA_INT(pbVar10)) {
startCol = pbVar10;
}
fVar9 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self->_config[0])) + 0x118))));
cellStepX = fVar9 + (float)self->_config[0]._mapSprite._shadowLayerIndex;
fVar16 = (float)(GHIDRA_INT(local_5c) / 0xd - GHIDRA_INT(fVar14) / 2);
fVar9 = fVar9 + (float)self->_config[0]._mapSprite._bitflags;
if (GHIDRA_INT((0xdU - GHIDRA_INT(fVar14))) < GHIDRA_INT(fVar16)) {
fVar16 = (float)(0xdU - GHIDRA_INT(fVar14));
}
fVar14 = self->_config[0]._mapSprite._championColor._offset[2];
cellWidth = 0.0;
if (0 < GHIDRA_INT(fVar16)) {
cellWidth = fVar16;
}
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar14) + 0x10));
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar14) + 0x14));
self->_config[0]._borderScale =
(float)((double)iVar13 + __uint_to_double_fixup[-(iVar13 >> 0x1f)]);
self->_config[0]._i1 = GHIDRA_INT((float)((double)iVar17 + __uint_to_double_fixup[-(iVar17 >> 0x1f)]));
self->_config[0]._i2 = GHIDRA_INT(g_vectorZero.x);
self->_config[0]._minimapIconNum = GHIDRA_INT(g_vectorZero.y);
fVar14 = self->_config[0]._vec1.y;
local_34 = GHIDRA_CAST<RNG *>(0x0);
pMVar15 = self;
startRow = cellWidth;
local_7c = cellWidth;
cellStepY = fVar9;
if (GHIDRA_INT(cellWidth) < GHIDRA_INT(fVar14) + GHIDRA_INT(cellWidth)) {
do {
local_4c = GHIDRA_CAST<uint8_t *>(0x0);
local_58.y = (float)startCol;
pRVar18 = local_34;
if (GHIDRA_INT(startCol) < GHIDRA_INT((startCol + GHIDRA_INT(pMVar15->_config[0]._vec1.x)))) {
local_8c = GHIDRA_INT(local_7c) * 0xd;
pbVar10 = startCol;
fVar9 = cellStepX;
local_74.y = (float)local_34;
do {
pMVar4 = self;
pbVar11 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_58.y) + local_8c));
if ((-1 < GHIDRA_INT(pbVar11)) && (pbVar11 < GHIDRA_CAST<uint8_t *>(0xa9))) {
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4));
if (-1 < iVar13) {
pvVar12 = roomList[iVar13].Data;
pMVar15 = pMVar4;
if ((pvVar12 != (void *)0x0) && (roomList[iVar13].DisplayFlags != 0)) {
isOutlineVisible = true;
if ((g_game->_stage == 0xc) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 8)) == 5)) {
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x48));
if (iVar17 == 4) {
local_5c = (float)roomList[iVar13].AllowedDoors;
if ((GHIDRA_UINT(local_5c) & 7) != 0) {
pbVar10 = pbVar11 + 0xd;
if ((GHIDRA_INT(pbVar10) < 0) || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar10)) {
isOutlineVisible = false;
}
else {
isOutlineVisible = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar10) * 4)) == iVar13;
}
}
if ((GHIDRA_UINT(local_5c) & 0x58) != 0) {
if ((GHIDRA_INT((pbVar11 + -0xd)) < 0) || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + -0xd))
goto LAB_0098ba08;
isOutlineVisible =
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT((pbVar11 + -0xd)) * 4)) == iVar13;
}
}
else if (iVar17 == 6) {
uVar6 = roomList[iVar13].AllowedDoors;
if ((uVar6 & 0xb) == 0) {
if (((uVar6 & 0x24) != 0) || ((uVar6 >> 7 & 1) != 0)) {
if ((GHIDRA_INT(pbVar11) < 1) || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + -1))
goto LAB_0098ba08;
isOutlineVisible =
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + -4)) == iVar13;
}
}
else {
if ((GHIDRA_INT((pbVar11 + 1)) < 0) || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + 1))
goto LAB_0098ba08;
isOutlineVisible = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + 4)) == iVar13;
}
}
else if (iVar17 == 8) {
local_5c = (float)roomList[iVar13].AllowedDoors;
if ((GHIDRA_UINT(local_5c) & 3) == 0) {
if ((GHIDRA_UINT(local_5c) & 0x24) == 0) {
if ((GHIDRA_UINT(local_5c) & 0x18) == 0) {
if (((GHIDRA_UINT(local_5c) >> 7 & 1) != 0) || ((GHIDRA_UINT(local_5c) >> 6 & 1) != 0)
) {
if ((GHIDRA_INT(pbVar11) < 1) ||
((((GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + -1 ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + -4)) != iVar13)) ||
(GHIDRA_INT((pbVar11 + -0xd)) < 0)) ||
((GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + -0xd ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT((pbVar11 + -0xd)) * 4)) != iVar13)))
))) goto LAB_0098ba08;
isOutlineVisible = true;
}
}
else {
if (((GHIDRA_INT((pbVar11 + 1)) < 0) || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + 1)) ||
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + 4)) != iVar13 ||
(((GHIDRA_INT((pbVar11 + -0xd)) < 0 || (GHIDRA_CAST<uint8_t *>(0xa8) < pbVar11 + -0xd)) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT((pbVar11 + -0xd)) * 4)) != iVar13)))))
) goto LAB_0098ba08;
isOutlineVisible = true;
}
goto LAB_0098ba0a;
}
if ((0 < GHIDRA_INT(pbVar11)) && (pbVar11 + -1 < GHIDRA_CAST<uint8_t *>(0xa9))) {
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + -4));
goto LAB_0098b9f4;
}
}
else if ((-1 < GHIDRA_INT((pbVar11 + 1))) && (pbVar11 + 1 < GHIDRA_CAST<uint8_t *>(0xa9))) {
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4 + 4));
LAB_0098b9f4:
if ((((iVar17 == iVar13) && (pbVar11 = pbVar11 + 0xd, -1 < GHIDRA_INT(pbVar11))) &&
(pbVar11 < GHIDRA_CAST<uint8_t *>(0xa9))) &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar11) * 4)) == iVar13))
goto LAB_0098ba0a;
}
LAB_0098ba08:
isOutlineVisible = false;
}
}
LAB_0098ba0a:
fVar9 = self->_config[0]._borderScale;
pbVar10 = local_4c;
if (fVar9 <= (float)local_4c) {
pbVar10 = GHIDRA_CAST<uint8_t *>(fVar9);
}
self->_config[0]._borderScale = (float)pbVar10;
pRVar2 = GHIDRA_CAST<RNG *>(self->_config[0]._i1);
pRVar3 = pRVar18;
if ((float)pRVar2 <= (float)pRVar18) {
pRVar3 = pRVar2;
}
fVar16 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self->_config[0])) + 0x114)))) +
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self->_config[0])) + 0x118))));
fVar9 = (float)self->_config[0]._mapSprite._shadowLayerIndex;
self->_config[0]._i1 = GHIDRA_INT(pRVar3);
fVar14 = (float)self->_config[0]._i2;
fVar16 = fVar16 + fVar16;
fVar9 = (float)local_4c + fVar9 + fVar16;
if (fVar9 <= fVar14) {
fVar9 = fVar14;
}
self->_config[0]._i2 = GHIDRA_INT(fVar9);
fVar9 = (float)self->_config[0]._minimapIconNum;
fVar16 = (float)pRVar18 + (float)self->_config[0]._mapSprite._bitflags + fVar16;
if (fVar16 <= fVar9) {
fVar16 = fVar9;
}
self->_config[0]._minimapIconNum = GHIDRA_INT(fVar16);
local_74.x = (float)local_4c;
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(self))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("RoomOutline"),1);
if (((bVar5 != 0) &&
(*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) &&
(AnimationState::SetFrameFloat
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName),
0.0),
*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) {
*GHIDRA_CAST<uint8_t *>(&pMVar4->_config[0]._mapSprite._animDefaultName._capacity) = 0;
}
if ((!isOutlineVisible) ||
(*GHIDRA_CAST<char *>((GHIDRA_INT(pMVar4->_config[0]._mapSprite._championColor._colorize) + 0xd))
== '\0')) {
pRVar18 = local_34;
fVar9 = cellStepX;
}
else {
ppvVar1 = &pMVar4->_config[0]._mapSprite._animState._layerFrames;
if (*GHIDRA_CAST<char *>(&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames) ==
'\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName),
&local_74,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(ppvVar1),&local_74,&g_vectorZero,&g_vectorZero);
local_34 = GHIDRA_CAST<RNG *>(local_74.y);
pRVar18 = GHIDRA_CAST<RNG *>(local_74.y);
fVar9 = cellStepX;
local_4c = GHIDRA_CAST<uint8_t *>(local_74.x);
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(ppvVar1),&local_74,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName),
&local_74,&g_vectorZero,&g_vectorZero);
local_34 = GHIDRA_CAST<RNG *>(local_74.y);
pRVar18 = GHIDRA_CAST<RNG *>(local_74.y);
fVar9 = cellStepX;
local_4c = GHIDRA_CAST<uint8_t *>(local_74.x);
}
}
}
}
pbVar10 = startCol;
}
local_4c = GHIDRA_CAST<uint8_t *>(((float)local_4c + fVar9));
local_58.y = (float)(GHIDRA_INT(local_58.y) + 1);
} while (GHIDRA_INT(local_58.y) < GHIDRA_INT((pbVar10 + GHIDRA_INT(pMVar15->_config[0]._vec1.x))));
cellWidth = startRow;
fVar9 = cellStepY;
}
fVar14 = pMVar15->_config[0]._vec1.y;
local_34 = GHIDRA_CAST<RNG *>(((float)pRVar18 + fVar9));
local_7c = (float)(GHIDRA_INT(local_7c) + 1);
} while (GHIDRA_INT(local_7c) < GHIDRA_INT(fVar14) + GHIDRA_INT(cellWidth));
}
local_4c = GHIDRA_CAST<uint8_t *>(0x0);
local_74.x = 0.0;
cellX = 0.0;
local_2c = GHIDRA_CAST<uint8_t *>(0x0);
if (0 < GHIDRA_INT(cellWidth)) {
local_2c = GHIDRA_CAST<uint8_t *>((0.0 - fVar9));
}
if (0 < GHIDRA_INT(startCol)) {
cellX = 0.0 - cellStepX;
}
if (GHIDRA_INT(cellWidth) < 1) {
local_64 = cellWidth;
}
else {
local_64 = (float)(GHIDRA_INT(cellWidth) - 1);
}
local_74.y = (float)local_34;
if (GHIDRA_INT(local_64) < GHIDRA_INT(fVar14) + GHIDRA_INT(cellWidth)) {
local_5c = (float)(GHIDRA_INT(local_64) * 0xd);
pMVar15 = self;
do {
local_4c = startCol;
if (0 < GHIDRA_INT(startCol)) {
local_4c = startCol + -1;
}
pbVar10 = local_2c;
fVar14 = cellStepX;
if (GHIDRA_INT(local_4c) < GHIDRA_INT((startCol + GHIDRA_INT(pMVar15->_config[0]._vec1.x)))) {
local_6c = local_4c + GHIDRA_INT(local_5c);
local_68 = GHIDRA_CAST<int *>((GHIDRA_INT(roomGrid) + GHIDRA_INT(local_6c) * 4));
pbVar11 = startCol;
do {
pRVar7 = roomList;
if ((-1 < GHIDRA_INT(local_6c)) && (local_6c < GHIDRA_CAST<uint8_t *>(0xa9))) {
iVar13 = *local_68;
if (-1 < iVar13) {
if (GHIDRA_CAST<uint8_t *>(roomList[iVar13].GridIndex) == local_6c) {
LAB_0098bdb8:
pvVar12 = roomList[iVar13].Data;
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x48)) + -1;
if (iVar17 < 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("invalid room shape id: %d\n"));
pvVar12 = pRVar7[iVar13].Data;
}
local_48 = GHIDRA_CAST<uint8_t *>(g_vectorOne.x);
local_34 = GHIDRA_CAST<RNG *>(g_vectorOne.y);
switch(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar12) + 0x48))) {
case 1:
case 2:
case 3:
break;
case 4:
case 5:
local_48 = GHIDRA_CAST<uint8_t *>(0x3f800000);
local_34 = GHIDRA_CAST<RNG *>(0x40000000);
break;
case 6:
case 7:
local_48 = GHIDRA_CAST<uint8_t *>(0x40000000);
local_34 = GHIDRA_CAST<RNG *>(0x3f800000);
break;
case 8:
case 10:
case 0xb:
case 0xc:
local_34 = GHIDRA_CAST<RNG *>(0x40000000);
local_48 = GHIDRA_CAST<uint8_t *>(0x40000000);
break;
case 9:
local_48 = GHIDRA_CAST<uint8_t *>(0x0);
local_34 = GHIDRA_CAST<RNG *>(0x40000000);
break;
default:
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("invalid room shape id: %d\n"));
pvVar12 = pRVar7[iVar13].Data;
}
pMVar4 = self;
roomShape = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x48));
local_58.x = cellX;
local_58.y = (float)local_2c;
if (roomShape == 9) {
local_58.x = cellX - cellStepX;
}
if ((g_game->_stage == 0xc) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 8)) == 5)) {
if (roomShape == 4) {
if ((pRVar7[iVar13].AllowedDoors & 0x58) != 0) {
LAB_0098bef9:
local_58.y = (float)local_2c + cellStepY;
}
}
else {
if (roomShape == 6) {
if ((pRVar7[iVar13].AllowedDoors & 0xa4) == 0) goto LAB_0098bf06;
}
else {
if (roomShape != 8) goto LAB_0098bf22;
uVar6 = pRVar7[iVar13].AllowedDoors;
if ((uVar6 & 0x24) == 0) {
if ((uVar6 & 0x18) == 0) {
if ((uVar6 & 0xc0) == 0) goto LAB_0098bf06;
local_58.x = local_58.x + cellStepX;
}
goto LAB_0098bef9;
}
}
local_58.x = local_58.x + cellStepX;
}
LAB_0098bf06:
iVar17 = 0;
local_48 = GHIDRA_CAST<uint8_t *>(g_vectorOne.x);
local_34 = GHIDRA_CAST<RNG *>(g_vectorOne.y);
}
LAB_0098bf22:
uVar6 = GHIDRA_UINT(pRVar7[iVar13].Flags) >> 10;
if ((uVar6 & 1) != 0) {
self->_config[0]._mapSprite._numEvents = 0x3f800000;
self->_config[0]._mapSprite._offset.x = 0.29411766;
self->_config[0]._mapSprite._offset.y = 0.29411766;
self->_config[0]._mapSprite._scale.x = 1.0;
}
if (local_88->ListIndex == roomList[iVar13].ListIndex) {
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(self))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("RoomCurrent"),1);
if (((bVar5 != 0) &&
(*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) &&
(AnimationState::SetFrameFloat
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName)
,(float)iVar17),
*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) {
*GHIDRA_CAST<uint8_t *>(&pMVar4->_config[0]._mapSprite._animDefaultName._capacity) = 0;
}
if (*GHIDRA_CAST<char *>((GHIDRA_INT(pMVar4->_config[0]._mapSprite._championColor._colorize) + 0xd))
!= '\0') {
lastState = (AnimationState *)
&pMVar4->_config[0]._mapSprite._animState._layerFrames;
if (*GHIDRA_CAST<char *>(&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames) ==
'\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName)
,&local_58,&g_vectorZero,&g_vectorZero);
}
else {
AnimationState::Render(lastState,&local_58,&g_vectorZero,&g_vectorZero);
lastState = (AnimationState *)
&pMVar4->_config[0]._mapSprite._animDefaultName;
}
AnimationState::Render(lastState,&local_58,&g_vectorZero,&g_vectorZero);
}
fVar14 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar4->_config[0])) + 0x114)))) +
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar4->_config[0])) + 0x118))));
fVar16 = fVar14 * g_vectorOne.y;
fVar9 = (float)pMVar4->_config[0]._mapSprite._bitflags;
pMVar4->_config[0]._borderPadding.y =
(float)local_48 * (float)pMVar4->_config[0]._mapSprite._shadowLayerIndex *
0.5 + cellX + fVar14 * g_vectorOne.x;
pMVar4->_config[0]._posOffsetX =
(float)local_34 * fVar9 * 0.5 + (float)local_2c + fVar16;
}
else {
if (((roomList[iVar13].Flags & 1) == 0) ||
((roomList[iVar13].DisplayFlags & 1) == 0)) {
if ((((roomList[iVar13].Data == (void *)0x0) ||
(((roomList[iVar13].DisplayFlags & 1) == 0 ||
(iVar13 = *GHIDRA_CAST<int *>((GHIDRA_INT(roomList[iVar13].Data) + 8)), iVar13 == 7)))) ||
(iVar13 == 8)) || (iVar13 == 0x1d)) goto LAB_0098c150;
uVar20 = 0x100b7d3e0;
}
else {
uVar20 = 0x100b7d350;
}
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(self))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(uVar20),
(uint8_t)((uint64_t)uVar20 >> 0x20));
if (((bVar5 != 0) &&
(*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) &&
(AnimationState::SetFrameFloat
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName)
,(float)iVar17),
*GHIDRA_CAST<int *>((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) {
*GHIDRA_CAST<uint8_t *>(&pMVar4->_config[0]._mapSprite._animDefaultName._capacity) = 0;
}
if (*GHIDRA_CAST<char *>((GHIDRA_INT(pMVar4->_config[0]._mapSprite._championColor._colorize) + 0xd))
!= '\0') {
ppvVar1 = &pMVar4->_config[0]._mapSprite._animState._layerFrames;
if (*GHIDRA_CAST<char *>(&pMVar4->_config[0]._mapSprite._overlayAnimState._layerFrames) ==
'\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName)
,&local_58,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(ppvVar1),&local_58,&g_vectorZero,&g_vectorZero);
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(ppvVar1),&local_58,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(GHIDRA_CAST<AnimationState *>(&pMVar4->_config[0]._mapSprite._animDefaultName)
,&local_58,&g_vectorZero,&g_vectorZero);
}
}
}
LAB_0098c150:
pMVar15 = self;
pbVar10 = local_2c;
fVar14 = cellStepX;
if ((uVar6 & 1) != 0) {
pMVar4->_config[0]._mapSprite._numEvents = 0x3f800000;
pMVar4->_config[0]._mapSprite._offset.x = 1.0;
pMVar4->_config[0]._mapSprite._offset.y = 1.0;
pMVar4->_config[0]._mapSprite._scale.x = 1.0;
}
}
else if (GHIDRA_CAST<uint8_t *>(roomList[iVar13].GridIndex) + 1 == local_6c) {
if (*GHIDRA_CAST<int *>((GHIDRA_INT(roomList[iVar13].Data) + 0x48)) == 9) goto LAB_0098bdb8;
}
pbVar11 = startCol;
}
}
cellX = cellX + fVar14;
local_4c = local_4c + 1;
local_6c = local_6c + 1;
local_68 = local_68 + 1;
} while (GHIDRA_INT(local_4c) < GHIDRA_INT((pbVar11 + GHIDRA_INT(pMVar15->_config[0]._vec1.x))));
fVar9 = cellStepY;
}
cellX = 0.0;
if (0 < GHIDRA_INT(startCol)) {
cellX = 0.0 - fVar14;
}
local_2c = GHIDRA_CAST<uint8_t *>(((float)pbVar10 + fVar9));
fVar14 = pMVar15->_config[0]._vec1.y;
local_64 = (float)(GHIDRA_INT(local_64) + 1);
local_5c = (float)(GHIDRA_INT(local_5c) + 0xd);
} while (GHIDRA_INT(local_64) < GHIDRA_INT(startRow) + GHIDRA_INT(fVar14));
pMVar15 = self;
cellWidth = startRow;
}
cellX = 0.0;
local_6c = GHIDRA_CAST<uint8_t *>(0x0);
if (0 < GHIDRA_INT(cellWidth)) {
local_6c = GHIDRA_CAST<uint8_t *>((0.0 - fVar9));
}
if (0 < GHIDRA_INT(startCol)) {
cellX = 0.0 - cellStepX;
}
if (GHIDRA_INT(cellWidth) < 1) {
local_5c = cellWidth;
}
else {
local_5c = (float)(GHIDRA_INT(cellWidth) - 1);
}
if (GHIDRA_INT(local_5c) < GHIDRA_INT(fVar14) + GHIDRA_INT(cellWidth)) {
do {
if (GHIDRA_INT(startCol) < 1) {
local_48 = startCol;
}
else {
local_48 = startCol + -1;
}
fVar14 = cellStepX;
if (GHIDRA_INT(local_48) < GHIDRA_INT((startCol + GHIDRA_INT(pMVar15->_config[0]._vec1.x)))) {
local_4c = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_5c) * 0xd));
do {
pbVar10 = local_4c + GHIDRA_INT(local_48);
if (-1 < GHIDRA_INT(pbVar10)) {
if (pbVar10 < GHIDRA_CAST<uint8_t *>(0xa9)) {
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomGrid) + GHIDRA_INT(pbVar10) * 4));
if (-1 < iVar13) {
roomIconName = GHIDRA_CAST<char *>(0x0);
local_2c = GHIDRA_CAST<uint8_t *>(0x0);
local_34 = GHIDRA_CAST<RNG *>((roomList + iVar13));
pvVar12 = (void *)local_34[1]._seed;
if ((pvVar12 == (void *)0x0) || ((local_34[3]._shift3 & 4) == 0)) {
switchD_0098c2e6_caseD_3:
if ((void *)local_34[1]._seed != (void *)0x0) {
iVar13 = *GHIDRA_CAST<int *>((local_34[1]._seed + 8));
if (((iVar13 != 1) && ((float)local_34[4]._seed == 0.0)) &&
((local_34[3]._shift3 & 2) != 0)) {
switch(iVar13) {
case 2:
case 9:
case 0xc:
case 0x12:
case 0x13:
case 0x14:
case 0x15:
case 0x18:
roomIconName = "IconLockedRoom";
goto LAB_0098c47d;
}
}
}
}
else {
switch(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar12) + 8))) {
case 1:
if (((float)local_34[4]._seed == 0.0) || (g_game->_currentDimensionIdx == 2))
goto switchD_0098c2e6_caseD_3;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x10)) == 0x22) {
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasMirrorDimension();
if (bVar5 == 0) goto switchD_0098c2e6_caseD_3;
roomIconName = "IconMirrorRoom";
}
else {
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x10)) != 10) ||
(bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(), bVar5 == 0))
goto switchD_0098c2e6_caseD_3;
roomIconName = "IconMinecartRoom";
}
break;
case 2:
roomIconName = "IconShop";
break;
default:
goto switchD_0098c2e6_caseD_3;
case 4:
if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) &&
(g_game->_greedModeTreasureRoomIdx != local_34->_seed)) {
roomIconName = "IconTreasureRoomGreed";
}
else {
roomIconName = "IconTreasureRoomRed";
if ((GHIDRA_UINT(local_34[4]._shift1) >> 0xb & 1) == 0) {
roomIconName = "IconTreasureRoom";
}
}
break;
case 5:
roomIconName = "IconBoss";
break;
case 6:
roomIconName = "IconMiniboss";
break;
case 7:
roomIconName = "IconSecretRoom";
break;
case 8:
roomIconName = "IconSuperSecretRoom";
break;
case 9:
roomIconName = "IconArcade";
break;
case 10:
roomIconName = "IconCurseRoom";
break;
case 0xb:
roomIconName = "IconBossAmbushRoom";
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + 0x10)) != 1) {
roomIconName = "IconAmbushRoom";
}
break;
case 0xc:
roomIconName = "IconLibrary";
break;
case 0xd:
roomIconName = "IconSacrificeRoom";
break;
case 0xe:
roomIconName = "IconDevilRoom";
break;
case 0xf:
roomIconName = "IconAngelRoom";
break;
case 0x12:
roomIconName = "IconIsaacsRoom";
break;
case 0x13:
roomIconName = "IconBarrenRoom";
break;
case 0x14:
roomIconName = "IconChestRoom";
break;
case 0x15:
roomIconName = "IconDiceRoom";
break;
case 0x18:
roomIconName = "IconPlanetarium";
break;
case 0x19:
case 0x1a:
roomIconName = "IconTeleporterRoom";
break;
case 0x1d:
roomIconName = "IconUltraSecretRoom";
}
LAB_0098c47d:
local_2c = GHIDRA_CAST<uint8_t *>(roomIconName);
}
uVar6 = 0;
heartIconFrame = 0;
chestIconFrame = 0;
fVar9 = (float)GHIDRA_UINT((GHIDRA_CAST<uint8_t *>(roomIconName) != GHIDRA_CAST<uint8_t *>(0x0)));
keyIconFrame = 0;
local_74.y = 0.0;
local_58.y = 0.0;
local_7c = 0.0;
pillIconFrame = 0;
local_88 = GHIDRA_CAST<RoomDescriptor *>(0x0);
local_8c = 0;
iconSlot = fVar9;
if (local_34[3]._shift3 != 0) {
pRVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(GHIDRA_INT((local_48 + GHIDRA_INT(local_4c))),-1)
;
savedEntry = (pRVar7->SavedEntities)._begin;
pRVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(GHIDRA_INT((local_48 + GHIDRA_INT(local_4c))),-1)
;
if (savedEntry != (pRVar7->SavedEntities)._end) {
do {
iVar13 = *savedEntry;
if (iVar13 == 5) {
if (savedEntry[5] == 0) {
if ((float)savedEntry[10] == g_vectorZero.x) {
if ((float)savedEntry[0xb] == g_vectorZero.y)
goto switchD_0098c8f3_caseD_34;
}
iVar13 = savedEntry[1];
if (iVar13 == 10) {
if ((uVar6 & 1) == 0) {
uVar6 = uVar6 | 1;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
switch(savedEntry[2]) {
case 2:
break;
case 3:
uVar8 = 5;
if (4 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 4:
uVar8 = 9;
if (8 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
default:
uVar8 = 1;
if (heartIconFrame != 0) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 6:
uVar8 = 6;
if (5 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 7:
uVar8 = 8;
if (7 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 8:
uVar8 = 3;
if (2 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 10:
uVar8 = 4;
if (3 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 0xb:
uVar8 = 7;
if (6 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
break;
case 0xc:
uVar8 = 2;
if (1 < heartIconFrame) {
uVar8 = heartIconFrame;
}
heartIconFrame = uVar8;
}
}
else if (iVar13 == 0x14) {
if ((uVar6 & 2) == 0) {
uVar6 = uVar6 | 2;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
switch(savedEntry[2]) {
case 2:
case 6:
pRVar7 = GHIDRA_CAST<RoomDescriptor *>(0x1);
if (local_88 != GHIDRA_CAST<RoomDescriptor *>(0x0)) {
pRVar7 = local_88;
}
local_88 = pRVar7;
break;
case 3:
pRVar7 = GHIDRA_CAST<RoomDescriptor *>(0x2);
if (GHIDRA_CAST<RoomDescriptor *>(0x1) < local_88) {
pRVar7 = local_88;
}
local_88 = pRVar7;
break;
default:
break;
case 7:
pRVar7 = GHIDRA_CAST<RoomDescriptor *>(0x3);
if (GHIDRA_CAST<RoomDescriptor *>(0x2) < local_88) {
pRVar7 = local_88;
}
local_88 = pRVar7;
}
}
else if (iVar13 == 0x2a) {
if ((uVar6 & 4) == 0) {
uVar6 = uVar6 | 4;
goto LAB_0098ca30;
}
}
else if (iVar13 == 0x28) {
if ((uVar6 & 0x10) == 0) {
uVar6 = uVar6 | 0x10;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (GHIDRA_UINT(local_74.y) < GHIDRA_CAST<RNG *>(GHIDRA_UINT((savedEntry[2] == 4)))) {
local_74.y = (float)GHIDRA_UINT((savedEntry[2] == 4));
}
}
else if (iVar13 == 0x1e) {
if ((uVar6 & 8) == 0) {
uVar6 = uVar6 | 8;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (savedEntry[2] == 2) {
uVar8 = 1;
if (keyIconFrame != 0) {
uVar8 = keyIconFrame;
}
keyIconFrame = uVar8;
}
else if (savedEntry[2] == 4) {
uVar8 = 2;
if (1 < keyIconFrame) {
uVar8 = keyIconFrame;
}
keyIconFrame = uVar8;
}
else {
}
}
else if (iVar13 == 300) {
iVar13 = savedEntry[2];
if (((iVar13 < 0) ||
(pvVar12 = (g_manager->_itemConfig)._cards._begin,
GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(pvVar12) >> 2 <=
iVar13)) ||
((iVar13 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar12) + iVar13 * 4)), iVar13 == 0 ||
(*GHIDRA_CAST<int *>((iVar13 + 0x58)) != 2)))) {
if ((uVar6 & 0x20) == 0) {
uVar6 = uVar6 | 0x20;
goto LAB_0098ca30;
}
}
else if ((uVar6 & 0x1000) == 0) {
uVar6 = uVar6 | 0x1000;
goto LAB_0098ca30;
}
}
else if (iVar13 == 100) {
if ((uVar6 & 0x40) == 0) {
uVar6 = uVar6 | 0x40;
goto LAB_0098ca30;
}
LAB_0098c8c3:
bVar5 = Entity_Pickup::IsChest(iVar13);
if (bVar5 == 0) {
if (extraout_ECX != 0x45) goto switchD_0098c8f3_caseD_34;
}
if ((uVar6 & 0x200) == 0) {
uVar6 = uVar6 | 0x200;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (extraout_ECX < 0x46) {
if (extraout_ECX == 0x45) {
uVar8 = (savedEntry[2] == 2) + 2;
}
else {
switch(extraout_ECX) {
case 0x33:
uVar8 = 1;
break;
case 0x34:
goto switchD_0098c8f3_caseD_34;
case 0x35:
uVar8 = 7;
break;
default:
goto switchD_0098c8f3_caseD_36;
case 0x38:
uVar8 = 6;
break;
case 0x39:
uVar8 = 9;
break;
case 0x3c:
uVar8 = 8;
}
}
}
else if (extraout_ECX == 0x168) {
uVar8 = 5;
}
else {
switchD_0098c8f3_caseD_36:
uVar8 = 4;
}
if (chestIconFrame < uVar8) {
chestIconFrame = uVar8;
}
}
else if (iVar13 == 0x15e) {
if ((uVar6 & 0x400) != 0) goto LAB_0098c8c3;
uVar6 = uVar6 | 0x400;
LAB_0098ca30:
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
else if (iVar13 == 0x5a) {
if ((uVar6 & 0x100) == 0) {
uVar6 = uVar6 | 0x100;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (local_8c < (savedEntry[2] == 4)) {
local_8c = GHIDRA_UINT((savedEntry[2] == 4));
}
}
else {
if (iVar13 != 0x46) goto LAB_0098c8c3;
if (-1 < (char)uVar6) {
uVar6 = uVar6 | 0x80;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
uVar8 = GHIDRA_UINT(((savedEntry[2] & 0x7ffU) == 0xe));
if (pillIconFrame < uVar8) {
pillIconFrame = uVar8;
}
}
}
goto switchD_0098c8f3_caseD_34;
}
if (iVar13 != 6) {
if (iVar13 == 1000) {
if (savedEntry[1] == 0xa1) {
if (savedEntry[2] == 0x3d4) {
if ((uVar6 & 0x8000) == 0) {
uVar6 = uVar6 | 0x8000;
goto LAB_0098ca30;
}
}
}
}
goto switchD_0098c8f3_caseD_34;
}
if (savedEntry[1] == 0xe) goto switchD_0098c8f3_caseD_34;
switch(savedEntry[1]) {
default:
pbVar10 = GHIDRA_CAST<uint8_t *>(0x2);
break;
case 2:
pbVar10 = GHIDRA_CAST<uint8_t *>(0x3);
break;
case 3:
pbVar10 = &DAT_00000004;
break;
case 4:
case 6:
fVar14 = 0.0;
goto LAB_0098c9d2;
case 5:
case 0xf:
fVar14 = 2.8026e-45;
goto LAB_0098c9d2;
case 7:
fVar14 = 4.2039e-45;
goto LAB_0098c9d2;
case 8:
case 0xb:
pbVar10 = GHIDRA_CAST<uint8_t *>(0x1);
break;
case 9:
fVar14 = 5.60519e-45;
goto LAB_0098c9d2;
case 10:
pbVar10 = &DAT_00000006;
break;
case 0xc:
pbVar10 = GHIDRA_CAST<uint8_t *>(0x0);
break;
case 0xd:
fVar14 = 7.00649e-45;
goto LAB_0098c9d2;
case 0x10:
pbVar10 = &DAT_00000005;
break;
case 0x11:
pbVar10 = &DAT_00000007;
break;
case 0x12:
fVar14 = 1.4013e-45;
LAB_0098c9d2:
if ((uVar6 & 0x2000) == 0) {
uVar6 = uVar6 | 0x2000;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (GHIDRA_UINT(local_7c) < GHIDRA_UINT(fVar14)) {
local_7c = fVar14;
}
goto switchD_0098c8f3_caseD_34;
case 0x13:
pbVar10 = &DAT_00000008;
}
if ((uVar6 & 0x800) == 0) {
uVar6 = uVar6 | 0x800;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
if (GHIDRA_UINT(local_58.y) < pbVar10) {
local_58.y = (float)pbVar10;
}
switchD_0098c8f3_caseD_34:
savedEntry = savedEntry + 0x1e;
pRVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(GHIDRA_INT((local_48 + GHIDRA_INT(local_4c)))
,-1);
} while (savedEntry != (pRVar7->SavedEntities)._end);
}
savedEntry = (GHIDRA_CAST<std_vector *>(&local_34[6]._shift2))->_begin;
for (iVar13 = GHIDRA_INT(local_34[6]._shift3) - GHIDRA_INT(savedEntry) >> 5; iVar13 != 0;
iVar13 = iVar13 + -1) {
if ((*savedEntry == 0x12) && ((uVar6 & 0x4000) == 0)) {
uVar6 = uVar6 | 0x4000;
fVar9 = (float)(GHIDRA_INT(fVar9) + 1);
}
savedEntry = savedEntry + 8;
}
}
if ((GHIDRA_CAST<uint8_t *>(local_34->_seed) == local_48 + GHIDRA_INT(local_4c)) ||
((GHIDRA_CAST<uint8_t *>(local_34->_seed) + 1 == local_48 + GHIDRA_INT(local_4c) &&
(*GHIDRA_CAST<int *>((GHIDRA_INT(local_34[1]._seed) + 0x48)) == 9)))) {
fVar14 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self->_config[0])) + 0x114)))) +
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(self->_config[0])) + 0x118))));
local_64 = cellX;
fVar16 = fVar14 * g_vectorOne.x;
fVar14 = fVar14 * g_vectorOne.y;
local_68 = GHIDRA_CAST<int *>(local_6c);
if ((g_game->_stage == 0xc) && (*GHIDRA_CAST<int *>((local_34[1]._seed + 8)) == 5)) {
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_INT(local_34[1]._seed) + 0x48));
if (iVar13 == 4) {
if ((local_34[1]._shift2 & 0x58) != 0) {
LAB_0098cb43:
local_68 = GHIDRA_CAST<int *>(((float)local_6c + cellStepY));
}
}
else if (iVar13 == 6) {
if ((local_34[1]._shift2 & 0xa4) != 0) {
LAB_0098cb31:
local_64 = cellX + cellStepX;
}
}
else {
if (iVar13 != 8) goto LAB_0098cb4f;
uVar8 = local_34[1]._shift2;
if ((uVar8 & 0x24) != 0) goto LAB_0098cb31;
if ((uVar8 & 0x18) != 0) goto LAB_0098cb43;
if ((uVar8 & 0xc0) != 0) {
local_64 = cellX + cellStepX;
local_68 = GHIDRA_CAST<int *>(((float)local_6c + cellStepY));
}
}
}
else {
LAB_0098cb4f:
iVar13 = *GHIDRA_CAST<int *>((GHIDRA_INT(local_34[1]._seed) + 0x48));
if (iVar13 == 4) {
LAB_0098cb7c:
fVar14 = fVar14 + (float)self->_config[0]._mapSprite._bitflags * 0.5;
}
else if (iVar13 == 6) {
fVar16 = fVar16 + (float)self->_config[0]._mapSprite._shadowLayerIndex * 0.5
;
}
else if (iVar13 == 8) {
fVar16 = fVar16 + (float)self->_config[0]._mapSprite._shadowLayerIndex * 0.5
;
goto LAB_0098cb7c;
}
}
cellWidth = (float)self->_config[0]._mapSprite._shadowLayerIndex;
cellHeight = (float)self->_config[0]._mapSprite._bitflags;
maxIcons = self->_config[0]._borderPadding.x;
if (GHIDRA_UINT(maxIcons) < GHIDRA_UINT(fVar9)) {
fVar9 = maxIcons;
}
local_c8._seed = GHIDRA_INT((cellWidth * 0.25 + fVar16));
quadIconOffsets[1].x = cellWidth * 0.75 + fVar16;
local_c8._shift3 = GHIDRA_INT((cellHeight * 0.5 + fVar14));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x4))) = local_c8._shift3;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x0))) = cellWidth * 0.5 + fVar16;
local_c8._shift2 = GHIDRA_INT(quadIconOffsets[1].x);
local_c8._shift1 = local_c8._shift3;
quadIconOffsets[0].y = cellHeight * 0.25 + fVar14;
quadIconOffsets[2].y = cellHeight * 0.75 + fVar14;
quadIconOffsets[0].x = (float)local_c8._seed;
quadIconOffsets[1].y = quadIconOffsets[0].y;
quadIconOffsets[2].x = (float)local_c8._seed;
quadIconOffsets[3].x = quadIconOffsets[1].x;
quadIconOffsets[3].y = quadIconOffsets[2].y;
if (GHIDRA_UINT(fVar9) < 5) {
if (GHIDRA_UINT(fVar9) < 2) {
local_34 = GHIDRA_CAST<RNG *>(local_b8);
}
else {
if (2 < GHIDRA_UINT(fVar9)) goto LAB_0098cc6f;
local_34 = &local_c8;
}
}
else {
KAGE_LogMessage(0x10,(uint8_t *)
"currently there are no more than 4 minimap icons supported\n"
);
LAB_0098cc6f:
local_34 = GHIDRA_CAST<RNG *>(quadIconOffsets);
}
iconSprite = iconSpriteRef;
pbVar10 = GHIDRA_CAST<uint8_t *>(0x0);
if (local_2c != GHIDRA_CAST<uint8_t *>(0x0)) {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSpriteRef)))->ANM2::SetAnimation(local_2c,1);
if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) &&
((GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
(iconSprite->_animState)._animData != (void *)0x0)) {
(iconSprite->_animState)._isPlaying = 0;
}
local_2c = GHIDRA_CAST<uint8_t *>(((local_64 + (float)local_34->_seed) - 6.0));
dVar19 = floor((double)(float)local_2c);
roomIconPos.x = (float)dVar19;
local_2c = GHIDRA_CAST<uint8_t *>((((float)local_68 + (float)local_34->_shift1) - 6.0));
dVar19 = floor((double)(float)local_2c);
roomIconPos.y = (float)dVar19;
pbVar10 = local_2c;
if (iconSprite->_loaded != 0) {
if (iconSprite->_overlayRenderFirst == 0) {
AnimationState::Render
(&iconSprite->_animState,&roomIconPos,&g_vectorZero,
&g_vectorZero);
lastState = &iconSprite->_overlayAnimState;
}
else {
AnimationState::Render
(&iconSprite->_overlayAnimState,&roomIconPos,&g_vectorZero,
&g_vectorZero);
lastState = &iconSprite->_animState;
}
AnimationState::Render(lastState,&roomIconPos,&g_vectorZero,&g_vectorZero);
pbVar10 = local_2c;
}
}
while ((local_2c = pbVar10, GHIDRA_UINT(iconSlot) < GHIDRA_UINT(fVar9) && (uVar6 != 0))) {
if ((uVar6 & 1) == 0) {
if ((uVar6 & 0x40) == 0) {
if ((uVar6 & 0x400) == 0) {
if ((uVar6 & 0x200) == 0) {
if ((uVar6 & 0x1000) == 0) {
if ((uVar6 & 0x20) == 0) {
if ((char)uVar6 < '\0') {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconPill"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,(float)GHIDRA_INT(pillIconFrame)
), *GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffff7f;
}
else if ((uVar6 & 8) == 0) {
if ((uVar6 & 0x10) == 0) {
if ((uVar6 & 4) == 0) {
if ((uVar6 & 2) == 0) {
if ((uVar6 & 0x100) == 0) {
if ((uVar6 & 0x2000) == 0) {
if ((uVar6 & 0x800) == 0) {
if ((uVar6 & 0x4000) == 0) {
if ((uVar6 & 0x8000) != 0) {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconPortal"),
1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData !=
(void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffff7fff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconLadder"),1)
;
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData !=
(void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffbfff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconSlot"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData !=
(void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,
(float)GHIDRA_INT(local_58.y)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffff7ff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconBeggar"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0
)) && (AnimationState::SetFrameFloat
(&iconSprite->_animState,
(float)GHIDRA_INT(local_7c)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffdfff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconBattery"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0))
&& (AnimationState::SetFrameFloat
(&iconSprite->_animState,
(float)GHIDRA_INT(local_8c)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffeff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconCoin"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0))
&& (AnimationState::SetFrameFloat
(&iconSprite->_animState,
(float)GHIDRA_INT(local_88)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffffd;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconPoop"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffffb;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconBomb"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,(float)GHIDRA_INT(local_74.y))
, *GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffffef;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconKey"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,(float)GHIDRA_INT(keyIconFrame))
, *GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffff7;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconCard"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
((GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffffdf;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconRune"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
((GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffefff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconChest"),1);
if (((bVar5 != 0) &&
((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,(float)GHIDRA_INT(chestIconFrame)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffdff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconTrinket"),1);
if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)
) && ((GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffbff;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconItem"),1);
if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0))
&& ((GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xffffffbf;
}
}
else {
bVar5 = (GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IconHeart"),1);
if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat
(&iconSprite->_animState,(float)GHIDRA_INT(heartIconFrame)),
*GHIDRA_CAST<int *>((iconSpriteOwner + 0x534)) != 0)) {
(iconSprite->_animState)._isPlaying = 0;
}
uVar6 = uVar6 & 0xfffffffe;
}
local_2c = GHIDRA_CAST<uint8_t *>(((local_64 + (float)(&local_34->_seed)[GHIDRA_INT(iconSlot) * 2])
- 6.0));
dVar19 = floor((double)(float)local_2c);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_b8)) + 0x8))) = (BADTYPE)dVar19;
local_2c = GHIDRA_CAST<uint8_t *>((((float)local_68 +
(float)(&local_34->_shift1)[GHIDRA_INT(iconSlot) * 2]) - 6.0));
dVar19 = floor((double)(float)local_2c);
local_ac = (float)dVar19;
if (iconSprite->_loaded != 0) {
if (iconSprite->_overlayRenderFirst == 0) {
AnimationState::Render
(&iconSprite->_animState,GHIDRA_CAST<Vector *>((local_b8 + 8)),&g_vectorZero,
&g_vectorZero);
lastState = &iconSprite->_overlayAnimState;
}
else {
AnimationState::Render
(&iconSprite->_overlayAnimState,GHIDRA_CAST<Vector *>((local_b8 + 8)),
&g_vectorZero,&g_vectorZero);
lastState = &iconSprite->_animState;
}
AnimationState::Render
(lastState,GHIDRA_CAST<Vector *>((local_b8 + 8)),&g_vectorZero,&g_vectorZero);
}
iconSlot = (float)(GHIDRA_INT(iconSlot) + 1);
pbVar10 = local_2c;
}
}
pMVar15 = self;
fVar14 = cellStepX;
}
}
}
local_48 = local_48 + 1;
cellX = cellX + fVar14;
} while (GHIDRA_INT(local_48) < GHIDRA_INT((startCol + GHIDRA_INT(pMVar15->_config[0]._vec1.x))));
cellWidth = startRow;
fVar9 = cellStepY;
}
cellX = 0.0;
if (0 < GHIDRA_INT(startCol)) {
cellX = 0.0 - fVar14;
}
local_6c = GHIDRA_CAST<uint8_t *>(((float)local_6c + fVar9));
local_5c = (float)(GHIDRA_INT(local_5c) + 1);
} while (GHIDRA_INT(local_5c) < GHIDRA_INT(pMVar15->_config[0]._vec1.y) + GHIDRA_INT(cellWidth));
}
_glfw_context_reset();
if (g_renderTargetStackSize == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("PopRenderTarget: stack is empty!\n"));
}
renderTargetEntry = msvc::deque::back();
KAGE_Graphics::SetRenderTarget
(&DAT_00c798e0,(void *)*renderTargetEntry,*GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)));
g_renderTargetStackSize = g_renderTargetStackSize - 1;
if (g_renderTargetStackSize == 0) {
DAT_00c7978c = 0;
}
}
DAT_00c33910 = 1;
return;
}
// 0098d560
void Minimap::Init()
{
int iVar1;
Minimap *pMVar2;
MinimapConfig *pMVar3;
char cVar4;
int iVar5;
int iVar6;
int iVar7;
int iVar8;
void *pvVar9;
uint8_t auVar10 [4];
char *ptr;
uint32_t uVar11;
uint8_t tmpHandle [4];
int *tmpRefCount;
Minimap *minimap;
int layersLeft;
MinimapConfig *mapLayer;
std_string iconsPath;
uint8_t anm2Path [4];
KColor local_38;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
puStack_20 = anm2Path + 0x38;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0d46d;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((anm2Path + 0x2c));
ExceptionList = &local_1c;
local_38._alpha = 0.0;
local_38._unk = 0xf;
anm2Path[0] = '\0';
anm2Path[1] = '\0';
anm2Path[2] = '\0';
anm2Path[3] = '\0';
minimap = this;
anm2Path = (uint8_t [4])msvc::_Allocate(0x20);
local_38._alpha = 2.8026e-44;
local_38._unk = 0x1f;
builtin_strncpy(GHIDRA_CAST<char *>(anm2Path),"gfx/ui/minimap1.anm2",0x15);
local_14 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_config[0]._mapSprite)))->ANM2::Load(GHIDRA_CAST<std_string *>(anm2Path),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_38._unk)) {
uVar11 = local_38._unk + 1;
auVar10 = anm2Path;
if (0xfff < uVar11) {
auVar10 = *(uint8_t (*) [4])(GHIDRA_INT(anm2Path) + -4);
uVar11 = local_38._unk + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(auVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete((void *)auVar10,uVar11);
}
this->_config[0]._vec1.x = 16.0;
this->_config[0]._vec1.y = 16.0;
this->_config[0]._borderPadding.x = 7.0;
this->_config[0]._borderPadding.y = 6.0;
this->_config[0]._posOffsetX = 2.0;
this->_config[0]._borderScale = 1.0;
this->_config[0]._i1 = 7;
this->_config[0]._i2 = 7;
this->_config[0]._minimapIconNum = 1;
local_38._alpha = 0.0;
local_38._unk = 0xf;
anm2Path[0] = '\0';
anm2Path[1] = '\0';
anm2Path[2] = '\0';
anm2Path[3] = '\0';
anm2Path = (uint8_t [4])msvc::_Allocate(0x20);
local_38._alpha = 2.8026e-44;
local_38._unk = 0x1f;
builtin_strncpy(GHIDRA_CAST<char *>(anm2Path),"gfx/ui/minimap2.anm2",0x15);
local_14 = 1;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this->_config[1]._mapSprite._filename._buf + 4)))))->ANM2::Load(GHIDRA_CAST<std_string *>(anm2Path),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_38._unk)) {
uVar11 = local_38._unk + 1;
auVar10 = anm2Path;
if (0xfff < uVar11) {
auVar10 = *(uint8_t (*) [4])(GHIDRA_INT(anm2Path) + -4);
uVar11 = local_38._unk + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(auVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete((void *)auVar10,uVar11);
}
mapLayer = this->_config + 1;
this->_config[1]._vec1.y = (float)&DAT_42000000;
this->_config[1]._borderPadding.x = (float)&DAT_42000000;
this->_config[1]._borderPadding.y = 16.0;
this->_config[1]._posOffsetX = 14.0;
this->_config[1]._borderScale = 4.0;
this->_config[1]._i1 = 0x3f800000;
this->_config[1]._i2 = 0xd;
this->_config[1]._minimapIconNum = 0xd;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x140)))) = 4;
layersLeft = 2;
do {
*GHIDRA_CAST<Minimap **>((mapLayer->_mapSprite)._filename._buf) = this;
iVar5 = __ftoui3();
iVar6 = __ftoui3();
iVar7 = __ftoui3();
iVar1 = mapLayer[-1]._i1;
iVar8 = __ftoui3();
local_38._unk = 0;
local_38._red = 0.0;
local_38._green = 0.0;
local_38._blue = 0.0;
local_38._alpha = 0.0;
pvVar9 = KAGE_Graphics::create_render_target
(tmpHandle,(iVar7 + iVar5) * iVar1 + iVar6 * 2 + iVar5,
(iVar8 + iVar5) * mapLayer[-1]._i2 + iVar6 * 2 + iVar5,
GHIDRA_CAST<uint8_t *>("Minimap Surface"),&local_38);
pMVar3 = mapLayer;
local_14 = 2;
(GHIDRA_CAST<shared_ptr *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(mapLayer[-1])) + 0x114))))))->shared_ptr::operator_assign(pvVar9);
local_14 = 3;
if (tmpRefCount != GHIDRA_CAST<int *>(0x0)) {
cVar4 = (**(code **)(*tmpRefCount + 0xc))();
if ((cVar4 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(tmpHandle);
}
}
pMVar2 = minimap;
local_14 = 0xffffffff;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar3[-1])) + 0x140)))) = g_vectorZero.x;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar3[-1])) + 0x144)))) = g_vectorZero.y;
pMVar3[-1]._alpha = 0.0;
mapLayer = GHIDRA_CAST<MinimapConfig *>((GHIDRA_INT((pMVar3 + 1)) + 4));
layersLeft = layersLeft + -1;
this = minimap;
} while (layersLeft != 0);
local_38._alpha = 0.0;
local_38._unk = 0xf;
anm2Path[0] = '\0';
anm2Path[1] = '\0';
anm2Path[2] = '\0';
anm2Path[3] = '\0';
anm2Path = (uint8_t [4])msvc::_Allocate(0x20);
local_38._alpha = 3.36312e-44;
local_38._unk = 0x1f;
builtin_strncpy(GHIDRA_CAST<char *>(anm2Path),"gfx/ui/mapitemicons.anm2",0x19);
local_14 = 4;
(GHIDRA_CAST<ANM2 *>((&pMVar2->_itemIconsSprite)))->ANM2::Load(GHIDRA_CAST<std_string *>(anm2Path),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_38._unk)) {
uVar11 = local_38._unk + 1;
auVar10 = anm2Path;
if (0xfff < uVar11) {
auVar10 = *(uint8_t (*) [4])(GHIDRA_INT(anm2Path) + -4);
uVar11 = local_38._unk + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(auVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete((void *)auVar10,uVar11);
}
local_38._alpha = 0.0;
local_38._unk = 0xf;
anm2Path[0] = '\0';
anm2Path[1] = '\0';
anm2Path[2] = '\0';
anm2Path[3] = '\0';
anm2Path = (uint8_t [4])msvc::_Allocate(0x20);
local_38._alpha = 3.08286e-44;
local_38._unk = 0x1f;
builtin_strncpy(GHIDRA_CAST<char *>(anm2Path),"gfx/ui/hudpickups.anm2",0x17);
local_14 = 5;
(GHIDRA_CAST<ANM2 *>((&pMVar2->_hudPickupSprite)))->ANM2::Load(GHIDRA_CAST<std_string *>(anm2Path),1);
local_14 = 0xffffffff;
if (0xf < GHIDRA_UINT(local_38._unk)) {
uVar11 = local_38._unk + 1;
auVar10 = anm2Path;
if (0xfff < uVar11) {
auVar10 = *(uint8_t (*) [4])(GHIDRA_INT(anm2Path) + -4);
uVar11 = local_38._unk + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(anm2Path) + (-4 - GHIDRA_INT(auVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete((void *)auVar10,uVar11);
}
local_38._alpha = 0.0;
local_38._unk = 0xf;
anm2Path = (uint8_t [4])(GHIDRA_UINT(anm2Path) & 0xffffff00);
pvVar9 = Manager::LoadImage(tmpHandle,GHIDRA_CAST<uint8_t *>("gfx/ui/minimap_questionmark.png"));
local_14 = 6;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar2)) + 0x614))))))->KAGE::SmartPointer::operator_assign(pvVar9);
local_14 = 7;
if (tmpRefCount != GHIDRA_CAST<int *>(0x0)) {
cVar4 = (**(code **)(*tmpRefCount + 0xc))();
if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpHandle);
}
}
local_14 = 0xffffffff;
iconsPath._size = 0;
iconsPath._capacity = 0xf;
iconsPath._buf[0] = '\0';
iconsPath._buf[1] = '\0';
iconsPath._buf[2] = '\0';
iconsPath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(iconsPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
iconsPath._size = 0x19;
iconsPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(iconsPath._buf))) + 0x0))),"gfx/ui/minimap_icons.anm2",0x1a);
local_14 = 8;
(GHIDRA_CAST<ANM2 *>((&pMVar2->_iconsSprite)))->ANM2::Load(&iconsPath,1);
if (0xf < iconsPath._capacity) {
uVar11 = iconsPath._capacity + 1;
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(iconsPath._buf))) + 0x0)));
if (0xfff < uVar11) {
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(iconsPath._buf)) + 0x0))) + -4));
uVar11 = iconsPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(iconsPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar11);
}
pMVar2->_state = 0;
pMVar2->_holdTime = 0;
pMVar2->_unkBool = 0;
pMVar2->_unkFloat = 1.0;
pMVar2->_shakeDuration = 0;
(pMVar2->_shakeOffset).x = g_vectorZero.x;
(pMVar2->_shakeOffset).y = g_vectorZero.y;
ExceptionList = local_1c;
return;
}
// 0098db50
void Minimap::Refresh()
{
Game *game;
refresh_room_icons(GHIDRA_CAST<Minimap *>(this->_config));
refresh_room_icons(GHIDRA_CAST<Minimap *>((this->_config[1]._mapSprite._filename._buf + 4)));
game = g_game;
if ((g_game->_hud)._hudRefreshType != 2) {
(g_game->_hud)._hudRefreshType = 1;
(game->_hud)._hudRefreshCountdown = 2;
}
return;
}
// 0098e170
void Minimap::render_icons(float *param_2)
{
uint32_t uVar1;
Minimap *pMVar2;
uint8_t isAnimSet;
Entity_Player *itemOwner;
uint32_t forcedCurses;
uint32_t preventedCurses;
uint32_t uVar3;
ColorMod *iconColor;
AnimationState *lastAnimState;
uint32_t iconCount;
ANM2 *iconsSprite;
float in_XMM2_Da;
uint32_t local_70;
uint32_t uStack_6c;
uint32_t uStack_68;
uint32_t local_50;
uint32_t uStack_4c;
uint32_t local_48;
AnimationState *overlayAnimState;
uint32_t iconIndex;
float iconSpacing;
Minimap *minimap;
Vector iconPos;
uint32_t iconFrames [8];
uint32_t local_c;
uint8_t auStack_8 [4];
void *animData;
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
iconColor = &(this->_itemIconsSprite)._color;
iconPos.x = *param_2;
iconPos.y = param_2[1];
local_70 = 0x3f800000;
uStack_6c = 0x3f800000;
uStack_68 = 0x3f800000;
local_50 = 0;
uStack_4c = 0;
local_48 = 0;
if (iconColor != GHIDRA_CAST<ColorMod *>(&local_70)) {
(this->_itemIconsSprite)._color._colorize[0] = 0.0;
(this->_itemIconsSprite)._color._colorize[1] = 0.0;
(this->_itemIconsSprite)._color._colorize[2] = 0.0;
(this->_itemIconsSprite)._color._colorize[3] = 0.0;
iconColor->_tint[0] = 1.0;
(this->_itemIconsSprite)._color._tint[1] = 1.0;
(this->_itemIconsSprite)._color._tint[2] = 1.0;
(this->_itemIconsSprite)._color._tint[3] = in_XMM2_Da;
(this->_itemIconsSprite)._color._offset[0] = 0.0;
(this->_itemIconsSprite)._color._offset[1] = 0.0;
(this->_itemIconsSprite)._color._offset[2] = 0.0;
}
iconSpacing = -16.0;
minimap = this;
itemOwner = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0x14d,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
if (itemOwner == GHIDRA_CAST<Entity_Player *>(0x0)) {
itemOwner = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0x15,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
if (itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
iconFrames[0] = 0;
}
iconCount = GHIDRA_UINT((itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)));
itemOwner = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0xf6,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
if (itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
iconFrames[iconCount] = 1;
iconCount = iconCount + 1;
}
itemOwner = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0x36,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
if (itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
iconFrames[iconCount] = 2;
iconCount = iconCount + 1;
}
}
else {
iconFrames[0] = 5;
iconCount = 1;
}
itemOwner = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0x178,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
if ((itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) && (iconCount < 7)) {
iconFrames[iconCount] = 4;
iconCount = iconCount + 1;
}
uVar3 = g_game->_debugCurses;
uVar1 = g_game->_curses;
forcedCurses = Seeds::GetForcedCurses();
preventedCurses = Seeds::GetPreventedCurses();
pMVar2 = minimap;
uVar3 = ~preventedCurses & (forcedCurses | uVar3 | uVar1);
if (((uVar3 & 1) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xffffffff;
iconCount = iconCount + 1;
}
if (((uVar3 & 2) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffffe;
iconCount = iconCount + 1;
}
if (((uVar3 & 4) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffffd;
iconCount = iconCount + 1;
}
if (((uVar3 & 8) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffffc;
iconCount = iconCount + 1;
}
if (((uVar3 & 0x10) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffffb;
iconCount = iconCount + 1;
}
if (((uVar3 & 0x20) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffffa;
iconCount = iconCount + 1;
}
if (((uVar3 & 0x40) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffff9;
iconCount = iconCount + 1;
}
if (((char)uVar3 < '\0') && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffff8;
iconCount = iconCount + 1;
}
if (((uVar3 & 0x100) != 0) && (iconCount < 7)) {
iconFrames[iconCount] = 0xfffffff7;
iconCount = iconCount + 1;
}
if (iconCount < 4) {
if (iconCount == 0) {
return;
}
}
else {
iconSpacing = (float)((double)GHIDRA_INT((iconCount - 3)) +
__uint_to_double_fixup[-(GHIDRA_INT((iconCount - 3)) >> 0x1f)]) - 16.0;
}
iconsSprite = &minimap->_itemIconsSprite;
iconIndex = 0;
do {
uVar3 = iconFrames[iconIndex];
if (GHIDRA_INT(uVar3) < 0) {
isAnimSet = (GHIDRA_CAST<ANM2 *>((iconsSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("curses"),1);
if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) {
(GHIDRA_CAST<AnimationState *>((&(pMVar2->_itemIconsSprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(~uVar3));
animData = (pMVar2->_itemIconsSprite)._animState._animData;
LAB_0098e430:
if (animData != (void *)0x0) {
(pMVar2->_itemIconsSprite)._animState._isPlaying = 0;
}
}
}
else {
isAnimSet = (GHIDRA_CAST<ANM2 *>((iconsSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("icons"),1);
if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) {
(GHIDRA_CAST<AnimationState *>((&(pMVar2->_itemIconsSprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar3));
animData = (pMVar2->_itemIconsSprite)._animState._animData;
goto LAB_0098e430;
}
}
if ((minimap->_itemIconsSprite)._loaded != 0) {
overlayAnimState = &(minimap->_itemIconsSprite)._overlayAnimState;
lastAnimState = &(minimap->_itemIconsSprite)._animState;
if ((minimap->_itemIconsSprite)._overlayRenderFirst == 0) {
AnimationState::Render(lastAnimState,&iconPos,&g_vectorZero,&g_vectorZero);
lastAnimState = overlayAnimState;
}
else {
AnimationState::Render(overlayAnimState,&iconPos,&g_vectorZero,&g_vectorZero);
}
AnimationState::Render(lastAnimState,&iconPos,&g_vectorZero,&g_vectorZero);
}
iconPos.x = iconSpacing + iconPos.x;
iconIndex = iconIndex + 1;
iconPos.y = iconPos.y + 0.0;
if (iconCount <= iconIndex) {
return;
}
} while( true );
}
// 0098e4d0
void Minimap::Render()
{
int *piVar1;
int iVar2;
uint8_t isMirrorWorld;
uint32_t forcedCurses;
uint32_t curseMask;
ColorMod *color;
int iVar3;
KColor *color_00;
Game *game;
float textureWidth;
float fVar4;
float fVar5;
float fVar6;
double dVar7;
Minimap *local_150;
float drawPosY;
float local_148;
float local_144;
float clipTop;
float local_13c;
float halfWidth;
float screenShakeX;
float screenShakeY;
float hudAlpha;
Minimap *local_128;
float hudOffsetY;
float local_120;
float local_11c;
float local_118;
KColor local_114;
KColor local_100;
float fStack_ec;
Minimap *pMStack_e8;
float fStack_e4;
float local_e0;
ColorMod local_d0;
uint32_t local_94;
uint32_t local_90;
uint32_t local_8c;
float local_88;
uint32_t local_84;
uint8_t quad [124];
uint32_t curses;
float mirroredOffsetX;
code *renderFn;
game = g_game;
if ((g_game->_hud)._isVisible != 0) {
local_144 = 1.4013e-44;
local_150 = this;
msvc::set<int>::find_node(&local_114,&local_144);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_114._blue) + 0xd)) != '\0') ||
(10 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_114._blue) + 0x10)))) ||
((void *)local_114._blue == (game->_seedEffects)._seedEffects)) {
screenShakeX = (game->_screenShakeOffset).x;
fVar4 = 1.0 - (g_manager->_optionsConfig)._hudOffset;
screenShakeY = (game->_screenShakeOffset).y;
curseMask = game->_debugCurses;
fVar5 = fVar4 * -14.0;
curses = g_game->_curses;
fVar4 = fVar4 * 24.0;
local_13c = fVar4;
hudOffsetY = fVar5;
forcedCurses = Seeds::GetForcedCurses();
local_144 = (float)((forcedCurses | curseMask | curses) >> 2);
curseMask = Seeds::GetPreventedCurses();
game = g_game;
local_144 = (float)(CONCAT31((uint3)(~curseMask >> 10),
(uint8_t)(~curseMask >> 2) & (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_144)) + 0x0)))) & 0xffffff01);
hudAlpha = (GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::get_hud_alpha();
local_118 = hudAlpha * this->_config[0]._alpha;
piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x10));
if (((piVar1 == GHIDRA_CAST<int *>(0x0)) || (piVar1[2] != 0x10)) || (*piVar1 != 0x23)) {
if (0.0 < local_118) {
local_d0._tint[0] = 1.0;
local_d0._colorize[0] = 0.0;
local_d0._colorize[1] = 0.0;
local_d0._colorize[2] = 0.0;
local_d0._colorize[3] = 0.0;
local_d0._tint[1] = 1.0;
local_d0._tint[2] = 1.0;
local_d0._offset[0] = 0.0;
local_d0._offset[1] = 0.0;
local_d0._offset[2] = 0.0;
local_84 = 0;
local_114._red = (g_screenWidth - 80.0) + (this->_shakeOffset).x + fVar4;
local_94 = 0x3f800000;
local_90 = 0x3f800000;
local_8c = 0x3f800000;
local_114._green = (this->_shakeOffset).y + 16.0 + fVar5;
local_d0._tint[3] = local_118;
local_88 = local_118;
(GHIDRA_CAST<ANM2 *>((&this->_config[0]._mapSprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>("Frame"),0);
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(this->_config))))->Sprite::SetColor(&local_d0);
(GHIDRA_CAST<ANM2 *>((&this->_config[0]._mapSprite)))->ANM2::Render(GHIDRA_CAST<Vector *>(&local_114),&g_vectorZero,&g_vectorZero);
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_144)) + 0x0))) == '\0') {
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(&local_d0))))->Color::Color();
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(this->_config))))->Sprite::SetColor(color);
dVar7 = floor((double)*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[0])) + 0x140)))));
local_128 = GHIDRA_CAST<Minimap *>((float)dVar7);
fVar5 = this->_config[0]._borderScale;
halfWidth = ((float)(this->_config[0]._i1 + -1) *
(fVar5 + this->_config[0]._borderPadding.x) + fVar5) * 0.5;
dVar7 = floor((double)halfWidth);
local_150 = GHIDRA_CAST<Minimap *>(((float)local_128 - (float)dVar7));
dVar7 = floor((double)*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[0])) + 0x144)))));
local_120 = (float)dVar7;
fVar5 = this->_config[0]._borderScale;
local_148 = ((float)(this->_config[0]._i2 + -1) *
(fVar5 + this->_config[0]._borderPadding.y) + fVar5) * 0.5;
dVar7 = floor((double)local_148);
clipTop = local_120 - (float)dVar7;
dVar7 = ceil((double)halfWidth);
halfWidth = (float)dVar7;
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[0])) + 0x114))));
local_128 = GHIDRA_CAST<Minimap *>((halfWidth + (float)local_128));
dVar7 = ceil((double)local_148);
local_148 = (float)dVar7;
iVar2 = *GHIDRA_CAST<int *>((iVar3 + 0x14));
iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0x10));
fVar5 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]);
fStack_ec = local_148 + local_120;
if (fVar5 <= local_148 + local_120) {
fStack_ec = fVar5;
}
local_100._green = clipTop;
if (clipTop <= 0.0) {
local_100._green = 0.0;
}
local_e0 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_e0)) + 0x1))),1);
textureWidth = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]);
local_100._blue = (float)local_128;
if (textureWidth <= (float)local_128) {
local_100._blue = textureWidth;
}
local_100._red = (float)local_150;
if ((float)local_150 <= 0.0) {
local_100._red = 0.0;
}
local_100._alpha = local_100._green;
local_100._unk = GHIDRA_INT(local_100._red);
pMStack_e8 = GHIDRA_CAST<Minimap *>(local_100._blue);
fStack_e4 = fStack_ec;
isMirrorWorld = (GHIDRA_CAST<Room *>((g_game->_room)))->Room::IsMirrorWorld();
fVar5 = local_100._red;
piVar1 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[0])) + 0x114))));
if (isMirrorWorld == 0) {
fVar5 = this->_config[0]._posOffsetX;
iVar3 = *piVar1;
fVar4 = fVar5 * g_vectorOne.x + local_114._red + (local_100._red - (float)local_150);
drawPosY = fVar5 * g_vectorOne.y + local_114._green + (local_100._green - clipTop);
}
else {
fVar4 = (float)pMStack_e8 - local_100._red;
local_d0._colorize[0] = (float)pMStack_e8;
fVar6 = (float)local_128 - local_100._red;
local_d0._tint[0] = (float)pMStack_e8;
local_d0._colorize[3] = fStack_e4;
local_d0._colorize[1] = fStack_e4;
local_d0._tint[3] = local_100._green;
local_d0._tint[1] = local_100._green;
mirroredOffsetX = this->_config[0]._posOffsetX;
local_d0._tint[2] = local_100._red;
local_100._red = (float)pMStack_e8;
local_100._blue = fVar5;
local_100._alpha = local_100._green;
local_d0._colorize[2] = fVar5;
local_100._unk = GHIDRA_INT(pMStack_e8);
fStack_ec = fStack_e4;
pMStack_e8 = GHIDRA_CAST<Minimap *>(fVar5);
local_d0._offset[0] = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_d0._offset[0])) + 0x1))),1);
local_e0 = local_d0._offset[0];
iVar3 = *piVar1;
fVar4 = mirroredOffsetX * g_vectorOne.x + local_114._red + (fVar6 - fVar4);
drawPosY = mirroredOffsetX * g_vectorOne.y + local_114._green +
(local_100._green - clipTop);
}
drawPosY = drawPosY + screenShakeY;
local_150 = GHIDRA_CAST<Minimap *>((fVar4 + screenShakeX));
(**(code **)(iVar3 + 0x18))(&local_100,&local_150);
}
else {
renderFn = *(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x614)))) + 0x20);
(GHIDRA_CAST<KColor *>((&local_100)))->KColor::SetFromARGB(0xffffffff);
local_120 = local_114._red + 8.0 + screenShakeX;
local_11c = local_114._green + 8.0 + screenShakeY;
(*renderFn)(&local_120);
this = local_150;
}
local_150 = GHIDRA_CAST<Minimap *>(((local_114._red + 53.0) - 8.0));
drawPosY = local_114._green + 47.0 + 8.0;
render_icons(this);
game = g_game;
fVar5 = hudOffsetY;
fVar4 = local_13c;
}
hudAlpha = hudAlpha * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2d0))));
if (0.0 < hudAlpha) {
hudOffsetY = fVar5 + 0.0;
fVar5 = this->_config[1]._size2.x;
local_13c = fVar4 + g_screenWidth;
local_100._unk = 0;
local_100._red = 1.0;
local_118 = this->_config[1]._size2.y;
local_148 = this->_config[1]._alpha - fVar5;
local_100._green = 1.0;
local_100._blue = 1.0;
local_100._alpha = hudAlpha;
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_144)) + 0x0))) == '\0') {
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x118))));
iVar2 = *GHIDRA_CAST<int *>((iVar3 + 0x10));
iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0x14));
fVar4 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]);
local_120 = (fVar4 - fVar4 * this->_unkFloat) * 0.5;
fVar4 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]);
local_144 = hudOffsetY - fVar5;
local_150 = GHIDRA_CAST<Minimap *>(((fVar4 - fVar4 * this->_unkFloat) * 0.5));
isMirrorWorld = (GHIDRA_CAST<Room *>((game->_room)))->Room::IsMirrorWorld();
fVar5 = local_144 + 14.0 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) + (this->_shakeOffset).y +
screenShakeY;
if (isMirrorWorld == 0) {
fVar4 = ((local_13c - local_118) - 24.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) +
(this->_shakeOffset).x + screenShakeX;
(GHIDRA_CAST<KColor *>((&local_114)))->KColor::SetFromARGB(0xffffffff);
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x118))));
iVar2 = *GHIDRA_CAST<int *>((iVar3 + 0x14));
iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0x10));
render_quad_set_uniform_color
(quad,local_120 + fVar4,fVar5 + (float)local_150,
((float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) + fVar4)
- local_120,
((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) + fVar5)
- (float)local_150,&local_114);
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x118)))) + 0x1c))(quad,&local_100);
}
else {
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x118))));
local_d0._colorize[0] = 1.0;
local_d0._tint[0] = 1.0;
local_d0._tint[3] = 0.0;
local_d0._tint[1] = 0.0;
local_d0._colorize[2] = 0.0;
local_d0._tint[2] = 0.0;
local_d0._colorize[3] = 1.0;
local_d0._colorize[1] = 1.0;
local_d0._offset[0] = (float)(GHIDRA_UINT(local_d0._offset[0]) & 0xffffff00);
fVar4 = ((local_13c -
((float)((double)*GHIDRA_CAST<int *>((iVar3 + 0x10)) +
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((iVar3 + 0x10)) >> 0x1f)]) -
this->_config[1]._size1.y)) - 24.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) +
(this->_shakeOffset).x + screenShakeX;
(GHIDRA_CAST<KColor *>((&local_114)))->KColor::SetFromARGB(0xffffffff);
render_quad_set_uniform_color
(quad,local_120 + fVar4,fVar5 + (float)local_150,
((float)((double)*GHIDRA_CAST<int *>((iVar3 + 0x10)) +
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((iVar3 + 0x10)) >> 0x1f)]) + fVar4)
- local_120,
((float)((double)*GHIDRA_CAST<int *>((iVar3 + 0x14)) +
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((iVar3 + 0x14)) >> 0x1f)]) + fVar5)
- (float)local_150,color_00);
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this->_config[1])) + 0x118)))) + 0x14))
(&local_d0,quad,&local_100);
}
}
local_114._red = local_13c - 32.0;
local_114._green = local_148 + 16.0 + 8.0 + hudOffsetY;
render_icons(this);
}
fVar5 = hudAlpha;
if (((g_manager->_optionsConfig)._historyHudMode == 1) && (fVar5 = 0.5, 0.5 <= hudAlpha)) {
fVar5 = hudAlpha;
}
if (0.0 < fVar5) {
render_score_time();
}
}
else if ((game->_dailyChallenge)._id != 0) {
render_score_time();
return;
}
}
}
return;
}
// 0098ef30
void Minimap::render_score_time()
{
int iVar1;
uint8_t *labelText;
int iVar2;
StringTable **maxWidthPtr;
uint32_t forcedCurses;
uint32_t preventedCurses;
Entity_Player *player;
float *heartsWidthPtr;
uint32_t uVar3;
void *settings;
void *settings_00;
int extraout_EDX;
Font *fontCopy;
float hudAlpha;
uint32_t in_XMM1_Da;
float spaceRight;
float fVar4;
StringTable *pSVar5;
StringTable *textRightX;
float minimapWidth;
float minimapMarginX;
FontSettings local_e4 [9];
float maxHeartsWidth;
uint32_t local_c4;
float hudInset;
KColor local_bc;
uint32_t local_a8;
uint32_t local_a4;
uint32_t local_a0;
uint32_t uStack_9c;
uint32_t uStack_98;
uint32_t uStack_94;
uint32_t local_90;
float local_8c;
float local_88;
float shakeX;
Font *font;
float local_7c;
StringTable *local_78;
StringTable *local_74;
float textY;
StringTable *local_6c;
uint8_t valueText [68];
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
uint32_t curses;
Game *game;
game = g_game;
puStack_20 = valueText + 100;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0d501;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((valueText + 0x58));
if ((g_game->_hud)._isVisible == 0) {
return;
}
local_88 = 1.4013e-44;
ExceptionList = &local_1c;
local_c4 = in_XMM1_Da;
msvc::set<int>::find_node(&local_bc._blue,&local_88);
if (((*GHIDRA_CAST<char *>((local_bc._unk + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((local_bc._unk + 0x10)) < 0xb)) &&
((void *)local_bc._unk != (game->_seedEffects)._seedEffects)) {
ExceptionList = local_1c;
return;
}
local_74 = &g_manager->_stringTable;
font = &g_manager->_font2_TeamMeatEx12;
if (*GHIDRA_CAST<int *>(&g_manager->_stringTable) == 0) {
font = &g_manager->_font1_TeamMeatEx10;
}
fontCopy = font;
hudInset = 1.0 - (g_manager->_optionsConfig)._hudOffset;
textY = hudInset * -24.0;
shakeX = (game->_screenShakeOffset).x;
local_88 = (game->_screenShakeOffset).y;
iVar1 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(GHIDRA_CAST<uint8_t *>(" 00:00:00"),-1);
labelText = string_table_translate(local_74,GHIDRA_CAST<uint8_t *>("#MINIMAP_TIME_LABEL"));
iVar2 = (GHIDRA_CAST<Font *>((fontCopy)))->Font::get_string_width_n(labelText,-1);
pSVar5 = &g_manager->_stringTable;
local_78 = (StringTable *)
((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) +
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]));
local_6c = local_78;
iVar1 = (GHIDRA_CAST<Font *>((fontCopy)))->Font::get_string_width_n(GHIDRA_CAST<uint8_t *>(" 000000"),-1);
labelText = string_table_translate(pSVar5,GHIDRA_CAST<uint8_t *>("#MINIMAP_TIME_LABEL"));
iVar2 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(labelText,-1);
local_74 = (StringTable *)
((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) +
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]));
maxWidthPtr = &local_74;
if ((float)local_74 <= (float)local_6c) {
maxWidthPtr = &local_78;
}
uVar3 = g_game->_debugCurses;
pSVar5 = GHIDRA_CAST<StringTable *>(((g_screenWidth - (float)*maxWidthPtr) * 0.5));
curses = g_game->_curses;
textRightX = GHIDRA_CAST<StringTable *>(((float)*maxWidthPtr + (float)pSVar5));
local_78 = textRightX;
local_6c = pSVar5;
forcedCurses = Seeds::GetForcedCurses();
preventedCurses = Seeds::GetPreventedCurses();
fVar4 = local_8c;
game = g_game;
if ((~preventedCurses & (forcedCurses | uVar3 | curses) & 4) == 0) {
spaceRight = g_screenWidth - (float)textRightX;
minimapWidth = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_8c) + 0x2c8)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_8c) + 0x2c0));
minimapMarginX = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_8c) + 0x29c));
if (spaceRight < minimapMarginX + minimapWidth) {
hudAlpha = (GHIDRA_CAST<RoomTransition *>((&g_game->_roomTransition)))->RoomTransition::get_hud_alpha();
local_74 = GHIDRA_CAST<StringTable *>(0x0);
if (0.0 < hudAlpha * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar4) + 0x2d0))) {
local_7c = 1.0 - hudInset;
fVar4 = ((spaceRight - minimapWidth) - minimapMarginX) - local_7c * 24.0;
local_78 = GHIDRA_CAST<StringTable *>(((float)textRightX + fVar4));
local_6c = GHIDRA_CAST<StringTable *>(((float)pSVar5 + fVar4));
player = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(0);
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetExtraLives();
if (0 < iVar1) {
local_74 = GHIDRA_CAST<StringTable *>(0x41800000);
}
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
iVar1 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetEffectiveMaxHearts();
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
maxHeartsWidth = 72.0;
local_8c = (float)(iVar1 + player->_soulHearts) * 6.0;
heartsWidthPtr = &local_8c;
if (72.0 <= local_8c) {
heartsWidthPtr = &maxHeartsWidth;
}
pSVar5 = local_6c;
if (((float)local_6c <= ((*heartsWidthPtr + 60.0) - hudInset * 20.0) + (float)local_74) &&
(uVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses(), pSVar5 = local_6c, (uVar3 & 8) == 0)) {
textY = (24.0 - local_7c * 12.0) + textY;
}
}
}
}
local_bc._green = 1.0;
local_bc._blue = 1.0;
if (g_game->_challenge == 0x16) {
local_a0 = 0x3f800000;
iVar2 = 0x7080 - g_game->_timeCounter;
uStack_9c = 0x3f000000;
uStack_98 = 0x3f000000;
uStack_94 = local_c4;
iVar1 = 0;
if (0 < iVar2) {
iVar1 = iVar2;
}
local_bc._green = 0.5;
local_bc._blue = 0.5;
}
else {
iVar1 = g_game->_timeCounter;
}
local_bc._unk = 0;
local_bc._red = 1.0;
local_7c = (float)((iVar1 % 0x1a5e0) / 0x708);
if (iVar1 < 1) {
uVar3 = g_game->_frameCount & 0x80000007;
if (GHIDRA_INT(uVar3) < 0) {
uVar3 = (uVar3 - 1 | 0xfffffff8) + 1;
}
if (3 < GHIDRA_INT(uVar3)) {
local_6c = GHIDRA_CAST<StringTable *>(((float)pSVar5 + shakeX));
fontCopy = font;
goto LAB_0098f558;
}
}
sprintf_s(valueText,0x40,GHIDRA_CAST<uint8_t *>("%02d:%02d:%02d"));
fontCopy = font;
iVar1 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(valueText,-1);
local_a8 = 0;
local_a4 = 0xffff;
local_a0 = 0;
uStack_9c = 0x3f800000;
uStack_98 = 0xffffffff;
uStack_94 = 0;
local_90 = 0;
local_14 = 0;
labelText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#MINIMAP_TIME_LABEL"));
local_6c = GHIDRA_CAST<StringTable *>((shakeX + (float)local_6c));
local_7c = textY + 30.0 + local_88;
(GHIDRA_CAST<Font *>((fontCopy)))->Font::DrawString(labelText,&local_bc,&local_a8,(float)local_6c,local_7c);
local_a8 = 0;
local_a4 = 0xffff;
local_a0 = 0;
uStack_9c = 0x3f800000;
uStack_98 = 0xffffffff;
uStack_94 = 0;
local_90 = 0;
local_14 = 1;
(GHIDRA_CAST<Font *>((fontCopy)))->Font::DrawString(valueText,&local_bc,&local_a8,((float)local_78 - (float)iVar1) + shakeX,
local_7c);
local_14 = 0xffffffff;
LAB_0098f558:
if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) &&
((g_game->_dailyChallenge)._id != 0)) {
local_bc._unk = 0;
local_bc._red = 1.0;
local_bc._green = 1.0;
local_bc._blue = 1.0;
(GHIDRA_CAST<FontSettings *>((GHIDRA_CAST<FontSettings *>(&local_a8))))->FontSettings::constructor();
local_14 = 2;
labelText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#MINIMAP_SCORE_LABEL"));
textY = textY + 46.0 + local_88;
(GHIDRA_CAST<Font *>((fontCopy)))->Font::DrawString(labelText,&local_bc,settings,(float)local_6c,textY);
local_14 = 0xffffffff;
uStack_94 = 0;
local_90 = 0;
(GHIDRA_CAST<ScoreSheet *>((GHIDRA_CAST<ScoreSheet *>(&g_game->_scoreSheet))))->ScoreSheet::Calculate();
sprintf_s(valueText,0x40,s__d);
(GHIDRA_CAST<Font *>((fontCopy)))->Font::get_string_width_n(valueText,-1);
(GHIDRA_CAST<FontSettings *>((local_e4)))->FontSettings::constructor();
local_14 = 3;
(GHIDRA_CAST<Font *>((fontCopy)))->Font::DrawString(valueText,&local_bc,settings_00,
((float)local_78 - (float)extraout_EDX) + shakeX,textY);
}
ExceptionList = local_1c;
return;
}