Six agents took over ANM2/AnimationState/LayerState, ItemConfig, EntityConfig, StringTable/Font/FormattedText/RichText, OptionsConfig/ChallengeParams and ModManager/ModEntry functions (FormattedText::parse checked against a transliteration of its assembly on 200,000 random inputs). 174 field rows and 32 names from the round are merged into db/. source_tree.py: a struct or class src/*.h defines is no longer emitted in classes.h (class takeover) and gets no stubs; data labels get stub definitions. build/isaac links (64-bit ELF) and stops at the first function not reconstructed: IsaacMain. Boot path 64/615 functions curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29632 lines
1.2 MiB
Plaintext
29632 lines
1.2 MiB
Plaintext
#include "classes.h"
|
|
|
|
// 0040c2e0
|
|
int Room::GetGridHeight()
|
|
{
|
|
return this->_gridHeight;
|
|
}
|
|
|
|
// 00417930
|
|
Room * Room::init_render_buffers()
|
|
{
|
|
char isLastRef;
|
|
void *pvVar1;
|
|
uint32_t firstSubList;
|
|
int iVar2;
|
|
float fVar3;
|
|
uint8_t shadowImage [4];
|
|
void **local_18;
|
|
Room *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
void **mapHeadSlot;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af151b;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
*GHIDRA_CAST<uint8_t *>(&(this->_bottomRightPos).y) = 0;
|
|
this->_gridEntities[1] = (void *)0x4000;
|
|
this->_gridEntities[2] = (void *)0x0;
|
|
local_14 = this;
|
|
pvVar1 = operator_new_tracked(0x10000);
|
|
this->_gridEntities[0] = pvVar1;
|
|
local_8 = 0;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 3)) = 0;
|
|
this->_gridEntities[5] = (void *)0x100;
|
|
this->_gridEntities[6] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x400);
|
|
this->_gridEntities[4] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 7)) = 0;
|
|
this->_gridEntities[9] = (void *)0x800;
|
|
this->_gridEntities[10] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x2000);
|
|
this->_gridEntities[8] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0xb)) = 0;
|
|
this->_gridEntities[0xd] = (void *)0x4000;
|
|
this->_gridEntities[0xe] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x10000);
|
|
this->_gridEntities[0xc] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0xf)) = 0;
|
|
this->_gridEntities[0x11] = (void *)0x4000;
|
|
this->_gridEntities[0x12] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x10000);
|
|
this->_gridEntities[0x10] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0x13)) = 0;
|
|
this->_gridEntities[0x15] = (void *)0x4000;
|
|
this->_gridEntities[0x16] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x10000);
|
|
this->_gridEntities[0x14] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0x17)) = 0;
|
|
this->_gridEntities[0x19] = (void *)0x8000;
|
|
this->_gridEntities[0x1a] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x20000);
|
|
this->_gridEntities[0x18] = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0x1b)) = 0;
|
|
this->_gridEntities[0x1d] = (void *)0x100;
|
|
this->_gridEntities[0x1e] = (void *)0x0;
|
|
pvVar1 = operator_new_tracked(0x400);
|
|
this->_gridEntities[0x1c] = pvVar1;
|
|
this->_gridEntities[0x28] = (void *)0x0;
|
|
this->_gridEntities[0x29] = (void *)0x0;
|
|
this->_gridEntities[0x2a] = (void *)0x0;
|
|
this->_gridEntities[0x2b] = (void *)0x0;
|
|
this->_gridEntities[0x2d] = (void *)0x0;
|
|
this->_gridEntities[0x2e] = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
|
|
mapHeadSlot = this->_gridEntities + 0x2f;
|
|
*mapHeadSlot = (void *)0x0;
|
|
this->_gridEntities[0x30] = (void *)0x0;
|
|
local_18 = mapHeadSlot;
|
|
pvVar1 = operator_new(0x2c);
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pvVar1) + 0xc)) = 0x101;
|
|
*mapHeadSlot = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
|
|
local_18 = this->_gridEntities + 0x35;
|
|
this->_gridEntities[0x34] = (void *)0x1;
|
|
this->_gridEntities[0x31] = (void *)0x0;
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0x32)) = 0;
|
|
this->_gridEntities[0x33] = (void *)0xfedcba76;
|
|
_eh_vector_constructor_iterator_
|
|
(local_18,0x18,0x20,FUN_00417710,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_004177b0));
|
|
this->_gridEntities[0xf5] = (void *)0x0;
|
|
this->_gridEntities[0xf6] = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xc;
|
|
if (local_18 == (void *)0x0) {
|
|
firstSubList = 0;
|
|
}
|
|
else {
|
|
firstSubList = FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
*GHIDRA_CAST<uint32_t *>(this) = firstSubList;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xd;
|
|
if (local_18 == (void *)0x0) {
|
|
firstSubList = 0;
|
|
}
|
|
else {
|
|
firstSubList = FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = firstSubList;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xe;
|
|
if (local_18 == (void *)0x0) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
this->_roomType = iVar2;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xf;
|
|
if (local_18 == (void *)0x0) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
this->_gridWidth = iVar2;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x10;
|
|
if (local_18 == (void *)0x0) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
this->_gridHeight = iVar2;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x11;
|
|
if (local_18 == (void *)0x0) {
|
|
fVar3 = 0.0;
|
|
}
|
|
else {
|
|
fVar3 = (float)FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
(this->_topLeftPos).x = fVar3;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x12;
|
|
if (local_18 == (void *)0x0) {
|
|
fVar3 = 0.0;
|
|
}
|
|
else {
|
|
fVar3 = (float)FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
(this->_topLeftPos).y = fVar3;
|
|
local_18 = operator_new(0x24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x13;
|
|
if (local_18 == (void **)0x0) {
|
|
fVar3 = 0.0;
|
|
}
|
|
else {
|
|
fVar3 = (float)FUN_0041b9f0(this,0x44340000);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
(this->_bottomRightPos).x = fVar3;
|
|
pvVar1 = Manager::LoadImage(shadowImage,GHIDRA_CAST<uint8_t *>("gfx/shadow.png"));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x14;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_gridEntities + 0x2d)))->KAGE::SmartPointer::operator_assign(pvVar1);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x15;
|
|
if (local_18 != (void **)0x0) {
|
|
isLastRef = (**(code **)(GHIDRA_INT(*local_18) + 0xc))();
|
|
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(shadowImage);
|
|
}
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0xb);
|
|
this->_gridEntities[0x2c] = (void *)0x0;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(this))))->EntityList::Reset();
|
|
ExceptionList = local_10;
|
|
return this;
|
|
}
|
|
|
|
// 00421800
|
|
Vector * Room::GetTopLeftPos()
|
|
{
|
|
return &this->_topLeftPos;
|
|
}
|
|
|
|
// 00428a50
|
|
EntityList * Room::GetEntities()
|
|
{
|
|
return GHIDRA_CAST<EntityList *>(&(this->_entityList)._updateEL);
|
|
}
|
|
|
|
// 0042a270
|
|
int Room::GetRoomShape()
|
|
{
|
|
int roomData;
|
|
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) ||
|
|
(roomData = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), roomData == 0)) {
|
|
return 1;
|
|
}
|
|
return *GHIDRA_CAST<int *>((roomData + 0x48));
|
|
}
|
|
|
|
// 0042a290
|
|
uint8_t Room::SetGridPath(int gridIndex, int value)
|
|
{
|
|
if (GHIDRA_UINT(gridIndex) < 0x1c0) {
|
|
this->_gridPaths[gridIndex] = value;
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 0042cc70
|
|
Vector * Room::GetBottomRightPos()
|
|
{
|
|
return &this->_bottomRightPos;
|
|
}
|
|
|
|
// 0042d030
|
|
Vector * Room::GetRenderScrollOffset()
|
|
{
|
|
return &this->_renderScrollOffset;
|
|
}
|
|
|
|
// 00436020
|
|
GridEntity_Door * Room::GetDoor(int slot)
|
|
{
|
|
if (slot + 1U < 9) {
|
|
return this->_doors[slot];
|
|
}
|
|
return GHIDRA_CAST<GridEntity_Door *>(0x0);
|
|
}
|
|
|
|
// 00436050
|
|
uint32_t Room::GetSpawnSeed()
|
|
{
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
return 0;
|
|
}
|
|
return *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x5c));
|
|
}
|
|
|
|
// 00436060
|
|
GridEntity * Room::GetGridEntity(uint32_t idx)
|
|
{
|
|
if (idx < 0x1c0) {
|
|
return this->_gridEntities[idx];
|
|
}
|
|
return GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
|
|
// 00436080
|
|
uint8_t Room::IsClear()
|
|
{
|
|
return *GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 1;
|
|
}
|
|
|
|
// 00436090
|
|
Vector * Room::GetClampedPosition(Vector *outPos, Vector *position, float margin)
|
|
{
|
|
GetClampedPositionImpl(this,outPos,position,margin,margin,margin,margin);
|
|
return outPos;
|
|
}
|
|
|
|
// 004360c0
|
|
int Room::GetTintedRockIdx()
|
|
{
|
|
return this->_tintedRockIdx;
|
|
}
|
|
|
|
// 0043ef20
|
|
int Room::GetBossID()
|
|
{
|
|
return this->_bossId;
|
|
}
|
|
|
|
// 004565c0
|
|
int Room::GetGridPath(int gridIndex)
|
|
{
|
|
if (GHIDRA_UINT(gridIndex) < 0x1c0) {
|
|
return this->_gridPaths[gridIndex];
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00456620
|
|
GridEntity * Room::GetGridEntityFromPos(Vector *pos)
|
|
{
|
|
uint32_t gridIndex;
|
|
int gridY;
|
|
int gridX;
|
|
|
|
gridX = GHIDRA_INT(((pos->x - 40.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) ||
|
|
(gridY = GHIDRA_INT(((pos->y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
((this->_gridHeight <= gridY ||
|
|
(gridIndex = this->_gridWidth * gridY + gridX, 0x1bf < gridIndex)))) {
|
|
return GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
return this->_gridEntities[gridIndex];
|
|
}
|
|
|
|
// 004566a0
|
|
int Room::GetGridSize()
|
|
{
|
|
return this->_gridHeight * this->_gridWidth;
|
|
}
|
|
|
|
// 004566b0
|
|
int Room::GetAliveEnemiesCount()
|
|
{
|
|
int aliveCount;
|
|
int enemyCount;
|
|
|
|
enemyCount = this->_aliveEnemyCount + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x12c4))));
|
|
aliveCount = 0;
|
|
if (0 < enemyCount) {
|
|
aliveCount = enemyCount;
|
|
}
|
|
return aliveCount;
|
|
}
|
|
|
|
// 004566d0
|
|
int Room::GetAliveBossesCount()
|
|
{
|
|
int clampedCount;
|
|
int bossCount;
|
|
|
|
bossCount = this->_aliveBossCount + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x12cc))));
|
|
clampedCount = 0;
|
|
if (0 < bossCount) {
|
|
clampedCount = bossCount;
|
|
}
|
|
return clampedCount;
|
|
}
|
|
|
|
// 004566f0
|
|
void Room::EmitBloodFromWalls(int duration, int count)
|
|
{
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7214)))) = duration;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7218)))) = count;
|
|
return;
|
|
}
|
|
|
|
// 00456710
|
|
bool Room::HasSlowDown()
|
|
{
|
|
return 0 < this->_slowdownDuration;
|
|
}
|
|
|
|
// 00456720
|
|
void Room::SetSlowDown(int duration)
|
|
{
|
|
int *longerDuration;
|
|
|
|
longerDuration = &duration;
|
|
if (duration <= this->_slowdownDuration) {
|
|
longerDuration = &this->_slowdownDuration;
|
|
}
|
|
this->_slowdownDuration = *longerDuration;
|
|
return;
|
|
}
|
|
|
|
// 004aae80
|
|
uint32_t Room::GetDecorationSeed()
|
|
{
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
return 0;
|
|
}
|
|
return *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
}
|
|
|
|
// 004aae90
|
|
void Room::SetClear(uint8_t isClear)
|
|
{
|
|
uint32_t newFlags;
|
|
uint32_t oldFlags;
|
|
|
|
oldFlags = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
newFlags = oldFlags | 1;
|
|
if (isClear == 0) {
|
|
newFlags = oldFlags & 0xfffffffe;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) = newFlags;
|
|
return;
|
|
}
|
|
|
|
// 004aaeb0
|
|
void Room::SetSacrificeDone(uint8_t isDone)
|
|
{
|
|
uint32_t newDescFlags;
|
|
uint32_t descFlags;
|
|
|
|
descFlags = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
newDescFlags = descFlags | 4;
|
|
if (isDone == 0) {
|
|
newDescFlags = descFlags & 0xfffffffb;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) = newDescFlags;
|
|
return;
|
|
}
|
|
|
|
// 004cdd20
|
|
int Room::GetBackdropType()
|
|
{
|
|
return this->_backdropType;
|
|
}
|
|
|
|
// 004cdd80
|
|
uint8_t Room::RaiseGridPathAtPos(Vector *pos, int pathValue)
|
|
{
|
|
int gridY;
|
|
int iVar1;
|
|
uint32_t gridIndex;
|
|
|
|
iVar1 = GHIDRA_INT(((pos->x - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar1 < 0) || (this->_gridWidth <= iVar1)) ||
|
|
(gridY = GHIDRA_INT(((pos->y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
(((this->_gridHeight <= gridY ||
|
|
(gridIndex = this->_gridWidth * gridY + iVar1, 0x1bf < gridIndex)) || (0x3b6 < pathValue))))
|
|
{
|
|
return 0;
|
|
}
|
|
iVar1 = this->_gridPaths[gridIndex] % 1000;
|
|
if (iVar1 < pathValue) {
|
|
this->_gridPaths[gridIndex] = (this->_gridPaths[gridIndex] - iVar1) + pathValue;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 004d7780
|
|
uint8_t Room::HasTriggerPressurePlates()
|
|
{
|
|
return this->_hasTriggerPressurePlates;
|
|
}
|
|
|
|
// 00505c40
|
|
uint8_t Room::HasWaterPits()
|
|
{
|
|
return (uint8_t)(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5) & 1;
|
|
}
|
|
|
|
// 00505c50
|
|
Vector * Room::GetWaterCurrent(Vector *outResult)
|
|
{
|
|
float currentY;
|
|
|
|
currentY = (this->_waterCurrent).y;
|
|
outResult->x = (this->_waterCurrent).x;
|
|
outResult->y = currentY;
|
|
return outResult;
|
|
}
|
|
|
|
// 005784d0
|
|
void Room::StopRain()
|
|
{
|
|
this->_isRainStopped = 1;
|
|
return;
|
|
}
|
|
|
|
// 00589f90
|
|
uint8_t Room::CanSpawnObstacleAtPos(Vector *position, uint8_t isForce)
|
|
{
|
|
uint8_t bVar1;
|
|
int gridY;
|
|
int gridX;
|
|
|
|
gridX = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) ||
|
|
(gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
(this->_gridHeight <= gridY)) {
|
|
bVar1 = CanSpawnObstacleAtPosition(this,-1,isForce);
|
|
return bVar1;
|
|
}
|
|
bVar1 = CanSpawnObstacleAtPosition(this,this->_gridWidth * gridY + gridX,isForce);
|
|
return bVar1;
|
|
}
|
|
|
|
// 00592270
|
|
int Room::get_beast_arena()
|
|
{
|
|
int in_ECX;
|
|
|
|
return in_ECX + 0x776c;
|
|
}
|
|
|
|
// 0059e250
|
|
uint8_t Room::IsDoorSlotAllowed(int slot)
|
|
{
|
|
if (GHIDRA_UINT(slot) < 8) {
|
|
return (*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x38 + (GHIDRA_UINT(slot) >> 5) * 4)) &
|
|
1 << ((uint8_t)slot & 0x1f)) != 0;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 005b16c0
|
|
void Room::InvalidatePickupVision()
|
|
{
|
|
this->_isPickupVisionInvalid = 1;
|
|
return;
|
|
}
|
|
|
|
// 005cd650
|
|
uint8_t Room::IsSacrificeDone()
|
|
{
|
|
return (uint8_t)(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 2) & 1;
|
|
}
|
|
|
|
// 005cd660
|
|
uint8_t Room::is_deaths_list_done()
|
|
{
|
|
int in_ECX;
|
|
|
|
return *GHIDRA_CAST<uint8_t *>((in_ECX + 0x1bbc));
|
|
}
|
|
|
|
// 005cd670
|
|
uint8_t Room::has_exorcist()
|
|
{
|
|
int in_ECX;
|
|
|
|
return *GHIDRA_CAST<uint8_t *>((in_ECX + 0x7768));
|
|
}
|
|
|
|
// 00652ab0
|
|
Vector * Room::ScreenWrapPosition(Vector *outPosition, Vector *position, float margin)
|
|
{
|
|
ScreenWrapPositionImpl(this,outPosition,position,margin,margin,margin,margin);
|
|
return outPosition;
|
|
}
|
|
|
|
// 0065cef0
|
|
uint8_t Room::IsFirstVisit()
|
|
{
|
|
int in_ECX;
|
|
|
|
return *GHIDRA_CAST<uint8_t *>((in_ECX + 1));
|
|
}
|
|
|
|
// 006b83d0
|
|
uint8_t Room::IsInitialized()
|
|
{
|
|
return *GHIDRA_CAST<uint8_t *>(this);
|
|
}
|
|
|
|
// 006b83e0
|
|
Vector * Room::GetRenderSurfaceTopLeft()
|
|
{
|
|
return &this->_renderSurfaceTopLeft;
|
|
}
|
|
|
|
// 006b83f0
|
|
uint8_t Room::IsFirstEnemyDead()
|
|
{
|
|
return this->_isFirstEnemyDead;
|
|
}
|
|
|
|
// 006b8400
|
|
void Room::SetFirstEnemyDead(uint8_t param_2)
|
|
{
|
|
this->_isFirstEnemyDead = param_2;
|
|
return;
|
|
}
|
|
|
|
// 006b8410
|
|
uint8_t Room::has_room_config_flag(uint32_t mask)
|
|
{
|
|
int roomConfig;
|
|
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) ||
|
|
(roomConfig = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), roomConfig == 0)) {
|
|
return 0;
|
|
}
|
|
return (*GHIDRA_CAST<uint32_t *>((roomConfig + 0x4c)) & mask) != 0;
|
|
}
|
|
|
|
// 0070c560
|
|
uint8_t Room::IsAmbushDone()
|
|
{
|
|
return (uint8_t)(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 3) & 1;
|
|
}
|
|
|
|
// 007120c0
|
|
long double Room::GetLavaIntensity()
|
|
{
|
|
return (long double)this->_lavaIntensity;
|
|
}
|
|
|
|
// 007537c0
|
|
void Room::SetRedHeartDamage()
|
|
{
|
|
this->_redHeartDamage = 1;
|
|
return;
|
|
}
|
|
|
|
// 007537d0
|
|
void Room::SetCardAgainstHumanity()
|
|
{
|
|
int in_ECX;
|
|
|
|
*GHIDRA_CAST<uint8_t *>((in_ECX + 0x11f4)) = 1;
|
|
return;
|
|
}
|
|
|
|
// 007537e0
|
|
int Room::GetDeliriumDistance()
|
|
{
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
return 0;
|
|
}
|
|
return *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xb0));
|
|
}
|
|
|
|
// 007e91a0
|
|
uint8_t Room::GetRedHeartDamage()
|
|
{
|
|
return this->_redHeartDamage;
|
|
}
|
|
|
|
// 007e91b0
|
|
void Room::SetFloorColor(float param_2, float param_3, float param_4, float param_5, float param_6, float param_7, float param_8, float param_9, uint64_t param_10, float param_11)
|
|
{
|
|
if (&this->_floorColor != GHIDRA_CAST<ColorMod *>(¶m_2)) {
|
|
(this->_floorColor)._tint[0] = param_2;
|
|
(this->_floorColor)._tint[1] = param_3;
|
|
(this->_floorColor)._tint[2] = param_4;
|
|
(this->_floorColor)._tint[3] = param_5;
|
|
(this->_floorColor)._colorize[0] = param_6;
|
|
(this->_floorColor)._colorize[1] = param_7;
|
|
(this->_floorColor)._colorize[2] = param_8;
|
|
(this->_floorColor)._colorize[3] = param_9;
|
|
*GHIDRA_CAST<uint64_t *>((this->_floorColor)._offset) = param_10;
|
|
(this->_floorColor)._offset[2] = param_11;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007e91f0
|
|
void Room::SetWallColor(ColorMod color)
|
|
{
|
|
if (&this->_wallColor != &color) {
|
|
(this->_wallColor)._tint[0] = color._tint[0];
|
|
(this->_wallColor)._tint[1] = color._tint[1];
|
|
(this->_wallColor)._tint[2] = color._tint[2];
|
|
(this->_wallColor)._tint[3] = color._tint[3];
|
|
(this->_wallColor)._colorize[0] = color._colorize[0];
|
|
(this->_wallColor)._colorize[1] = color._colorize[1];
|
|
(this->_wallColor)._colorize[2] = color._colorize[2];
|
|
(this->_wallColor)._colorize[3] = color._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>((this->_wallColor)._offset) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(color._offset)) + 0x0)));
|
|
(this->_wallColor)._offset[2] = color._offset[2];
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007e9400
|
|
Room * Room::constructor()
|
|
{
|
|
int *dequeProxy;
|
|
void *pvVar1;
|
|
uint32_t *puVar2;
|
|
uint8_t *extraout_EAX;
|
|
int entriesLeft;
|
|
uint32_t *puVar3;
|
|
uint32_t uVar4;
|
|
float fVar5;
|
|
void *redirectedPath [4];
|
|
uint32_t redirectedPathSize;
|
|
uint32_t redirectedPathCapacity;
|
|
std_string backdropsPath;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
void *local_14;
|
|
uint8_t *gridIndexSet;
|
|
std_deque *shopItemDeque;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((redirectedPath + 0x14));
|
|
local_14 = (void *)0xffffffff;
|
|
puStack_18 = &LAB_00b00d42;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((redirectedPath + 0x11));
|
|
ExceptionList = &local_1c;
|
|
*GHIDRA_CAST<uint8_t *>(this) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = 0;
|
|
this->_roomType = 0;
|
|
(this->_topLeftPos).y = 0.0;
|
|
(this->_topLeftPos).x = 0.0;
|
|
(this->_bottomRightPos).y = 0.0;
|
|
(this->_bottomRightPos).x = 0.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x11f6))) = 1;
|
|
(this->_renderSurfaceTopLeft).y = 0.0;
|
|
(this->_renderSurfaceTopLeft).x = 0.0;
|
|
(this->_renderScrollOffset).y = 0.0;
|
|
(this->_renderScrollOffset).x = 0.0;
|
|
init_render_buffers(GHIDRA_CAST<Room *>(&this->_entityList),stackCookie);
|
|
local_14 = (void *)0x0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&this->_fxLayers) = 0;
|
|
(this->_fxLayers)._loaded = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x10)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x14)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x18)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x1c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x20)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x24)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x28)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x2c)))) = 0;
|
|
(GHIDRA_CAST<FXParams *>((GHIDRA_CAST<FXParams *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x38)))))))->FXParams::FXParams();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x84)))) = 0x3f800000;
|
|
entriesLeft = 10;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x88)))) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x8c)))) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x90)))) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x94)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x98)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x9c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xa0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xa4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xa8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xac)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xb4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xb0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xbc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xb8)))) = 0;
|
|
puVar2 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0xc0))));
|
|
do {
|
|
*puVar2 = 0;
|
|
puVar2[4] = 0;
|
|
puVar2[5] = 0;
|
|
puVar2[6] = 0x3f800000;
|
|
puVar2[7] = 0;
|
|
puVar2[8] = 0x3f800000;
|
|
puVar2[9] = 0;
|
|
*GHIDRA_CAST<uint8_t *>((puVar2 + 0xc)) = 0;
|
|
*GHIDRA_CAST<uint64_t *>((puVar2 + 1)) = 0;
|
|
puVar2[0xb] = 0;
|
|
puVar2[10] = 0;
|
|
puVar2[3] = 0;
|
|
entriesLeft = entriesLeft + -1;
|
|
puVar2 = puVar2 + 0xd;
|
|
} while (entriesLeft != 0);
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x2c8))),0x114,2,ANM2::constructor,ANM2::~ANM2);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x4f4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers))) + 0x4f0)))) = 0;
|
|
(GHIDRA_CAST<FXParams *>((&(this->_fxLayers)._fxParams)))->FXParams::FXParams();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1bb8)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1bc4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1bc0)))) = 0;
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&this->_backdrop))))->Backdrop::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6f54)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
|
shopItemDeque = &this->_shopItemDeque;
|
|
shopItemDeque->_proxy = (void *)0x0;
|
|
(this->_shopItemDeque)._map = (void *)0x0;
|
|
(this->_shopItemDeque)._mapSize = 0;
|
|
(this->_shopItemDeque)._offset = 0;
|
|
(this->_shopItemDeque)._size = 0;
|
|
dequeProxy = operator_new(8);
|
|
dequeProxy[1] = 0;
|
|
shopItemDeque->_proxy = dequeProxy;
|
|
*dequeProxy = GHIDRA_INT(shopItemDeque);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
|
entriesLeft = 2;
|
|
puVar2 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70c4))));
|
|
do {
|
|
*puVar2 = 0xc3160000;
|
|
puVar2[1] = 0;
|
|
puVar2[2] = 0;
|
|
puVar2[3] = 0x3c23d70a;
|
|
puVar2[4] = 0x3dcccccd;
|
|
puVar2[5] = 0;
|
|
puVar2[6] = 5;
|
|
entriesLeft = entriesLeft + -1;
|
|
puVar2 = puVar2 + 7;
|
|
} while (entriesLeft != 0);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
|
|
gridIndexSet = this->_pendingGridRemovals;
|
|
gridIndexSet[0] = 0;
|
|
gridIndexSet[1] = 0;
|
|
gridIndexSet[2] = 0;
|
|
gridIndexSet[3] = 0;
|
|
this->_pendingGridRemovals[4] = 0;
|
|
this->_pendingGridRemovals[5] = 0;
|
|
this->_pendingGridRemovals[6] = 0;
|
|
this->_pendingGridRemovals[7] = 0;
|
|
pvVar1 = operator_new(0x14);
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pvVar1) + 0xc)) = 0x101;
|
|
*(void **)gridIndexSet = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
|
|
(GHIDRA_CAST<KColor *>((&this->_waterColor)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<KColor *>((&this->_waterColorMultiplier)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<KColor *>((&this->_waterLerpTargetColor)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<KColor *>((&this->_waterLerpTargetColorMult)))->KColor::SetFromARGB(0xffffffff);
|
|
(this->_floorColor)._tint[0] = 1.0;
|
|
(this->_floorColor)._tint[1] = 1.0;
|
|
(this->_floorColor)._tint[2] = 1.0;
|
|
(this->_floorColor)._tint[3] = 1.0;
|
|
(this->_floorColor)._colorize[0] = 0.0;
|
|
(this->_floorColor)._colorize[1] = 0.0;
|
|
(this->_floorColor)._colorize[2] = 0.0;
|
|
(this->_floorColor)._colorize[3] = 0.0;
|
|
(this->_floorColor)._offset[0] = 0.0;
|
|
(this->_floorColor)._offset[1] = 0.0;
|
|
(this->_floorColor)._offset[2] = 0.0;
|
|
(this->_wallColor)._tint[0] = 1.0;
|
|
(this->_wallColor)._tint[1] = 1.0;
|
|
(this->_wallColor)._tint[2] = 1.0;
|
|
(this->_wallColor)._tint[3] = 1.0;
|
|
(this->_wallColor)._colorize[0] = 0.0;
|
|
(this->_wallColor)._colorize[1] = 0.0;
|
|
(this->_wallColor)._colorize[2] = 0.0;
|
|
(this->_wallColor)._colorize[3] = 0.0;
|
|
(this->_wallColor)._offset[0] = 0.0;
|
|
(this->_wallColor)._offset[1] = 0.0;
|
|
(this->_wallColor)._offset[2] = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7304)))) = 0;
|
|
pvVar1 = operator_new(0x20);
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))) = pvVar1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
|
|
gridIndexSet = this->_litGridIndices;
|
|
gridIndexSet[0] = 0;
|
|
gridIndexSet[1] = 0;
|
|
gridIndexSet[2] = 0;
|
|
gridIndexSet[3] = 0;
|
|
this->_litGridIndices[4] = 0;
|
|
this->_litGridIndices[5] = 0;
|
|
this->_litGridIndices[6] = 0;
|
|
this->_litGridIndices[7] = 0;
|
|
pvVar1 = operator_new(0x14);
|
|
*(void **)pvVar1 = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 4) = pvVar1;
|
|
*(void **)(GHIDRA_CAST<char *>(pvVar1) + 8) = pvVar1;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(pvVar1) + 0xc)) = 0x101;
|
|
*(void **)gridIndexSet = pvVar1;
|
|
(this->_temporaryEffects)._effects._begin = (void *)0x0;
|
|
(this->_temporaryEffects)._effects._end = (void *)0x0;
|
|
(this->_temporaryEffects)._effects._capacity = (void *)0x0;
|
|
(this->_temporaryEffects)._cacheFlags = 0;
|
|
(this->_temporaryEffects)._shouldEvaluateCache = 0;
|
|
(this->_temporaryEffects)._disabled = 0;
|
|
(this->_temporaryEffects)._player = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xe;
|
|
_eh_vector_constructor_iterator_(this->_outputGroupGridIndices,8,10,FUN_005cbe20,FUN_00424420);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
|
|
_eh_vector_constructor_iterator_
|
|
(this->_outputGroupCallbacks,0xc,10,FUN_00424510,FID_conflict__Tidy);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x10;
|
|
entriesLeft = 4;
|
|
puVar2 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7408))));
|
|
puVar3 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x73f4))));
|
|
do {
|
|
puVar2[-4] = 0;
|
|
*puVar3 = 0;
|
|
puVar2[-2] = 0;
|
|
puVar2[-3] = 0;
|
|
*puVar2 = 0;
|
|
puVar2[-1] = 0;
|
|
entriesLeft = entriesLeft + -1;
|
|
puVar2 = puVar2 + 6;
|
|
puVar3 = puVar3 + 6;
|
|
} while (entriesLeft != 0);
|
|
(this->_waterCurrent).y = 0.0;
|
|
(this->_waterCurrent).x = 0.0;
|
|
(this->_railManager)._room = this;
|
|
(GHIDRA_CAST<ANM2 *>((&(this->_railManager)._sprite)))->ANM2::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x11;
|
|
_eh_vector_constructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7744))),4,8,FUN_0042a020,FUN_00579700);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x12;
|
|
*GHIDRA_CAST<Room **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x776c)))) = this;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7770)))))))->ANM2::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7884))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7888)))) = 0;
|
|
this->_beastBlastForce = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7890)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x13;
|
|
memset(this->_gridEntities,0,0x720);
|
|
init_room_render_surfaces();
|
|
builtin_strncpy(backdropsPath._buf + 8,"s.xml",6);
|
|
backdropsPath._capacity = 0xf;
|
|
backdropsPath._size = 0xd;
|
|
builtin_strncpy(backdropsPath._buf,"backdrop",8);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x14;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&g_manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPath),&backdropsPath);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x15);
|
|
gridIndexSet = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
|
|
gridIndexSet = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&this->_backdrop))))->Backdrop::LoadConfig(gridIndexSet);
|
|
if (0xf < redirectedPathCapacity) {
|
|
uVar4 = redirectedPathCapacity + 1;
|
|
pvVar1 = redirectedPath[0];
|
|
if (0xfff < uVar4) {
|
|
pvVar1 = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4);
|
|
uVar4 = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(pvVar1))))) goto LAB_007e9af3;
|
|
}
|
|
operator_delete(pvVar1,uVar4);
|
|
}
|
|
redirectedPathSize = 0;
|
|
redirectedPathCapacity = 0xf;
|
|
redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00);
|
|
if (0xf < backdropsPath._capacity) {
|
|
uVar4 = backdropsPath._capacity + 1;
|
|
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)backdropsPath._buf)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(backdropsPath._buf)) + 0x0))) + -4);
|
|
uVar4 = backdropsPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(backdropsPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
|
|
LAB_007e9af3:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar1,uVar4);
|
|
}
|
|
this->_Camera = (void *)0x0;
|
|
fVar5 = g_screenHeight - 182.0;
|
|
(this->_renderSurfaceTopLeft).x = (g_screenWidth - 338.0) * 0.5 - 52.0;
|
|
(this->_renderSurfaceTopLeft).y = fVar5 * 0.5 - 52.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7084)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7088)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x708c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7090)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7094)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7098)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x709c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70a0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70a4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70a8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70ac)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70b0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70b4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70b8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70bc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x70c0)))) = 0;
|
|
ExceptionList = local_1c;
|
|
return this;
|
|
}
|
|
|
|
// 007e9ba0
|
|
Room::~Room()
|
|
{
|
|
uint8_t *gridIndexSet;
|
|
uint32_t uVar2;
|
|
uint64_t *allocCounter;
|
|
void **gridEntitySlot;
|
|
int iVar3;
|
|
Room *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint64_t allocatedBytes;
|
|
void *freeBlock;
|
|
ANM2 *railSprite;
|
|
uint8_t *refSlot;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00d70;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
gridEntitySlot = this->_gridEntities;
|
|
iVar3 = 0x1c0;
|
|
local_14 = this;
|
|
do {
|
|
if (*gridEntitySlot != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(*gridEntitySlot))(1,uVar2);
|
|
}
|
|
gridEntitySlot = gridEntitySlot + 1;
|
|
iVar3 = iVar3 + -1;
|
|
} while (iVar3 != 0);
|
|
if (this->_Camera != (void *)0x0) {
|
|
FUN_007ea0c0(this->_Camera);
|
|
}
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7770)))))))->ANM2::Reset();
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77c8))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77c8)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77cc))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77cc)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77a8))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77a8)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77ac))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x77ac)))) = 0;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7788))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7770))))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
_eh_vector_destructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7744))),4,8,FUN_00579700);
|
|
railSprite = &(this->_railManager)._sprite;
|
|
local_8 = 5;
|
|
(GHIDRA_CAST<ANM2 *>((railSprite)))->ANM2::Reset();
|
|
freeBlock = (this->_railManager)._sprite._overlayAnimState._layerFrames;
|
|
if (freeBlock != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(freeBlock) + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(GHIDRA_INT(freeBlock) + -4));
|
|
(this->_railManager)._sprite._overlayAnimState._layerFrames = (void *)0x0;
|
|
}
|
|
freeBlock = (this->_railManager)._sprite._overlayAnimState._nullLayerFrames;
|
|
if (freeBlock != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(freeBlock) + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(GHIDRA_INT(freeBlock) + -4));
|
|
(this->_railManager)._sprite._overlayAnimState._nullLayerFrames = (void *)0x0;
|
|
}
|
|
freeBlock = (this->_railManager)._sprite._animState._layerFrames;
|
|
if (freeBlock != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(freeBlock) + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(GHIDRA_INT(freeBlock) + -4));
|
|
(this->_railManager)._sprite._animState._layerFrames = (void *)0x0;
|
|
}
|
|
freeBlock = (this->_railManager)._sprite._animState._nullLayerFrames;
|
|
if (freeBlock != (void *)0x0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(freeBlock) + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(GHIDRA_INT(freeBlock) + -4));
|
|
(this->_railManager)._sprite._animState._nullLayerFrames = (void *)0x0;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>(((this->_railManager)._sprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(railSprite))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
_eh_vector_destructor_iterator_(this->_outputGroupCallbacks,0xc,10,FID_conflict__Tidy);
|
|
_eh_vector_destructor_iterator_(this->_outputGroupGridIndices,8,10,FUN_00424420);
|
|
FUN_004b3950();
|
|
gridIndexSet = this->_litGridIndices;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(gridIndexSet,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)gridIndexSet,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>(this->_litGridIndices) + 4));
|
|
operator_delete(*(void **)gridIndexSet,0x14);
|
|
FUN_00827f30();
|
|
gridIndexSet = this->_pendingGridRemovals;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(gridIndexSet,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)gridIndexSet,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>(this->_pendingGridRemovals) + 4));
|
|
operator_delete(*(void **)gridIndexSet,0x14);
|
|
local_8 = 10;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100)))))))->ANM2::Reset();
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7158))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7158)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x715c))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x715c)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7138))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7138)))) = 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x713c))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x713c)))) = 0;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7118))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100))))))->msvc::string::_Tidy_deallocate();
|
|
msvc::deque<ptr>::_Tidy();
|
|
freeBlock = (this->_shopItemDeque)._proxy;
|
|
(this->_shopItemDeque)._proxy = (void *)0x0;
|
|
operator_delete(freeBlock,8);
|
|
local_8 = 0xf;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6f54)))))))->ANM2::Reset();
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6fac))));
|
|
if (iVar3 != 0) {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar3 + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar2));
|
|
free((void *)(iVar3 + -4));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6fac)))) = 0;
|
|
}
|
|
if (*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6fb0))) != (void *)0x0) {
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x11);
|
|
tracked_alloc(1,*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6fb0))),0);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6fb0)))) = 0;
|
|
}
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6f84)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6f6c))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6f54))))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 0x12;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_lightSprite)._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_lightSprite)._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lightSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_lightSprite))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&this->_backdrop))))->Backdrop::destructor();
|
|
refSlot = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1bb8)));
|
|
if (*GHIDRA_CAST<int *>(refSlot) != 0) {
|
|
local_14 = GHIDRA_CAST<Room *>(refSlot);
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
*GHIDRA_CAST<uint32_t *>(refSlot) = 0;
|
|
}
|
|
(GHIDRA_CAST<FXLayers *>((&this->_fxLayers)))->FXLayers::destructor();
|
|
FUN_00417e50();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007ea190
|
|
uint8_t Room::is_type_16()
|
|
{
|
|
return this->_roomType == 0x10;
|
|
}
|
|
|
|
// 007ea1a0
|
|
void Room::TriggerEffectRemoved(ItemConfig_Item *item, int unused)
|
|
{
|
|
int iVar1;
|
|
uint32_t i;
|
|
float musicPitch;
|
|
Game *game;
|
|
Manager *manager;
|
|
void *room;
|
|
|
|
manager = g_manager;
|
|
game = g_game;
|
|
iVar1 = item->type;
|
|
if (((iVar1 != 1) && (iVar1 != 3)) && (iVar1 != 4)) {
|
|
return;
|
|
}
|
|
iVar1 = item->id;
|
|
if (iVar1 != 0x42) {
|
|
if (iVar1 == 0x1de) {
|
|
i = 0;
|
|
room = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x1264)) == 0) {
|
|
return;
|
|
}
|
|
do {
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0x125c)) + i * 4));
|
|
if (((1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 1)) ||
|
|
((*GHIDRA_CAST<int *>((iVar1 + 0x28)) - 10U < 0x3de || (*GHIDRA_CAST<int *>((iVar1 + 0x28)) == 1000)))) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar1 + 0x31c)) = 0;
|
|
}
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(room) + 0x1264)));
|
|
return;
|
|
}
|
|
if (iVar1 != 0x2a5) {
|
|
return;
|
|
}
|
|
}
|
|
musicPitch = time_scale_update(this);
|
|
(manager->_musicManager)._targetPitch = musicPitch;
|
|
return;
|
|
}
|
|
|
|
// 007ea260
|
|
void Room::SetPauseTimer(int Duration)
|
|
{
|
|
uint32_t i;
|
|
int entity;
|
|
int entityType;
|
|
|
|
i = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
entity = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + i * 4));
|
|
if ((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((entity + 0x28)) == 1)) ||
|
|
(entityType = *GHIDRA_CAST<int *>((entity + 0x28)), entityType - 10U < 0x3de)) ||
|
|
((entityType == 9 || (entityType == 1000)))) {
|
|
*GHIDRA_CAST<int *>((entity + 0x31c)) = Duration;
|
|
}
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ea2d0
|
|
float Room::time_scale_update()
|
|
{
|
|
uint8_t isHasEffect;
|
|
void *pvVar1;
|
|
Entity_Player *stopWatchOwner;
|
|
int gFuelCount;
|
|
int extraGFuel;
|
|
float easeFraction;
|
|
float timeScale;
|
|
|
|
timeScale = 1.0;
|
|
pvVar1 = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x2a5);
|
|
if (pvVar1 != (void *)0x0) {
|
|
easeFraction = ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 8)) - 0.0) / 90.0;
|
|
if (easeFraction <= 0.0) {
|
|
easeFraction = 0.0;
|
|
}
|
|
if (1.0 <= easeFraction) {
|
|
easeFraction = 1.0;
|
|
}
|
|
timeScale = 1.0 - easeFraction * 0.8;
|
|
if (timeScale <= 0.5) {
|
|
timeScale = 0.5;
|
|
}
|
|
goto LAB_007ea3b4;
|
|
}
|
|
isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xe8);
|
|
if ((isHasEffect == 0) &&
|
|
(isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x42),
|
|
isHasEffect == 0)) {
|
|
if (g_game->_challenge != 0x16) {
|
|
if (this->_brokenWatchState == 1) goto LAB_007ea3a7;
|
|
if (this->_brokenWatchState != 2) {
|
|
stopWatchOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xe8,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (stopWatchOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
timeScale = 0.9;
|
|
}
|
|
goto LAB_007ea3b4;
|
|
}
|
|
}
|
|
timeScale = 1.43;
|
|
}
|
|
else {
|
|
LAB_007ea3a7:
|
|
timeScale = 0.7;
|
|
}
|
|
LAB_007ea3b4:
|
|
gFuelCount = PlayerManager::GetGFuelCount();
|
|
extraGFuel = 0;
|
|
if (0 < gFuelCount + -1) {
|
|
extraGFuel = gFuelCount + -1;
|
|
}
|
|
return (float)extraGFuel * 0.1 + timeScale;
|
|
}
|
|
|
|
// 007ea3e0
|
|
float Room::GetTimeScale(Vector *unusedPosition, Entity *entity)
|
|
{
|
|
uint8_t isAstralProjection;
|
|
Entity_Player *player;
|
|
int gFuelCount;
|
|
void *astralEffect;
|
|
int extraGFuel;
|
|
float velocityY;
|
|
float timeScale;
|
|
uint32_t seedKey;
|
|
Room *room;
|
|
uint8_t local_14 [8];
|
|
void *seedNode;
|
|
Game *game;
|
|
float velocityY;
|
|
|
|
timeScale = 1.0;
|
|
room = this;
|
|
if ((entity == GHIDRA_CAST<Entity *>(0x0)) || (entity->_type != 1)) {
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xe8,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
game = g_game;
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
timeScale = 0.8;
|
|
}
|
|
seedKey = 0x4d;
|
|
msvc::set<int>::find_node(local_14,&seedKey);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0x4e)) &&
|
|
(seedNode != (game->_seedEffects)._seedEffects)) {
|
|
player = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(0);
|
|
velocityY = (player->_velocity).x;
|
|
velocityY = (player->_velocity).y;
|
|
timeScale = sqrtf(velocityY * velocityY + velocityY * velocityY);
|
|
timeScale = timeScale / 4.2;
|
|
if (timeScale <= 0.02) {
|
|
timeScale = 0.02;
|
|
}
|
|
if (1.75 <= timeScale) {
|
|
timeScale = 1.75;
|
|
}
|
|
}
|
|
}
|
|
gFuelCount = PlayerManager::GetGFuelCount();
|
|
extraGFuel = 0;
|
|
if (0 < gFuelCount + -1) {
|
|
extraGFuel = gFuelCount + -1;
|
|
}
|
|
timeScale = (float)extraGFuel * 0.1 + timeScale;
|
|
astralEffect = (GHIDRA_CAST<TemporaryEffects *>((&room->_temporaryEffects)))->TemporaryEffects::GetCollectibleEffect(0x2a5);
|
|
if (astralEffect != (void *)0x0) {
|
|
if ((entity == GHIDRA_CAST<Entity *>(0x0)) || (entity->_type != 1)) {
|
|
velocityY = ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(astralEffect) + 8)) - 0.0) / 90.0;
|
|
if (velocityY <= 0.0) {
|
|
velocityY = 0.0;
|
|
}
|
|
if (1.0 <= velocityY) {
|
|
velocityY = 1.0;
|
|
}
|
|
timeScale = (1.0 - velocityY) * timeScale;
|
|
if (timeScale <= 0.02) {
|
|
timeScale = 0.02;
|
|
}
|
|
}
|
|
else {
|
|
isAstralProjection = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(entity))))->Entity_Player::HasCollectible(0x2a5,0);
|
|
if (isAstralProjection != 0) {
|
|
velocityY = ((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(astralEffect) + 8)) - 0.0) / 90.0;
|
|
if (velocityY <= 0.0) {
|
|
velocityY = 0.0;
|
|
}
|
|
if (1.0 <= velocityY) {
|
|
velocityY = 1.0;
|
|
}
|
|
timeScale = timeScale * (velocityY + 1.0);
|
|
}
|
|
}
|
|
}
|
|
if ((g_game->_challenge == 0x16) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1210)) == 2)) {
|
|
timeScale = timeScale * 1.43;
|
|
}
|
|
return timeScale;
|
|
}
|
|
|
|
// 007eb1b0
|
|
void Room::PlayMusic()
|
|
{
|
|
int roomType;
|
|
code *pcVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
Game *game;
|
|
float musicPitch;
|
|
uint64_t uVar6;
|
|
int unusedInt;
|
|
uint8_t unusedBool;
|
|
uint32_t stageType;
|
|
int jingleId;
|
|
float local_c;
|
|
uint32_t stage;
|
|
uint32_t currentMusic;
|
|
Manager *manager;
|
|
MusicManager *musicManager;
|
|
int roomType;
|
|
|
|
stage = g_game->_stage;
|
|
stageType = g_game->_stageType;
|
|
if (g_game->_challenge == 0x2c) {
|
|
stageType = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomStageType(g_game->_currentRoomIdx);
|
|
}
|
|
game = g_game;
|
|
roomType = this->_roomType;
|
|
jingleId = 0;
|
|
if (g_game->_challenge == 0x2d) {
|
|
local_c = (float)g_game->_dungeonPlacementSeed;
|
|
if (stage - 1 < 0xb) {
|
|
if (local_c == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_c) >> 2 ^ GHIDRA_UINT(local_c);
|
|
uVar4 = uVar4 << 7 ^ uVar4;
|
|
local_c = (float)(uVar4 >> 9 ^ uVar4);
|
|
stage = GHIDRA_UINT(local_c) % 0xb + 1;
|
|
}
|
|
if (local_c == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_c) >> 2 ^ GHIDRA_UINT(local_c);
|
|
uVar4 = uVar4 << 7 ^ uVar4;
|
|
stageType = (uVar4 >> 9 ^ uVar4) % 5;
|
|
if (stageType == 3) {
|
|
stageType = 4;
|
|
}
|
|
}
|
|
local_c = 0.08;
|
|
unusedInt = 0x7eb2f9;
|
|
uVar4 = RoomConfig::GetStageID(stage,stageType,-1);
|
|
if (roomType == 5) {
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 1) == 0) {
|
|
switch(this->_bossId) {
|
|
case 6:
|
|
uVar6 = CONCAT44(uVar4,0x14);
|
|
break;
|
|
default:
|
|
switchD_007eb334_caseD_7:
|
|
uVar6 = FUN_008206e0();
|
|
break;
|
|
case 8:
|
|
case 0x19:
|
|
uVar6 = CONCAT44(uVar4,0x15);
|
|
break;
|
|
case 0x18:
|
|
case 0x37:
|
|
switchD_007eb334_caseD_18:
|
|
uVar6 = CONCAT44(uVar4,0x21);
|
|
break;
|
|
case 0x27:
|
|
uVar6 = CONCAT44(uVar4,0x16);
|
|
break;
|
|
case 0x28:
|
|
case 0x3f:
|
|
uVar6 = CONCAT44(uVar4,0x19);
|
|
break;
|
|
case 0x36:
|
|
uVar6 = CONCAT44(uVar4,0x18);
|
|
break;
|
|
case 0x3e:
|
|
uVar6 = CONCAT44(uVar4,0x1c);
|
|
break;
|
|
case 0x46:
|
|
uVar6 = CONCAT44(uVar4,0x67);
|
|
break;
|
|
case 0x58:
|
|
uVar6 = CONCAT44(uVar4,0x2b);
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = CONCAT44(uVar4,0x25);
|
|
}
|
|
}
|
|
else if ((roomType == 6) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(game->_room) + 0x7228)) != '\0')) {
|
|
uVar6 = CONCAT44(uVar4,0x26 - GHIDRA_UINT(((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 1) != 0)));
|
|
}
|
|
else if (roomType == 2) {
|
|
uVar6 = CONCAT44(uVar4,0x23);
|
|
}
|
|
else if (roomType == 0xc) {
|
|
uVar6 = CONCAT44(uVar4,0x1e);
|
|
}
|
|
else if (roomType == 0xf) {
|
|
uVar6 = CONCAT44(uVar4,0x22);
|
|
}
|
|
else if (roomType == 9) {
|
|
uVar6 = CONCAT44(uVar4,0x24);
|
|
}
|
|
else {
|
|
if (roomType == 0xe) goto switchD_007eb334_caseD_18;
|
|
if (roomType == 7) {
|
|
uVar6 = CONCAT44(uVar4,0x1f);
|
|
}
|
|
else if (roomType == 8) {
|
|
uVar6 = CONCAT44(uVar4,0x20);
|
|
}
|
|
else if (roomType == 0x1d) {
|
|
uVar6 = CONCAT44(uVar4,0x33);
|
|
}
|
|
else if (roomType == 0xb) {
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 3 & 1) == 0) {
|
|
LAB_007eb438:
|
|
if (game->_currentRoomIdx == -0xb) {
|
|
uVar6 = CONCAT44(uVar4,0x25);
|
|
}
|
|
else if (roomType == 0x18) {
|
|
uVar6 = CONCAT44(uVar4,0x32);
|
|
}
|
|
else if (((roomType == 0x10) &&
|
|
(roomType = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), roomType != 0)) &&
|
|
(*GHIDRA_CAST<int *>((roomType + 0x10)) == 4)) {
|
|
uVar6 = CONCAT44(uVar4,0x2d);
|
|
}
|
|
else if ((stage == 0xd) && (stageType == 1)) {
|
|
if (((uint8_t)*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 5) == 4) {
|
|
local_c = 1.0;
|
|
uVar6 = CONCAT44(uVar4,0x2c);
|
|
}
|
|
else {
|
|
uVar6 = CONCAT44(uVar4,*(uint32_t *)
|
|
(game->_ventricleRazorPortals + uVar4 * 0xc4 + 0x654));
|
|
}
|
|
}
|
|
else {
|
|
if (roomType == 0x10) {
|
|
roomType = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if ((roomType != 0) && ((roomType = *GHIDRA_CAST<int *>((roomType + 0x10)), roomType == 2 || (roomType == 3))))
|
|
goto switchD_007eb334_caseD_7;
|
|
}
|
|
else if ((roomType == 4) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1))) != '\0')) {
|
|
uVar5 = Random();
|
|
jingleId = (uVar5 & 3) + 0x57;
|
|
game = g_game;
|
|
}
|
|
uVar6 = CONCAT44(uVar4,*(uint32_t *)
|
|
(game->_ventricleRazorPortals + uVar4 * 0xc4 + 0x654));
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = CONCAT44(uVar4,0x25);
|
|
}
|
|
}
|
|
else {
|
|
if (roomType != 0x1b) goto LAB_007eb438;
|
|
uVar6 = CONCAT44(uVar4,0x25);
|
|
}
|
|
}
|
|
uVar5 = GHIDRA_UINT(uVar6);
|
|
if ((((game->_difficulty != 2) && (game->_difficulty != 3)) && (stage == 9)) && (roomType != 5)) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((game->_ventricleRazorPortals + GHIDRA_INT(((uint64_t)uVar6 >> 0x20)) * 0xc4 + 0x654))
|
|
;
|
|
jingleId = 0;
|
|
}
|
|
unusedBool = 0x50;
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsMausoleumHeartStage();
|
|
if (bVar3 != 0) {
|
|
if (g_game->_currentRoomIdx != -10) {
|
|
local_c = 1.0;
|
|
}
|
|
uVar5 = 0;
|
|
jingleId = 0;
|
|
if (g_game->_currentRoomIdx != -10) {
|
|
uVar5 = 0x34;
|
|
}
|
|
}
|
|
if (g_game->_currentDimensionIdx == 2) {
|
|
uVar5 = 0x45;
|
|
jingleId = 0;
|
|
}
|
|
else {
|
|
unusedBool = 0x9e;
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasMirrorDimension();
|
|
if (((bVar3 == 0) || (g_game->_currentDimensionIdx != 1)) ||
|
|
((roomType == 5 || ((roomType == 6 || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 0x7228)) != '\0')))))) {
|
|
unusedBool = 0xdf;
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft();
|
|
if ((bVar3 == 0) || (g_game->_currentDimensionIdx != 1)) {
|
|
if (((0 < g_game->_stage) && (g_game->_stage < 7)) &&
|
|
((g_game->_gameStateFlags & 0x1000000000000) != 0)) {
|
|
uVar5 = 0x76;
|
|
jingleId = 0;
|
|
}
|
|
}
|
|
else {
|
|
jingleId = 0;
|
|
uVar5 = (g_game->_levelStateFlags & 0x400000U | 0x1d000000) >> 0x16;
|
|
}
|
|
}
|
|
else {
|
|
uVar5 = (uVar4 == 0x1c) + 0x72;
|
|
jingleId = 0;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
uVar4 = (g_manager->_musicManager)._queuedMusicID;
|
|
musicManager = &g_manager->_musicManager;
|
|
currentMusic = (g_manager->_musicManager)._currentMusicID;
|
|
if (uVar4 == 0) {
|
|
uVar4 = currentMusic;
|
|
}
|
|
if (currentMusic == 0x68) {
|
|
if (uVar5 == 0x72) {
|
|
LAB_007eb66b:
|
|
local_c = 0.008;
|
|
goto LAB_007eb678;
|
|
}
|
|
}
|
|
else if (currentMusic == 0x72) {
|
|
if (uVar5 == 0x68) goto LAB_007eb66b;
|
|
}
|
|
else {
|
|
LAB_007eb678:
|
|
if (currentMusic == 0x41) {
|
|
local_c = 0.01;
|
|
}
|
|
else if (currentMusic == 0x2d) {
|
|
local_c = 1.0;
|
|
}
|
|
else if ((currentMusic == 0x5f) || (currentMusic == 0x40)) {
|
|
if ((-1 < GHIDRA_INT(uVar5)) &&
|
|
(GHIDRA_INT(uVar5) <
|
|
(GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60)) {
|
|
(g_manager->_musicManager)._queuedMusicID = uVar5;
|
|
}
|
|
goto LAB_007eb7d5;
|
|
}
|
|
}
|
|
if (jingleId == 0) {
|
|
if (((uVar4 == 0) && (currentMusic != uVar5)) || (uVar4 != uVar5)) {
|
|
if (uVar5 == 0) {
|
|
musicManager->_channels[musicManager->_currentChannel]._targetVolume = 0.0;
|
|
musicManager->_channels[musicManager->_currentChannel]._fadeRate = 0.08;
|
|
(manager->_musicManager)._queuedMusicID = 0;
|
|
}
|
|
else if (local_c < 1.0) {
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::Crossfade(uVar5,local_c);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(musicManager))))->Music::Play(uVar5,(g_manager->_optionsConfig)._musicVolume);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x2a304)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x2a320)))) = 0xffffff9c;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(musicManager))))->Music::PlayJingle(jingleId,unusedInt,unusedBool);
|
|
if ((uVar5 != 0) && (((uVar4 == 0 && (currentMusic != uVar5)) || (uVar4 != uVar5)))) {
|
|
if (local_c < 1.0) {
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::Crossfade(uVar5,local_c);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(musicManager))))->Music::Play(uVar5,(g_manager->_optionsConfig)._musicVolume);
|
|
}
|
|
}
|
|
}
|
|
LAB_007eb7d5:
|
|
musicPitch = time_scale_update(this);
|
|
(g_manager->_musicManager)._targetPitch = musicPitch;
|
|
return;
|
|
}
|
|
|
|
// 007ebca0
|
|
uint8_t Room::SpawnGridEntity(int GridIndex, uint32_t Type, uint32_t Variant, uint32_t Seed, int VarData)
|
|
{
|
|
uint32_t uVar1;
|
|
GridEntity *gridEntity;
|
|
bool bVar2;
|
|
bool bVar3;
|
|
int gridPath;
|
|
|
|
if ((GridIndex < 0) || (0x1bf < GridIndex)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if (GHIDRA_UINT(GridIndex) < 0x1c0) {
|
|
if ((((Type == 0x11) || (Type == 0x12)) || (Type == 0x14)) || (Type == 0x17)) {
|
|
uVar1 = GetGridCollision(this,GridIndex);
|
|
bVar3 = false;
|
|
bVar2 = uVar1 == 0;
|
|
}
|
|
else {
|
|
gridPath = this->_gridPaths[GridIndex];
|
|
bVar3 = SBORROW4(gridPath,900);
|
|
uVar1 = gridPath - 900;
|
|
bVar2 = gridPath == 900;
|
|
}
|
|
if (bVar2 || bVar3 != GHIDRA_INT(uVar1) < 0) {
|
|
gridEntity = Isaac::CreateGridEntity(Type,GridIndex);
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
if (this->_gridEntities[GridIndex] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[GridIndex]))(1);
|
|
}
|
|
this->_gridEntities[GridIndex] = gridEntity;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = Variant;
|
|
gridEntity->_varData = VarData;
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Init(Seed);
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007ebd50
|
|
uint8_t Room::SpawnGridEntityDesc(int GridIndex, GridEntityDesc *Desc)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
int iVar3;
|
|
uint8_t bVar4;
|
|
undefined3 uVar5;
|
|
uint32_t uVar6;
|
|
GridEntity *gridEntity;
|
|
bool bVar7;
|
|
bool bVar8;
|
|
Game *game;
|
|
|
|
if ((GridIndex < 0) || (0x1bf < GridIndex)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
iVar1 = Desc->_type;
|
|
if ((((iVar1 == 0x11) || (iVar1 == 0x12)) || (iVar1 == 0x14)) || (iVar1 == 0x17)) {
|
|
uVar6 = GetGridCollision(this,GridIndex);
|
|
bVar8 = false;
|
|
bVar7 = uVar6 == 0;
|
|
}
|
|
else {
|
|
iVar2 = this->_gridPaths[GridIndex];
|
|
bVar8 = SBORROW4(iVar2,900);
|
|
uVar6 = iVar2 - 900;
|
|
bVar7 = iVar2 == 900;
|
|
}
|
|
if (bVar7 || bVar8 != GHIDRA_INT(uVar6) < 0) {
|
|
gridEntity = Isaac::CreateGridEntity(iVar1,GridIndex);
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
if (this->_gridEntities[GridIndex] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[GridIndex]))(1);
|
|
}
|
|
this->_gridEntities[GridIndex] = gridEntity;
|
|
iVar1 = Desc->_variant;
|
|
iVar2 = Desc->_state;
|
|
iVar3 = Desc->_spawnCount;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) = Desc->_type;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = iVar1;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xc)))) = iVar2;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = iVar3;
|
|
iVar1 = Desc->_spawnSeed;
|
|
iVar2 = Desc->_varData;
|
|
bVar4 = Desc->_initialized;
|
|
uVar5 = *GHIDRA_CAST<undefined3 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((Desc)) + 0x19))));
|
|
iVar3 = Desc->_variableSeed;
|
|
gridEntity->_collisionClass = 0;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x14)))) = iVar1;
|
|
gridEntity->_varData = iVar2;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c))) = bVar4;
|
|
*GHIDRA_CAST<undefined3 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1d)))) = uVar5;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x20)))) = iVar3;
|
|
gridEntity->BeginBatches();
|
|
game = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c))) = 1;
|
|
gridEntity->_spawnFrame = game->_frameCount;
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 007ec080
|
|
int Room::GetSeededCollectible(uint32_t Seed, uint8_t NoDecrease)
|
|
{
|
|
int collectibleId;
|
|
|
|
collectibleId =
|
|
ItemPool::GetSeededCollectible(Seed,NoDecrease,*GHIDRA_CAST<RoomDescriptor **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))));
|
|
return collectibleId;
|
|
}
|
|
|
|
// 007ec100
|
|
void Room::TransformEntry(void *entry, uint32_t gridIndex, uint32_t seed)
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
int iVar4;
|
|
uint32_t uVar5;
|
|
uint32_t preventedCurses;
|
|
ChallengeParam *challengeParams;
|
|
uint32_t uVar6;
|
|
uint16_t uVar7;
|
|
Game *game;
|
|
int endStage;
|
|
Game *curGame;
|
|
short sVar8;
|
|
Manager *extraout_EDX;
|
|
Manager *manager;
|
|
uint32_t uVar9;
|
|
char cVar12;
|
|
uint32_t uVar10;
|
|
uint32_t uVar11;
|
|
uint16_t *puVar13;
|
|
int *entityType;
|
|
bool bVar14;
|
|
RNG slotRng;
|
|
uint32_t gridX;
|
|
uint16_t *variantPtr;
|
|
int *entryPtr;
|
|
uint32_t local_58;
|
|
int *local_54;
|
|
RNG rng;
|
|
uint32_t local_40;
|
|
Room *room;
|
|
char isBurningBasement;
|
|
char isFloodedCaves;
|
|
char isScarredWomb;
|
|
char local_33;
|
|
char local_32;
|
|
char local_31;
|
|
uint16_t *local_30;
|
|
RNG lockedCardRng;
|
|
RNG cardRng;
|
|
uint32_t local_c;
|
|
uint8_t auStack_8 [4];
|
|
void *cardConfigs;
|
|
uint16_t *subTypePtr;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
|
uVar7 = 1;
|
|
entryPtr = entry;
|
|
local_58 = seed;
|
|
rng._seed = seed;
|
|
rng._shift1 = 1;
|
|
rng._shift2 = 0x15;
|
|
rng._shift3 = 0x14;
|
|
room = this;
|
|
if (*GHIDRA_CAST<int *>(entry) == 0x578) {
|
|
*GHIDRA_CAST<uint32_t *>(entry) = 0x21;
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
rng._seed = seed >> 1 ^ seed;
|
|
rng._seed = rng._seed << 0x15 ^ rng._seed;
|
|
rng._seed = GHIDRA_UINT(rng._seed) >> 0x14 ^ rng._seed;
|
|
uVar7 = (uint16_t)(rng._seed == (GHIDRA_UINT(rng._seed) / 0x28) * 0x28);
|
|
LAB_007ec1a6:
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(entry) + 4)) = uVar7;
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(entry) == 0x582) {
|
|
*GHIDRA_CAST<uint32_t *>(entry) = 0x21;
|
|
goto LAB_007ec1a6;
|
|
}
|
|
local_40 = *GHIDRA_CAST<uint32_t *>(entry);
|
|
local_30 = GHIDRA_CAST<uint16_t *>((GHIDRA_INT(entry) + 6));
|
|
puVar13 = GHIDRA_CAST<uint16_t *>((GHIDRA_INT(entry) + 4));
|
|
variantPtr = puVar13;
|
|
local_33 = LuaEngine::Callback_PreEntitySpawn(&local_40,puVar13,local_30,gridIndex,seed);
|
|
*GHIDRA_CAST<uint32_t *>(entry) = local_40;
|
|
if ((local_40 == 5) && (*puVar13 == 0x12d)) {
|
|
*puVar13 = 300;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
iVar4 = ItemPool::GetCardEx(uVar3,0,1,0,1);
|
|
cardRng._shift3 = 7;
|
|
cardRng._shift1 = 5;
|
|
cardRng._shift2 = 9;
|
|
cardRng._seed = uVar3;
|
|
iVar4 = lua_callback_run_get_card(&cardRng,iVar4,0,1,1);
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(entry) + 6)) = (short)iVar4;
|
|
}
|
|
manager = g_manager;
|
|
game = g_game;
|
|
if (local_33 != '\0') {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(entry) == 5) {
|
|
local_40 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
subTypePtr = local_30;
|
|
game = g_game;
|
|
uVar7 = *puVar13;
|
|
if (uVar7 == 0x28) {
|
|
if (*local_30 == 4) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0xe2] == 0;
|
|
goto LAB_007ec3d4;
|
|
}
|
|
}
|
|
else if (uVar7 == 10) {
|
|
if (*local_30 == 7) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0xe0] == 0;
|
|
LAB_007ec3d4:
|
|
if (bVar14) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*local_30 = 0;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
else {
|
|
uVar7 = *local_30;
|
|
if (uVar7 == 8) {
|
|
if ((manager->_persistentGameData)._achievements[0x21] == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*local_30 = 3;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
else if (uVar7 == 9) {
|
|
if ((manager->_persistentGameData)._achievements[0x148] == 0) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8))));
|
|
puVar13 = local_30;
|
|
goto LAB_007ec308;
|
|
}
|
|
}
|
|
else {
|
|
if (uVar7 == 0xb) {
|
|
bVar2 = (manager->_persistentGameData)._achievements[0x187];
|
|
}
|
|
else {
|
|
if (uVar7 != 0xc) goto LAB_007ec4be;
|
|
bVar2 = (manager->_persistentGameData)._achievements[0x19b];
|
|
}
|
|
if (bVar2 == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*local_30 = 2;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (uVar7 == 0x14) {
|
|
if (*local_30 == 5) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0xf2] == 0;
|
|
}
|
|
else if (*local_30 == 6) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0xf0] == 0;
|
|
}
|
|
else {
|
|
if (*local_30 != 7) goto LAB_007ec4be;
|
|
bVar14 = (manager->_persistentGameData)._achievements[0x265] == 0;
|
|
}
|
|
goto LAB_007ec3d4;
|
|
}
|
|
if (uVar7 == 0x1e) {
|
|
if (*local_30 == 4) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0x14d] == 0;
|
|
goto LAB_007ec3d4;
|
|
}
|
|
}
|
|
else if (uVar7 == 300) {
|
|
uVar7 = *local_30;
|
|
if ((((uVar7 != 0) &&
|
|
(cardConfigs = (g_manager->_itemConfig)._cards._begin,
|
|
GHIDRA_INT(GHIDRA_UINT(uVar7)) < GHIDRA_INT((g_manager->_itemConfig)._cards._end) - GHIDRA_INT(cardConfigs) >> 2))
|
|
&& (iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(cardConfigs) + GHIDRA_UINT(uVar7) * 4)), iVar4 != 0)) &&
|
|
(iVar4 = *GHIDRA_CAST<int *>((iVar4 + 4)), -1 < iVar4)) {
|
|
bVar2 = (GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::Unlocked(iVar4);
|
|
uVar3 = local_40;
|
|
if (bVar2 == 0) {
|
|
iVar4 = ItemPool::GetCardEx(local_40,0x19,10,10,1);
|
|
lockedCardRng._shift3 = 7;
|
|
lockedCardRng._seed = uVar3;
|
|
lockedCardRng._shift1 = 5;
|
|
lockedCardRng._shift2 = 9;
|
|
iVar4 = lua_callback_run_get_card(&lockedCardRng,iVar4,1,1,0);
|
|
*subTypePtr = (uint16_t)iVar4;
|
|
}
|
|
}
|
|
}
|
|
else if (uVar7 == 0x45) {
|
|
if (*local_30 == 2) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0x25c] == 0;
|
|
goto LAB_007ec3d4;
|
|
}
|
|
}
|
|
else if (uVar7 == 0x5a) {
|
|
if (*local_30 == 4) {
|
|
bVar14 = (manager->_persistentGameData)._achievements[0x267] == 0;
|
|
goto LAB_007ec3d4;
|
|
}
|
|
}
|
|
else {
|
|
if (uVar7 == 0x38) {
|
|
bVar2 = (manager->_persistentGameData)._achievements[0x261];
|
|
}
|
|
else {
|
|
if (uVar7 != 0x3a) {
|
|
if ((uVar7 == 0x39) && ((manager->_persistentGameData)._achievements[0x259] == 0)) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*puVar13 = 0x3c;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
goto LAB_007ec4be;
|
|
}
|
|
bVar2 = (manager->_persistentGameData)._achievements[0x263];
|
|
}
|
|
if (bVar2 == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*puVar13 = 0x32;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
}
|
|
LAB_007ec4be:
|
|
game = g_game;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(entry) != 6) goto LAB_007ec4be;
|
|
uVar7 = *puVar13;
|
|
if (uVar7 != 0xf) {
|
|
if (uVar7 == 0x12) {
|
|
if ((g_manager->_persistentGameData)._achievements[0x266] == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*puVar13 = 7;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
else if (uVar7 == 0x11) {
|
|
if ((g_manager->_persistentGameData)._achievements[0x268] == 0) {
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*GHIDRA_CAST<uint32_t *>(entry) = 5;
|
|
*puVar13 = 10;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(entry) + 6)) = 3;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
else if (uVar7 == 0x10) {
|
|
if ((g_manager->_persistentGameData)._achievements[0x25f] == 0) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8))));
|
|
LAB_007ec308:
|
|
game = g_game;
|
|
if (((iVar4 != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*puVar13 = 1;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
}
|
|
else if (uVar7 == 0xe) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
iVar4 = FUN_00929b00();
|
|
manager = g_manager;
|
|
if ((iVar4 != 0) && (-1 < *GHIDRA_CAST<int *>((iVar4 + 0x7c)))) {
|
|
bVar2 = PersistentGameData::Unlocked
|
|
(&g_manager->_persistentGameData,*GHIDRA_CAST<int *>((iVar4 + 0x7c)));
|
|
manager = extraout_EDX;
|
|
if (bVar2 == 0) goto LAB_007ec4be;
|
|
}
|
|
game = g_game;
|
|
if (((manager->_persistentGameData)._achievements[0x1b2] == 0) &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) != 2 || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) {
|
|
*GHIDRA_CAST<uint32_t *>(entry) = 0x11;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(entry) + 4)) = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint32_t *>(entry) = 5;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(entry) + 4)) = 0x2b00064;
|
|
}
|
|
goto LAB_007ec4c4;
|
|
}
|
|
goto LAB_007ec4be;
|
|
}
|
|
if ((g_manager->_persistentGameData)._achievements[0x260] != 0) goto LAB_007ec4be;
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))) {
|
|
*puVar13 = 5;
|
|
}
|
|
}
|
|
LAB_007ec4c4:
|
|
uVar3 = game->_debugCurses;
|
|
uVar6 = game->_stage;
|
|
uVar10 = game->_curses;
|
|
uVar5 = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
game = g_game;
|
|
uVar11 = uVar6 + 1;
|
|
if ((~preventedCurses & (uVar5 | uVar3 | uVar10) & 2) == 0) {
|
|
uVar11 = uVar6;
|
|
}
|
|
iVar4 = g_game->_difficulty;
|
|
if ((iVar4 == 2) || (local_40 = uVar11, iVar4 == 3)) {
|
|
if (GHIDRA_INT(uVar11) < 5) {
|
|
local_40 = uVar11 * 2 - 1;
|
|
}
|
|
else {
|
|
local_40 = 0;
|
|
if (uVar11 == 5) {
|
|
local_40 = 10;
|
|
}
|
|
}
|
|
}
|
|
uVar3 = local_40;
|
|
local_30 = GHIDRA_CAST<uint16_t *>(g_game->_stageType);
|
|
if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) {
|
|
LAB_007ec7f3:
|
|
local_32 = '\x01';
|
|
}
|
|
else {
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
local_32 = '\0';
|
|
if (challengeParams->_pathType == 1) goto LAB_007ec7f3;
|
|
}
|
|
if ((game->_challenge == 0) && ((game->_dailyChallenge)._id == 0)) {
|
|
LAB_007ec81d:
|
|
local_31 = '\0';
|
|
}
|
|
else {
|
|
challengeParams = (GHIDRA_CAST<Game *>((game)))->Game::GetChallengeParams();
|
|
local_31 = '\x01';
|
|
if (challengeParams->_pathType != 1) goto LAB_007ec81d;
|
|
}
|
|
entityType = entryPtr;
|
|
if ((iVar4 == 2) || (iVar4 == 3)) {
|
|
if ((*entryPtr == 9000) &&
|
|
((game->_currentRoomIdx == -0xc &&
|
|
(bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsNextStageAvailable(), bVar2 == 0)))) goto LAB_007ec9c4;
|
|
goto LAB_007ec9e3;
|
|
}
|
|
if (*entryPtr != 9000) goto LAB_007ec8f4;
|
|
if (((game->_stage < 1) || (6 < game->_stage)) || ((game->_gameStateFlags & 0x1000000000000) == 0)
|
|
) {
|
|
if ((uVar3 == 0xb) && (room->_roomType == 3)) {
|
|
challengeParams = (GHIDRA_CAST<Game *>((game)))->Game::GetChallengeParams();
|
|
curGame = g_game;
|
|
iVar4 = 0xc;
|
|
if ((challengeParams->_endStage != 0xc) &&
|
|
(((game->_challenge != 0 || ((game->_dailyChallenge)._id != 0)) ||
|
|
(((g_manager->_persistentGameData)._achievements[0x140] == 0 &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 || (game->_isDebug == 0)))))))) {
|
|
iVar4 = 0xb;
|
|
}
|
|
endStage = iVar4;
|
|
if (challengeParams->_isPathTypeSet != 0) {
|
|
endStage = challengeParams->_endStage;
|
|
if (challengeParams->_endStage == 0) {
|
|
endStage = iVar4;
|
|
}
|
|
if (challengeParams->_pathType == 3) goto LAB_007ec8f4;
|
|
}
|
|
if (endStage < 0xc) goto LAB_007ec8f4;
|
|
*GHIDRA_CAST<uint16_t *>((entityType + 1)) = 1;
|
|
}
|
|
else {
|
|
LAB_007ec8f4:
|
|
if (*entityType == 9000) {
|
|
if ((room->_roomType == 3) &&
|
|
(bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsNextStageAvailable(), bVar2 == 0)) {
|
|
LAB_007ec9c4:
|
|
curGame = g_game;
|
|
*entityType = 0x238c;
|
|
*GHIDRA_CAST<uint16_t *>((entityType + 1)) = 3;
|
|
goto LAB_007ec9e6;
|
|
}
|
|
if ((*entityType == 9000) &&
|
|
((room->_roomType == 0xf ||
|
|
((((room->_roomType == 3 && ((uVar3 == 8 || (uVar3 == 9)))) &&
|
|
(((uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2), uVar6 == 0 && (local_32 != '\0')) ||
|
|
(local_31 != '\0')))) ||
|
|
(((9 < GHIDRA_INT(uVar3) && (local_30 != GHIDRA_CAST<uint16_t *>(0x0))) || (g_game->_currentRoomIdx == -0xc))
|
|
)))))) {
|
|
bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsNextStageAvailable();
|
|
if (bVar2 == 0) goto LAB_007ec9c4;
|
|
bVar2 = Level::IsStageWithinEnd(10,1);
|
|
if (bVar2 != 0) goto LAB_007ec98c;
|
|
}
|
|
}
|
|
LAB_007ec9e3:
|
|
curGame = g_game;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007ec98c:
|
|
curGame = g_game;
|
|
*entityType = 999;
|
|
*GHIDRA_CAST<uint16_t *>((entityType + 1)) = 0x27;
|
|
}
|
|
LAB_007ec9e6:
|
|
puVar13 = GHIDRA_CAST<uint16_t *>((entityType + 1));
|
|
if (((room->_roomType == 4) && ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) >> 0xb & 1) != 0)) &&
|
|
((*entityType == 5 && ((*puVar13 == 100 && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(entityType) + 6)) == 0)))))) {
|
|
*puVar13 = 0x96;
|
|
}
|
|
if (*entityType == 6) {
|
|
slotRng._seed = local_58;
|
|
slotRng._shift3 = 0xd;
|
|
slotRng._shift1 = 0xb;
|
|
slotRng._shift2 = 0x11;
|
|
if (*puVar13 == 6) {
|
|
if ((((g_manager->_persistentGameData)._achievements[0x260] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (curGame != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((curGame->_dailyChallenge)._id != 0 || (curGame->_isDebug != 0)))))) &&
|
|
(0 < curGame->_devilRoomDeals)) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&slotRng)))->RNG::RandomInt(4);
|
|
if (uVar6 == 0) {
|
|
uVar7 = 0xf;
|
|
goto LAB_007ecad2;
|
|
}
|
|
goto LAB_007ecad5;
|
|
}
|
|
}
|
|
else if ((*puVar13 == 4) &&
|
|
(((g_manager->_persistentGameData)._achievements[0x266] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (curGame != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((curGame->_dailyChallenge)._id != 0 || (curGame->_isDebug != 0)))))))) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&slotRng)))->RNG::RandomInt(0xf);
|
|
if (uVar6 == 0) {
|
|
uVar7 = 0x12;
|
|
LAB_007ecad2:
|
|
*puVar13 = uVar7;
|
|
}
|
|
LAB_007ecad5:
|
|
curGame = g_game;
|
|
}
|
|
}
|
|
if (*entityType - 1U < 999) {
|
|
local_54 = GHIDRA_CAST<int *>(GHIDRA_UINT(*puVar13));
|
|
Entity_NPC::Redirect(entityType,GHIDRA_CAST<int *>(&local_54));
|
|
curGame = g_game;
|
|
*puVar13 = (uint16_t)local_54;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) == 0) ||
|
|
(iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x10)), iVar4 == 0)) {
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
bVar2 = (uint8_t)*GHIDRA_CAST<uint32_t *>((iVar4 + 0x4c)) & 1;
|
|
}
|
|
if (bVar2 != 0) {
|
|
return;
|
|
}
|
|
if (room->_roomType == 0x1b) {
|
|
return;
|
|
}
|
|
local_30 = GHIDRA_CAST<uint16_t *>(curGame->_stageType);
|
|
if ((((uVar3 != 3) && (uVar3 != 4)) || (local_30 == GHIDRA_CAST<uint16_t *>(0x4))) ||
|
|
(local_33 = '\x01', local_30 == GHIDRA_CAST<uint16_t *>(0x5))) {
|
|
local_33 = '\0';
|
|
}
|
|
if ((local_30 == GHIDRA_CAST<uint16_t *>(0x2)) && ((uVar3 == 1 || (uVar3 == 2)))) {
|
|
uVar9 = 0x100;
|
|
isBurningBasement = '\x01';
|
|
LAB_007ecb70:
|
|
if ((uVar3 != 3) && (uVar3 != 4)) goto LAB_007ecb80;
|
|
isFloodedCaves = '\x01';
|
|
LAB_007ecb89:
|
|
if ((uVar3 != 5) && (uVar3 != 6)) goto LAB_007ecb99;
|
|
local_31 = '\x01';
|
|
LAB_007ecba2:
|
|
if ((uVar3 != 7) && (uVar3 != 8)) goto LAB_007ecbb2;
|
|
isScarredWomb = '\x01';
|
|
}
|
|
else {
|
|
uVar9 = 0;
|
|
isBurningBasement = '\0';
|
|
if (local_30 == GHIDRA_CAST<uint16_t *>(0x2)) goto LAB_007ecb70;
|
|
LAB_007ecb80:
|
|
isFloodedCaves = '\0';
|
|
if (local_30 == GHIDRA_CAST<uint16_t *>(0x2)) goto LAB_007ecb89;
|
|
LAB_007ecb99:
|
|
local_31 = '\0';
|
|
if (local_30 == GHIDRA_CAST<uint16_t *>(0x2)) goto LAB_007ecba2;
|
|
LAB_007ecbb2:
|
|
isScarredWomb = '\0';
|
|
}
|
|
if (((g_manager->_persistentGameData)._achievements[0x15c] == 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 ||
|
|
(((curGame->_dailyChallenge)._id == 0 && (curGame->_isDebug == 0)))))) {
|
|
sVar8 = (short)(GHIDRA_UINT(uVar9) >> 8) << 8;
|
|
}
|
|
else {
|
|
sVar8 = (short)CONCAT31((int3)(GHIDRA_UINT(uVar9) >> 8),1);
|
|
}
|
|
iVar4 = *entityType;
|
|
local_32 = (char)sVar8;
|
|
if (0x12e < iVar4) goto switchD_007ecc0d_caseD_b;
|
|
if (iVar4 == 0x12e) {
|
|
if ((curGame->_dailyChallenge)._specialDailyId != 7) {
|
|
if (curGame->_challenge != 0x20) goto switchD_007ecc0d_caseD_b;
|
|
}
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
if (uVar6 == 0) {
|
|
*puVar13 = 10;
|
|
return;
|
|
}
|
|
goto switchD_007ecc0d_caseD_b;
|
|
}
|
|
cVar12 = (char)((uint16_t)sVar8 >> 8);
|
|
switch(iVar4) {
|
|
case 10:
|
|
goto LAB_007ecc16;
|
|
case 0xc:
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x3c);
|
|
if (uVar6 == 0) {
|
|
*entityType = 0x32c;
|
|
*puVar13 = 0;
|
|
return;
|
|
}
|
|
break;
|
|
case 0x16:
|
|
bVar14 = isFloodedCaves == '\0';
|
|
goto LAB_007ecc9f;
|
|
case 0x17:
|
|
if ((isFloodedCaves != '\0') && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2), uVar6 == 0)) {
|
|
*entityType = 0x17;
|
|
*puVar13 = 1;
|
|
return;
|
|
}
|
|
break;
|
|
case 0x18:
|
|
cVar12 = local_31;
|
|
goto LAB_007eccd6;
|
|
case 0x19:
|
|
cVar12 = isFloodedCaves;
|
|
LAB_007eccd6:
|
|
if (cVar12 != '\0') {
|
|
uVar6 = 2;
|
|
LAB_007eccde:
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(uVar6);
|
|
if (uVar6 == 0) goto LAB_007ecc2f;
|
|
}
|
|
break;
|
|
case 0x1b:
|
|
if (((local_33 != '\0') && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5), uVar6 == 0)) && (local_32 != '\0'))
|
|
{
|
|
*entityType = 300;
|
|
*puVar13 = 0;
|
|
return;
|
|
}
|
|
break;
|
|
case 0x1d:
|
|
if (((*puVar13 == 0) && (cVar12 != '\0')) && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5), uVar6 < 3)) {
|
|
*entityType = 0x36;
|
|
*puVar13 = 0;
|
|
return;
|
|
}
|
|
break;
|
|
case 0x23:
|
|
uVar6 = 0xf;
|
|
goto LAB_007eccde;
|
|
case 0x27:
|
|
if (((*puVar13 != 2) && (isScarredWomb != '\0')) && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2), uVar6 == 0)
|
|
) {
|
|
*puVar13 = 3;
|
|
return;
|
|
}
|
|
break;
|
|
case 0x28:
|
|
case 0x3a:
|
|
bVar14 = isScarredWomb == '\0';
|
|
goto LAB_007ecc9f;
|
|
case 0x29:
|
|
if (*puVar13 == 0) {
|
|
uVar6 = 0x3c;
|
|
goto LAB_007eccde;
|
|
}
|
|
break;
|
|
case 0x55:
|
|
if (((local_30 == GHIDRA_CAST<uint16_t *>(0x4)) || (local_30 == GHIDRA_CAST<uint16_t *>(0x5))) &&
|
|
((uVar3 == 1 || (uVar3 == 2)))) {
|
|
*entityType = 0x32e;
|
|
*puVar13 = 0;
|
|
return;
|
|
}
|
|
goto LAB_007ecf5d;
|
|
case 0xd0:
|
|
if (((local_32 != '\0') && (*puVar13 == 1)) && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(10), uVar6 == 0)) {
|
|
*entityType = 0x12e;
|
|
*puVar13 = 0;
|
|
return;
|
|
}
|
|
cVar12 = isBurningBasement;
|
|
LAB_007ecc16:
|
|
if (cVar12 != '\0') {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
bVar14 = uVar6 < 3;
|
|
LAB_007ecc29:
|
|
if (bVar14) {
|
|
LAB_007ecc2f:
|
|
*puVar13 = 2;
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
case 0xd4:
|
|
case 0xdc:
|
|
bVar14 = local_31 == '\0';
|
|
LAB_007ecc9f:
|
|
if (!bVar14) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2);
|
|
if (uVar6 == 0) {
|
|
LAB_007eccb7:
|
|
*puVar13 = 1;
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
case 0xe2:
|
|
if (cVar12 == '\0') break;
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
bVar14 = uVar6 < 2;
|
|
goto LAB_007ecc29;
|
|
case 0xe7:
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
if (uVar6 == 0) {
|
|
if (local_32 != '\0') {
|
|
local_58 = gridIndex / GHIDRA_UINT(room->_gridWidth);
|
|
gridX = gridIndex % GHIDRA_UINT(room->_gridWidth);
|
|
local_54 = room->_doorGridPositions;
|
|
uVar3 = 0;
|
|
do {
|
|
puVar13 = variantPtr;
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x18 + (uVar3 >> 5) * 4)) &
|
|
1 << ((uint8_t)uVar3 & 0x1f)) != 0) &&
|
|
(uVar6 = *local_54 / room->_gridWidth - local_58,
|
|
uVar5 = *local_54 % room->_gridWidth - gridX, uVar10 = GHIDRA_INT(uVar6) >> 0x1f,
|
|
uVar11 = GHIDRA_INT(uVar5) >> 0x1f,
|
|
GHIDRA_INT((((uVar6 ^ uVar10) - uVar10) + ((uVar5 ^ uVar11) - uVar11))) < 4)) {
|
|
entityType = entryPtr;
|
|
uVar3 = local_40;
|
|
goto switchD_007ecc0d_caseD_b;
|
|
}
|
|
uVar3 = uVar3 + 1;
|
|
local_54 = local_54 + 1;
|
|
} while (GHIDRA_INT(uVar3) < 8);
|
|
goto LAB_007eccb7;
|
|
}
|
|
}
|
|
}
|
|
switchD_007ecc0d_caseD_b:
|
|
LAB_007ecf5d:
|
|
local_32 = '\0';
|
|
local_33 = '\0';
|
|
local_31 = '\0';
|
|
if (*puVar13 == 0) {
|
|
switch(*entityType) {
|
|
case 0xe:
|
|
case 0x10:
|
|
case 0x18:
|
|
case 0x1a:
|
|
case 0x1b:
|
|
switchD_007ecf80_caseD_e:
|
|
local_32 = '\x01';
|
|
break;
|
|
case 0x19:
|
|
if (2 < GHIDRA_INT(uVar3)) goto switchD_007ecf80_caseD_e;
|
|
break;
|
|
case 0x1d:
|
|
case 0x1e:
|
|
case 0x26:
|
|
case 0x2a:
|
|
case 0x39:
|
|
case 0x3d:
|
|
case 0x58:
|
|
local_31 = '\x01';
|
|
break;
|
|
case 0x27:
|
|
if (((uVar3 == 7) || (uVar3 == 8)) && (local_30 == GHIDRA_CAST<uint16_t *>(0x1))) {
|
|
local_31 = '\x01';
|
|
}
|
|
break;
|
|
case 0x29:
|
|
case 0x37:
|
|
case 0x3c:
|
|
local_33 = '\x01';
|
|
}
|
|
}
|
|
switch(*entityType) {
|
|
case 0xf:
|
|
case 0x10:
|
|
case 0x1a:
|
|
case 0x1e:
|
|
case 0x27:
|
|
case 0x37:
|
|
case 0x58:
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(100);
|
|
if (uVar3 == 0) {
|
|
*puVar13 = 2;
|
|
}
|
|
}
|
|
if (local_33 == '\0') {
|
|
if ((local_32 == '\0') && (local_31 == '\0')) goto LAB_007ed028;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x15);
|
|
if (uVar3 != 0) goto LAB_007ecffe;
|
|
}
|
|
else {
|
|
LAB_007ecffe:
|
|
if (((local_31 != '\0') || (uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x19), uVar3 != 0)) &&
|
|
(uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(100), uVar3 != 0)) goto LAB_007ed028;
|
|
}
|
|
*puVar13 = 1;
|
|
LAB_007ed028:
|
|
if (((*entityType == 0x19) && (*puVar13 == 3)) && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(entityType) + 6)) == 100)) {
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2);
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(entityType) + 6)) = (short)uVar3;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007ed2a0
|
|
uint8_t Room::IsPersistentRoomEntity(int type, int variant, int subType)
|
|
{
|
|
if ((((type != 0x2a) && (type != 0xeb)) && (type != 0xec)) && ((type != 0xca && (type != 0xcb))))
|
|
{
|
|
if (type == 0x2c) {
|
|
if (variant == 0) {
|
|
return 0;
|
|
}
|
|
}
|
|
else if ((((type != 0xda) && (type != 0x324)) &&
|
|
((type != 0x329 && (((type != 0x36d && (type != 0x37d)) && (type != 0x354)))))) &&
|
|
(type != 0x3c5)) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007ed310
|
|
uint8_t Room::SpawnEntry(uint32_t gridIndex, void *entry, uint32_t seed, Entity **outEntity, uint8_t isRespawn)
|
|
{
|
|
Room *gridEntity = this;
|
|
int *piVar1;
|
|
code *pcVar2;
|
|
uint8_t bVar3;
|
|
uint16_t newVariant;
|
|
uint32_t uVar4;
|
|
int iVar5;
|
|
Entity_Player *itemOwner;
|
|
void *extraout_EAX;
|
|
void *state;
|
|
int iVar6;
|
|
uint32_t local_EAX_3229;
|
|
Entity *pEVar7;
|
|
GridEntity *gridEntity;
|
|
uint8_t unused;
|
|
uint8_t unused_00;
|
|
Manager *extraout_ECX;
|
|
Manager *extraout_ECX_00;
|
|
Manager *extraout_ECX_01;
|
|
Manager *pMVar8;
|
|
int extraout_ECX_02;
|
|
int extraout_ECX_03;
|
|
uint32_t extraout_EDX;
|
|
Room *pRVar9;
|
|
Game *game;
|
|
Entity **gridVariant;
|
|
float fVar10;
|
|
float fVar11;
|
|
float fVar12;
|
|
float fVar13;
|
|
EntityRef entityRef;
|
|
float ellipseCenterX;
|
|
Vector local_7c;
|
|
Vector local_74;
|
|
PlayerManager *local_6c;
|
|
RNG tmpRng;
|
|
float local_58;
|
|
uint32_t local_54;
|
|
RNG rng;
|
|
float local_40;
|
|
float local_3c;
|
|
float gridIndexLocal;
|
|
uint8_t local_31;
|
|
Entity *local_30;
|
|
Entity **local_2c;
|
|
Manager *local_28;
|
|
Room *room;
|
|
uint64_t entryLocal;
|
|
uint32_t entryWeight;
|
|
uint32_t local_14;
|
|
bool isUnlocked;
|
|
short *poopCount;
|
|
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
local_2c = outEntity;
|
|
rng._shift1 = 5;
|
|
rng._shift2 = 9;
|
|
entryLocal = *GHIDRA_CAST<uint64_t *>(entry);
|
|
entryWeight = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(entry) + 8));
|
|
local_30 = GHIDRA_CAST<Entity *>(seed);
|
|
rng._seed = seed;
|
|
local_28 = GHIDRA_CAST<Manager *>(&DAT_00000007);
|
|
rng._shift3 = GHIDRA_INT(&DAT_00000007);
|
|
gridIndexLocal = (float)gridIndex;
|
|
local_54 = seed;
|
|
room = gridEntity;
|
|
TransformEntry(gridEntity,&entryLocal,gridIndex,seed);
|
|
if (((g_game->_currentRoomIdx == -0xc) && (GHIDRA_UINT(entryLocal) == 5)) && ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 100))
|
|
goto LAB_007ed567;
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasMirrorDimension();
|
|
if ((((bVar3 != 0) && (isRespawn == 0)) &&
|
|
((g_game->_currentDimensionIdx == 1 && (GHIDRA_UINT(entryLocal) == 5)))) &&
|
|
((iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x10)), *GHIDRA_CAST<int *>((iVar5 + 8)) != 4 ||
|
|
(*GHIDRA_CAST<int *>((iVar5 + 0x10)) != 0x22)))) goto LAB_007ed567;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4))));
|
|
if ((iVar5 == 0) || (*GHIDRA_CAST<int *>((iVar5 + 0x10)) == 0)) {
|
|
bVar3 = 0;
|
|
}
|
|
else {
|
|
bVar3 = (uint8_t)(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar5 + 0x10)) + 0x4c)) >> 3) & 1;
|
|
}
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
if (bVar3 != 0) {
|
|
if (GHIDRA_UINT(entryLocal) == 1000) {
|
|
if ((float)room->_tintedRockIdx != gridIndexLocal) goto LAB_007ed444;
|
|
}
|
|
else if ((GHIDRA_UINT(entryLocal) == 0x3e9) || (GHIDRA_UINT(entryLocal) == 0x3ea)) {
|
|
LAB_007ed444:
|
|
if ((g_game->_stageType == 2) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 0x10)) + 8)) == 1)) {
|
|
if (local_54 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_30) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_30);
|
|
uVar4 = uVar4 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar4;
|
|
rng._seed = uVar4 >> ((uint8_t)local_28 & 0x1f) ^ uVar4;
|
|
local_30 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
if (GHIDRA_UINT(rng._seed) % 10 == 0) {
|
|
iVar5 = g_game->_stage;
|
|
if ((iVar5 == 1) || (iVar5 == 2)) {
|
|
entryLocal = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))),0x21);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x28);
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
entryLocal = (uint64_t)CONCAT14(uVar4 == 0,GHIDRA_UINT(entryLocal));
|
|
local_28 = GHIDRA_CAST<Manager *>(rng._shift3);
|
|
local_30 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
}
|
|
else if ((iVar5 == 3) || (iVar5 == 4)) {
|
|
entryLocal = 3000;
|
|
iVar6 = 3000;
|
|
}
|
|
else if ((iVar5 == 5) || (iVar5 == 6)) {
|
|
entryLocal = 0x78a;
|
|
iVar6 = 0x78a;
|
|
}
|
|
else if ((iVar5 == 7) || (iVar5 == 8)) {
|
|
entryLocal = 0x5d2;
|
|
iVar6 = 0x5d2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pMVar8 = GHIDRA_CAST<Manager *>(room);
|
|
if (((room->_roomType == 2) && (**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) < 0)) && (iVar6 == 6)) {
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 8) goto LAB_007ed567;
|
|
LAB_007ed9e7:
|
|
bVar3 = *GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44));
|
|
local_54 = CONCAT31((int3)(GHIDRA_UINT(pMVar8) >> 8),bVar3) & 0xffffff01;
|
|
if ((((bVar3 & 1) == 0) && (room->_roomType == 5)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) & 0x10000) != 0)) {
|
|
local_54 = GHIDRA_UINT((iVar6 != 0x38f));
|
|
}
|
|
if (iVar6 == 5) {
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
if (bVar3 != 0) goto LAB_007ed567;
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
}
|
|
game = g_game;
|
|
if ((iVar6 == 0x3c5) && ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) >> 2 & 1) != 0))
|
|
goto LAB_007ed567;
|
|
if ((char)local_54 != '\0') {
|
|
bVar3 = IsPersistentRoomEntity(iVar6,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),local_54);
|
|
if (((bVar3 == 0) && (bVar3 = (GHIDRA_CAST<Game *>((game)))->Game::IsInTimedSet(0x19), bVar3 == 0)) &&
|
|
((bVar3 = (GHIDRA_CAST<Game *>((game)))->Game::IsInTimedSet(0x20), bVar3 == 0 && (isRespawn == 0)))) {
|
|
bVar3 = entity_type_is_saved(iVar6,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x6))),0,1);
|
|
if (bVar3 == 0) goto LAB_007ed567;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<EntityRef *>((&entityRef)))->EntityRef::EntityRef();
|
|
pRVar9 = room;
|
|
fVar13 = gridIndexLocal;
|
|
if ((GHIDRA_UINT(gridIndexLocal) < 0x1c0) && (room->_gridEntities[GHIDRA_INT(gridIndexLocal)] != GHIDRA_CAST<int *>(0x0)))
|
|
{
|
|
(**(code **)(*GHIDRA_CAST<int *>(room->_gridEntities[GHIDRA_INT(gridIndexLocal)]) + 0x14))(1);
|
|
}
|
|
local_74.x = (float)(GHIDRA_INT(fVar13) % pRVar9->_gridWidth) * 40.0 + 40.0;
|
|
local_74.y = (float)(GHIDRA_INT(fVar13) / pRVar9->_gridWidth) * 40.0 + 120.0;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
local_30 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(entryLocal),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),&local_74,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x6))),uVar4);
|
|
local_30->_spawnGridIndex = GHIDRA_INT(fVar13);
|
|
if (local_30->_type == 5) {
|
|
iVar5 = __RTDynamicCast(local_30,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor);
|
|
if (iVar5 != 0) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar5 + 0x544)) = 0;
|
|
if (((*GHIDRA_CAST<int *>((iVar5 + 0x28)) == 5) && (*GHIDRA_CAST<int *>((iVar5 + 0x2c)) == 100)) &&
|
|
((*GHIDRA_CAST<int *>((iVar5 + 0x30)) == 0x272 || (*GHIDRA_CAST<int *>((iVar5 + 0x30)) == 0x273)))) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar5 + 0x5c0)) = 0;
|
|
}
|
|
itemOwner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x2c7,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) && (*GHIDRA_CAST<char *>((iVar5 + 0x173)) == '\0')) {
|
|
bVar3 = Entity_Pickup::CanRerollVariant(*GHIDRA_CAST<int *>((iVar5 + 0x2c)),*GHIDRA_CAST<int *>((iVar5 + 0x30)));
|
|
if ((bVar3 != 0) &&
|
|
(((bVar3 = Entity_Pickup::IsChest(*GHIDRA_CAST<int *>((iVar5 + 0x2c))), bVar3 == 0 ||
|
|
(*GHIDRA_CAST<int *>((iVar5 + 0x30)) != 0)) && (extraout_ECX_02 == 100)))) {
|
|
local_7c.y = (float)operator_new(0x78);
|
|
if (GHIDRA_CAST<EntitySaveState *>(local_7c.y) == GHIDRA_CAST<EntitySaveState *>(0x0)) {
|
|
state = (void *)0x0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((GHIDRA_CAST<EntitySaveState *>(local_7c.y))))->EntitySaveState::constructor();
|
|
state = extraout_EAX;
|
|
}
|
|
piVar1 = GHIDRA_CAST<int *>((iVar5 + 0x5c8));
|
|
(GHIDRA_CAST<EntitySaveStateRef *>((piVar1)))->EntitySaveStateRef::Set(state);
|
|
tmpRng._shift1 = 5;
|
|
tmpRng._shift2 = 0xf;
|
|
*GHIDRA_CAST<uint32_t *>(*piVar1) = *GHIDRA_CAST<uint32_t *>((iVar5 + 0x28));
|
|
*GHIDRA_CAST<uint32_t *>((*piVar1 + 4)) = *GHIDRA_CAST<uint32_t *>((iVar5 + 0x2c));
|
|
tmpRng._seed = *GHIDRA_CAST<int *>((iVar5 + 0x3ec));
|
|
tmpRng._shift3 = 0x11;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::Next();
|
|
*GHIDRA_CAST<uint32_t *>((*piVar1 + 0x34)) = uVar4;
|
|
iVar6 = ItemPool::GetSeededCollectible
|
|
(*GHIDRA_CAST<uint32_t *>((*piVar1 + 0x34)),1,
|
|
*GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(g_game->_room) + 4)));
|
|
*GHIDRA_CAST<int *>((*piVar1 + 8)) = iVar6;
|
|
pRVar9 = room;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar5 + 0x5d0)))))->ANM2::Reset();
|
|
}
|
|
fVar13 = gridIndexLocal;
|
|
}
|
|
bVar3 = entity_type_is_saved(GHIDRA_UINT(entryLocal),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x6))),0,0)
|
|
;
|
|
if (bVar3 != 0) {
|
|
local_3c = fVar13;
|
|
msvc::set<int>::insert(&local_7c,&local_3c);
|
|
}
|
|
iVar5 = pRVar9->_roomType;
|
|
if (iVar5 == 0x11) {
|
|
LAB_007edd85:
|
|
if ((GHIDRA_UINT(entryLocal) == 5) && (((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 100 && (local_30->_type == 5)))) {
|
|
local_30[1]._sprite._color._offset[2] = 1.4013e-45;
|
|
}
|
|
}
|
|
else if (iVar5 == 4) {
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRVar9)) + 0x4)))) + 0x10)) + 0x10));
|
|
if (((iVar5 == 1) || (iVar5 == 3)) || (bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsAltPath(), bVar3 != 0))
|
|
goto LAB_007edd85;
|
|
}
|
|
else if ((iVar5 == 0x18) || (iVar5 == 0xf)) goto LAB_007edd85;
|
|
pEVar7 = local_30;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] "));
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawn Entity with Type(%d), Variant(%d), Pos(%.2f,%.2f)\n"));
|
|
if (local_2c != GHIDRA_CAST<Entity **>(0x0)) {
|
|
*local_2c = pEVar7;
|
|
return 1;
|
|
}
|
|
goto LAB_007ee699;
|
|
}
|
|
if (iVar6 == 1000) {
|
|
if ((float)room->_tintedRockIdx != gridIndexLocal) goto LAB_007ed5aa;
|
|
goto LAB_007ed926;
|
|
}
|
|
if ((iVar6 == 0x3e9) || (iVar6 == 0x3ea)) {
|
|
LAB_007ed5aa:
|
|
if (room->_roomType != 0x10) {
|
|
local_3c = 2.66247e-44;
|
|
local_6c = &g_game->_playerManager;
|
|
tmpRng._shift1 = 1;
|
|
tmpRng._shift2 = 5;
|
|
if (local_54 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = local_54 >> 1 ^ local_54;
|
|
uVar4 = uVar4 << 5 ^ uVar4;
|
|
uVar4 = uVar4 >> 0x13 ^ uVar4;
|
|
itemOwner = (GHIDRA_CAST<PlayerManager *>((local_6c)))->PlayerManager::RandomCollectibleOwner(0x240,uVar4,GHIDRA_CAST<RNG **>(0x0));
|
|
pMVar8 = extraout_ECX;
|
|
if (itemOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_3c = itemOwner->_luck * 0.005 + 0.0625;
|
|
if (0.1 <= local_3c) {
|
|
local_3c = 0.1;
|
|
}
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)tmpRng._shift1 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((uint8_t)tmpRng._shift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> 0x13 ^ uVar4;
|
|
pMVar8 = GHIDRA_CAST<Manager *>(0x0);
|
|
if ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 <= local_3c) {
|
|
iVar6 = 0x5dc;
|
|
entryLocal = 0x5dc;
|
|
goto LAB_007ed926;
|
|
}
|
|
}
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
}
|
|
}
|
|
if (iVar6 == 0x514) {
|
|
if (local_30 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_30) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_30);
|
|
uVar4 = uVar4 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar4;
|
|
rng._seed = uVar4 >> ((uint8_t)local_28 & 0x1f) ^ uVar4;
|
|
pMVar8 = GHIDRA_CAST<Manager *>(((GHIDRA_UINT(rng._seed) / 10) * 10));
|
|
local_30 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
if (GHIDRA_UINT(rng._seed) % 10 != 0) goto LAB_007ed72b;
|
|
iVar6 = 0x124;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) = 0;
|
|
LAB_007ed9e4:
|
|
entryLocal = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))),iVar6);
|
|
goto LAB_007ed9e7;
|
|
}
|
|
LAB_007ed72b:
|
|
if (iVar6 != 9000) {
|
|
if (iVar6 != 999) goto LAB_007ed79c;
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 0x27) goto LAB_007ed746;
|
|
LAB_007ed9df:
|
|
iVar6 = 1000;
|
|
goto LAB_007ed9e4;
|
|
}
|
|
LAB_007ed746:
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsNextStageAvailable();
|
|
if ((((bVar3 == 0) && (iVar5 = room->_roomType, iVar5 != 3)) &&
|
|
((iVar5 != 0x1b && (g_game->_currentRoomIdx != -0xc)))) &&
|
|
((iVar5 != 5 || (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x10)) + 0x10)) != 0x58)))) {
|
|
iVar6 = 0x794;
|
|
entryLocal = 0x794;
|
|
pMVar8 = extraout_ECX_00;
|
|
goto LAB_007ed926;
|
|
}
|
|
pMVar8 = extraout_ECX_00;
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
LAB_007ed79c:
|
|
if (iVar6 == 9000) {
|
|
LAB_007ed7b7:
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasMirrorDimension();
|
|
if ((bVar3 != 0) && (g_game->_currentDimensionIdx == 1)) {
|
|
iVar6 = 0;
|
|
entryLocal = 0;
|
|
pMVar8 = extraout_ECX_01;
|
|
goto LAB_007ed926;
|
|
}
|
|
pMVar8 = extraout_ECX_01;
|
|
iVar6 = GHIDRA_UINT(entryLocal);
|
|
}
|
|
else if (iVar6 == 999) {
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) != 0x27) goto LAB_007ed9df;
|
|
goto LAB_007ed7b7;
|
|
}
|
|
if (iVar6 == 0x11) {
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 0) {
|
|
if (local_30 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_30) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_30);
|
|
uVar4 = uVar4 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar4;
|
|
rng._seed = uVar4 >> ((uint8_t)local_28 & 0x1f) ^ uVar4;
|
|
pMVar8 = local_28;
|
|
local_30 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
if (((rng._seed & 3U) != 0) ||
|
|
((pMVar8 = g_manager, (g_manager->_persistentGameData)._achievements[0xf7] == 0 &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))))) goto LAB_007ed870;
|
|
newVariant = 3;
|
|
LAB_007ed8ea:
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x0))) = CONCAT24(newVariant,GHIDRA_UINT(entryLocal));
|
|
rng._seed = GHIDRA_INT(local_30);
|
|
}
|
|
else {
|
|
LAB_007ed870:
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4))) == 1) {
|
|
if (local_30 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_30) >> ((uint8_t)rng._shift1 & 0x1f) ^ GHIDRA_UINT(local_30);
|
|
uVar4 = uVar4 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar4;
|
|
rng._seed = uVar4 >> ((uint8_t)local_28 & 0x1f) ^ uVar4;
|
|
pMVar8 = local_28;
|
|
local_30 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
if (((rng._seed & 3U) == 0) &&
|
|
(((g_manager->_persistentGameData)._achievements[0xf3] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
newVariant = 4;
|
|
goto LAB_007ed8ea;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (iVar6 == 5000) {
|
|
if ((**GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_bossPool))) + 0x8ac)))) & 0x1000000) != 0) {
|
|
iVar6 = 1000;
|
|
entryLocal = 0x10000000003e8;
|
|
}
|
|
LAB_007ed926:
|
|
if (isRespawn != 0) goto LAB_007ed567;
|
|
}
|
|
else if ((iVar6 < 1) || (999 < iVar6)) goto LAB_007ed926;
|
|
game = g_game;
|
|
if (iVar6 == 0x3ca) goto LAB_007ee699;
|
|
if (iVar6 == 0x3c9) {
|
|
uVar4 = GHIDRA_UINT(gridIndexLocal) / GHIDRA_UINT(room->_gridWidth);
|
|
local_EAX_3229 = GHIDRA_UINT(gridIndexLocal) % GHIDRA_UINT(room->_gridWidth);
|
|
add_trigger_output_cell(room,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),local_EAX_3229 - 1,uVar4);
|
|
add_trigger_output_cell(room,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),local_EAX_3229 + 1,uVar4);
|
|
add_trigger_output_cell(room,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),local_EAX_3229,uVar4 - 1);
|
|
add_trigger_output_cell(room,(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x4))),local_EAX_3229,uVar4 + 1);
|
|
return 1;
|
|
}
|
|
if (iVar6 == 6000) {
|
|
(room->_railManager)._sprite._filename._buf[GHIDRA_INT(gridIndexLocal) + -0x1c0] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4)));
|
|
return 1;
|
|
}
|
|
if ((0 < iVar6) && (iVar6 < 1000)) {
|
|
if (iVar6 != 999) goto LAB_007ed9e7;
|
|
goto LAB_007ed9df;
|
|
}
|
|
if (iVar6 == 0x1771) {
|
|
iVar6 = 3000;
|
|
(room->_railManager)._sprite._filename._buf[GHIDRA_INT(gridIndexLocal) + -0x1c0] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x4)));
|
|
entryLocal = CONCAT26((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x6))),3000);
|
|
}
|
|
if (room->_gridEntities[GHIDRA_INT(gridIndexLocal)] != (void *)0x0) goto LAB_007ed567;
|
|
local_2c = (*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity **>(GHIDRA_UINT(entryLocal)))) + 0x4)));
|
|
local_6c = GHIDRA_CAST<PlayerManager *>(0x0);
|
|
local_31 = has_room_config_flag(room,2);
|
|
local_3c = 2.8026e-45;
|
|
pRVar9 = room;
|
|
if (iVar6 < 0x515) {
|
|
if (iVar6 == 0x514) {
|
|
iVar5 = 0xc;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xc);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
goto LAB_007ee65c;
|
|
}
|
|
switch(iVar6) {
|
|
case 1000:
|
|
if ((local_31 != 0) || ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x6))) != 0)) {
|
|
iVar5 = 2;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x2);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
}
|
|
if (((g_manager->_persistentGameData)._achievements[0x264] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) {
|
|
tmpRng._shift1 = 3;
|
|
tmpRng._shift2 = 3;
|
|
tmpRng._seed = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((extraout_ECX_03 + 4)) + 0x58));
|
|
tmpRng._shift3 = 0x1a;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomInt(10);
|
|
if (uVar4 == 0) {
|
|
local_74.y = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
pRVar9 = room;
|
|
local_30 = GHIDRA_CAST<Entity *>((float)room->_gridHeight);
|
|
local_74.y = local_74.y * (float)local_30;
|
|
ellipseCenterX = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
ellipseCenterX = ellipseCenterX * (float)pRVar9->_gridWidth;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x3fa00000);
|
|
local_30 = GHIDRA_CAST<Entity *>(0x3e99999a);
|
|
uVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(unused);
|
|
if ((uVar4 == 0x1d) || (uVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(unused_00), uVar4 == 0x1e)) {
|
|
local_28 = GHIDRA_CAST<Manager *>(0x3fe66666);
|
|
local_30 = GHIDRA_CAST<Entity *>(0x3f000000);
|
|
}
|
|
local_58 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
local_40 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
local_7c.y = (local_58 + local_40) * (float)local_30 + 0.3;
|
|
local_40 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
local_58 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
local_30 = GHIDRA_CAST<Entity *>(((local_40 + local_58) * (float)local_28 + 0.5));
|
|
fVar13 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomFloat();
|
|
uVar4 = pRVar9->_gridWidth;
|
|
local_EAX_3229 = GHIDRA_UINT(gridIndexLocal) / uVar4;
|
|
uVar4 = GHIDRA_UINT(gridIndexLocal) % uVar4;
|
|
local_40 = -(fVar13 * 360.0) * 0.017453292;
|
|
local_58 = cos(local_40);
|
|
fVar13 = sin(local_40);
|
|
fVar12 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) -
|
|
ellipseCenterX;
|
|
fVar10 = (float)((double)GHIDRA_INT(local_EAX_3229) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(local_EAX_3229) >> 0x1f)]) - local_74.y;
|
|
fVar11 = (fVar12 * local_58 - fVar13 * fVar10) / (float)local_30;
|
|
fVar13 = (fVar12 * fVar13 + local_58 * fVar10) / local_7c.y;
|
|
local_31 = fVar13 * fVar13 + fVar11 * fVar11 <= 1.0;
|
|
}
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x3e9);
|
|
pRVar9 = room;
|
|
if ((float)room->_tintedRockIdx == gridIndexLocal) {
|
|
local_28 = GHIDRA_CAST<Manager *>(0x4);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x14);
|
|
if ((uVar4 == 0) &&
|
|
(((g_manager->_persistentGameData)._achievements[0x143] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
iVar5 = 0x16;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x16);
|
|
}
|
|
else {
|
|
iVar5 = 4;
|
|
}
|
|
}
|
|
else {
|
|
if (9 < GHIDRA_INT(uVar4)) {
|
|
gridVariant = local_2c;
|
|
if (local_31 == 0) {
|
|
iVar5 = GHIDRA_UINT((GHIDRA_INT(uVar4) < 0x10)) * 4 + 2;
|
|
local_28 = GHIDRA_CAST<Manager *>(iVar5);
|
|
}
|
|
else {
|
|
iVar5 = 0x1b;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x1b);
|
|
}
|
|
break;
|
|
}
|
|
iVar5 = 5;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x5);
|
|
}
|
|
goto LAB_007ee659;
|
|
case 0x3e9:
|
|
iVar5 = 5;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x5);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x3ea:
|
|
iVar5 = 6;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x6);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x3eb:
|
|
iVar5 = 4;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x4);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x3ec:
|
|
iVar5 = 0x16;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x16);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
default:
|
|
goto switchD_007ede2a_caseD_3ed;
|
|
case 0x3f0:
|
|
iVar5 = 0x1a;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x1a);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x3f1:
|
|
iVar5 = 2;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x2);
|
|
gridVariant = GHIDRA_CAST<Entity **>(10000);
|
|
break;
|
|
case 0x3f2:
|
|
iVar5 = 0x19;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x19);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x3f3:
|
|
if (((g_manager->_persistentGameData)._achievements[0x264] == 0) &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 || (game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((game->_dailyChallenge)._id == 0 && (game->_isDebug == 0)))))) {
|
|
isUnlocked = false;
|
|
}
|
|
else {
|
|
isUnlocked = true;
|
|
}
|
|
iVar5 = 0x1b;
|
|
if (!isUnlocked) {
|
|
iVar5 = 2;
|
|
}
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
local_28 = GHIDRA_CAST<Manager *>(iVar5);
|
|
}
|
|
goto LAB_007ee65c;
|
|
}
|
|
if (0x76c < iVar6) {
|
|
if (4000 < iVar6) {
|
|
if (iVar6 < 0x17d5) {
|
|
if (iVar6 == 0x17d4) {
|
|
iVar5 = 0x17;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x17);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
else {
|
|
if (0x1389 < iVar6) {
|
|
if (iVar6 == 0x1771) goto switchD_007ee4c1_caseD_bb8;
|
|
goto switchD_007ede2a_caseD_3ed;
|
|
}
|
|
if (iVar6 == 0x1389) {
|
|
iVar5 = 0x15;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x15);
|
|
gridVariant = GHIDRA_CAST<Entity **>(1);
|
|
}
|
|
else if (iVar6 == 0x1194) {
|
|
iVar5 = 0x14;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x14);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
else {
|
|
if (iVar6 != 5000) goto switchD_007ede2a_caseD_3ed;
|
|
iVar5 = 0x15;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x15);
|
|
gridVariant = GHIDRA_CAST<Entity **>(0);
|
|
}
|
|
}
|
|
}
|
|
else if (iVar6 == 9000) {
|
|
iVar5 = 0x11;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x11);
|
|
gridVariant = GHIDRA_CAST<Entity **>(0);
|
|
local_6c = GHIDRA_CAST<PlayerManager *>(extraout_EDX);
|
|
}
|
|
else if (iVar6 == 0x238c) {
|
|
iVar5 = 0x12;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x12);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
else {
|
|
if (iVar6 != 10000) goto switchD_007ede2a_caseD_3ed;
|
|
iVar5 = 0x13;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x13);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
goto LAB_007ee65c;
|
|
}
|
|
if (iVar6 == 4000) {
|
|
iVar5 = 0xb;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xb);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
goto LAB_007ee65c;
|
|
}
|
|
if (iVar6 < 2000) {
|
|
if (iVar6 == 1999) {
|
|
iVar5 = 0xf;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xf);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
else {
|
|
switch(iVar6) {
|
|
case 0x76d:
|
|
iVar5 = 0x18;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x18);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
default:
|
|
goto switchD_007ede2a_caseD_3ed;
|
|
case 0x78a:
|
|
iVar5 = 8;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x8);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x78b:
|
|
iVar5 = 9;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x9);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0x794:
|
|
iVar5 = 10;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xa);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
}
|
|
}
|
|
goto LAB_007ee65c;
|
|
}
|
|
switch(iVar6) {
|
|
case 3000:
|
|
case 0xbba:
|
|
switchD_007ee4c1_caseD_bb8:
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
goto LAB_007ee5d9;
|
|
case 0xbb9:
|
|
local_28 = GHIDRA_CAST<Manager *>(0x7);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
local_7c.x = (float)(GHIDRA_INT(gridIndexLocal) % room->_gridWidth) * 40.0 + 40.0;
|
|
local_7c.y = (float)(GHIDRA_INT(gridIndexLocal) / room->_gridWidth) * 40.0 + 120.0;
|
|
pEVar7 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xc0,&local_7c,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entryLocal))) + 0x6))),uVar4);
|
|
pEVar7->Update();
|
|
iVar5 = 7;
|
|
piVar1 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x54));
|
|
*piVar1 = *piVar1 + 1;
|
|
pRVar9 = room;
|
|
gridVariant = local_2c;
|
|
break;
|
|
default:
|
|
switchD_007ede2a_caseD_3ed:
|
|
iVar5 = 1;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x1);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
break;
|
|
case 0xbc1:
|
|
gridVariant = GHIDRA_CAST<Entity **>(0x80);
|
|
LAB_007ee5d9:
|
|
iVar5 = 7;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x7);
|
|
piVar1 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x54));
|
|
*piVar1 = *piVar1 + 1;
|
|
}
|
|
goto LAB_007ee65c;
|
|
}
|
|
if (iVar6 == 0x76c) {
|
|
iVar5 = 3;
|
|
local_28 = GHIDRA_CAST<Manager *>(0x3);
|
|
gridVariant = GHIDRA_CAST<Entity **>(extraout_EDX);
|
|
goto LAB_007ee65c;
|
|
}
|
|
switch(iVar6) {
|
|
case 0x578:
|
|
iVar5 = 0xd;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xd);
|
|
gridVariant = GHIDRA_CAST<Entity **>(0);
|
|
goto LAB_007ee65c;
|
|
default:
|
|
goto switchD_007ede2a_caseD_3ed;
|
|
case 0x582:
|
|
iVar5 = 0xd;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xd);
|
|
gridVariant = GHIDRA_CAST<Entity **>(1);
|
|
goto LAB_007ee65c;
|
|
case 0x5d2:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x1);
|
|
break;
|
|
case 0x5d6:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x4);
|
|
break;
|
|
case 0x5d7:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x2);
|
|
break;
|
|
case 0x5d8:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x3);
|
|
break;
|
|
case 0x5d9:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x5);
|
|
break;
|
|
case 0x5da:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x6);
|
|
break;
|
|
case 0x5db:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x7);
|
|
break;
|
|
case 0x5dc:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x0);
|
|
break;
|
|
case 0x5dd:
|
|
local_2c = GHIDRA_CAST<Entity **>(0xb);
|
|
}
|
|
iVar5 = 0xe;
|
|
local_28 = GHIDRA_CAST<Manager *>(0xe);
|
|
if ((local_31 == 0) && ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x6))) == 0)) {
|
|
if (local_2c == GHIDRA_CAST<Entity **>(0x0)) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x28);
|
|
if (uVar4 == 0) {
|
|
local_2c = GHIDRA_CAST<Entity **>(0x2);
|
|
goto LAB_007ee333;
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(100);
|
|
if (uVar4 == 0) {
|
|
game = g_game;
|
|
pEVar7 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
if (((g_manager->_persistentGameData)._achievements[0x25d] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
local_2c = GHIDRA_CAST<Entity **>(0xb);
|
|
}
|
|
goto LAB_007ee378;
|
|
}
|
|
goto switchD_007ee34a_caseD_3;
|
|
}
|
|
if (local_2c == GHIDRA_CAST<Entity **>(0x2)) {
|
|
LAB_007ee333:
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(0x28);
|
|
switch(uVar4) {
|
|
case 1:
|
|
case 2:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x3);
|
|
default:
|
|
switchD_007ee34a_caseD_3:
|
|
pEVar7 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
game = g_game;
|
|
break;
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
local_2c = GHIDRA_CAST<Entity **>(0x4);
|
|
pEVar7 = GHIDRA_CAST<Entity *>(rng._seed);
|
|
game = g_game;
|
|
}
|
|
}
|
|
else {
|
|
pEVar7 = local_30;
|
|
}
|
|
LAB_007ee378:
|
|
itemOwner = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x5b);
|
|
if (itemOwner == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar5 = 0xe;
|
|
poopCount = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x50));
|
|
*poopCount = *poopCount + 1;
|
|
pRVar9 = room;
|
|
gridVariant = local_2c;
|
|
}
|
|
else {
|
|
tmpRng._shift3 = 0x19;
|
|
uVar4 = 0x21;
|
|
tmpRng._shift1 = 2;
|
|
tmpRng._shift2 = 7;
|
|
tmpRng._seed = GHIDRA_INT(pEVar7);
|
|
iVar5 = (GHIDRA_CAST<Entity_Player *>((itemOwner)))->Entity_Player::GetTrinketMultiplier(0x5b);
|
|
if (iVar5 == 2) {
|
|
uVar4 = 0x42;
|
|
}
|
|
else if (iVar5 == 3) {
|
|
uVar4 = 100;
|
|
}
|
|
local_EAX_3229 = (GHIDRA_CAST<RNG *>((&tmpRng)))->RNG::RandomInt(100);
|
|
gridVariant = local_2c;
|
|
if (local_EAX_3229 < uVar4) {
|
|
gridVariant = GHIDRA_CAST<Entity **>(0x5);
|
|
}
|
|
iVar5 = 0xe;
|
|
poopCount = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x50));
|
|
*poopCount = *poopCount + 1;
|
|
pRVar9 = room;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007ee659:
|
|
gridVariant = local_2c;
|
|
}
|
|
LAB_007ee65c:
|
|
gridEntity = Isaac::CreateGridEntity(iVar5,GHIDRA_UINT(gridIndexLocal));
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
LAB_007ed567:
|
|
bVar3 = 0;
|
|
}
|
|
else {
|
|
pRVar9->_gridEntities[GHIDRA_INT(gridIndexLocal)] = gridEntity;
|
|
*GHIDRA_CAST<Entity ***>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = gridVariant;
|
|
gridEntity->_varData = GHIDRA_INT(local_6c);
|
|
if (local_28 == GHIDRA_CAST<Manager *>(0x17)) {
|
|
fVar13 = 0.0;
|
|
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entryLocal)) + 0x6))) != 0) {
|
|
fVar13 = local_3c;
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xc)))) = fVar13;
|
|
}
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Init(local_54);
|
|
LAB_007ee699:
|
|
bVar3 = 1;
|
|
}
|
|
return bVar3;
|
|
}
|
|
|
|
// 007ee7e0
|
|
uint8_t Room::make_wall(int x, int y)
|
|
{
|
|
uint32_t uVar1;
|
|
GridEntity *gridEntity;
|
|
uint32_t Seed;
|
|
uint32_t uVar2;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int roomData;
|
|
int roomSubtype;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00ebb;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
uVar2 = this->_gridWidth * y + x;
|
|
if ((GHIDRA_INT(uVar2) < 0) || (this->_gridHeight * this->_gridWidth <= GHIDRA_INT(uVar2))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("make_wall index out of bounds\n"));
|
|
}
|
|
if (this->_gridEntities[uVar2] != (void *)0x0) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (this->_roomType == 0x10) {
|
|
roomData = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
roomSubtype = *GHIDRA_CAST<int *>((roomData + 0x10));
|
|
if ((roomSubtype != 2) && (roomSubtype != 3)) {
|
|
if (y == 0) {
|
|
if (x == 2) {
|
|
uVar1 = Random();
|
|
if ((GHIDRA_INT(uVar2) < 0) || (0x1bf < GHIDRA_INT(uVar2))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if (0x1bf < uVar2) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (900 < this->_gridPaths[uVar2]) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
gridEntity = operator_new(0x154);
|
|
local_8 = 0;
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(gridEntity) = IsaacRepentancePlus::GridEntity_Decoration::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) = 1;
|
|
gridEntity->_gridIndex = uVar2;
|
|
if (this->_gridEntities[uVar2] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[uVar2]))(1);
|
|
}
|
|
this->_gridEntities[uVar2] = gridEntity;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = 10;
|
|
gridEntity->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Init(uVar1);
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
}
|
|
else if ((((y == 3) || (y == 4)) && (x == 0xe)) && (*GHIDRA_CAST<int *>((roomData + 0xc)) == 1)) {
|
|
Seed = Random();
|
|
if (((GHIDRA_INT(uVar2) < 0) || (0x1bf < GHIDRA_INT(uVar2))) &&
|
|
((KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n")), GHIDRA_INT(uVar2) < 0
|
|
|| (0x1bf < GHIDRA_INT(uVar2))))) {
|
|
(**(code **)(iRam00000000 + 4))(uVar1);
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (this->_gridPaths[uVar2] < 0x385) {
|
|
gridEntity = operator_new(0x154);
|
|
local_8 = 0x29;
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(gridEntity) = IsaacRepentancePlus::GridEntity_Gravity::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) = 0x13;
|
|
gridEntity->_gridIndex = uVar2;
|
|
if (this->_gridEntities[uVar2] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[uVar2]))(1);
|
|
}
|
|
this->_gridEntities[uVar2] = gridEntity;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = 0;
|
|
gridEntity->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Init(Seed);
|
|
}
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_gridEntities[uVar2]) + 4))();
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
gridEntity = operator_new(0x154);
|
|
local_8 = 0x33;
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(gridEntity) = IsaacRepentancePlus::GridEntity_Wall::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) = 0xf;
|
|
gridEntity->_gridIndex = uVar2;
|
|
this->_gridEntities[uVar2] = gridEntity;
|
|
uVar2 = Random();
|
|
(GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Init(uVar2);
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
|
|
// 007eea90
|
|
void Room::MakeDoor(int slot)
|
|
{
|
|
int iVar1;
|
|
uint32_t uVar2;
|
|
int *piVar3;
|
|
GridEntity *newDoor;
|
|
int doorAngles [5];
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
Game *game;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b00f0d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((doorAngles + 8));
|
|
ExceptionList = &local_10;
|
|
if (this->_doors[slot] == (void *)0x0) {
|
|
iVar1 = this->_doorGridPositions[slot];
|
|
doorAngles[4] = uVar2;
|
|
if (iVar1 < 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("invalid GridIndex while spawning door (slot %d)"));
|
|
}
|
|
piVar3 = GHIDRA_CAST<int *>(__RTDynamicCast(this->_gridEntities[iVar1],0,
|
|
&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0,
|
|
uVar2));
|
|
if (piVar3 == GHIDRA_CAST<int *>(0x0)) {
|
|
newDoor = operator_new(0x404);
|
|
local_8 = 2;
|
|
if (newDoor == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
newDoor = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((newDoor)))->GridEntity::GridEntity();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
*GHIDRA_CAST<uint8_t ***>(newDoor) = IsaacRepentancePlus::GridEntity_Door::vftable;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newDoor[1])) + 0x14)))))))->ANM2::constructor();
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),4);
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((newDoor[1]._sprite._championColor._colorize + 1)))))->ANM2::constructor();
|
|
newDoor[2]._sprite._color._colorize[1] = 0.0;
|
|
newDoor[2]._sprite._color._offset[1] = 0.0;
|
|
newDoor[2]._sprite._color._offset[2] = 2.10195e-44;
|
|
*GHIDRA_CAST<uint8_t *>((newDoor[2]._sprite._color._colorize + 1)) = 0;
|
|
newDoor[2]._sprite._championColor._tint[0] = 0.0;
|
|
newDoor[2]._sprite._championColor._colorize[0] = 0.0;
|
|
newDoor[2]._sprite._championColor._colorize[1] = 2.10195e-44;
|
|
*GHIDRA_CAST<uint8_t *>(newDoor[2]._sprite._championColor._tint) = 0;
|
|
newDoor[2]._sprite._championColor._colorize[2] = 0.0;
|
|
newDoor[2]._sprite._championColor._offset[2] = 0.0;
|
|
newDoor[2]._sprite._flipX = 0xf;
|
|
newDoor[2]._sprite._flipY = 0;
|
|
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newDoor[2]._sprite)) + 0x102)))) = 0;
|
|
*GHIDRA_CAST<uint8_t *>((newDoor[2]._sprite._championColor._colorize + 2)) = 0;
|
|
newDoor[2]._sprite._playbackSpeed = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>((newDoor + 3)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(newDoor[3])) + 0x4)))) = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(&newDoor[2]._sprite._playbackSpeed) = 0;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (newDoor != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((newDoor)) + 0x4)))) = 0x10;
|
|
newDoor->_gridIndex = iVar1;
|
|
}
|
|
piVar3 = GHIDRA_CAST<int *>(__RTDynamicCast(newDoor,0,
|
|
&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0,
|
|
uVar2));
|
|
piVar3[2] = 0;
|
|
piVar3[3] = 0;
|
|
if (this->_gridEntities[iVar1] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[iVar1]))(1);
|
|
}
|
|
this->_gridEntities[iVar1] = piVar3;
|
|
}
|
|
uVar2 = Random();
|
|
piVar3[5] = uVar2;
|
|
piVar3[0xf] = 0;
|
|
(**(code **)(*piVar3 + 0x20))();
|
|
game = g_game;
|
|
piVar3[4] = piVar3[4] + 1;
|
|
*GHIDRA_CAST<uint8_t *>((piVar3 + 7)) = 1;
|
|
piVar3[10] = game->_frameCount;
|
|
uVar2 = slot & 0x80000003;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar2 = (uVar2 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
doorAngles[0] = -0x3d4c0000;
|
|
doorAngles[1] = 0;
|
|
doorAngles[2] = 0x42b40000;
|
|
doorAngles[3] = 0x43340000;
|
|
piVar3[0x59] = uVar2;
|
|
iVar1 = doorAngles[uVar2];
|
|
piVar3[0x39] = iVar1;
|
|
piVar3[200] = iVar1;
|
|
piVar3[0x83] = iVar1;
|
|
piVar3[0x56] = slot;
|
|
this->_doors[slot] = piVar3;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007eece0
|
|
int Room::GetRoomConfigStage()
|
|
{
|
|
int *roomConfig;
|
|
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) ||
|
|
(roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), roomConfig == GHIDRA_CAST<int *>(0x0))) {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("Room stage config is missing, returning a default one (SPECIAL)!\n"));
|
|
return 0;
|
|
}
|
|
return *roomConfig;
|
|
}
|
|
|
|
// 007efa50
|
|
void Room::on_leave()
|
|
{
|
|
void *pvVar1;
|
|
Entity_Pickup *pickup;
|
|
uint8_t bVar2;
|
|
char isReleased;
|
|
uint32_t stackCookie;
|
|
int gridSaveOffset;
|
|
void **gridEntitySlot;
|
|
int gridIndex;
|
|
uint32_t childSaveState;
|
|
uint32_t local_120;
|
|
uint32_t local_11c;
|
|
uint32_t local_118;
|
|
uint32_t local_114;
|
|
uint32_t uStack_110;
|
|
uint32_t uStack_10c;
|
|
uint32_t uStack_108;
|
|
uint32_t local_104;
|
|
uint32_t local_100;
|
|
Vector childSavedTargetPos;
|
|
uint32_t childExtraData;
|
|
int *childExtraDataRefCount;
|
|
uint32_t childLinkedSaveState;
|
|
int *childLinkedSaveStateRefCount;
|
|
uint32_t saveState;
|
|
uint32_t local_a8;
|
|
uint32_t local_a4;
|
|
uint32_t local_a0;
|
|
uint32_t local_9c;
|
|
uint32_t uStack_98;
|
|
uint32_t uStack_94;
|
|
uint32_t uStack_90;
|
|
uint32_t local_8c;
|
|
uint32_t local_88;
|
|
Vector savedTargetPos;
|
|
uint32_t extraData;
|
|
int *extraDataRefCount;
|
|
uint32_t linkedSaveState;
|
|
int *linkedSaveStateRefCount;
|
|
GridEntityDesc emptyGridDesc;
|
|
uint32_t local_14;
|
|
void *prevExceptionList;
|
|
uint8_t *puStack_c;
|
|
uint32_t ehState;
|
|
short *clearCount;
|
|
uint32_t descInitialized;
|
|
uint32_t descSpawnCount;
|
|
uint32_t descSpawnSeed;
|
|
uint32_t descState;
|
|
uint32_t descVarData;
|
|
uint32_t descVariableSeed;
|
|
uint32_t descVariant;
|
|
Game *game;
|
|
uint32_t *gridSaveSlot;
|
|
int gridSaveStates;
|
|
bool isPairedPickup;
|
|
EntitySaveState *savedEntitiesEnd;
|
|
|
|
ehState = 0xffffffff;
|
|
puStack_c = &LAB_00b00fab;
|
|
prevExceptionList = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &prevExceptionList;
|
|
if (0 < this->_shopRestockTimer) {
|
|
this->_shopRestockTimer = -1;
|
|
ShopRestockPartial(this);
|
|
}
|
|
game = g_game;
|
|
if ((g_game->_currentRoomIdx != -3) &&
|
|
(gridIndex = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))), *GHIDRA_CAST<int *>((gridIndex + 0x40)) != 0)) {
|
|
if ((this->_roomClearDelay - 1U < 8) && ((*GHIDRA_CAST<uint8_t *>((gridIndex + 0x44)) & 1) == 0)) {
|
|
this->_roomClearDelay = 0;
|
|
*GHIDRA_CAST<uint32_t *>((gridIndex + 0x44)) = *GHIDRA_CAST<uint32_t *>((gridIndex + 0x44)) | 1;
|
|
clearCount = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x4a));
|
|
*clearCount = *clearCount + 1;
|
|
gridIndex = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
ScoreSheet::add_cleared_room
|
|
(GHIDRA_CAST<ScoreSheet *>(&game->_scoreSheet),this->_roomType,
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((gridIndex + 0x10)) + 0x48)),GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((gridIndex + 0x4a))),
|
|
(uint8_t)(*GHIDRA_CAST<uint32_t *>((gridIndex + 0x44)) >> 10) & 1);
|
|
game = g_game;
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if ((bVar2 == 0) || (this->_roomType != 1)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::trigger_room_clear();
|
|
}
|
|
SpawnClearAward(this);
|
|
game = g_game;
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if ((bVar2 != 0) && (this->_roomType == 1)) {
|
|
game->_greedLastBeatenWave = game->_greedModeWave;
|
|
}
|
|
}
|
|
FUN_00571170(stackCookie);
|
|
gridIndex = 0;
|
|
if (0 < this->_gridWidth * this->_gridHeight) {
|
|
gridSaveOffset = 0;
|
|
gridEntitySlot = this->_gridEntities;
|
|
do {
|
|
pvVar1 = *gridEntitySlot;
|
|
if (pvVar1 == (void *)0x0) {
|
|
emptyGridDesc._type = 0;
|
|
emptyGridDesc._variant = 0;
|
|
emptyGridDesc._state = 0;
|
|
gridSaveStates = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x68));
|
|
emptyGridDesc._spawnCount = 0;
|
|
emptyGridDesc._spawnSeed = 0x16a9de81;
|
|
emptyGridDesc._varData = 0;
|
|
gridSaveSlot = GHIDRA_CAST<uint32_t *>((gridSaveStates + gridSaveOffset));
|
|
*gridSaveSlot = 0;
|
|
gridSaveSlot[1] = 0;
|
|
gridSaveSlot[2] = 0;
|
|
gridSaveSlot[3] = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(emptyGridDesc)) + 0x18))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(emptyGridDesc)) + 0x18))) & 0xffffff00;
|
|
emptyGridDesc._variableSeed = 0x16a9de81;
|
|
gridSaveSlot = GHIDRA_CAST<uint32_t *>((gridSaveStates + 0x10 + gridSaveOffset));
|
|
*gridSaveSlot = 0x16a9de81;
|
|
gridSaveSlot[1] = 0;
|
|
gridSaveSlot[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(emptyGridDesc)) + 0x18)));
|
|
gridSaveSlot[3] = 0x16a9de81;
|
|
}
|
|
else {
|
|
descVariant = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 8));
|
|
descState = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0xc));
|
|
descSpawnCount = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x10));
|
|
descSpawnSeed = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x14));
|
|
descVarData = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x18));
|
|
descInitialized = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1c));
|
|
descVariableSeed = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x20));
|
|
gridSaveStates = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x68));
|
|
gridSaveSlot = GHIDRA_CAST<uint32_t *>((gridSaveStates + gridSaveOffset));
|
|
*gridSaveSlot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 4));
|
|
gridSaveSlot[1] = descVariant;
|
|
gridSaveSlot[2] = descState;
|
|
gridSaveSlot[3] = descSpawnCount;
|
|
gridSaveSlot = GHIDRA_CAST<uint32_t *>((gridSaveStates + 0x10 + gridSaveOffset));
|
|
*gridSaveSlot = descSpawnSeed;
|
|
gridSaveSlot[1] = descVarData;
|
|
gridSaveSlot[2] = descInitialized;
|
|
gridSaveSlot[3] = descVariableSeed;
|
|
}
|
|
gridIndex = gridIndex + 1;
|
|
gridEntitySlot = gridEntitySlot + 1;
|
|
gridSaveOffset = gridSaveOffset + 0x20;
|
|
} while (gridIndex < this->_gridWidth * this->_gridHeight);
|
|
}
|
|
local_14 = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
pickup = *(Entity_Pickup **)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + local_14 * 4);
|
|
local_9c = 0;
|
|
uStack_98 = 0;
|
|
uStack_94 = 0xffffffff;
|
|
uStack_90 = 0xffffffff;
|
|
saveState = 0;
|
|
savedTargetPos.x = g_vectorZero.x;
|
|
savedTargetPos.y = g_vectorZero.y;
|
|
local_a8 = 0;
|
|
local_a4 = 0;
|
|
local_a0 = 0;
|
|
local_8c = 0;
|
|
local_88 = 0;
|
|
extraData = 0;
|
|
extraDataRefCount = GHIDRA_CAST<int *>(0x0);
|
|
linkedSaveState = 0;
|
|
linkedSaveStateRefCount = GHIDRA_CAST<int *>(0x0);
|
|
ehState = 0;
|
|
if ((pickup->_type == 0x3c5) && (pickup->_variant == 0)) {
|
|
isPairedPickup = true;
|
|
}
|
|
else {
|
|
isPairedPickup = false;
|
|
}
|
|
if (isPairedPickup) {
|
|
local_114 = 0;
|
|
uStack_110 = 0;
|
|
uStack_10c = 0xffffffff;
|
|
uStack_108 = 0xffffffff;
|
|
childSaveState = 0;
|
|
childSavedTargetPos.x = g_vectorZero.x;
|
|
childSavedTargetPos.y = g_vectorZero.y;
|
|
local_120 = 0;
|
|
local_11c = 0;
|
|
local_118 = 0;
|
|
local_104 = 0;
|
|
local_100 = 0;
|
|
childExtraData = 0;
|
|
childExtraDataRefCount = GHIDRA_CAST<int *>(0x0);
|
|
childLinkedSaveState = 0;
|
|
childLinkedSaveStateRefCount = GHIDRA_CAST<int *>(0x0);
|
|
ehState = 1;
|
|
if (GHIDRA_CAST<Entity_Pickup *>(pickup->_child) != GHIDRA_CAST<Entity_Pickup *>(0x0)) {
|
|
bVar2 = Entity_Pickup::CanFlip
|
|
(this,GHIDRA_CAST<Entity_Pickup *>(pickup->_child),
|
|
GHIDRA_CAST<EntitySaveState *>(&childSaveState),1);
|
|
if (bVar2 != 0) {
|
|
bVar2 = Entity_Pickup::CanFlip(this,pickup,GHIDRA_CAST<EntitySaveState *>(&saveState),0);
|
|
if (bVar2 != 0) {
|
|
gridIndex = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
savedEntitiesEnd = *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x78));
|
|
if (savedEntitiesEnd == *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x7c))) {
|
|
msvc::vector<EntitySaveState>::_Emplace_reallocate(savedEntitiesEnd,&saveState);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((savedEntitiesEnd)))->EntitySaveState::copy(&saveState);
|
|
*GHIDRA_CAST<int *>((gridIndex + 0x78)) = *GHIDRA_CAST<int *>((gridIndex + 0x78)) + 0x78;
|
|
}
|
|
gridIndex = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
savedEntitiesEnd = *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x78));
|
|
if (savedEntitiesEnd == *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x7c))) {
|
|
msvc::vector<EntitySaveState>::_Emplace_reallocate
|
|
(savedEntitiesEnd,&childSaveState);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((savedEntitiesEnd)))->EntitySaveState::copy(&childSaveState);
|
|
*GHIDRA_CAST<int *>((gridIndex + 0x78)) = *GHIDRA_CAST<int *>((gridIndex + 0x78)) + 0x78;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 2;
|
|
if (childLinkedSaveStateRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isReleased = (**(code **)(*childLinkedSaveStateRefCount + 0xc))();
|
|
if ((isReleased != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateReleaseFn)(&childLinkedSaveState);
|
|
}
|
|
}
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),3);
|
|
if (childExtraDataRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isReleased = (**(code **)(*childExtraDataRefCount + 0xc))();
|
|
if ((isReleased != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateExtraDataReleaseFn)(&childExtraData);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = Entity_Pickup::CanFlip(this,pickup,GHIDRA_CAST<EntitySaveState *>(&saveState),0);
|
|
if (bVar2 != 0) {
|
|
gridIndex = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
savedEntitiesEnd = *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x78));
|
|
if (savedEntitiesEnd == *GHIDRA_CAST<EntitySaveState **>((gridIndex + 0x7c))) {
|
|
msvc::vector<EntitySaveState>::_Emplace_reallocate(savedEntitiesEnd,&saveState);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<EntitySaveState *>((savedEntitiesEnd)))->EntitySaveState::copy(&saveState);
|
|
*GHIDRA_CAST<int *>((gridIndex + 0x78)) = *GHIDRA_CAST<int *>((gridIndex + 0x78)) + 0x78;
|
|
}
|
|
}
|
|
}
|
|
ehState = 4;
|
|
if (linkedSaveStateRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isReleased = (**(code **)(*linkedSaveStateRefCount + 0xc))();
|
|
if ((isReleased != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateReleaseFn)(&linkedSaveState);
|
|
}
|
|
}
|
|
ehState = 5;
|
|
if (extraDataRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
isReleased = (**(code **)(*extraDataRefCount + 0xc))();
|
|
if ((isReleased != '\0') && (g_entitySaveStateExtraDataReleaseFn != (void *)0x0)) {
|
|
(*g_entitySaveStateExtraDataReleaseFn)(&extraData);
|
|
}
|
|
}
|
|
local_14 = local_14 + 1;
|
|
} while (local_14 < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
}
|
|
ExceptionList = prevExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 007eff50
|
|
void Room::RestoreState()
|
|
{
|
|
void *pvVar1;
|
|
Entity_Pickup *pickup;
|
|
int iVar2;
|
|
void *owner;
|
|
int gridX;
|
|
uint32_t uVar3;
|
|
uint32_t *saveState;
|
|
uint32_t *saveState_00;
|
|
int iVar4;
|
|
Vector *pickupPos;
|
|
int roomDesc;
|
|
Vector minecartDir;
|
|
Vector minecartPos;
|
|
uint32_t *linkedGridEntity;
|
|
float minecartAngle;
|
|
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1;
|
|
roomDesc = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
saveState_00 = *GHIDRA_CAST<uint32_t **>((roomDesc + 0x74));
|
|
if (saveState_00 != *GHIDRA_CAST<uint32_t **>((roomDesc + 0x78))) {
|
|
pickupPos = GHIDRA_CAST<Vector *>((saveState_00 + 10));
|
|
do {
|
|
if ((*saveState_00 == 0x3c5) && (saveState_00[1] == 0)) {
|
|
pickupPos = pickupPos + 0xf;
|
|
saveState = saveState_00 + 0x1e;
|
|
pickup = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(*saveState,saveState_00[0x1f],pickupPos,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),saveState_00[0x20],saveState_00[0x2b],0);
|
|
Entity_Pickup::RestoreState(this,pickup,saveState);
|
|
minecartAngle = (float)saveState_00[0x14];
|
|
minecartDir.x = cos(minecartAngle * 0.017453292);
|
|
minecartDir.y = sin(minecartAngle * 0.017453292);
|
|
minecartPos.x = (float)(GHIDRA_INT((short)saveState_00[8]) % this->_gridWidth) * 40.0 + 40.0;
|
|
minecartPos.y = (float)(GHIDRA_INT((short)saveState_00[8]) / this->_gridWidth) * 40.0 + 120.0;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(pickup))))->Entity::GiveMinecart(&minecartPos,&minecartDir);
|
|
saveState_00 = saveState;
|
|
}
|
|
else {
|
|
pickup = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(*saveState_00,saveState_00[1],pickupPos,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),saveState_00[2],saveState_00[0xd],0);
|
|
Entity_Pickup::RestoreState(this,pickup,saveState_00);
|
|
}
|
|
roomDesc = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
saveState_00 = saveState_00 + 0x1e;
|
|
pickupPos = pickupPos + 0xf;
|
|
} while (saveState_00 != *GHIDRA_CAST<uint32_t **>((roomDesc + 0x78)));
|
|
}
|
|
pvVar1 = *(void **)(roomDesc + 0x78);
|
|
owner = *(void **)(roomDesc + 0x74);
|
|
if (owner != pvVar1) {
|
|
do {
|
|
invoke_pending_callbacks(owner);
|
|
owner = (void *)(GHIDRA_INT(owner) + 0x78);
|
|
} while (owner != pvVar1);
|
|
owner = *(void **)(roomDesc + 0x74);
|
|
}
|
|
iVar4 = g_pickupIgnoreModifiers;
|
|
*(void **)(roomDesc + 0x78) = owner;
|
|
if (((**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) != -10) || (g_game->_stage != 8)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x11)) & 1) == 0)) {
|
|
g_pickupIgnoreModifiers = iVar4 + -1;
|
|
return;
|
|
}
|
|
iVar4 = 1;
|
|
if (1 < this->_gridHeight + -1) {
|
|
do {
|
|
iVar2 = this->_gridWidth;
|
|
gridX = 1;
|
|
if (1 < iVar2 + -1) {
|
|
do {
|
|
if ((((-1 < gridX) && (gridX < iVar2)) &&
|
|
((-1 < iVar4 &&
|
|
((iVar4 < this->_gridHeight && (iVar2 = iVar2 * iVar4 + gridX, -1 < iVar2)))))) &&
|
|
((pvVar1 = this->_gridEntities[iVar2], pvVar1 != (void *)0x0 &&
|
|
((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) == 0xf &&
|
|
(uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x24)), uVar3 < 0x1c0)) &&
|
|
(linkedGridEntity = this->_gridEntities[uVar3],
|
|
linkedGridEntity != GHIDRA_CAST<uint32_t *>(0x0))) && (linkedGridEntity[1] != 1)))))) {
|
|
this->_gridPaths[uVar3] = 900;
|
|
this->_gridEntities[uVar3] = (void *)0x0;
|
|
(**(code **)*linkedGridEntity)(1);
|
|
}
|
|
iVar2 = this->_gridWidth;
|
|
gridX = gridX + 1;
|
|
} while (gridX < iVar2 + -1);
|
|
}
|
|
iVar4 = iVar4 + 1;
|
|
} while (iVar4 < this->_gridHeight + -1);
|
|
}
|
|
uVar3 = 0;
|
|
do {
|
|
RemoveDoor(this,uVar3);
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < 8);
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1;
|
|
return;
|
|
}
|
|
|
|
// 007f01c0
|
|
void Room::update_door_transitions()
|
|
{
|
|
GridEntity_Door *this_00;
|
|
Entity_Player *player;
|
|
uint32_t direction;
|
|
RoomDescriptor *roomDesc;
|
|
uint32_t uVar1;
|
|
Game *this_01;
|
|
uint32_t uVar2;
|
|
bool isDoorPassable;
|
|
float velocityY;
|
|
float fVar4;
|
|
float fVar5;
|
|
float fVar6;
|
|
int iVar7;
|
|
uint32_t playerIndex;
|
|
void **doorSlot;
|
|
float doorOffsets [8];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
Game *game;
|
|
float playerX;
|
|
float playerY;
|
|
int *roomConfig;
|
|
int targetRoomIdx;
|
|
int transitionAnim;
|
|
float velocityY;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((doorOffsets + 0x10));
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00b00ff1;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((doorOffsets + 0xd));
|
|
ExceptionList = &local_1c;
|
|
if (((*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0) &&
|
|
(((roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), roomConfig == GHIDRA_CAST<int *>(0x0) ||
|
|
(roomConfig[2] != 0x10)) || (*roomConfig != 0x23)))) &&
|
|
(playerIndex = 0,
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0)) {
|
|
do {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(playerIndex);
|
|
if (player->_variant == 0) {
|
|
playerX = (player->_pos).x;
|
|
uVar2 = 0;
|
|
playerY = (player->_pos).y;
|
|
doorSlot = this->_doors;
|
|
do {
|
|
this_00 = *doorSlot;
|
|
direction = uVar2 & 3;
|
|
doorOffsets[0] = -18.0;
|
|
doorOffsets[1] = 0.0;
|
|
doorOffsets[2] = 0.0;
|
|
doorOffsets[3] = -18.0;
|
|
doorOffsets[4] = 18.0;
|
|
doorOffsets[5] = 0.0;
|
|
doorOffsets[6] = 0.0;
|
|
doorOffsets[7] = 18.0;
|
|
if (this_00 != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
velocityY = (float)(this_00->_gridIndex / iVar7) * 40.0 + 120.0 +
|
|
doorOffsets[direction * 2 + 1];
|
|
fVar5 = (float)(this_00->_gridIndex % iVar7) * 40.0 + 40.0 + doorOffsets[direction * 2];
|
|
fVar4 = velocityY - playerY;
|
|
fVar6 = fVar5 - playerX;
|
|
fVar4 = sqrtf(fVar4 * fVar4 + fVar6 * fVar6);
|
|
uVar1 = player->_moveDirection;
|
|
if (player->_playerType == 0x23) {
|
|
fVar6 = (player->_velocity).x;
|
|
velocityY = (player->_velocity).y;
|
|
if (4.0 < fVar6 * fVar6 + velocityY * velocityY) {
|
|
if (ABS(fVar6) <= ABS(velocityY)) {
|
|
uVar1 = GHIDRA_UINT((0.0 <= velocityY)) * 2 + 1;
|
|
}
|
|
else {
|
|
uVar1 = 2;
|
|
if (fVar6 < 0.0) {
|
|
uVar1 = 0;
|
|
}
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8))));
|
|
if (((iVar7 == 1) || (iVar7 == 4)) ||
|
|
((iVar7 == 3 || ((iVar7 == 2 || (iVar7 == 5)))))) {
|
|
fVar5 = fVar5 - (playerX + fVar6 + fVar6);
|
|
velocityY = velocityY - (playerY + velocityY + velocityY);
|
|
fVar4 = sqrtf(velocityY * velocityY + fVar5 * fVar5);
|
|
}
|
|
}
|
|
}
|
|
if ((this_00->_doorFlags & 0x10) == 0) {
|
|
isDoorPassable = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0xc)))) == 2;
|
|
}
|
|
else {
|
|
isDoorPassable = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0xc)))) != 2;
|
|
}
|
|
if ((isDoorPassable) && (fVar4 < 25.0)) {
|
|
Game::save_rewind_state(uVar2);
|
|
game = g_game;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar1 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar1 = uVar2;
|
|
if (6 < GHIDRA_INT(uVar2)) {
|
|
uVar1 = 7;
|
|
}
|
|
}
|
|
g_game->_leaveDoor = uVar1;
|
|
this_01 = game;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(this->_doors[uVar2]) + 0x394)) == -1) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard
|
|
) {
|
|
_Init_thread_header(&g_invalidRoomDescriptorGuard);
|
|
if (g_invalidRoomDescriptorGuard == -1) {
|
|
local_14 = 0.0;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_14 = -NAN;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
this_01 = g_game;
|
|
}
|
|
roomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(game->_currentDimensionIdx) < 3) {
|
|
roomDesc = game->_roomList + 0x1fb;
|
|
}
|
|
if (roomDesc->Data == (void *)0x0) {
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(this->_doors[uVar2]) + 0x160));
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_01))))->Level::InitializeDevilAngelRoom(iVar7 == 0xf,iVar7 != 0xf);
|
|
this_01 = g_game;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
if (iVar7 == 0xf) {
|
|
*GHIDRA_CAST<uint32_t *>(&this_01->_gameStateFlags) = GHIDRA_UINT(this_01->_gameStateFlags) | 1;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint32_t *>(&this_01->_gameStateFlags) = GHIDRA_UINT(this_01->_gameStateFlags) | 0x20;
|
|
}
|
|
}
|
|
}
|
|
iVar7 = -1;
|
|
targetRoomIdx = *GHIDRA_CAST<int *>((GHIDRA_INT(this->_doors[uVar2]) + 0x394));
|
|
if (targetRoomIdx < -99) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this_01))))->Level::GetRoomByIdx(targetRoomIdx,-1);
|
|
transitionAnim = 0x12;
|
|
iVar7 = roomDesc->Dimension;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(this->_doors[uVar2]) + 0x394)) != -100) {
|
|
transitionAnim = 0;
|
|
}
|
|
targetRoomIdx = roomDesc->GridIndex;
|
|
this_01 = g_game;
|
|
}
|
|
else {
|
|
transitionAnim = 0;
|
|
}
|
|
Game::StartRoomTransition(this_01,targetRoomIdx,direction,transitionAnim,player,iVar7)
|
|
;
|
|
g_game->_isPocketItemRewindSaved = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8))));
|
|
if (((((iVar7 == 1) || (iVar7 == 4)) || (iVar7 == 3)) || ((iVar7 == 2 || (iVar7 == 5))))
|
|
&& (((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 1) != 0 &&
|
|
((fVar4 < 60.0 && (uVar1 == direction)))))) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::TryUnlock(player,0);
|
|
}
|
|
}
|
|
game = g_game;
|
|
uVar2 = uVar2 + 1;
|
|
doorSlot = doorSlot + 1;
|
|
} while (uVar2 < 8);
|
|
if (this->_roomType == 0x10) {
|
|
if ((playerY < 120.0) || (((playerY < 110.0 && (100.0 < playerX)) && (playerX < 140.0))))
|
|
{
|
|
transitionAnim = 2;
|
|
iVar7 = g_game->_enterDoor;
|
|
targetRoomIdx = g_game->_dungeonReturnRoomIndex;
|
|
LAB_007f070c:
|
|
Game::StartRoomTransition(game,targetRoomIdx,iVar7,transitionAnim,player,-1);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if ((this->_bottomRightPos).x + 20.0 < playerX) {
|
|
transitionAnim = 0;
|
|
iVar7 = 2;
|
|
if (**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == -0xe) {
|
|
targetRoomIdx = -0xf;
|
|
g_game->_leaveDoor = 2;
|
|
}
|
|
else {
|
|
uVar2 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))[4] + 0x38));
|
|
g_game->_leaveDoor = 2;
|
|
if ((uVar2 >> 2 & 1) == 0) {
|
|
targetRoomIdx = -2;
|
|
}
|
|
else {
|
|
targetRoomIdx = -6;
|
|
}
|
|
}
|
|
goto LAB_007f070c;
|
|
}
|
|
if (playerX < 0.0) {
|
|
transitionAnim = 0;
|
|
iVar7 = 0;
|
|
g_game->_leaveDoor = 0;
|
|
targetRoomIdx = -2;
|
|
goto LAB_007f070c;
|
|
}
|
|
if ((this->_bottomRightPos).y + 20.0 < playerY) {
|
|
transitionAnim = 0;
|
|
iVar7 = 3;
|
|
g_game->_leaveDoor = 3;
|
|
targetRoomIdx = -2;
|
|
goto LAB_007f070c;
|
|
}
|
|
}
|
|
}
|
|
playerIndex = playerIndex + 1;
|
|
} while (playerIndex <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007f0780
|
|
int Room::GetGridCollisionAtPos(Vector pos)
|
|
{
|
|
uint32_t collision;
|
|
int gridY;
|
|
int gridX;
|
|
|
|
gridX = GHIDRA_INT(((pos.x - 40.0) / 40.0 + 0.5));
|
|
gridY = GHIDRA_INT(((pos.y - 120.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) || (gridY < 0)) || (this->_gridHeight <= gridY))
|
|
{
|
|
collision = GetGridCollision(this,-1);
|
|
return collision;
|
|
}
|
|
collision = GetGridCollision(this,this->_gridWidth * gridY + gridX);
|
|
return collision;
|
|
}
|
|
|
|
// 007f0800
|
|
uint32_t Room::GetGridCollision(int index)
|
|
{
|
|
int gridPath;
|
|
int *roomData;
|
|
|
|
roomData = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if (((roomData != GHIDRA_CAST<int *>(0x0)) && (roomData[2] == 0x10)) && (*roomData == 0x23)) {
|
|
return 0;
|
|
}
|
|
if (index < 0) {
|
|
return 4;
|
|
}
|
|
if (this->_gridEntities[index] != (void *)0x0) {
|
|
return *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_gridEntities[index]) + 0x3c));
|
|
}
|
|
gridPath = this->_gridPaths[index];
|
|
if (gridPath < 3000) {
|
|
if (gridPath < 1000) {
|
|
return 0;
|
|
}
|
|
}
|
|
else if (gridPath < 4000) {
|
|
return 1;
|
|
}
|
|
return 3;
|
|
}
|
|
|
|
// 007f0b40
|
|
Vector * Room::GetLaserTarget(Vector *outTarget, Vector *position, Vector *direction)
|
|
{
|
|
int index;
|
|
uint32_t gridCollision;
|
|
Vector *result;
|
|
int gridX;
|
|
int gridY;
|
|
float tStep;
|
|
float fVar1;
|
|
float deltaY;
|
|
float deltaX;
|
|
float traveled;
|
|
int cellX;
|
|
int cellY;
|
|
float currentX;
|
|
float currentY;
|
|
Vector hitPos;
|
|
Vector endPos;
|
|
int stepX;
|
|
int stepY;
|
|
int xBoundarySide;
|
|
int yBoundarySide;
|
|
|
|
outTarget->y = 0.0;
|
|
currentX = position->x;
|
|
hitPos.x = currentX;
|
|
currentY = position->y;
|
|
outTarget->x = 0.0;
|
|
endPos.x = direction->x * 10000.0 + position->x;
|
|
gridX = GHIDRA_INT(((currentX - 40.0) / 40.0 + 0.5));
|
|
hitPos.y = currentY;
|
|
endPos.y = direction->y * 10000.0 + currentY;
|
|
deltaX = endPos.x - position->x;
|
|
deltaY = endPos.y - currentY;
|
|
xBoundarySide = GHIDRA_UINT((0.0 < deltaX)) * 2;
|
|
stepX = xBoundarySide + -1;
|
|
gridY = GHIDRA_INT(((currentY - 120.0) / 40.0 + 0.5));
|
|
yBoundarySide = GHIDRA_UINT((0.0 < deltaY)) * 2;
|
|
stepY = yBoundarySide + -1;
|
|
traveled = 0.0;
|
|
if ((deltaX != g_vectorZero.x) || (fVar1 = 0.0, deltaY != g_vectorZero.y)) {
|
|
cellY = gridY * 0x28;
|
|
cellX = gridX * 0x28;
|
|
do {
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) || (gridY < 0)) ||
|
|
(this->_gridHeight <= gridY)) {
|
|
index = -1;
|
|
}
|
|
else {
|
|
index = this->_gridWidth * gridY + gridX;
|
|
}
|
|
hitPos.x = currentX;
|
|
hitPos.y = currentY;
|
|
gridCollision = GetGridCollision(this,index);
|
|
if (((gridCollision == 2) || (gridCollision == 3)) ||
|
|
((gridCollision == 4 || (gridCollision == 5)))) {
|
|
fVar1 = traveled;
|
|
break;
|
|
}
|
|
if (deltaX == 0.0) {
|
|
fVar1 = INFINITY;
|
|
}
|
|
else {
|
|
fVar1 = ((float)(cellX + (xBoundarySide + 1) * 0x14) - currentX) / deltaX;
|
|
}
|
|
if (deltaY == 0.0) {
|
|
tStep = INFINITY;
|
|
}
|
|
else {
|
|
tStep = ((float)(cellY + (yBoundarySide + 5) * 0x14) - currentY) / deltaY;
|
|
}
|
|
if (tStep <= fVar1) {
|
|
gridY = gridY + stepY;
|
|
cellY = cellY + stepY * 0x28;
|
|
}
|
|
else {
|
|
gridX = gridX + stepX;
|
|
cellX = cellX + stepX * 0x28;
|
|
tStep = fVar1;
|
|
}
|
|
traveled = tStep + traveled;
|
|
currentY = deltaY * traveled + position->y;
|
|
currentX = deltaX * traveled + position->x;
|
|
hitPos.y = currentY;
|
|
hitPos.x = currentX;
|
|
fVar1 = traveled;
|
|
} while (traveled < 1.0);
|
|
}
|
|
result = &endPos;
|
|
if (fVar1 < 1.0) {
|
|
result = &hitPos;
|
|
}
|
|
outTarget->x = result->x;
|
|
outTarget->y = result->y;
|
|
return outTarget;
|
|
}
|
|
|
|
// 007f0df0
|
|
uint8_t Room::CheckLine(Vector *pos1, Vector *pos2, int mode, int gridPathThreshold, uint8_t isIgnoreWalls, uint8_t isIgnoreCrushable, Vector *outPos)
|
|
{
|
|
uint8_t isCrushable;
|
|
int iVar1;
|
|
int gridIndex;
|
|
uint32_t uVar2;
|
|
int collisionClass;
|
|
int gridIndex;
|
|
GridEntity *this_00;
|
|
uint32_t cornerGridIndex;
|
|
GridEntity *this_01;
|
|
GridEntity *gridEntity;
|
|
float curY;
|
|
float curX;
|
|
float cellSize;
|
|
float curStepX;
|
|
float curStepY;
|
|
float roundBias;
|
|
int blockedPathCount;
|
|
float posY;
|
|
float posX;
|
|
float stepX;
|
|
float stepY;
|
|
Vector *savedOutPos;
|
|
uint32_t startGridIndex;
|
|
int *local_38;
|
|
float traveled;
|
|
float lineLength;
|
|
float cornerOffsets [8];
|
|
uint32_t local_c;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&blockedPathCount);
|
|
posX = pos1->x;
|
|
posY = pos1->y;
|
|
stepX = posX - pos2->x;
|
|
stepY = posY - pos2->y;
|
|
savedOutPos = outPos;
|
|
lineLength = sqrtf(stepY * stepY + stepX * stepX);
|
|
traveled = 0.0;
|
|
if (0.0 < lineLength) {
|
|
cellSize = 40.0;
|
|
roundBias = 0.5;
|
|
curStepX = (stepX / lineLength) * 10.0;
|
|
curStepY = (stepY / lineLength) * 10.0;
|
|
gridIndex = GHIDRA_INT(((posX - 40.0) / 40.0 + 0.5));
|
|
if ((((gridIndex < 0) || (this->_gridWidth <= gridIndex)) ||
|
|
(iVar1 = GHIDRA_INT(((posY - 120.0) / 40.0 + 0.5)), iVar1 < 0)) || (this->_gridHeight <= iVar1)) {
|
|
startGridIndex = 0xffffffff;
|
|
}
|
|
else {
|
|
startGridIndex = this->_gridWidth * iVar1 + gridIndex;
|
|
}
|
|
blockedPathCount = 0;
|
|
curY = posY;
|
|
curX = posX;
|
|
stepX = curStepX;
|
|
stepY = curStepY;
|
|
if (0.0 < lineLength) {
|
|
do {
|
|
curX = curX - curStepX;
|
|
curY = curY - curStepY;
|
|
posY = curY;
|
|
posX = curX;
|
|
if ((mode == 0) || (mode == 3)) {
|
|
uVar2 = 0;
|
|
cornerOffsets[0] = -5.0;
|
|
cornerOffsets[1] = -5.0;
|
|
cornerOffsets[2] = -5.0;
|
|
cornerOffsets[3] = 5.0;
|
|
local_38 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
cornerOffsets[4] = 5.0;
|
|
cornerOffsets[5] = 5.0;
|
|
cornerOffsets[6] = 5.0;
|
|
cornerOffsets[7] = -5.0;
|
|
do {
|
|
iVar1 = GHIDRA_INT((((curX + cornerOffsets[uVar2 * 2]) - cellSize) / cellSize + roundBias));
|
|
gridIndex = GHIDRA_INT((((curY + cornerOffsets[uVar2 * 2 + 1]) - 120.0) / cellSize + roundBias));
|
|
if (((iVar1 < 0) || (this->_gridWidth <= iVar1)) ||
|
|
((gridIndex < 0 || (this->_gridHeight <= gridIndex)))) {
|
|
gridIndex = -1;
|
|
}
|
|
else {
|
|
gridIndex = gridIndex * this->_gridWidth + iVar1;
|
|
}
|
|
if (((local_38 == GHIDRA_CAST<int *>(0x0)) || (local_38[2] != 0x10)) || (*local_38 != 0x23)) {
|
|
if (gridIndex < 0) {
|
|
collisionClass = 4;
|
|
}
|
|
else if (this->_gridEntities[gridIndex] == (void *)0x0) {
|
|
if (this->_gridPaths[gridIndex] - 3000U < 1000) {
|
|
collisionClass = 1;
|
|
}
|
|
else {
|
|
collisionClass = 0;
|
|
if (999 < this->_gridPaths[gridIndex]) {
|
|
collisionClass = 3;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
collisionClass = *GHIDRA_CAST<int *>((GHIDRA_INT(this->_gridEntities[gridIndex]) + 0x3c));
|
|
}
|
|
}
|
|
else {
|
|
collisionClass = 0;
|
|
}
|
|
if ((mode != 3) || (collisionClass != 1)) {
|
|
if (collisionClass == 0) {
|
|
if (((iVar1 < 0) || ((this->_gridWidth <= iVar1 || (gridIndex < 0)))) ||
|
|
(this->_gridHeight <= gridIndex)) {
|
|
cornerGridIndex = 0xffffffff;
|
|
}
|
|
else {
|
|
cornerGridIndex = gridIndex * this->_gridWidth + iVar1;
|
|
}
|
|
if (cornerGridIndex != startGridIndex) {
|
|
if (cornerGridIndex < 0x1c0) {
|
|
gridIndex = this->_gridPaths[cornerGridIndex];
|
|
}
|
|
else {
|
|
gridIndex = 0;
|
|
}
|
|
if ((mode == 0) && (gridPathThreshold < gridIndex)) {
|
|
blockedPathCount = blockedPathCount + 1;
|
|
}
|
|
}
|
|
}
|
|
else if (((isIgnoreCrushable == 0) || (iVar1 < 0)) ||
|
|
((this->_gridWidth <= iVar1 ||
|
|
(((((gridIndex < 0 || (this->_gridHeight <= gridIndex)) ||
|
|
(cornerGridIndex = gridIndex * this->_gridWidth + iVar1,
|
|
0x1bf < cornerGridIndex)) ||
|
|
(this->_gridEntities[cornerGridIndex] == GHIDRA_CAST<GridEntity *>(0x0))) ||
|
|
((isCrushable = GridEntity::IsEasyCrushableOrWalkable
|
|
(this->_gridEntities[cornerGridIndex]),
|
|
isCrushable == 0 &&
|
|
(isCrushable = (GHIDRA_CAST<GridEntity *>((this_01)))->GridEntity::IsDangerousCrushableOrWalkable(),
|
|
isCrushable == 0)))))))) goto LAB_007f114d;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < 4);
|
|
}
|
|
else {
|
|
gridIndex = GHIDRA_INT(((curX - cellSize) / cellSize + roundBias));
|
|
iVar1 = GHIDRA_INT(((curY - 120.0) / cellSize + roundBias));
|
|
if ((((gridIndex < 0) || (this->_gridWidth <= gridIndex)) || (iVar1 < 0)) ||
|
|
(this->_gridHeight <= iVar1)) {
|
|
gridIndex = -1;
|
|
}
|
|
else {
|
|
gridIndex = this->_gridWidth * iVar1 + gridIndex;
|
|
}
|
|
local_38 = GHIDRA_CAST<int *>(GetGridCollision(this,gridIndex));
|
|
if (mode == 1) {
|
|
if (local_38 != GHIDRA_CAST<int *>(0x0)) {
|
|
if (savedOutPos == GHIDRA_CAST<Vector *>(0x0)) {
|
|
return 0;
|
|
}
|
|
savedOutPos->x = stepX + posX;
|
|
savedOutPos->y = posY + stepY;
|
|
return 0;
|
|
}
|
|
if (((gridIndex < 0) || (this->_gridWidth <= gridIndex)) ||
|
|
((iVar1 < 0 || (this->_gridHeight <= iVar1)))) {
|
|
uVar2 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar2 = this->_gridWidth * iVar1 + gridIndex;
|
|
}
|
|
if (uVar2 != startGridIndex) {
|
|
if (uVar2 < 0x1c0) {
|
|
gridIndex = this->_gridPaths[uVar2];
|
|
}
|
|
else {
|
|
gridIndex = 0;
|
|
}
|
|
iVar1 = blockedPathCount + 1;
|
|
if (gridIndex <= gridPathThreshold) {
|
|
iVar1 = blockedPathCount;
|
|
}
|
|
blockedPathCount = iVar1;
|
|
}
|
|
}
|
|
else if (mode == 2) {
|
|
if (((gridIndex < 0) || (this->_gridWidth <= gridIndex)) ||
|
|
((iVar1 < 0 ||
|
|
((this->_gridHeight <= iVar1 ||
|
|
(uVar2 = this->_gridWidth * iVar1 + gridIndex, 0x1bf < uVar2)))))) {
|
|
gridEntity = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
gridEntity = this->_gridEntities[uVar2];
|
|
}
|
|
if (local_38 == GHIDRA_CAST<int *>(0x0)) {
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_007f1093;
|
|
}
|
|
else if (gridEntity == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
LAB_007f10ca:
|
|
if (local_38 == GHIDRA_CAST<int *>(&DAT_00000004)) goto LAB_007f104c;
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_007f10d7;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) == 3) goto LAB_007f104c;
|
|
LAB_007f1093:
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) != 0xb) ||
|
|
(isCrushable = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x88),
|
|
isCrushable == 0)) {
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) != 0x10) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) != 0xf || (isIgnoreWalls == 0))))
|
|
goto LAB_007f10ca;
|
|
LAB_007f10d7:
|
|
isCrushable = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::IsEasyCrushableOrWalkable();
|
|
if (((isCrushable != 0) ||
|
|
(isCrushable = (GHIDRA_CAST<GridEntity *>((this_00)))->GridEntity::IsDangerousCrushableOrWalkable(),
|
|
isCrushable != 0)) && (isIgnoreCrushable != 0)) {
|
|
LAB_007f104c:
|
|
if (savedOutPos == GHIDRA_CAST<Vector *>(0x0)) {
|
|
return 0;
|
|
}
|
|
savedOutPos->x = posX + stepX;
|
|
savedOutPos->y = posY + stepY;
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cellSize = 40.0;
|
|
roundBias = 0.5;
|
|
curY = posY;
|
|
curX = posX;
|
|
curStepX = stepX;
|
|
curStepY = stepY;
|
|
}
|
|
traveled = traveled + 10.0;
|
|
} while (traveled < lineLength);
|
|
if (8 < blockedPathCount) {
|
|
LAB_007f114d:
|
|
if (savedOutPos != GHIDRA_CAST<Vector *>(0x0)) {
|
|
savedOutPos->y = curY + curStepY;
|
|
savedOutPos->x = curX + curStepX;
|
|
}
|
|
return 0;
|
|
}
|
|
outPos = savedOutPos;
|
|
}
|
|
}
|
|
if (outPos != GHIDRA_CAST<Vector *>(0x0)) {
|
|
outPos->x = pos2->x;
|
|
outPos->y = pos2->y;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 007f1380
|
|
void Room::LoadBackdropGraphics()
|
|
{
|
|
uint8_t *puVar1;
|
|
uint8_t bVar2;
|
|
char cVar3;
|
|
uint32_t uVar4;
|
|
uint32_t voidRoomStage;
|
|
uint8_t *extraout_EAX;
|
|
uint8_t *path;
|
|
char *pcVar5;
|
|
void *pvVar6;
|
|
uint32_t *puVar7;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t extraout_CL_01;
|
|
uint8_t extraout_CL_02;
|
|
int iVar8;
|
|
uint32_t voidRoomStageType;
|
|
uint32_t extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
uint32_t extraout_ECX_01;
|
|
uint32_t extraout_ECX_02;
|
|
uint32_t uVar9;
|
|
uint32_t extraout_ECX_03;
|
|
uint32_t extraout_ECX_04;
|
|
Game *extraout_EDX;
|
|
Game *game;
|
|
uint32_t uVar10;
|
|
uint32_t local_74 [4];
|
|
uint32_t stageType;
|
|
uint64_t local_60;
|
|
uint8_t local_58 [8];
|
|
char local_50 [8];
|
|
uint32_t pathSize;
|
|
uint32_t pathCapacity;
|
|
std_string local_40;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
code *clearFn;
|
|
int *descriptor;
|
|
|
|
puStack_20 = local_58 + 0x54;
|
|
local_14 = -1;
|
|
puStack_18 = &LAB_00b010d5;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((local_58 + 0x48));
|
|
ExceptionList = &local_1c;
|
|
uVar10 = g_game->_stage;
|
|
local_74[0] = g_game->_stageType;
|
|
local_74[2] = uVar10;
|
|
local_74[3] = uVar10;
|
|
stageType = local_74[0];
|
|
local_24 = uVar4;
|
|
puVar1 = local_58 + 0x54;
|
|
if (g_game->_challenge == 0x2c) {
|
|
stageType = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomStageType(g_game->_currentRoomIdx);
|
|
puVar1 = puStack_20;
|
|
}
|
|
puStack_20 = puVar1;
|
|
local_60 = CONCAT44(this->_roomType,(uint32_t)local_60);
|
|
local_74[0] = stageType;
|
|
if (this->_bossId == 0x37) {
|
|
uVar10 = 0x12;
|
|
goto LAB_007f17bc;
|
|
}
|
|
iVar8 = g_game->_currentRoomIdx;
|
|
if (iVar8 == -8) {
|
|
uVar10 = 0x1b;
|
|
goto LAB_007f17bc;
|
|
}
|
|
if (iVar8 == -0x10) {
|
|
uVar10 = 0xd;
|
|
goto LAB_007f17bc;
|
|
}
|
|
if (iVar8 == -0x13) {
|
|
uVar10 = 0x3d;
|
|
goto LAB_007f17bc;
|
|
}
|
|
if (iVar8 == -0x14) {
|
|
uVar10 = 0x3e;
|
|
goto LAB_007f17bc;
|
|
}
|
|
switch(this->_roomType) {
|
|
case 2:
|
|
uVar10 = 0x14;
|
|
if (iVar8 == -0xd) {
|
|
uVar10 = 0x17;
|
|
}
|
|
goto LAB_007f1670;
|
|
case 3:
|
|
uVar10 = 0x1a;
|
|
break;
|
|
default:
|
|
if (iVar8 == -0x11) {
|
|
Level::boss_count_adjust(GHIDRA_CAST<int *>((local_74 + 2)),GHIDRA_CAST<int *>(local_74));
|
|
local_74[3] = local_74[2];
|
|
stageType = local_74[0];
|
|
game = extraout_EDX;
|
|
uVar10 = local_74[2];
|
|
}
|
|
else {
|
|
game = g_game;
|
|
}
|
|
local_74[0] = stageType;
|
|
if (game->_challenge == 0x2d) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x8))) = game->_dungeonPlacementSeed;
|
|
local_40._capacity = 7;
|
|
local_40._buf[0xc] = '\x02';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 7;
|
|
if (uVar10 - 1 < 0xb) {
|
|
uVar10 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((local_40._buf + 8)))))->RNG::RandomInt(0xb);
|
|
uVar10 = uVar10 + 1;
|
|
local_74[3] = uVar10;
|
|
}
|
|
stageType = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((local_40._buf + 8)))))->RNG::RandomInt(5);
|
|
if (stageType == 3) {
|
|
stageType = 4;
|
|
}
|
|
}
|
|
local_74[2] = RoomConfig::GetStageID(uVar10,stageType,-1);
|
|
if (uVar10 == 0xc) {
|
|
uVar10 = **GHIDRA_CAST<uint32_t **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if (uVar10 != 0) {
|
|
local_74[2] = uVar10;
|
|
}
|
|
}
|
|
if (local_74[2] == 0x1a) {
|
|
local_40._buf[0xc] = '\x01';
|
|
local_40._buf[0xd] = '\0';
|
|
local_40._buf[0xe] = '\0';
|
|
local_40._buf[0xf] = '\0';
|
|
local_40._size = 0x15;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x8))) = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
local_40._capacity = 0x14;
|
|
uVar10 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((local_40._buf + 8)))))->RNG::RandomInt(0x11);
|
|
uVar10 = uVar10 + 1;
|
|
goto LAB_007f1670;
|
|
}
|
|
if (local_74[2] == 0x23) {
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
uVar10 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar8 + 0x10)) + 0x10));
|
|
if (uVar10 == 0) {
|
|
uVar10 = 0x31;
|
|
}
|
|
else if (uVar10 == 2) {
|
|
uVar10 = 0x33;
|
|
}
|
|
else {
|
|
if (9 < uVar10) {
|
|
uVar10 = *GHIDRA_CAST<uint32_t *>((iVar8 + 0x44)) >> 10 & 1 | 0x34;
|
|
goto LAB_007f1670;
|
|
}
|
|
if (uVar10 == 3) {
|
|
if ((*GHIDRA_CAST<uint32_t *>((iVar8 + 0x44)) >> 2 & 1) != 0) goto LAB_007f16cb;
|
|
}
|
|
else if (uVar10 == 9) {
|
|
LAB_007f16cb:
|
|
uVar10 = 0x36;
|
|
break;
|
|
}
|
|
switchD_007f145f_caseD_1d:
|
|
uVar10 = 0x32;
|
|
}
|
|
break;
|
|
}
|
|
uVar10 = *GHIDRA_CAST<uint32_t *>((g_game->_ventricleRazorPortals + local_74[2] * 0xc4 + 0x658));
|
|
if ((((local_74[2] == 0x18) || (local_74[2] == 0x19)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)) == 5)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 8)) == g_game->_lastBossRoomListIdx)) {
|
|
uVar10 = 0x1c;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) == GHIDRA_CAST<int *>(0x4)) {
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 0xb & 1) != 0)
|
|
goto switchD_007f145f_caseD_a;
|
|
}
|
|
else if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) == GHIDRA_CAST<int *>(0x5)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10)) == 0x5a)) {
|
|
uVar10 = 10;
|
|
break;
|
|
}
|
|
if (uVar10 == 0x21) {
|
|
bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
if (bVar2 != 0) {
|
|
uVar10 = 0x27;
|
|
break;
|
|
}
|
|
goto LAB_007f1679;
|
|
}
|
|
goto LAB_007f1778;
|
|
case 7:
|
|
switchD_007f145f_caseD_7:
|
|
uVar10 = 0x17;
|
|
break;
|
|
case 8:
|
|
uVar10 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10));
|
|
LAB_007f1670:
|
|
if (uVar10 == 0x21) {
|
|
LAB_007f1679:
|
|
if ((this->_bossId == 0x4e) || (this->_secondBossID == 0x4e)) {
|
|
uVar10 = 0x2a;
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xb4)) < 1) {
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58)) & 1) == 0) {
|
|
uVar10 = 0x28;
|
|
}
|
|
}
|
|
else {
|
|
uVar10 = 0x29;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007f1778:
|
|
if (uVar10 == 0x22) {
|
|
descriptor = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (*GHIDRA_CAST<int *>((descriptor[4] + 8)) == 5) {
|
|
if (*GHIDRA_CAST<int *>((descriptor[4] + 0x10)) == 0x57) {
|
|
uVar10 = 0x2b;
|
|
}
|
|
}
|
|
else if ((descriptor[0x11] & 0x1000U) == 0) {
|
|
if (((*GHIDRA_CAST<uint8_t *>((descriptor + 0x16)) & 1) == 0) && (*descriptor != g_game->_startingRoomIdx)
|
|
) {
|
|
uVar10 = 0x2b;
|
|
}
|
|
}
|
|
else {
|
|
uVar10 = 0x2c;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case 9:
|
|
uVar10 = 0x19;
|
|
break;
|
|
case 10:
|
|
case 0xb:
|
|
case 0xe:
|
|
case 0x11:
|
|
case 0x16:
|
|
switchD_007f145f_caseD_a:
|
|
uVar10 = 0xe;
|
|
break;
|
|
case 0xc:
|
|
uVar10 = 0x13;
|
|
break;
|
|
case 0xd:
|
|
uVar10 = 0x1e;
|
|
break;
|
|
case 0xf:
|
|
uVar10 = 0xf;
|
|
break;
|
|
case 0x10:
|
|
switch(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10))) {
|
|
case 1:
|
|
uVar10 = 0x37;
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
uVar10 = 0x38;
|
|
break;
|
|
case 4:
|
|
uVar10 = 0x39;
|
|
break;
|
|
default:
|
|
uVar10 = 0x1d;
|
|
}
|
|
break;
|
|
case 0x12:
|
|
uVar10 = 0x15;
|
|
break;
|
|
case 0x13:
|
|
uVar10 = 0x16;
|
|
break;
|
|
case 0x14:
|
|
uVar10 = 0x11;
|
|
break;
|
|
case 0x15:
|
|
uVar10 = 0x18;
|
|
break;
|
|
case 0x18:
|
|
uVar10 = 0x23;
|
|
break;
|
|
case 0x1b:
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10));
|
|
if (iVar8 == 1) {
|
|
uVar10 = 0x24;
|
|
}
|
|
else {
|
|
if (iVar8 != 3) goto switchD_007f145f_caseD_7;
|
|
uVar10 = 0x26;
|
|
}
|
|
break;
|
|
case 0x1d:
|
|
goto switchD_007f145f_caseD_1d;
|
|
}
|
|
LAB_007f17bc:
|
|
bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft();
|
|
if ((bVar2 == 0) || (g_game->_currentDimensionIdx != 1)) {
|
|
LAB_007f187c:
|
|
if (g_game->_currentDimensionIdx != 2) goto LAB_007f17ef;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
uVar10 = 0x3c;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar8 + 0x10)) + 0x10)) == 0x21) {
|
|
uVar10 = 0x35;
|
|
}
|
|
}
|
|
else {
|
|
if (uVar10 == 0x20) {
|
|
uVar10 = 0x3a;
|
|
}
|
|
else {
|
|
if (uVar10 != 0x2e) goto LAB_007f187c;
|
|
uVar10 = 0x3b;
|
|
}
|
|
LAB_007f17ef:
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
}
|
|
uVar9 = *GHIDRA_CAST<uint32_t *>((iVar8 + 0x58));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6b00)))) = uVar9;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6af0)))) = uVar9;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6af4)))) = 0x900000005;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6afc)))) = 7;
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&this->_backdrop))))->Backdrop::Init(uVar10,0);
|
|
if (local_74[3] == 0xc) {
|
|
iVar8 = **GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || ((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) {
|
|
if (iVar8 == 0) goto LAB_007f1979;
|
|
if (iVar8 == 0x23) {
|
|
voidRoomStage = 0xd;
|
|
goto LAB_007f1971;
|
|
}
|
|
if (iVar8 < 0x1b) {
|
|
if (0xc < iVar8) {
|
|
if (iVar8 == 0xd) {
|
|
voidRoomStage = 9;
|
|
}
|
|
else {
|
|
voidRoomStageType = iVar8 - 0xe;
|
|
if (voidRoomStageType < 4) {
|
|
voidRoomStage = GHIDRA_INT(voidRoomStageType) / 2 + 10;
|
|
voidRoomStageType = voidRoomStageType & 0x80000001;
|
|
if (GHIDRA_INT(voidRoomStageType) < 0) {
|
|
voidRoomStageType = (voidRoomStageType - 1 | 0xfffffffe) + 1;
|
|
}
|
|
goto LAB_007f1961;
|
|
}
|
|
if (iVar8 != 0x1a) goto LAB_007f1979;
|
|
voidRoomStage = 0xc;
|
|
}
|
|
goto LAB_007f1971;
|
|
}
|
|
voidRoomStageType = (iVar8 + -1) % 3;
|
|
voidRoomStage = ((iVar8 + -1) / 3) * 2 + 1;
|
|
}
|
|
else {
|
|
voidRoomStage = (GHIDRA_INT((iVar8 - 0x1bU)) / 2) * 2 + 1;
|
|
voidRoomStageType = iVar8 - 0x1bU & 0x80000001;
|
|
if (GHIDRA_INT(voidRoomStageType) < 0) {
|
|
voidRoomStageType = (voidRoomStageType - 1 | 0xfffffffe) + 1;
|
|
}
|
|
voidRoomStageType = voidRoomStageType + 4;
|
|
}
|
|
LAB_007f1961:
|
|
if (voidRoomStage == 0) goto LAB_007f1979;
|
|
}
|
|
else {
|
|
if (iVar8 == 0x18) {
|
|
voidRoomStage = 6;
|
|
}
|
|
else {
|
|
if (iVar8 != 0x19) {
|
|
if (iVar8 < 0x1b) {
|
|
if (0xc < iVar8) goto LAB_007f1979;
|
|
voidRoomStageType = (iVar8 + -1) % 3;
|
|
voidRoomStage = (iVar8 + -1) / 3 + 1;
|
|
}
|
|
else {
|
|
voidRoomStage = (iVar8 + -0x1b) / 2 + 1;
|
|
voidRoomStageType = (iVar8 + -0x1b) % 2 + 4;
|
|
}
|
|
goto LAB_007f1961;
|
|
}
|
|
voidRoomStage = 7;
|
|
}
|
|
LAB_007f1971:
|
|
voidRoomStageType = 0;
|
|
}
|
|
local_74[3] = voidRoomStage;
|
|
stageType = voidRoomStageType;
|
|
}
|
|
LAB_007f1979:
|
|
if ((this->_roomType == 0x10) || (uVar10 == 0x12)) {
|
|
FXLayers::clear(uVar4);
|
|
uVar9 = extraout_ECX_02;
|
|
if (uVar10 != 0x12) goto LAB_007f1a86;
|
|
}
|
|
else {
|
|
pathCapacity = 0xf;
|
|
pathSize = 0xc;
|
|
local_58[0] = 'f';
|
|
local_58[1] = 'x';
|
|
local_58[2] = 'l';
|
|
local_58[3] = 'a';
|
|
local_58[4] = 'y';
|
|
local_58[5] = 'e';
|
|
local_58[6] = 'r';
|
|
local_58[7] = 's';
|
|
builtin_strncpy(local_50,".xml",5);
|
|
local_14 = 0;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&g_manager->_modManager),&local_40,GHIDRA_CAST<std_string *>(local_58));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
path = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
|
|
path = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<FXLayers *>((&this->_fxLayers)))->FXLayers::LoadConfig(path,local_74[3],stageType);
|
|
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
uVar9 = extraout_ECX;
|
|
if (0xf < local_40._capacity) {
|
|
uVar4 = local_40._capacity + 1;
|
|
pcVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_40._buf))) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pcVar5 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + -4));
|
|
uVar4 = local_40._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar5))))) goto LAB_007f1a64;
|
|
}
|
|
operator_delete(pcVar5,uVar4);
|
|
uVar9 = extraout_ECX_00;
|
|
}
|
|
local_14 = -1;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0xc))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0xc))) & 0xffffffff;
|
|
local_40._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < pathCapacity) {
|
|
uVar4 = pathCapacity + 1;
|
|
pvVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_58)) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x0))) + -4);
|
|
uVar4 = pathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
LAB_007f1a64:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,uVar4);
|
|
uVar9 = extraout_ECX_01;
|
|
}
|
|
LAB_007f1a86:
|
|
if (uVar10 != 0x1c) goto LAB_007f1c03;
|
|
}
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0xc))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0xc))) & 0xffffffff;
|
|
local_40._capacity = 0xf;
|
|
local_40._buf[0] = '\0';
|
|
local_40._buf[1] = '\0';
|
|
local_40._buf[2] = '\0';
|
|
local_40._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
local_40._size = 0x1b;
|
|
local_40._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_40._buf))) + 0x0))),"gfx/Effect_SatanRadial.anm2",0x1c);
|
|
local_14 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100)))))))->ANM2::Load(&local_40,0);
|
|
local_14 = -1;
|
|
bVar2 = extraout_CL;
|
|
if (0xf < local_40._capacity) {
|
|
uVar4 = local_40._capacity + 1;
|
|
pcVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_40._buf))) + 0x0)));
|
|
if (0xfff < uVar4) {
|
|
pcVar5 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + -4));
|
|
uVar4 = local_40._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_40._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar5,uVar4);
|
|
bVar2 = extraout_CL_00;
|
|
}
|
|
if (uVar10 == 0x1c) {
|
|
pcVar5 = msvc::_Allocate(0x20);
|
|
pathSize = 0x1f;
|
|
pathCapacity = 0x1f;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x0))) = pcVar5;
|
|
builtin_strncpy(pcVar5,"gfx/satan_radial_ultragreed.png",0x20);
|
|
local_14 = 3;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100)))))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(local_58));
|
|
local_14 = -1;
|
|
bVar2 = extraout_CL_01;
|
|
if (0xf < pathCapacity) {
|
|
uVar10 = pathCapacity + 1;
|
|
pvVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_58)) + 0x0)));
|
|
if (0xfff < uVar10) {
|
|
pvVar6 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x0))) + -4);
|
|
uVar10 = pathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x0))) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,uVar10);
|
|
bVar2 = extraout_CL_02;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7100)))))))->ANM2::LoadGraphics(bVar2);
|
|
uVar9 = extraout_ECX_03;
|
|
LAB_007f1c03:
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(uVar9);
|
|
if (((char)this->_gridPaths[this->_backdropType * 0x4f + 0x589] == '\0') &&
|
|
(0 < this->_gridPaths[this->_backdropType * 0x4f + 0x585])) {
|
|
iVar8 = this->_backdropType;
|
|
if ((iVar8 == 0x34) || (iVar8 == 0x35)) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10)) == 10) {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_closet_L.png"));
|
|
local_14 = 4;
|
|
FUN_008283d0(pvVar6);
|
|
local_14 = 5;
|
|
}
|
|
else {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_closet_R.png"));
|
|
local_14 = 6;
|
|
FUN_008283d0(pvVar6);
|
|
local_14 = 7;
|
|
}
|
|
if ((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) + 0xc))(), cVar3 != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(&local_60);
|
|
}
|
|
local_14 = -1;
|
|
}
|
|
else {
|
|
switch(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48))) {
|
|
default:
|
|
if (iVar8 == 0xb) {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_utero.png"));
|
|
local_14 = 8;
|
|
}
|
|
else {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading.png"));
|
|
local_14 = 9;
|
|
}
|
|
break;
|
|
case 2:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_ih.png"));
|
|
local_14 = 0x15;
|
|
break;
|
|
case 3:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_iv.png"));
|
|
local_14 = 0x14;
|
|
break;
|
|
case 4:
|
|
if (iVar8 == 0xb) {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_1x2_utero.png"));
|
|
local_14 = 0xc;
|
|
}
|
|
else {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_1x2.png"));
|
|
local_14 = 0xd;
|
|
}
|
|
break;
|
|
case 5:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_iiv.png"));
|
|
local_14 = 0x16;
|
|
break;
|
|
case 6:
|
|
if (iVar8 == 0xb) {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_2x1_utero.png"));
|
|
local_14 = 10;
|
|
}
|
|
else {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_2x1.png"));
|
|
local_14 = 0xb;
|
|
}
|
|
break;
|
|
case 7:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_iih.png"));
|
|
local_14 = 0x17;
|
|
break;
|
|
case 8:
|
|
if (iVar8 == 0xb) {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_2x2_utero.png"));
|
|
local_14 = 0xe;
|
|
}
|
|
else {
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_2x2.png"));
|
|
local_14 = 0xf;
|
|
}
|
|
break;
|
|
case 9:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_ltl.png"));
|
|
local_14 = 0x10;
|
|
break;
|
|
case 10:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_ltr.png"));
|
|
local_14 = 0x11;
|
|
break;
|
|
case 0xb:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_lbl.png"));
|
|
local_14 = 0x12;
|
|
break;
|
|
case 0xc:
|
|
pvVar6 = Manager::LoadImage(&local_60,GHIDRA_CAST<uint8_t *>("gfx/backdrop/shading_lbr.png"));
|
|
local_14 = 0x13;
|
|
}
|
|
FUN_008283d0(pvVar6);
|
|
local_14 = -1;
|
|
TexturePtr::release();
|
|
}
|
|
}
|
|
if (DAT_00c797bc != GHIDRA_CAST<int *>(0x0)) {
|
|
local_60 = 0;
|
|
msvc::vector::resize(&local_60);
|
|
puVar7 = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((puVar7 + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((puVar7 + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*puVar7 = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797ec,0);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
local_40._buf[8] = (uint8_t)g_graphicsManager_blendMode[0];
|
|
local_40._buf[9] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x1)));
|
|
local_40._buf[10] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x2)));
|
|
local_40._buf[0xb] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x3)));
|
|
local_40._buf[0xc] = (uint8_t)g_graphicsManager_blendMode[1];
|
|
local_40._buf[0xd] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x1)));
|
|
local_40._buf[0xe] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x2)));
|
|
local_40._buf[0xf] = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x3)));
|
|
local_40._size = g_graphicsManager_blendMode[2];
|
|
local_40._capacity = g_graphicsManager_blendMode[3];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))) = GHIDRA_CAST<int *>(g_graphicsManager_blendMode[4]);
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 0;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 0;
|
|
clearFn = *(code **)(*DAT_00c797bc + 0x20);
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_58 + 4)))))->KColor::SetFromARGB(0xffffffff);
|
|
local_74[2] = 0;
|
|
local_74[1] = 0;
|
|
(*clearFn)(local_74 + 1,extraout_ECX_04);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x0))) = local_40._buf[8];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x1))) = local_40._buf[9];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x2))) = local_40._buf[10];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[0])) + 0x3))) = local_40._buf[0xb];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x0))) = local_40._buf[0xc];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x1))) = local_40._buf[0xd];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x2))) = local_40._buf[0xe];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_graphicsManager_blendMode[1])) + 0x3))) = local_40._buf[0xf];
|
|
g_graphicsManager_blendMode[2] = local_40._size;
|
|
g_graphicsManager_blendMode[3] = local_40._capacity;
|
|
g_graphicsManager_blendMode[4] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_INT(local_60))) + 0x4)));
|
|
_glfw_context_reset(1);
|
|
pop_render_target();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007f2070
|
|
void Room::reload_backdrop()
|
|
{
|
|
float colorRed;
|
|
float colorGreen;
|
|
float colorAmount;
|
|
float colorBlue;
|
|
float colorGreen;
|
|
float colorRed;
|
|
Game *game;
|
|
float targetBrightness;
|
|
float targetContrast;
|
|
|
|
LoadBackdropGraphics(this);
|
|
game = g_game;
|
|
colorRed = *GHIDRA_CAST<float *>(&(this->_fxLayers)._fxParams);
|
|
colorGreen = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0x4))));
|
|
colorBlue = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0x8))));
|
|
colorAmount = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0xc))));
|
|
colorRed = (this->_fxLayers)._fxParams.brightness;
|
|
colorGreen = (this->_fxLayers)._fxParams.contrast;
|
|
targetBrightness = (this->_fxLayers)._fxParams.brightness;
|
|
targetContrast = (this->_fxLayers)._fxParams.contrast;
|
|
(g_game->_targetColorModifier)._red = colorRed;
|
|
(game->_targetColorModifier)._green = colorGreen;
|
|
(game->_targetColorModifier)._blue = colorBlue;
|
|
(game->_targetColorModifier)._amount = colorAmount;
|
|
(game->_currentColorModifier)._red = colorRed;
|
|
(game->_currentColorModifier)._green = colorGreen;
|
|
(game->_currentColorModifier)._blue = colorBlue;
|
|
(game->_currentColorModifier)._amount = colorAmount;
|
|
(game->_targetColorModifier)._brightness = targetBrightness;
|
|
(game->_targetColorModifier)._contrast = targetContrast;
|
|
(game->_currentColorModifier)._brightness = colorRed;
|
|
(game->_currentColorModifier)._contrast = colorGreen;
|
|
game->_shouldLerpColorModState = 0;
|
|
return;
|
|
}
|
|
|
|
// 007f2390
|
|
void Room::update_bounds(uint8_t isFromGridSize)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
void *openRows;
|
|
int iVar3;
|
|
int iVar4;
|
|
bool isColumnAllWall;
|
|
int iVar5;
|
|
int iVar6;
|
|
int iVar7;
|
|
uint64_t *allocCounter;
|
|
float topLeftX;
|
|
float topLeftY;
|
|
int scanRow;
|
|
int lastColumn;
|
|
int leftColumn;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
uint32_t allocSize;
|
|
uint64_t oldAllocated;
|
|
int *roomConfig;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01100;
|
|
local_10 = ExceptionList;
|
|
roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if (((roomConfig != GHIDRA_CAST<int *>(0x0)) && (roomConfig[2] == 0x10)) && (*roomConfig == 0x23)) {
|
|
(this->_topLeftPos).x = -49.230774;
|
|
(this->_topLeftPos).y = 72.30768;
|
|
(this->_bottomRightPos).x = 689.2308;
|
|
(this->_bottomRightPos).y = 487.69232;
|
|
return;
|
|
}
|
|
if (isFromGridSize != 0) {
|
|
iVar1 = this->_gridWidth;
|
|
if ((iVar1 < 2) || (this->_gridHeight < 2)) {
|
|
iVar2 = -1;
|
|
}
|
|
else {
|
|
iVar2 = iVar1 + 1;
|
|
}
|
|
topLeftX = ((float)(iVar2 % iVar1) * 40.0 + 40.0) - 20.0;
|
|
topLeftY = ((float)(iVar2 / iVar1) * 40.0 + 120.0) - 20.0;
|
|
(this->_topLeftPos).x = topLeftX;
|
|
(this->_topLeftPos).y = topLeftY;
|
|
iVar2 = this->_gridHeight;
|
|
(this->_bottomRightPos).x = (float)(iVar1 + -2) * 40.0 + topLeftX;
|
|
(this->_bottomRightPos).y = (float)(iVar2 + -2) * 40.0 + topLeftY;
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48));
|
|
if (((iVar1 != 2) && (iVar1 != 3)) && ((iVar1 != 5 && (iVar1 != 7)))) {
|
|
return;
|
|
}
|
|
iVar1 = iVar1 * 0x20;
|
|
iVar5 = *GHIDRA_CAST<int *>((&DAT_00c35b80 + iVar1));
|
|
iVar2 = *GHIDRA_CAST<int *>((&DAT_00c35b98 + iVar1));
|
|
iVar6 = *GHIDRA_CAST<int *>((&DAT_00c35b84 + iVar1));
|
|
iVar1 = *GHIDRA_CAST<int *>((&DAT_00c35b9c + iVar1));
|
|
if ((((iVar5 < 0) || (iVar4 = this->_gridWidth, iVar4 <= iVar5)) || (iVar6 < 0)) ||
|
|
(this->_gridHeight <= iVar6)) {
|
|
iVar4 = this->_gridWidth;
|
|
iVar5 = -1;
|
|
}
|
|
else {
|
|
iVar5 = iVar6 * iVar4 + iVar5;
|
|
}
|
|
(this->_topLeftPos).x = ((float)(iVar5 % iVar4) * 40.0 + 40.0) - 20.0;
|
|
(this->_topLeftPos).y = ((float)(iVar5 / iVar4) * 40.0 + 120.0) - 20.0;
|
|
if (((iVar2 < 0) || (iVar6 = this->_gridWidth, iVar6 <= iVar2)) ||
|
|
((iVar1 < 0 || (this->_gridHeight <= iVar1)))) {
|
|
iVar6 = this->_gridWidth;
|
|
iVar2 = -1;
|
|
}
|
|
else {
|
|
iVar2 = iVar6 * iVar1 + iVar2;
|
|
}
|
|
iVar5 = iVar2 / iVar6;
|
|
iVar2 = iVar2 % iVar6;
|
|
goto LAB_007f27c1;
|
|
}
|
|
ExceptionList = &local_10;
|
|
openRows = tracked_alloc(0,(void *)0x0,(uint64_t)GHIDRA_UINT(this->_gridHeight));
|
|
iVar1 = this->_gridHeight;
|
|
iVar2 = 0;
|
|
if (0 < iVar1) {
|
|
do {
|
|
*GHIDRA_CAST<uint8_t *>((iVar2 + GHIDRA_INT(openRows))) = 1;
|
|
iVar2 = iVar2 + 1;
|
|
iVar1 = this->_gridHeight;
|
|
} while (iVar2 < iVar1);
|
|
}
|
|
iVar2 = this->_gridWidth + -2;
|
|
leftColumn = 1;
|
|
iVar1 = iVar1 + -2;
|
|
scanRow = 1;
|
|
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48));
|
|
if (((iVar5 == 2) || (iVar5 == 3)) || (iVar5 == 5)) {
|
|
LAB_007f25e2:
|
|
iVar5 = iVar5 * 0x20;
|
|
iVar6 = *GHIDRA_CAST<int *>((&DAT_00c35b80 + iVar5));
|
|
scanRow = *GHIDRA_CAST<int *>((&DAT_00c35b84 + iVar5));
|
|
iVar2 = *GHIDRA_CAST<int *>((&DAT_00c35b98 + iVar5));
|
|
iVar1 = *GHIDRA_CAST<int *>((&DAT_00c35b9c + iVar5));
|
|
iVar4 = iVar6;
|
|
lastColumn = iVar2;
|
|
}
|
|
else {
|
|
iVar6 = leftColumn;
|
|
iVar4 = leftColumn;
|
|
lastColumn = iVar2;
|
|
if (iVar5 == 7) goto LAB_007f25e2;
|
|
}
|
|
while( true ) {
|
|
iVar5 = scanRow;
|
|
iVar7 = iVar1;
|
|
if (lastColumn < iVar6) break;
|
|
isColumnAllWall = true;
|
|
if (iVar1 < scanRow) {
|
|
LAB_007f2673:
|
|
leftColumn = iVar4 + 1;
|
|
if (iVar6 != iVar4) {
|
|
leftColumn = iVar4;
|
|
}
|
|
iVar5 = iVar6 + -1;
|
|
if (iVar2 != lastColumn) {
|
|
iVar5 = iVar2;
|
|
}
|
|
}
|
|
else {
|
|
do {
|
|
if (((iVar6 < 0) || (this->_gridWidth <= iVar6)) ||
|
|
((iVar5 < 0 ||
|
|
((((this->_gridHeight <= iVar5 || (iVar7 = this->_gridWidth * iVar5 + iVar6, iVar7 < 0))
|
|
|| (this->_gridEntities[iVar7] == (void *)0x0)) ||
|
|
((iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(this->_gridEntities[iVar7]) + 4)), iVar7 != 0xf &&
|
|
(iVar7 != 0x10)))))))) {
|
|
isColumnAllWall = false;
|
|
*GHIDRA_CAST<uint8_t *>((iVar5 + GHIDRA_INT(openRows))) = 0;
|
|
}
|
|
iVar5 = iVar5 + 1;
|
|
} while (iVar5 <= iVar1);
|
|
if (isColumnAllWall) goto LAB_007f2673;
|
|
iVar5 = lastColumn;
|
|
leftColumn = iVar4;
|
|
}
|
|
iVar2 = iVar5;
|
|
iVar6 = iVar6 + 1;
|
|
iVar4 = leftColumn;
|
|
}
|
|
for (; scanRow <= iVar1; scanRow = scanRow + 1) {
|
|
if (*GHIDRA_CAST<char *>((scanRow + GHIDRA_INT(openRows))) == '\0') {
|
|
iVar6 = iVar1;
|
|
}
|
|
else {
|
|
iVar3 = iVar5 + 1;
|
|
if (scanRow != iVar5) {
|
|
iVar3 = iVar5;
|
|
}
|
|
iVar6 = scanRow + -1;
|
|
if (iVar7 != iVar1) {
|
|
iVar6 = iVar7;
|
|
}
|
|
iVar5 = iVar3;
|
|
}
|
|
iVar7 = iVar6;
|
|
}
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (openRows != (void *)0x0) {
|
|
allocSize = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(openRows) + -4));
|
|
oldAllocated = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - allocSize;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(oldAllocated) < allocSize));
|
|
free(GHIDRA_CAST<uint32_t *>((GHIDRA_INT(openRows) + -4)));
|
|
}
|
|
if (((iVar4 < 0) || (this->_gridWidth <= iVar4)) || ((iVar5 < 0 || (this->_gridHeight <= iVar5))))
|
|
{
|
|
iVar4 = -1;
|
|
}
|
|
else {
|
|
iVar4 = this->_gridWidth * iVar5 + iVar4;
|
|
}
|
|
iVar1 = this->_gridWidth;
|
|
(this->_topLeftPos).x = ((float)(iVar4 % iVar1) * 40.0 + 40.0) - 20.0;
|
|
(this->_topLeftPos).y = ((float)(iVar4 / iVar1) * 40.0 + 120.0) - 20.0;
|
|
if ((((iVar2 < 0) || (iVar1 = this->_gridWidth, iVar1 <= iVar2)) || (iVar7 < 0)) ||
|
|
(this->_gridHeight <= iVar7)) {
|
|
iVar1 = this->_gridWidth;
|
|
iVar2 = -1;
|
|
}
|
|
else {
|
|
iVar2 = iVar1 * iVar7 + iVar2;
|
|
}
|
|
iVar5 = iVar2 / iVar1;
|
|
iVar2 = iVar2 % iVar1;
|
|
LAB_007f27c1:
|
|
(this->_bottomRightPos).y = (float)iVar5 * 40.0 + 120.0 + 20.0;
|
|
(this->_bottomRightPos).x = (float)iVar2 * 40.0 + 40.0 + 20.0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007f2800
|
|
void Room::Init(RoomConfig_Room *config, RoomDescriptor *descriptor)
|
|
{
|
|
ANM2 *pickup;
|
|
uint32_t *puVar1;
|
|
code *pcVar2;
|
|
uint16_t uVar3;
|
|
RoomConfig_Room *pRVar4;
|
|
uint8_t bVar5;
|
|
char cVar6;
|
|
uint32_t uVar7;
|
|
LayerState *layer;
|
|
int iVar8;
|
|
float fVar9;
|
|
EntityConfig_Entity *entityConfigEntry;
|
|
uint32_t *puVar10;
|
|
GridEntity *gridEntity;
|
|
Entity_Player *player;
|
|
EntityList_EL *queryResult;
|
|
uint32_t uVar11;
|
|
Entity *spawned;
|
|
RoomDescriptor *roomDesc;
|
|
uint8_t *puVar12;
|
|
float *extraout_EAX;
|
|
Vector *spawnPos;
|
|
uint32_t uVar13;
|
|
uint32_t preventedCurses;
|
|
Game *pGVar14;
|
|
uint32_t separatorSegment;
|
|
uint32_t nameSegment;
|
|
wchar_t *******title;
|
|
ColorMod *other;
|
|
void *extraout_EAX_00;
|
|
uint8_t bVar15;
|
|
char *pcVar16;
|
|
int iVar17;
|
|
int extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
Entity_Player *firstPlayer;
|
|
int *piVar18;
|
|
std_string *playerName;
|
|
void *textData;
|
|
uint32_t extraout_ECX_01;
|
|
PlayerManager *playerManager;
|
|
uint32_t uVar19;
|
|
short *spawnEntry;
|
|
std_string *nameCursor;
|
|
uint8_t *charCursor;
|
|
Game *pGVar20;
|
|
Game *pGVar21;
|
|
void **ppvVar22;
|
|
uint32_t *puVar23;
|
|
uint8_t *pbVar24;
|
|
Room *currentRoom;
|
|
bool isLess;
|
|
float fVar25;
|
|
Vector diceFloorCenter;
|
|
Vector carpetCenter;
|
|
Vector seedItemCenter;
|
|
Vector startRoomCenter;
|
|
Vector lunaCenter;
|
|
Vector isaacsTombCenter;
|
|
Vector randomPos;
|
|
Vector enterPos;
|
|
ColorMod ascentWallColor;
|
|
ColorMod seedWallColor;
|
|
ColorMod seedFloorColor;
|
|
ColorMod ascentFloorColor;
|
|
uint8_t findResult [8];
|
|
int foundNode;
|
|
uint8_t collectibleList [20];
|
|
uint64_t lunaRngShifts;
|
|
uint64_t diceFloorRngShifts;
|
|
uint64_t isaacsTombRngShifts;
|
|
uint32_t *roomTypeBits [5];
|
|
uint64_t greedRngShifts;
|
|
RNG placementRng;
|
|
uint64_t firstVisitRngShifts;
|
|
Vector tinyFlyPos;
|
|
Vector effect33Pos;
|
|
Vector effect63Pos;
|
|
Vector effect63PosB;
|
|
Vector effect64Pos;
|
|
Vector centerSpawnPos;
|
|
Vector effect87Pos;
|
|
char *rayTexturePaths [2];
|
|
uint8_t rayImage [4];
|
|
int *rayImageRefCount;
|
|
Vector oldChestPos;
|
|
Vector freePickupPos;
|
|
Vector effect82Pos;
|
|
Vector effect65PosB;
|
|
Vector firstPortalPos;
|
|
Vector secondPortalPosAlt;
|
|
Vector secondPortalPos;
|
|
Vector effect156Pos;
|
|
Vector collectiblePos;
|
|
Vector leftItemPos;
|
|
Vector effect65Pos;
|
|
uint64_t seedItemRngShifts;
|
|
uint64_t spawnRngShifts;
|
|
uint32_t spawnRngShift3;
|
|
uint8_t isPickupListOwned;
|
|
Game *pickupListData;
|
|
int pickupListCapacity;
|
|
uint32_t pickupListSize;
|
|
RNG spawnRng;
|
|
Vector effect158Pos;
|
|
uint64_t uStack_5c0;
|
|
Vector seedItemPos;
|
|
RNG decorationRng;
|
|
void *collectiblesBegin;
|
|
Game *collectiblesEnd;
|
|
Game *collectiblesCapacity;
|
|
float fStack_590;
|
|
float fStack_58c;
|
|
RNG ambientRng;
|
|
char isHasRaglich;
|
|
Vector VStack_574;
|
|
char isHasDump;
|
|
char isHasHeretic;
|
|
char isHasWater;
|
|
Room *room;
|
|
RoomConfig_Room *roomConfig;
|
|
Game *pGStack_560;
|
|
void **ppvStack_55c;
|
|
uint8_t bStack_555;
|
|
Game *pGStack_554;
|
|
Game *pGStack_550;
|
|
Game *pGStack_54c;
|
|
char cStack_545;
|
|
Game *local_544;
|
|
Game *local_540 [73];
|
|
uint8_t auStack_41c [24];
|
|
uint8_t auStack_404 [24];
|
|
uint8_t auStack_3ec [24];
|
|
uint8_t auStack_3d4 [24];
|
|
uint8_t auStack_3bc [24];
|
|
uint8_t auStack_3a4 [24];
|
|
uint8_t auStack_38c [24];
|
|
uint8_t auStack_374 [24];
|
|
uint8_t auStack_35c [24];
|
|
uint8_t auStack_344 [28];
|
|
uint64_t floodRngShifts;
|
|
uint64_t uStack_318;
|
|
std_string versusText;
|
|
RNG rayRng;
|
|
wchar_t *******titleText [4];
|
|
uint32_t titleSize;
|
|
uint32_t titleCapacity;
|
|
int scoreRoomType;
|
|
int scoreFlag;
|
|
Game *scoreValue;
|
|
std_string lightGradientPath;
|
|
std_string spotLightPath;
|
|
std_string minibossName;
|
|
uint32_t portalTypes [4];
|
|
uint8_t twinNameWide [128];
|
|
uint8_t playerNameWide [128];
|
|
uint8_t soloPlayerNameWide [128];
|
|
uint8_t minibossNameWide [128];
|
|
uint8_t versusWide [68];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t uStack_14;
|
|
int listIndex;
|
|
Manager *manager;
|
|
Entity_Pickup *pickup;
|
|
void *pillRngs;
|
|
|
|
puStack_20 = versusWide + 100;
|
|
uStack_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b01279;
|
|
local_1c = ExceptionList;
|
|
uVar7 = __security_cookie ^ GHIDRA_UINT((versusWide + 0x58));
|
|
ExceptionList = &local_1c;
|
|
roomConfig = config;
|
|
room = this;
|
|
local_24 = uVar7;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryEffects)))->TemporaryEffects::ClearEffects(0);
|
|
puVar10 = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))));
|
|
*GHIDRA_CAST<uint32_t *>(puVar10[1]) = 0;
|
|
puVar10 = GHIDRA_CAST<uint32_t *>(*puVar10);
|
|
while (puVar10 != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
puVar1 = GHIDRA_CAST<uint32_t *>(*puVar10);
|
|
operator_delete(puVar10,0x20);
|
|
puVar10 = puVar1;
|
|
}
|
|
local_544 = GHIDRA_CAST<Game *>(0xa);
|
|
*GHIDRA_CAST<uint32_t *>(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))));
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300)))) + 4)) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))));
|
|
local_540[0] = GHIDRA_CAST<Game *>(this->_outputGroupCallbacks);
|
|
pbVar24 = this->_outputGroupGridIndices;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7304)))) = 0;
|
|
do {
|
|
iVar17 = *GHIDRA_CAST<int *>(pbVar24);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(pbVar24,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)pbVar24,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar17 + 4));
|
|
*GHIDRA_CAST<int *>((iVar17 + 4)) = iVar17;
|
|
*GHIDRA_CAST<int *>(iVar17) = iVar17;
|
|
*GHIDRA_CAST<int *>((iVar17 + 8)) = iVar17;
|
|
pbVar24[4] = 0;
|
|
pbVar24[5] = 0;
|
|
pbVar24[6] = 0;
|
|
pbVar24[7] = 0;
|
|
pbVar24 = pbVar24 + 8;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 4)) = local_540[0]->_stage;
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 0xc));
|
|
local_544 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_544[-1]._console) + 3));
|
|
} while (local_544 != GHIDRA_CAST<Game *>(0x0));
|
|
FUN_00429f50(uVar7);
|
|
FUN_00429f50();
|
|
currentRoom = room;
|
|
puVar12 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x1bb8)));
|
|
(room->_waterCurrent).x = g_vectorZero.x;
|
|
(room->_waterCurrent).y = g_vectorZero.y;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x73f0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7764)))) = 0;
|
|
room->_lavaIntensity = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7769))) = 0;
|
|
room->_isPickupVisionInvalid = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x11f6))) = 1;
|
|
currentRoom->_isFirstEnemyDead = 0;
|
|
currentRoom->_pacifist = 0;
|
|
if (*GHIDRA_CAST<int *>(puVar12) != 0) {
|
|
local_544 = GHIDRA_CAST<Game *>(puVar12);
|
|
msvc::multiset<unsigned_int>::erase(&local_544);
|
|
*GHIDRA_CAST<uint32_t *>(puVar12) = 0;
|
|
}
|
|
pGVar20 = g_game;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1bbc))) = 0;
|
|
iVar17 = *GHIDRA_CAST<int *>(currentRoom->_pendingGridRemovals);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1bc0)))) = g_vectorZero.x;
|
|
fVar25 = g_vectorZero.y;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x7214)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x7218)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x70fc)))) = 0;
|
|
currentRoom->_slowdownDuration = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x7230)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x721c)))) = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1bc4)))) = fVar25;
|
|
currentRoom->_enterFrame = pGVar20->_frameCount;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(currentRoom->_pendingGridRemovals,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)
|
|
currentRoom->_pendingGridRemovals,*(_Tree_node<unsigned_int,void*> **)(iVar17 + 4));
|
|
*GHIDRA_CAST<int *>((iVar17 + 4)) = iVar17;
|
|
*GHIDRA_CAST<int *>(iVar17) = iVar17;
|
|
*GHIDRA_CAST<int *>((iVar17 + 8)) = iVar17;
|
|
manager = g_manager;
|
|
currentRoom->_pendingGridRemovals[4] = 0;
|
|
currentRoom->_pendingGridRemovals[5] = 0;
|
|
currentRoom->_pendingGridRemovals[6] = 0;
|
|
currentRoom->_pendingGridRemovals[7] = 0;
|
|
piVar18 = (manager->_entityConfig)._entities._head;
|
|
local_540[0] = GHIDRA_CAST<Game *>(*piVar18);
|
|
if (local_540[0] != GHIDRA_CAST<Game *>(piVar18)) {
|
|
do {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_540[0]) + 200)) = 0;
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)local_540);
|
|
} while (local_540[0] != (manager->_entityConfig)._entities._head);
|
|
}
|
|
pRVar4 = roomConfig;
|
|
currentRoom = room;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x11f5))) = 1;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Room %d.%d(%s)\n"));
|
|
(GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::ResetRoomBlacklist();
|
|
FUN_007eb010();
|
|
currentRoom->_gridWidth = pRVar4->Width + 2;
|
|
bVar5 = (currentRoom->_lightSprite)._loaded;
|
|
currentRoom->_gridHeight = pRVar4->Height + 2;
|
|
if (bVar5 == 0) {
|
|
pickup = ¤tRoom->_lightSprite;
|
|
lightGradientPath._size = 0;
|
|
lightGradientPath._capacity = 0xf;
|
|
lightGradientPath._buf[0] = '\0';
|
|
lightGradientPath._buf[1] = '\0';
|
|
lightGradientPath._buf[2] = '\0';
|
|
lightGradientPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lightGradientPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
lightGradientPath._size = 0x16;
|
|
lightGradientPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(lightGradientPath._buf))) + 0x0))),"gfx/LightGradient.anm2",0x17);
|
|
uStack_14 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((pickup)))->ANM2::Load(&lightGradientPath,1);
|
|
uStack_14 = 0xffffffff;
|
|
if (0xf < lightGradientPath._capacity) {
|
|
uVar7 = lightGradientPath._capacity + 1;
|
|
pcVar16 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(lightGradientPath._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar16 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lightGradientPath._buf)) + 0x0))) + -4));
|
|
uVar7 = lightGradientPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lightGradientPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar16))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar16,uVar7);
|
|
}
|
|
lightGradientPath._size = 0;
|
|
lightGradientPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lightGradientPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(lightGradientPath._buf)) + 0x0))) & 0xffffff00;
|
|
layer = (GHIDRA_CAST<ANM2 *>((pickup)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_minFilterMode = 1;
|
|
layer = (GHIDRA_CAST<ANM2 *>((pickup)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(&(currentRoom->_lightSprite)._animDefaultName);
|
|
layer->_magFilterMode = 1;
|
|
if (0xf < (currentRoom->_lightSprite)._animDefaultName._capacity) {
|
|
pGStack_54c = *GHIDRA_CAST<Game **>((GHIDRA_CAST<std_string *>(pGStack_54c))->_buf);
|
|
}
|
|
pbVar24 = (currentRoom->_lightSprite)._animState._animData;
|
|
if (pbVar24 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_007f2c5c:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((pickup)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(pGStack_54c),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(currentRoom->_lightSprite)._animState)))->AnimationState::Rewind();
|
|
(currentRoom->_lightSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar24 + 0x14))) {
|
|
pbVar24 = *GHIDRA_CAST<uint8_t **>(pbVar24);
|
|
}
|
|
pGVar20 = pGStack_54c;
|
|
do {
|
|
bVar5 = *pbVar24;
|
|
bVar15 = (uint8_t)pGVar20->_stage;
|
|
isLess = bVar5 < bVar15;
|
|
if (bVar5 != bVar15) {
|
|
LAB_007f2c44:
|
|
uVar7 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007f2c49;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar24[1];
|
|
bVar15 = *GHIDRA_CAST<char *>((GHIDRA_INT(&pGVar20->_stage) + 1));
|
|
isLess = bVar5 < bVar15;
|
|
if (bVar5 != bVar15) goto LAB_007f2c44;
|
|
pbVar24 = pbVar24 + 2;
|
|
pGVar20 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar20->_stage) + 2));
|
|
} while (bVar5 != 0);
|
|
uVar7 = 0;
|
|
LAB_007f2c49:
|
|
if ((uVar7 != 0) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT((currentRoom->_lightSprite)._animState._animData) + 0x34)) != '\0' &&
|
|
((currentRoom->_lightSprite)._animState._isPlaying == 0)))) goto LAB_007f2c5c;
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((¤tRoom->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_blendMode[0] = DAT_00c354ac;
|
|
layer->_blendMode[1] = DAT_00c354b0;
|
|
layer->_blendMode[2] = DAT_00c354b4;
|
|
layer->_blendMode[3] = DAT_00c354b8;
|
|
layer->_blendMode[4] = DAT_00c354bc;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x705d))) == '\0') {
|
|
puVar12 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f54)));
|
|
spotLightPath._size = 0;
|
|
spotLightPath._capacity = 0xf;
|
|
spotLightPath._buf[0] = '\0';
|
|
spotLightPath._buf[1] = '\0';
|
|
spotLightPath._buf[2] = '\0';
|
|
spotLightPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spotLightPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
spotLightPath._size = 0x12;
|
|
spotLightPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(spotLightPath._buf))) + 0x0))),"gfx/SpotLight.anm2",0x13);
|
|
uStack_14 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar12))))->ANM2::Load(&spotLightPath,1);
|
|
uStack_14 = 0xffffffff;
|
|
if (0xf < spotLightPath._capacity) {
|
|
uVar7 = spotLightPath._capacity + 1;
|
|
pcVar16 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(spotLightPath._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pcVar16 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spotLightPath._buf)) + 0x0))) + -4));
|
|
uVar7 = spotLightPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spotLightPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar16))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar16,uVar7);
|
|
}
|
|
spotLightPath._size = 0;
|
|
spotLightPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spotLightPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spotLightPath._buf)) + 0x0))) & 0xffffff00;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar12))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_minFilterMode = 1;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar12))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f6c))));
|
|
layer->_magFilterMode = 1;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f80))))) {
|
|
pGStack_54c = *GHIDRA_CAST<Game **>(pGStack_54c);
|
|
}
|
|
pbVar24 = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f88))));
|
|
if (pbVar24 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar24 + 0x14))) {
|
|
pbVar24 = *GHIDRA_CAST<uint8_t **>(pbVar24);
|
|
}
|
|
pGVar20 = pGStack_54c;
|
|
do {
|
|
bVar5 = *pbVar24;
|
|
bVar15 = (uint8_t)pGVar20->_stage;
|
|
isLess = bVar5 < bVar15;
|
|
if (bVar5 != bVar15) {
|
|
LAB_007f2e20:
|
|
uVar7 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_007f2e25;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar24[1];
|
|
bVar15 = *GHIDRA_CAST<char *>((GHIDRA_INT(&pGVar20->_stage) + 1));
|
|
isLess = bVar5 < bVar15;
|
|
if (bVar5 != bVar15) goto LAB_007f2e20;
|
|
pbVar24 = pbVar24 + 2;
|
|
pGVar20 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar20->_stage) + 2));
|
|
} while (bVar5 != 0);
|
|
uVar7 = 0;
|
|
LAB_007f2e25:
|
|
if ((uVar7 == 0) &&
|
|
((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f88)))) + 0x34)) == '\0' ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f98))) != '\0')))) goto LAB_007f2e57;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar12))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(pGStack_54c),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f84)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x6f98))) = 1;
|
|
}
|
|
}
|
|
LAB_007f2e57:
|
|
piVar18 = currentRoom->_doorGridPositions;
|
|
iVar17 = 0;
|
|
do {
|
|
iVar8 = room_shape_get_door_grid_index
|
|
(iVar17,currentRoom->_gridWidth,currentRoom->_gridHeight,
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(descriptor->Data) + 0x48)));
|
|
iVar17 = extraout_ECX + 1;
|
|
*piVar18 = iVar8;
|
|
piVar18 = piVar18 + 1;
|
|
} while (iVar17 < 8);
|
|
*GHIDRA_CAST<RoomDescriptor **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) = descriptor;
|
|
currentRoom->_roomType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(descriptor->Data) + 8));
|
|
currentRoom->_bossId = 0;
|
|
currentRoom->_secondBossID = 0;
|
|
func_0x009e2830();
|
|
(GHIDRA_CAST<BeastArena *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x776c))))))->BeastArena::init();
|
|
fVar25 = 0.0;
|
|
if (currentRoom->_roomType == 5) {
|
|
pGVar20 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
local_540[0] = GHIDRA_CAST<Game *>((*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar20)) + 0x10)))) + 0x44)) - 1));
|
|
pGStack_554 = pGVar20;
|
|
if (-1 < GHIDRA_INT(local_540[0])) {
|
|
VStack_574.y = (float)&g_manager->_entityConfig;
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) * 0x10));
|
|
do {
|
|
fStack_58c = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar20)) + 0x10))));
|
|
iVar17 = -1;
|
|
iVar8 = 0;
|
|
local_544 = *GHIDRA_CAST<Game **>((GHIDRA_CAST<char *>(fStack_58c) + 0x40));
|
|
pbVar24 = &local_544->_bossChallenge;
|
|
if (pbVar24[GHIDRA_INT(pGStack_54c)] == 0) {
|
|
fVar9 = fStack_58c;
|
|
}
|
|
else {
|
|
local_544 = *GHIDRA_CAST<Game **>((GHIDRA_INT(&local_544->_stageType) + GHIDRA_INT(pGStack_54c)));
|
|
do {
|
|
fVar9 = (float)local_544->_roomList[0]._doors[iVar8 * 3 + -10];
|
|
if (fVar25 < fVar9) {
|
|
iVar17 = iVar8;
|
|
fVar25 = fVar9;
|
|
}
|
|
iVar8 = iVar8 + 1;
|
|
} while (iVar8 < GHIDRA_INT(GHIDRA_UINT(pbVar24[GHIDRA_INT(pGStack_54c)])));
|
|
fVar25 = 0.0;
|
|
fVar9 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGStack_554)) + 0x10))));
|
|
currentRoom = room;
|
|
}
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_INT(pGStack_54c->_roomList[0]._doors) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar9) + 0x40)) + -0x2c
|
|
));
|
|
entityConfigEntry =
|
|
EntityConfig::GetEntity
|
|
(GHIDRA_CAST<EntityConfig *>(VStack_574.y),*GHIDRA_CAST<int *>((iVar8 + iVar17 * 0xc)),
|
|
GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((iVar8 + 4 + iVar17 * 0xc))),
|
|
GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((iVar8 + 6 + iVar17 * 0xc))));
|
|
if ((entityConfigEntry != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) &&
|
|
(iVar17 = entityConfigEntry->bossID, iVar17 != 0)) {
|
|
if (currentRoom->_bossId == 0) {
|
|
currentRoom->_bossId = iVar17;
|
|
}
|
|
else if (iVar17 != currentRoom->_bossId) {
|
|
currentRoom->_secondBossID = iVar17;
|
|
}
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + -1));
|
|
pGVar20 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
pGStack_54c = GHIDRA_CAST<Game *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGStack_54c[-1])) + 0x68d64))) + 8));
|
|
} while (-1 < GHIDRA_INT(local_540[0]));
|
|
}
|
|
}
|
|
pGVar20 = g_game;
|
|
uVar7 = GHIDRA_UINT(descriptor->Flags) >> 4;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x7228))) = (uint8_t)uVar7 & 1;
|
|
if (((pGVar20->_dailyChallenge)._specialDailyId == 0x11) && ((uVar7 & 1) != 0)) {
|
|
uVar11 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pGVar20->_gameStateFlags) + 4));
|
|
*GHIDRA_CAST<uint32_t *>(&pGVar20->_gameStateFlags) = GHIDRA_UINT(pGVar20->_gameStateFlags) | 0x20000000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pGVar20->_gameStateFlags) + 4)) = uVar11;
|
|
}
|
|
currentRoom->_hasTriggerPressurePlates = 0;
|
|
update_bounds(currentRoom,1);
|
|
manager = g_manager;
|
|
pGVar20 = g_game;
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
switch(g_game->_stage) {
|
|
case 1:
|
|
currentRoom->_shopLevel = 1;
|
|
break;
|
|
case 2:
|
|
LAB_007f30fb:
|
|
currentRoom->_shopLevel = 2;
|
|
break;
|
|
case 3:
|
|
LAB_007f3107:
|
|
currentRoom->_shopLevel = 3;
|
|
break;
|
|
case 4:
|
|
LAB_007f3113:
|
|
currentRoom->_shopLevel = 4;
|
|
break;
|
|
case 5:
|
|
goto LAB_007f311f;
|
|
case 6:
|
|
currentRoom->_shopLevel = GHIDRA_UINT((currentRoom->_roomType == 1)) * 4 + 1;
|
|
}
|
|
}
|
|
else {
|
|
currentRoom->_shopLevel = 1;
|
|
if (((manager->_persistentGameData)._achievements[0x9a] == 0) &&
|
|
((iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))), iVar17 != 2 ||
|
|
(((pGVar20->_dailyChallenge)._id == 0 && (pGVar20->_isDebug == 0)))))) {
|
|
if (((manager->_persistentGameData)._achievements[0x99] != 0) ||
|
|
((iVar17 == 2 && (((pGVar20->_dailyChallenge)._id != 0 || (pGVar20->_isDebug != 0))))))
|
|
goto LAB_007f3113;
|
|
if (((manager->_persistentGameData)._achievements[0x98] != 0) ||
|
|
((iVar17 == 2 && (((pGVar20->_dailyChallenge)._id != 0 || (pGVar20->_isDebug != 0))))))
|
|
goto LAB_007f3107;
|
|
if (((manager->_persistentGameData)._achievements[0x97] != 0) ||
|
|
((iVar17 == 2 && (((pGVar20->_dailyChallenge)._id != 0 || (pGVar20->_isDebug != 0))))))
|
|
goto LAB_007f30fb;
|
|
}
|
|
else {
|
|
LAB_007f311f:
|
|
currentRoom->_shopLevel = 5;
|
|
}
|
|
}
|
|
currentRoom->_shopRestockTimer = -1;
|
|
msvc::deque<ptr>::_Tidy();
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] "));
|
|
}
|
|
spawnRngShifts = 0x700000002;
|
|
pGVar20 = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x5c));
|
|
local_544 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
spawnRngShift3 = 7;
|
|
pGStack_560 = pGVar20;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("SpawnRNG seed: %u\n"));
|
|
isHasWater = '\0';
|
|
bStack_555 = 0;
|
|
cStack_545 = '\0';
|
|
isHasDump = '\0';
|
|
isHasHeretic = '\0';
|
|
isHasRaglich = '\0';
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
if (roomConfig->SpawnCount != 0) {
|
|
pGStack_550 = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
if (pGVar20 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(pGVar20) >> ((uint8_t)spawnRngShifts & 0x1f) ^ GHIDRA_UINT(pGVar20);
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)spawnRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
pGVar20 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)local_544 & 0x1f) ^ uVar7));
|
|
textData = (void *)(GHIDRA_INT(roomConfig->Spawns) + GHIDRA_INT(pGStack_550));
|
|
pGStack_554 = pGVar20;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(textData) + 8)) != '\0') {
|
|
puVar10 = (GHIDRA_CAST<Spawn *>((textData)))->Spawn::PickEntry((float)((double)GHIDRA_INT(pGVar20) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(pGVar20) >> 0x1f)])
|
|
* 2.3283062e-10);
|
|
switch(*puVar10) {
|
|
case 0x339:
|
|
case 0x38b:
|
|
isHasWater = '\x01';
|
|
break;
|
|
case 0x33d:
|
|
switchD_007f32bc_caseD_33d:
|
|
bStack_555 = 1;
|
|
break;
|
|
case 0x36c:
|
|
case 0x396:
|
|
switchD_007f32bc_caseD_36c:
|
|
isHasDump = '\x01';
|
|
case 0x372:
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 0x1000;
|
|
break;
|
|
case 0x389:
|
|
isHasHeretic = '\x01';
|
|
break;
|
|
case 0x397:
|
|
isHasRaglich = '\x01';
|
|
break;
|
|
case 0x3ca:
|
|
switch(*GHIDRA_CAST<uint16_t *>((puVar10 + 1))) {
|
|
case 0:
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 0x200;
|
|
break;
|
|
case 1:
|
|
uVar7 = GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(puVar10) + 6)));
|
|
if (uVar7 == 0x14) goto switchD_007f32bc_caseD_33d;
|
|
if (uVar7 == 0xb) {
|
|
cStack_545 = '\x01';
|
|
}
|
|
else {
|
|
if (uVar7 == 10) goto switchD_007f32bc_caseD_36c;
|
|
if (uVar7 < 4) {
|
|
(currentRoom->_waterCurrent).x = *GHIDRA_CAST<float *>((&DAT_00c5d0e8 + uVar7 * 8));
|
|
(currentRoom->_waterCurrent).y = *GHIDRA_CAST<float *>((&DAT_00c5d0ec + uVar7 * 8));
|
|
}
|
|
}
|
|
break;
|
|
case 3:
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 0x2000;
|
|
break;
|
|
case 4:
|
|
iVar17 = currentRoom->_gridWidth;
|
|
iVar8 = *GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(roomConfig->Spawns) + GHIDRA_INT(pGStack_550))) + 1 +
|
|
(*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(pGStack_550) + 2 + GHIDRA_INT(roomConfig->Spawns))) + 1) * iVar17;
|
|
fStack_590 = (float)(iVar8 % iVar17) * 40.0 + 40.0;
|
|
fStack_58c = (float)(iVar8 / iVar17) * 40.0 + 120.0;
|
|
FUN_00429f90(&fStack_590);
|
|
FUN_00429f90(&fStack_590);
|
|
pGVar20 = pGStack_554;
|
|
currentRoom = room;
|
|
}
|
|
}
|
|
}
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550) + 0x10));
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
} while (local_540[0] < GHIDRA_UINT((uint16_t)roomConfig->SpawnCount));
|
|
}
|
|
LoadBackdropGraphics(currentRoom);
|
|
pGVar20 = g_game;
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1d18));
|
|
if ((iVar17 == 6) || (iVar17 == 0x2c)) {
|
|
LAB_007f34f1:
|
|
fVar25 = 1.0;
|
|
}
|
|
else {
|
|
if ((iVar17 == 0xc) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x10)) + 8)) == 1)) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
floodRngShifts = 0x1300000001;
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x3);
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 1 ^ uVar7;
|
|
uVar7 = uVar7 << 0x13 ^ uVar7;
|
|
if ((uVar7 >> 3 ^ uVar7) % 5 == 0) goto LAB_007f34f1;
|
|
}
|
|
fVar25 = 0.0;
|
|
}
|
|
currentRoom->_waterAmount = fVar25;
|
|
currentRoom->_waterLerpColorDuration = -1;
|
|
currentRoom->_waterLerpColorCountdown = -1;
|
|
uVar7 = (GHIDRA_CAST<Game *>((pGVar20)))->Game::GetStageID((uint8_t)pGVar20);
|
|
if (((uVar7 == 0x1b) || (uVar7 == 0x1c)) && (currentRoom->_roomType != 0x1b)) {
|
|
currentRoom->_waterAmount = 1.0;
|
|
}
|
|
local_540[0] = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
if (((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) >> 8 & 1) != 0) || (cStack_545 != '\0')) {
|
|
currentRoom->_waterAmount = 1.0;
|
|
}
|
|
iVar17 = currentRoom->_backdropType;
|
|
if (((iVar17 == 0x10) || (iVar17 == 0x23)) ||
|
|
((currentRoom->_roomType == 0x10 ||
|
|
((isHasDump != '\0' && ((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) >> 8 & 1) == 0)))))) {
|
|
currentRoom->_waterAmount = 0.0;
|
|
}
|
|
if (0.0 < currentRoom->_waterAmount) {
|
|
currentRoom->_lavaIntensity = 0.0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(local_540[0]) + 0x40)) == 0) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1))) = 1;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x58));
|
|
firstVisitRngShifts = 0x900000005;
|
|
local_544 = GHIDRA_CAST<Game *>(0x7);
|
|
if ((iVar17 == 6) && ((g_manager->_optionsConfig)._enableWaterSurface == 0)) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) | 0x20;
|
|
}
|
|
else {
|
|
cVar6 = (char)currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x5ba];
|
|
if (cVar6 == '\x02') {
|
|
LAB_007f3658:
|
|
cStack_545 = '\x01';
|
|
}
|
|
else {
|
|
if (cVar6 == '\x01') {
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 5 ^ uVar7;
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
uVar7 = uVar7 >> 7 ^ uVar7;
|
|
if ((uVar7 & 1) == 0) goto LAB_007f3658;
|
|
}
|
|
cStack_545 = '\0';
|
|
}
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) | 0x20;
|
|
if (cStack_545 == '\0') {
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) & 0xffffffdf;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) = uVar19;
|
|
}
|
|
local_540[0] = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 5 ^ uVar7;
|
|
uVar19 = uVar7 << 9 ^ uVar7;
|
|
local_544 = GHIDRA_CAST<Game *>((CONCAT31((uint3)(uVar19 >> 0xf),~(uint8_t)(uVar19 >> 7) ^ (uint8_t)uVar7) &
|
|
0xffffff01));
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) | 0x40;
|
|
if ((char)local_544 == '\0') {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) & 0xffffffbf;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x44)) = uVar7;
|
|
pGVar20 = g_game;
|
|
if ((((currentRoom->_roomType == 2) &&
|
|
(g_game->_shopVisits = g_game->_shopVisits + 1, 5 < pGVar20->_shopVisits)) &&
|
|
(iVar17 = pGVar20->_difficulty, iVar17 != 2)) && (iVar17 != 3)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x17b);
|
|
}
|
|
iVar17 = currentRoom->_backdropType;
|
|
if (iVar17 == 0x20) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
if ((uVar7 >> 5 & 1) == 0) goto LAB_007f3755;
|
|
if ((uVar7 >> 9 & 1) != 0) {
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) = uVar7 & 0xffffffdf;
|
|
iVar17 = currentRoom->_backdropType;
|
|
goto LAB_007f3755;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007f3755:
|
|
if ((iVar17 == 0x3a) || (iVar17 == 0x3b)) {
|
|
if ((g_game->_levelStateFlags & 0x400000U) != 0) {
|
|
bStack_555 = 0;
|
|
isHasWater = '\x01';
|
|
}
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 0x2000;
|
|
}
|
|
}
|
|
if (isHasWater != '\0') {
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 0x20;
|
|
}
|
|
if (bStack_555 != 0) {
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 & 0xffffffdf;
|
|
}
|
|
if (currentRoom->_backdropType == 0x2e) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
if ((uVar7 >> 5 & 1) != 0) {
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) = uVar7 | 0x1000;
|
|
}
|
|
}
|
|
}
|
|
memset(currentRoom->_gridPaths,0,0xa80);
|
|
currentRoom->_roomClearDelay = 0;
|
|
pGStack_54c = GHIDRA_CAST<Game *>(0x0);
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x54)) = 0;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x50)) = 0;
|
|
if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) {
|
|
pGStack_550 = GHIDRA_CAST<Game *>(currentRoom->_gridEntities);
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
pGVar20 = local_540[0];
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar17 + 0x68)) + GHIDRA_INT(local_540[0]))) != 0) {
|
|
if (*GHIDRA_CAST<uint32_t **>(pGStack_550) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(**(code **)**GHIDRA_CAST<uint32_t **>(pGStack_550))(1);
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
}
|
|
local_544 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<int *>((iVar17 + 0x68)) + GHIDRA_INT(pGVar20)));
|
|
if (local_544->_stage != 0) {
|
|
gridEntity = Isaac::CreateGridEntity(local_544->_stage,GHIDRA_UINT(pGStack_54c));
|
|
*GHIDRA_CAST<GridEntity **>(pGStack_550) = gridEntity;
|
|
iVar17 = local_544->_stageType;
|
|
bVar5 = local_544->_bossChallenge;
|
|
bVar15 = local_544->_devilRoomDisabled;
|
|
uVar3 = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_544)) + 0xa))));
|
|
iVar8 = local_544->_curses;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x4)))) = local_544->_stage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = iVar17;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xc))) = bVar5;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xd))) = bVar15;
|
|
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xe)))) = uVar3;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = iVar8;
|
|
uVar11 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_544)) + 0x10))));
|
|
iVar17 = local_544->_roomList[0].GridIndex;
|
|
iVar8 = local_544->_roomList[0].SafeGridIndex;
|
|
listIndex = local_544->_roomList[0].ListIndex;
|
|
gridEntity->_collisionClass = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x14)))) = uVar11;
|
|
gridEntity->_varData = iVar17;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c)))) = iVar8;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x20)))) = listIndex;
|
|
gridEntity->BeginBatches();
|
|
pGVar20 = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c))) = 1;
|
|
gridEntity->_spawnFrame = pGVar20->_frameCount;
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
pGVar20 = local_540[0];
|
|
}
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar17 + 0x68)) + GHIDRA_INT(pGVar20)));
|
|
if (iVar8 == 7) {
|
|
*GHIDRA_CAST<int *>((iVar17 + 0x54)) = *GHIDRA_CAST<int *>((iVar17 + 0x54)) + 1;
|
|
}
|
|
else if (iVar8 == 0xe) {
|
|
*GHIDRA_CAST<short *>((iVar17 + 0x50)) = *GHIDRA_CAST<short *>((iVar17 + 0x50)) + 1;
|
|
}
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(pGVar20) + 0x20));
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550) + 4));
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_54c->_stage) + 1));
|
|
} while (GHIDRA_INT(pGStack_54c) < currentRoom->_gridHeight * currentRoom->_gridWidth);
|
|
}
|
|
if ((0 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x54))) && (currentRoom->_backdropType == 0x22)
|
|
) {
|
|
currentRoom->_waterAmount = 0.0;
|
|
}
|
|
spawnRng._seed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x5c));
|
|
spawnRng._shift3 = 9;
|
|
spawnRng._shift1 = 2;
|
|
spawnRng._shift2 = 0x15;
|
|
if ((g_game->_difficulty == 1) || (uVar7 = 1, g_game->_difficulty == 3)) {
|
|
uVar7 = 2;
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&spawnRng)))->RNG::RandomInt(uVar7);
|
|
if (uVar7 == 0) {
|
|
if (spawnRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(spawnRng._seed) >> ((uint8_t)spawnRng._shift1 & 0x1f) ^ spawnRng._seed;
|
|
uVar7 = uVar7 << ((uint8_t)spawnRng._shift2 & 0x1f) ^ uVar7;
|
|
iVar17 = GetRandomTileIndex(currentRoom,uVar7 >> ((uint8_t)spawnRng._shift3 & 0x1f) ^ uVar7);
|
|
}
|
|
else {
|
|
iVar17 = -1;
|
|
}
|
|
currentRoom->_tintedRockIdx = iVar17;
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
if (roomConfig->SpawnCount != 0) {
|
|
fStack_58c = 0.0;
|
|
pGVar20 = pGStack_560;
|
|
do {
|
|
if (pGVar20 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(pGVar20) >> ((uint8_t)spawnRngShifts & 0x1f) ^ GHIDRA_UINT(pGVar20);
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)spawnRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
pGVar20 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)spawnRngShift3 & 0x1f) ^ uVar7));
|
|
spawnEntry = GHIDRA_CAST<short *>((GHIDRA_INT(fStack_58c) + GHIDRA_INT(roomConfig->Spawns)));
|
|
pGStack_54c = GHIDRA_CAST<Game *>((*spawnEntry + 1 + (spawnEntry[1] + 1) * currentRoom->_gridWidth));
|
|
pGStack_560 = pGVar20;
|
|
if ((char)spawnEntry[4] != '\0') {
|
|
local_544 = (GHIDRA_CAST<Spawn *>((spawnEntry)))->Spawn::PickEntry((float)((double)GHIDRA_INT(pGVar20) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(pGVar20) >> 0x1f)]) *
|
|
2.3283062e-10);
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
msvc::set<int>::find_node(findResult,&pGStack_54c);
|
|
pGVar20 = pGStack_560;
|
|
if ((*GHIDRA_CAST<char *>((foundNode + 0xd)) != '\0') ||
|
|
(iVar8 = foundNode, GHIDRA_INT(pGStack_54c) < *GHIDRA_CAST<int *>((foundNode + 0x10)))) {
|
|
iVar8 = *GHIDRA_CAST<int *>((iVar17 + 0x80));
|
|
}
|
|
if (iVar8 == *GHIDRA_CAST<int *>((iVar17 + 0x80))) {
|
|
SpawnEntry(currentRoom,GHIDRA_UINT(pGStack_54c),local_544,GHIDRA_UINT(pGStack_560),GHIDRA_CAST<Entity **>(0x0),0);
|
|
}
|
|
}
|
|
fStack_58c = (float)(GHIDRA_INT(fStack_58c) + 0x10);
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
} while (local_540[0] < GHIDRA_UINT((uint16_t)roomConfig->SpawnCount));
|
|
}
|
|
if (roomConfig->Type == 4) {
|
|
pGVar21 = GHIDRA_CAST<Game *>(0x0);
|
|
collectiblesBegin = (void *)0x0;
|
|
pGVar20 = GHIDRA_CAST<Game *>(0x0);
|
|
pGStack_550 = GHIDRA_CAST<Game *>(0x0);
|
|
collectiblesEnd = GHIDRA_CAST<Game *>(0x0);
|
|
local_544 = GHIDRA_CAST<Game *>(0x0);
|
|
collectiblesCapacity = GHIDRA_CAST<Game *>(0x0);
|
|
uStack_14 = 2;
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
if ((currentRoom->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
pGVar14 = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((currentRoom->_entityList)._updateEL)) + 0x4)))) +
|
|
GHIDRA_INT(local_540[0]) * 4));
|
|
if (pGVar14->_roomList[0].OverrideData == &DAT_00000005) {
|
|
if (pGVar14->_roomList[0].AllowedDoors == 100) {
|
|
pGStack_554 = pGVar14;
|
|
if (pGVar21 == pGVar20) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(pGVar21,&pGStack_554);
|
|
pGVar20 = collectiblesCapacity;
|
|
pGVar21 = collectiblesEnd;
|
|
}
|
|
else {
|
|
pGVar21->_stage = GHIDRA_INT(pGVar14);
|
|
collectiblesEnd = GHIDRA_CAST<Game *>(&pGVar21->_stageType);
|
|
pGVar21 = collectiblesEnd;
|
|
}
|
|
}
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
} while (local_540[0] < GHIDRA_UINT((currentRoom->_entityList)._updateEL._size));
|
|
pGStack_550 = pGVar21;
|
|
local_544 = pGVar20;
|
|
}
|
|
pGVar20 = pGStack_550;
|
|
cStack_545 = '\0';
|
|
if (((g_game->_stage == 10) &&
|
|
((((g_game->_stageType == 0 &&
|
|
(player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0xa1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(iVar17 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0xa1), 1 < iVar17)) ||
|
|
(((g_game->_stage == 10 && (g_game->_stageType == 1)) &&
|
|
((player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x9b),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0) &&
|
|
(iVar17 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x9b), 1 < iVar17)))))))) ||
|
|
(((g_game->_stage == 7 || (g_game->_stage == 8)) &&
|
|
((player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x6f),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0) &&
|
|
(iVar17 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x6f), 1 < iVar17)))))) {
|
|
cStack_545 = '\x01';
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x19e,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (((player == GHIDRA_CAST<Entity_Player *>(0x0)) && (cStack_545 == '\0')) &&
|
|
((*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0 || (((g_game->_roomTransition)._flags & 1) == 0)))) {
|
|
cStack_545 = '\0';
|
|
}
|
|
else {
|
|
cStack_545 = '\x01';
|
|
}
|
|
if ((((g_game->_stageType == 4) || (g_game->_stageType == 5)) ||
|
|
(((bVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0xbb), bVar5 != 0 &&
|
|
(g_game->_stage != 9)) &&
|
|
((((roomConfig->Subtype != 1 && (roomConfig->Subtype != 3)) || (cStack_545 == '\0')) ||
|
|
((g_game->_stageType == 4 || (g_game->_stageType == 5)))))))) &&
|
|
((g_game->_stage < 1 ||
|
|
((6 < g_game->_stage || (bVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x30), bVar5 == 0)))))) {
|
|
textData = collectiblesBegin;
|
|
if ((1 < GHIDRA_UINT((GHIDRA_INT(pGVar20) - GHIDRA_INT(collectiblesBegin) >> 2))) &&
|
|
((g_game->_dailyChallenge)._id == 0)) {
|
|
if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) {
|
|
bVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0xbb);
|
|
if (bVar5 != 0) {
|
|
uStack_318 = 0x500000009;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x5c));
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x19);
|
|
pGStack_554 = GHIDRA_CAST<Game *>(&g_game->_playerManager);
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 9 ^ uVar7;
|
|
uVar7 = uVar7 << 5 ^ uVar7;
|
|
iVar17 = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(pGStack_554))))->PlayerManager::GetTrinketMultiplier(0xbb);
|
|
if (GHIDRA_INT(((uVar7 >> 0x19 ^ uVar7) & 1)) < iVar17) goto LAB_007f3e30;
|
|
textData = collectiblesBegin;
|
|
}
|
|
}
|
|
pickup = *GHIDRA_CAST<Entity_Pickup **>((GHIDRA_CAST<char *>(textData) + 4));
|
|
bVar5 = pickup->_isForceBlind;
|
|
pickup->_isForceBlind = 1;
|
|
if (((pickup->_variant == 100) && (pickup->_subtype != 0)) && (bVar5 != 1)) {
|
|
(GHIDRA_CAST<Entity_Pickup *>((pickup)))->Entity_Pickup::UpdateSprite(0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
LAB_007f3e30:
|
|
textData = collectiblesBegin;
|
|
}
|
|
pGVar20 = g_game;
|
|
if (((g_game->_stageType == 4) || (g_game->_stageType == 5)) &&
|
|
((2 < GHIDRA_UINT((GHIDRA_INT(pGStack_550) - GHIDRA_INT(textData) >> 2)) &&
|
|
((roomConfig->Subtype == 0 || (roomConfig->Subtype == 2)))))) {
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + 8)) + 0x528)) = 0;
|
|
}
|
|
iVar17 = pGVar20->_difficulty;
|
|
if (((iVar17 == 2) || (iVar17 == 3)) &&
|
|
(descriptor->GridIndex != pGVar20->_greedModeTreasureRoomIdx)) {
|
|
uVar19 = 0;
|
|
uVar7 = GHIDRA_INT(pGStack_550) - GHIDRA_INT(textData) >> 2;
|
|
if (uVar7 != 0) {
|
|
do {
|
|
iVar17 = uVar19 * 4;
|
|
uVar19 = uVar19 + 1;
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + iVar17)) + 0x588)) = 0;
|
|
} while (uVar19 < uVar7);
|
|
}
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
if (textData != (void *)0x0) {
|
|
deallocate(textData,GHIDRA_INT(local_544) - GHIDRA_INT(textData) >> 2);
|
|
collectiblesBegin = (void *)0x0;
|
|
collectiblesEnd = GHIDRA_CAST<Game *>(0x0);
|
|
collectiblesCapacity = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
}
|
|
hold_trigger_output_entities(currentRoom);
|
|
uVar7 = 0;
|
|
do {
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x18 + (uVar7 >> 5) * 4)) &
|
|
1 << ((uint8_t)uVar7 & 0x1f)) != 0) {
|
|
MakeDoor(currentRoom,uVar7);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (GHIDRA_INT(uVar7) < 8);
|
|
TrySpawnMegaSatanRoomDoor(currentRoom,0);
|
|
TrySpawnSpecialQuestDoor(currentRoom);
|
|
if ((g_game->_challenge == 0x1f) && (g_game->_currentRoomIdx == -7)) {
|
|
MakeDoor(currentRoom,3);
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(currentRoom->_doors[3]) + 0x394)) = g_game->_startingRoomIdx;
|
|
GridEntity_Door::SetRoomTypes
|
|
(currentRoom->_doors[3],*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x10)) + 8))
|
|
,1);
|
|
}
|
|
make_walls(currentRoom);
|
|
pGVar21 = g_game;
|
|
uVar7 = 0xffffffff;
|
|
pGVar20 = GHIDRA_CAST<Game *>(&DAT_00000005);
|
|
currentRoom->_dungeonRockIdx = -1;
|
|
placementRng._shift1 = 5;
|
|
placementRng._shift2 = 9;
|
|
placementRng._seed = pGVar21->_dungeonPlacementSeed;
|
|
placementRng._shift3 = 7;
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
if (-1 < GHIDRA_INT(uVar7)) break;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&placementRng)))->RNG::RandomInt(g_game->_nbRooms);
|
|
textData = g_game->_roomList[uVar7].Data;
|
|
if ((textData != (void *)0x0) &&
|
|
(((iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + 8)), iVar17 == 5 || (iVar17 == 0xb)) || (iVar17 == 6))))
|
|
{
|
|
uVar7 = 0xffffffff;
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
} while (local_540[0] < 3);
|
|
if (uVar7 == *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 8))) {
|
|
uVar7 = currentRoom->_dungeonRockIdx;
|
|
uVar19 = 0;
|
|
do {
|
|
if (-1 < GHIDRA_INT(uVar7)) break;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&placementRng)))->RNG::RandomInt(currentRoom->_gridHeight * currentRoom->_gridWidth);
|
|
currentRoom->_dungeonRockIdx = uVar7;
|
|
if (((((0x1bf < uVar7) || (currentRoom->_gridEntities[uVar7] == (void *)0x0)) ||
|
|
(iVar17 = *GHIDRA_CAST<int *>((GHIDRA_INT(currentRoom->_gridEntities[uVar7]) + 4)), iVar17 == 0xf)) ||
|
|
((iVar17 == 3 || (iVar17 == 0x16)))) || (iVar17 == 5)) {
|
|
currentRoom->_dungeonRockIdx = -1;
|
|
uVar7 = 0xffffffff;
|
|
}
|
|
uVar19 = uVar19 + 1;
|
|
} while (uVar19 < 10);
|
|
}
|
|
if (currentRoom->_roomType == 0x10) {
|
|
isPickupListOwned = 0;
|
|
pickupListData = GHIDRA_CAST<Game *>(0x0);
|
|
pickupListCapacity = 0;
|
|
pickupListSize = 0;
|
|
uStack_14 = 3;
|
|
queryResult = EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),
|
|
GHIDRA_CAST<EntityList_EL *>(collectibleList),5,100,-1,0,0);
|
|
isPickupListOwned = 1;
|
|
pickupListData = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((queryResult)) + 0x4))));
|
|
pickupListCapacity = queryResult->_capacity;
|
|
pickupListSize = queryResult->_size;
|
|
local_544 = pickupListData;
|
|
local_540[0] = GHIDRA_CAST<Game *>(pickupListSize);
|
|
if (collectibleList[0] == '\0') {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 4;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)collectibleList)) + 0x4))),0);
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),3);
|
|
}
|
|
pGVar21 = local_540[0];
|
|
uVar7 = 0;
|
|
if (local_540[0] != GHIDRA_CAST<Game *>(0x0)) {
|
|
do {
|
|
iVar17 = __RTDynamicCast(local_544->_roomList[0]._doors[uVar7 - 0xc],0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor,0);
|
|
uVar7 = uVar7 + 1;
|
|
pGVar20 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<float *>((iVar17 + 0x33c)) + 10.0));
|
|
*GHIDRA_CAST<Game **>((iVar17 + 0x33c)) = pGVar20;
|
|
*GHIDRA_CAST<float *>((iVar17 + 0x340)) = *GHIDRA_CAST<float *>((iVar17 + 0x340)) + 30.0;
|
|
} while (uVar7 < pGVar21);
|
|
currentRoom = room;
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) {
|
|
ppvStack_55c = currentRoom->_gridEntities;
|
|
do {
|
|
pGVar21 = pGStack_54c;
|
|
if (*ppvStack_55c == (void *)0x0) {
|
|
local_540[0] = GHIDRA_CAST<Game *>(Random());
|
|
if ((GHIDRA_INT(pGVar21) < 0) || (0x1bf < GHIDRA_INT(pGVar21))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if ((pGVar21 < GHIDRA_CAST<Game *>(0x1c0)) && (GHIDRA_INT(ppvStack_55c[0x1d2]) < 0x385)) {
|
|
gridEntity = Isaac::CreateGridEntity(0x13,GHIDRA_UINT(pGVar21));
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
if (*ppvStack_55c != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(*ppvStack_55c))(1);
|
|
}
|
|
*ppvStack_55c = gridEntity;
|
|
*GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x14)))) = local_540[0];
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = 0;
|
|
gridEntity->_varData = 0;
|
|
gridEntity->_collisionClass = 0;
|
|
gridEntity->BeginBatches();
|
|
pGVar21 = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c))) = 1;
|
|
gridEntity->_spawnFrame = pGVar21->_frameCount;
|
|
}
|
|
pGVar21 = pGStack_54c;
|
|
}
|
|
}
|
|
ppvStack_55c = ppvStack_55c + 1;
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar21->_stage) + 1));
|
|
} while (GHIDRA_INT(pGStack_54c) < currentRoom->_gridHeight * currentRoom->_gridWidth);
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
}
|
|
else {
|
|
iVar17 = currentRoom->_backdropType;
|
|
if (((iVar17 != 0x12) && (iVar17 != 0x10)) && (iVar17 != 0x23)) {
|
|
if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) {
|
|
iVar17 = g_game->_stage + 1;
|
|
}
|
|
else {
|
|
iVar17 = g_game->_stage;
|
|
}
|
|
if (((iVar17 != 1) || (g_game->_startingRoomIdx != g_game->_currentRoomIdx)) &&
|
|
(currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x58e] != 0)) {
|
|
pGVar20 = GHIDRA_CAST<Game *>(&DAT_00000005);
|
|
uStack_5c0 = 0x900000005;
|
|
uVar7 = ((*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))))[0x16] & 0x7fffffffU) +
|
|
**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
pGStack_560 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 5 ^ uVar7;
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
uVar7 = uVar7 >> 7 ^ uVar7;
|
|
local_540[0] = GHIDRA_CAST<Game *>((uVar7 & 3));
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 5 ^ uVar7;
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
ppvVar22 = (void **)(uVar7 >> 7 ^ uVar7);
|
|
bStack_555 = roomConfig->Width;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_UINT(ppvVar22) % 5 + GHIDRA_INT(local_540[0])));
|
|
if (0xd < bStack_555 != 7 < roomConfig->Height) {
|
|
if (ppvVar22 == (void **)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(ppvVar22) >> 5 ^ GHIDRA_UINT(ppvVar22);
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
ppvVar22 = (void **)(uVar7 >> 7 ^ uVar7);
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550->_roomList[0]._doors) + (GHIDRA_UINT(ppvVar22) % 9 - 0x30)
|
|
));
|
|
}
|
|
pGVar21 = pGStack_550;
|
|
if ((0xd < bStack_555) && (7 < roomConfig->Height)) {
|
|
if (ppvVar22 == (void **)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(ppvVar22) >> 5 ^ GHIDRA_UINT(ppvVar22);
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
uVar7 = uVar7 >> 7 ^ uVar7;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550->_roomList[0]._doors) + (uVar7 % 9 - 0x30)));
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 5 ^ uVar7;
|
|
uVar7 = uVar7 << 9 ^ uVar7;
|
|
ppvVar22 = (void **)(uVar7 >> 7 ^ uVar7);
|
|
pGVar21 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550->_roomList[0]._doors) + (GHIDRA_UINT(ppvVar22) % 0x12 - 0x30)))
|
|
;
|
|
ppvStack_55c = ppvVar22;
|
|
}
|
|
local_544 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGVar21) * 2));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(0x0);
|
|
if (pGVar21 != GHIDRA_CAST<Game *>(0x0)) {
|
|
do {
|
|
if (ppvVar22 == (void **)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(ppvVar22) >> ((uint8_t)uStack_5c0 & 0x1f) ^ GHIDRA_UINT(ppvVar22);
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)uStack_5c0 >> 0x20) & 0x1f) ^ uVar7;
|
|
ppvVar22 = (void **)(uVar7 >> ((uint8_t)pGStack_560 & 0x1f) ^ uVar7);
|
|
ppvStack_55c = ppvVar22;
|
|
pGStack_550 = GHIDRA_CAST<Game *>(GetRandomTileIndex(currentRoom,GHIDRA_UINT(ppvVar22)));
|
|
if (currentRoom->_gridEntities[GHIDRA_INT(pGStack_550)] == (void *)0x0) {
|
|
local_540[0] = GHIDRA_CAST<Game *>(Random());
|
|
if ((GHIDRA_INT(pGStack_550) < 0) || (0x1bf < GHIDRA_INT(pGStack_550))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if ((pGStack_550 < GHIDRA_CAST<Game *>(0x1c0)) &&
|
|
(currentRoom->_gridPaths[GHIDRA_INT(pGStack_550)] < 0x385)) {
|
|
gridEntity = Isaac::CreateGridEntity(1,GHIDRA_UINT(pGStack_550));
|
|
if (gridEntity != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
if (currentRoom->_gridEntities[GHIDRA_INT(pGStack_550)] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(currentRoom->_gridEntities[GHIDRA_INT(pGStack_550)]))(1);
|
|
}
|
|
currentRoom->_gridEntities[GHIDRA_INT(pGStack_550)] = gridEntity;
|
|
*GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x14)))) = local_540[0];
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x8)))) = 0;
|
|
gridEntity->_varData = 0;
|
|
gridEntity->_collisionClass = 0;
|
|
gridEntity->BeginBatches();
|
|
pGVar21 = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x10)))) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0x1c))) = 1;
|
|
gridEntity->_spawnFrame = pGVar21->_frameCount;
|
|
}
|
|
ppvVar22 = ppvStack_55c;
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_54c->_stage) + 1));
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_54c->_stage) + 1));
|
|
} while (pGStack_54c < local_544);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) && (roomConfig->Type == 1)) {
|
|
pGVar20 = GHIDRA_CAST<Game *>(&DAT_00000005);
|
|
greedRngShifts = 0x900000005;
|
|
local_544 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc)) / 2;
|
|
if (((iVar17 < 0) || (currentRoom->_gridWidth <= iVar17)) || (currentRoom->_gridHeight < 5)) {
|
|
local_540[0] = GHIDRA_CAST<Game *>(0xffffffff);
|
|
}
|
|
else {
|
|
local_540[0] = GHIDRA_CAST<Game *>((iVar17 + currentRoom->_gridWidth * 4));
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>(0x0);
|
|
pGVar21 = GHIDRA_CAST<Game *>(((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58)) & 0x7fffffff) +
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 8))));
|
|
while( true ) {
|
|
if (pGVar21 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(pGVar21) >> ((uint8_t)greedRngShifts & 0x1f) ^ GHIDRA_UINT(pGVar21);
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)greedRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)local_544 & 0x1f) ^ uVar7));
|
|
if (GHIDRA_INT((GHIDRA_UINT(pGStack_550) % 5 + 3)) <= GHIDRA_INT(pGStack_54c)) break;
|
|
VStack_574.x = (float)(GHIDRA_INT(local_540[0]) % currentRoom->_gridWidth) * 40.0 + 40.0;
|
|
VStack_574.y = (float)(GHIDRA_INT(local_540[0]) / currentRoom->_gridWidth) * 40.0 + 120.0;
|
|
FindFreePickupSpawnPosition(currentRoom,&freePickupPos,&VStack_574,0.0,0,0,0);
|
|
iVar8 = GHIDRA_INT(((freePickupPos.x - 40.0) / 40.0 + 0.5));
|
|
pGVar20 = GHIDRA_CAST<Game *>(((freePickupPos.y - 120.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT((float)pGVar20);
|
|
if (((iVar8 < 0) || (currentRoom->_gridWidth <= iVar8)) ||
|
|
((iVar17 < 0 || (currentRoom->_gridHeight <= iVar17)))) {
|
|
uVar7 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar7 = currentRoom->_gridWidth * iVar17 + iVar8;
|
|
}
|
|
if (currentRoom->_gridEntities[uVar7] == (void *)0x0) {
|
|
if (pGStack_550 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar19 = GHIDRA_UINT(pGStack_550) >> ((uint8_t)greedRngShifts & 0x1f) ^ GHIDRA_UINT(pGStack_550);
|
|
uVar19 = uVar19 << ((uint8_t)((uint64_t)greedRngShifts >> 0x20) & 0x1f) ^ uVar19;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((uVar19 >> ((uint8_t)local_544 & 0x1f) ^ uVar19));
|
|
if ((GHIDRA_INT(uVar7) < 0) || (0x1bf < GHIDRA_INT(uVar7))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if (((uVar7 < 0x1c0) && (currentRoom->_gridPaths[uVar7] < 0x385)) &&
|
|
(pGStack_554 = GHIDRA_CAST<Game *>(Isaac)::CreateGridEntity(1,uVar7), pGStack_554 != GHIDRA_CAST<Game *>(0x0))) {
|
|
if (currentRoom->_gridEntities[uVar7] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(currentRoom->_gridEntities[uVar7]))(1);
|
|
}
|
|
currentRoom->_gridEntities[uVar7] = pGStack_554;
|
|
pGStack_554->_roomList[0].GridIndex = GHIDRA_INT(pGStack_550);
|
|
textData = (GHIDRA_CAST<std_vector *>(&pGStack_554->_stage))->_begin;
|
|
*(void **)&pGStack_554->_bossChallenge = (void *)0xa;
|
|
pGStack_554->_roomList[0].SafeGridIndex = 0;
|
|
pGStack_554->_roomList[0]._doors[3] = 0;
|
|
(**(code **)(GHIDRA_CAST<char *>(textData) + 0x20))();
|
|
pGVar21 = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGStack_554)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGStack_554)) + 0x10)))) + 1;
|
|
*GHIDRA_CAST<uint8_t *>(&pGStack_554->_roomList[0].ListIndex) = 1;
|
|
pGStack_554->_roomList[0].OverrideData = (void *)pGVar21->_frameCount;
|
|
}
|
|
currentRoom->_gridPaths[uVar7] = 900;
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_54c->_stage) + 1));
|
|
pGVar21 = pGStack_550;
|
|
}
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < currentRoom->_gridHeight * currentRoom->_gridWidth) {
|
|
ppvVar22 = currentRoom->_gridEntities;
|
|
do {
|
|
if (*ppvVar22 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*ppvVar22) + 4))();
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
ppvVar22 = ppvVar22 + 1;
|
|
} while (GHIDRA_INT(local_540[0]) < currentRoom->_gridHeight * currentRoom->_gridWidth);
|
|
}
|
|
attach_minecarts();
|
|
if ((isHasHeretic != '\0') || (isHasRaglich != '\0')) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c82660) &&
|
|
(_Init_thread_header(&DAT_00c82660), DAT_00c82660 == -1)) {
|
|
_atexit(FUN_00b16540);
|
|
_Init_thread_footer(&DAT_00c82660);
|
|
}
|
|
uVar7 = 0;
|
|
_DAT_00c82668 = DAT_00c82664;
|
|
if ((currentRoom->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
iVar17 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((currentRoom->_entityList)._updateEL)) + 0x4)))) + uVar7 * 4));
|
|
if ((*GHIDRA_CAST<int *>((iVar17 + 0x28)) == 0x21) && (*GHIDRA_CAST<int *>((iVar17 + 0x2c)) == 3)) {
|
|
uVar11 = 0x397;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x380)) = 0x3f800000;
|
|
if (isHasHeretic != '\0') {
|
|
uVar11 = 0x389;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x38)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x16c)) = *GHIDRA_CAST<uint32_t *>((iVar17 + 0x16c)) | 0x400;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x34)) = uVar11;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x168)) = *GHIDRA_CAST<uint32_t *>((iVar17 + 0x168));
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT((currentRoom->_entityList)._updateEL._size));
|
|
}
|
|
}
|
|
RestoreState(currentRoom);
|
|
puVar23 = *GHIDRA_CAST<uint32_t **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x88));
|
|
if (puVar23 != *GHIDRA_CAST<uint32_t **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x8c))) {
|
|
do {
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(*puVar23,puVar23[1],GHIDRA_CAST<Vector *>((puVar23 + 10)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),puVar23[2],puVar23[0xd]);
|
|
pGVar20 = GHIDRA_CAST<Game *>(((float)puVar23[3] * g_vectorOne.x));
|
|
iVar17 = *GHIDRA_CAST<int *>(spawned);
|
|
(spawned->_sprite)._scale.y = (float)puVar23[3] * g_vectorOne.y;
|
|
(spawned->_sprite)._scale.x = (float)pGVar20;
|
|
(**(code **)(iVar17 + 0xc))();
|
|
puVar23 = puVar23 + 0x1e;
|
|
} while (puVar23 != *GHIDRA_CAST<uint32_t **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x8c)));
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
pGStack_54c = GHIDRA_CAST<Game *>(0x18378);
|
|
do {
|
|
pGVar21 = local_540[0];
|
|
local_544 = g_game;
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(*GHIDRA_CAST<int *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGStack_54c[-1])) + 0x68d68))) +
|
|
GHIDRA_INT((g_game->_roomList[0]._doors + -7)))),-1);
|
|
if (roomDesc == *GHIDRA_CAST<RoomDescriptor **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))))) {
|
|
uVar7 = Random();
|
|
pGVar21 = local_540[0];
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_INT(local_544->_roomList[0]._doors) + GHIDRA_INT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGStack_54c[-1])) + 0x68d50))))));
|
|
effect82Pos.x = (float)(iVar17 % currentRoom->_gridWidth) * 40.0 + 40.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>(((float)(iVar17 / currentRoom->_gridWidth) * 40.0 + 120.0));
|
|
effect82Pos.y = (float)pGVar20;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x52,&effect82Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_540[0]),uVar7);
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(pGVar21) + 1));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(&pGStack_54c->_curses);
|
|
} while (GHIDRA_INT(pGStack_54c) < 0x18390);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1))) != '\0') {
|
|
pGVar21 = g_game;
|
|
if ((g_game->_currentRoomIdx == g_game->_startingRoomIdx) && (g_game->_stage != 0xd)) {
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x294,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
((g_game->_difficulty != 2 && (g_game->_difficulty != 3)))) {
|
|
cStack_545 = '\0';
|
|
FUN_00737c10(0x1f,&cStack_545,extraout_ECX_00);
|
|
pGVar21 = g_game;
|
|
uStack_14 = 6;
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < g_game->_nbRooms) {
|
|
local_544 = GHIDRA_CAST<Game *>(&g_game->_roomList[0].Group);
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_544[-1])) + 0x68cd8)))) != 0) && (local_544->_stage < 0)) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_544[-1])) + 0x68cd8)))) + 8));
|
|
roomTypeBits[0][uVar7 >> 5] = roomTypeBits[0][uVar7 >> 5] | 1 << ((uint8_t)uVar7 & 0x1f);
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + 1));
|
|
local_544 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_544->_roomList[0])) + 0xa4))));
|
|
} while (GHIDRA_INT(local_540[0]) < pGVar21->_nbRooms);
|
|
currentRoom = room;
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>(*roomTypeBits[0]);
|
|
if ((GHIDRA_UINT(local_540[0]) & 0x10) != 0) {
|
|
portalTypes[0] = 0;
|
|
}
|
|
pGStack_550 = GHIDRA_CAST<Game *>(GHIDRA_UINT(((GHIDRA_UINT(local_540[0]) & 0x10) != 0)));
|
|
if ((GHIDRA_UINT(local_540[0]) & 0x20) != 0) {
|
|
portalTypes[GHIDRA_INT(pGStack_550)] = 1;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_550->_stage) + 1));
|
|
}
|
|
if ((char)local_540[0] < '\0') {
|
|
portalTypes[GHIDRA_INT(pGStack_550)] = 2;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_550->_stage) + 1));
|
|
}
|
|
if ((GHIDRA_UINT(local_540[0]) & 4) != 0) {
|
|
portalTypes[GHIDRA_INT(pGStack_550)] = 3;
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_550->_stage) + 1));
|
|
}
|
|
if (pGStack_550 != GHIDRA_CAST<Game *>(0x0)) {
|
|
iVar17 = 0;
|
|
decorationRng._shift1 = 9;
|
|
decorationRng._shift2 = 5;
|
|
decorationRng._seed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
ppvStack_55c = (void **)0x19;
|
|
decorationRng._shift3 = 0x19;
|
|
pGStack_560 = GHIDRA_CAST<Game *>(decorationRng._seed);
|
|
if (0 < GHIDRA_INT((GHIDRA_INT(&pGStack_550[-1]._console) + 3))) {
|
|
pGVar20 = pGStack_550 + -1;
|
|
do {
|
|
uVar19 = (GHIDRA_CAST<RNG *>((&decorationRng)))->RNG::RandomInt(GHIDRA_INT(pGStack_550) - iVar17);
|
|
uVar7 = portalTypes[iVar17];
|
|
iVar8 = uVar19 + iVar17;
|
|
portalTypes[iVar17] = portalTypes[iVar8];
|
|
iVar17 = iVar17 + 1;
|
|
portalTypes[iVar8] = uVar7;
|
|
} while (iVar17 < GHIDRA_INT((GHIDRA_INT(&pGVar20->_console) + 3)));
|
|
ppvStack_55c = (void **)decorationRng._shift3;
|
|
pGStack_560 = GHIDRA_CAST<Game *>(decorationRng._seed);
|
|
currentRoom = room;
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>(currentRoom->_gridWidth);
|
|
pGStack_554 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_54c) / 2));
|
|
VStack_574.y = (float)(currentRoom->_gridHeight / 2 + -1);
|
|
decorationRng._seed = GHIDRA_INT(pGStack_560);
|
|
decorationRng._shift3 = GHIDRA_INT(ppvStack_55c);
|
|
if (pGStack_550 < GHIDRA_CAST<Game *>(0x3)) {
|
|
if (pGStack_560 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(currentRoom->_gridWidth);
|
|
if (pGStack_560 == GHIDRA_CAST<Game *>(0x0)) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
uVar7 = GHIDRA_UINT(pGStack_560) >> ((uint8_t)decorationRng._shift1 & 0x1f) ^ GHIDRA_UINT(pGStack_560);
|
|
uVar7 = uVar7 << ((uint8_t)decorationRng._shift2 & 0x1f) ^ uVar7;
|
|
local_540[0] = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)ppvStack_55c & 0x1f) ^ uVar7));
|
|
puVar12 = (uint8_t *)
|
|
(GHIDRA_INT(&((GHIDRA_CAST<EntityConfig *>((GHIDRA_INT(VStack_574.y) + -0x38)))->_edenHair)._capacity) +
|
|
3);
|
|
if ((((GHIDRA_INT(pGStack_554) < 0) || (GHIDRA_INT(pGStack_54c) <= GHIDRA_INT(pGStack_554))) ||
|
|
(GHIDRA_INT(puVar12) < 0)) || (currentRoom->_gridHeight <= GHIDRA_INT(puVar12))) {
|
|
iVar17 = -1;
|
|
}
|
|
else {
|
|
iVar17 = GHIDRA_INT(pGStack_554->_roomList[0]._doors) +
|
|
GHIDRA_INT(puVar12) * GHIDRA_INT(pGStack_54c) + -0x30;
|
|
}
|
|
spawnPos = &secondPortalPos;
|
|
secondPortalPos.x = (float)(iVar17 % GHIDRA_INT(pGStack_54c)) * 40.0 + 40.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>(((float)(iVar17 / GHIDRA_INT(pGStack_54c)) * 40.0 + 120.0));
|
|
portalTypes[1] = portalTypes[0];
|
|
secondPortalPos.y = (float)pGVar20;
|
|
}
|
|
else {
|
|
if (pGStack_560 == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pGStack_54c = GHIDRA_CAST<Game *>(currentRoom->_gridWidth);
|
|
if (pGStack_560 == GHIDRA_CAST<Game *>(0x0)) {
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
}
|
|
fVar25 = VStack_574.y;
|
|
uVar7 = GHIDRA_UINT(pGStack_560) >> ((uint8_t)decorationRng._shift1 & 0x1f) ^ GHIDRA_UINT(pGStack_560);
|
|
uVar7 = uVar7 << ((uint8_t)decorationRng._shift2 & 0x1f) ^ uVar7;
|
|
fStack_58c = (float)(uVar7 >> ((uint8_t)ppvStack_55c & 0x1f) ^ uVar7);
|
|
puVar12 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&pGStack_554[-1]._console) + 2));
|
|
if (((GHIDRA_INT(puVar12) < 0) || (GHIDRA_INT(pGStack_54c) <= GHIDRA_INT(puVar12))) ||
|
|
((GHIDRA_INT(VStack_574.y) < 0 || (currentRoom->_gridHeight <= GHIDRA_INT(VStack_574.y))))) {
|
|
puVar12 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
}
|
|
else {
|
|
puVar12 = puVar12 + GHIDRA_INT(VStack_574.y) * GHIDRA_INT(pGStack_54c);
|
|
}
|
|
firstPortalPos.x = (float)(GHIDRA_INT(puVar12) % GHIDRA_INT(pGStack_54c)) * 40.0 + 40.0;
|
|
firstPortalPos.y = (float)(GHIDRA_INT(puVar12) / GHIDRA_INT(pGStack_54c)) * 40.0 + 120.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa1,&firstPortalPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),portalTypes[0],
|
|
GHIDRA_UINT(fStack_58c));
|
|
if (fStack_58c == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(fStack_58c) >> ((uint8_t)decorationRng._shift1 & 0x1f) ^ GHIDRA_UINT(fStack_58c);
|
|
uVar7 = uVar7 << ((uint8_t)decorationRng._shift2 & 0x1f) ^ uVar7;
|
|
local_540[0] = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)ppvStack_55c & 0x1f) ^ uVar7));
|
|
puVar12 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(GHIDRA_CAST<std_vector *>(&pGStack_554->_stage))->_begin) + 2));
|
|
if (((GHIDRA_INT(puVar12) < 0) || (iVar17 = currentRoom->_gridWidth, iVar17 <= GHIDRA_INT(puVar12)))
|
|
|| ((GHIDRA_INT(fVar25) < 0 || (currentRoom->_gridHeight <= GHIDRA_INT(fVar25))))) {
|
|
iVar17 = currentRoom->_gridWidth;
|
|
puVar12 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
}
|
|
else {
|
|
puVar12 = puVar12 + GHIDRA_INT(fVar25) * iVar17;
|
|
}
|
|
spawnPos = &secondPortalPosAlt;
|
|
secondPortalPosAlt.x = (float)(GHIDRA_INT(puVar12) % iVar17) * 40.0 + 40.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>(((float)(GHIDRA_INT(puVar12) / iVar17) * 40.0 + 120.0));
|
|
secondPortalPosAlt.y = (float)pGVar20;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa1,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),portalTypes[1],
|
|
GHIDRA_UINT(local_540[0]));
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
FID_conflict__Tidy(roomTypeBits);
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x24a,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar7 = Random();
|
|
iVar17 = currentRoom->_gridWidth;
|
|
if ((iVar17 < 0xb) || (currentRoom->_gridHeight < 2)) {
|
|
iVar8 = -1;
|
|
}
|
|
else {
|
|
iVar8 = iVar17 + 10;
|
|
}
|
|
effect156Pos.x = (float)(iVar8 % iVar17) * 40.0 + 40.0;
|
|
effect156Pos.y = (float)(iVar8 / iVar17) * 40.0 + 120.0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x9c,&effect156Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
(GHIDRA_CAST<Entity_Player *>((firstPlayer)))->Entity_Player::GetEnterPosition(&enterPos);
|
|
iVar8 = GHIDRA_INT(((*extraout_EAX - 40.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT(((extraout_EAX[1] - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar8 < 0) || (currentRoom->_gridWidth <= iVar8)) || (iVar17 < 0)) ||
|
|
(currentRoom->_gridHeight <= iVar17)) {
|
|
uVar7 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar7 = iVar17 * currentRoom->_gridWidth + iVar8;
|
|
}
|
|
pGVar20 = GHIDRA_CAST<Game *>((((spawned->_pos).x - 40.0) / 40.0 + 0.5));
|
|
iVar8 = GHIDRA_INT((float)pGVar20);
|
|
iVar17 = GHIDRA_INT((((spawned->_pos).y - 120.0) / 40.0 + 0.5));
|
|
if (((iVar8 < 0) || (currentRoom->_gridWidth <= iVar8)) ||
|
|
((iVar17 < 0 || (currentRoom->_gridHeight <= iVar17)))) {
|
|
uVar19 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar19 = iVar17 * currentRoom->_gridWidth + iVar8;
|
|
}
|
|
is_obstacle_path_valid(currentRoom,uVar7,uVar19,7);
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x2bd,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
isaacsTombRngShifts = 0x1500000009;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x10);
|
|
spawnPos = GetCenterPos(&isaacsTombCenter);
|
|
oldChestPos.x = spawnPos->x + 0.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>((spawnPos->y - 40.0));
|
|
oldChestPos.y = (float)pGVar20;
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> ((uint8_t)isaacsTombRngShifts & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)isaacsTombRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x37,&oldChestPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar7 >> ((uint8_t)local_540[0] & 0x1f) ^ uVar7);
|
|
}
|
|
pGVar21 = g_game;
|
|
bVar5 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
|
|
if (bVar5 != 0) {
|
|
seedItemRngShifts = 0x1500000009;
|
|
local_540[0] = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
local_544 = GHIDRA_CAST<Game *>(0x10);
|
|
spawnPos = GetCenterPos(&seedItemCenter);
|
|
seedItemPos.x = spawnPos->x + 0.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>((spawnPos->y - 40.0));
|
|
uVar7 = pGVar21->_debugCurses;
|
|
uVar19 = g_game->_curses;
|
|
seedItemPos.y = (float)pGVar20;
|
|
uVar13 = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
bVar15 = (uint8_t)local_544;
|
|
bVar5 = (uint8_t)((uint64_t)seedItemRngShifts >> 0x20);
|
|
if ((~preventedCurses & (uVar13 | uVar7 | uVar19) & 2) == 0) {
|
|
if (local_540[0] == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(local_540[0]) >> ((uint8_t)seedItemRngShifts & 0x1f) ^ GHIDRA_UINT(local_540[0]);
|
|
uVar7 = uVar7 << (bVar5 & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> (bVar15 & 0x1f) ^ uVar7;
|
|
spawnPos = &seedItemPos;
|
|
}
|
|
else {
|
|
if (local_540[0] == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
collectiblePos.x = seedItemPos.x - -40.0;
|
|
collectiblePos.y = seedItemPos.y - 0.0;
|
|
uVar7 = GHIDRA_UINT(local_540[0]) >> ((uint8_t)seedItemRngShifts & 0x1f) ^ GHIDRA_UINT(local_540[0]);
|
|
uVar7 = uVar7 << (bVar5 & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> (bVar15 & 0x1f) ^ uVar7;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&collectiblePos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xffffffff,uVar7);
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
leftItemPos.x = seedItemPos.x - 40.0;
|
|
pGVar20 = GHIDRA_CAST<Game *>((seedItemPos.y + 0.0));
|
|
uVar7 = uVar7 >> ((uint8_t)seedItemRngShifts & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)seedItemRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> (bVar15 & 0x1f) ^ uVar7;
|
|
spawnPos = &leftItemPos;
|
|
leftItemPos.y = (float)pGVar20;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xffffffff,uVar7);
|
|
pGVar21 = g_game;
|
|
currentRoom = room;
|
|
}
|
|
}
|
|
if ((((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1))) != '\0') &&
|
|
((currentRoom->_roomType == 7 || (currentRoom->_roomType == 8)))) &&
|
|
(player = PlayerManager::FirstCollectibleOwner
|
|
(&pGVar21->_playerManager,0x24d,GHIDRA_CAST<RNG **>(&pGVar21->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
pGVar20 = GHIDRA_CAST<Game *>(&DAT_00000009);
|
|
lunaRngShifts = 0xb00000009;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x13);
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> 9 ^ uVar7;
|
|
uVar7 = uVar7 << 0xb ^ uVar7;
|
|
spawnPos = GetCenterPos(&lunaCenter);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x27,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7 >> 0x13 ^ uVar7);
|
|
}
|
|
}
|
|
if (((currentRoom->_roomType == 0xe) &&
|
|
(player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x2b4,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1))) != '\0')) {
|
|
spawn_sanguine_bond_spikes(currentRoom,1);
|
|
}
|
|
if (((g_game->_stage == 1) && ((g_game->_levelStateFlags & 0x10000U) != 0)) &&
|
|
((g_game->_currentRoomIdx == g_game->_startingRoomIdx &&
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_INT((g_game->_itemPool)._removedCollectibles._begin) + 0x44)) & 0x40) == 0)))) {
|
|
uVar7 = Random();
|
|
spawnPos = GetCenterPos(&startRoomCenter);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x73,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
pGVar14 = g_game;
|
|
pGVar21 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar21)) + 0x10)))) + 8)) == 0xe) {
|
|
FUN_004d72b0(6,1);
|
|
pGVar21 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
}
|
|
pGStack_550 = pGVar21;
|
|
if (((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar21)) + 0x10)))) + 8)) == 4) && (pGVar21->_roomList[0]._doors[4] == 0))
|
|
&& ((GHIDRA_CAST<CoopJoinSlot *>(&pGVar21->_curses))->_controllerIndex == 0)) {
|
|
piVar18 = &pGVar14->_treasureRoomsVisited;
|
|
*piVar18 = *piVar18 + 1;
|
|
pGStack_550 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
}
|
|
VStack_574.y = (float)pGStack_550;
|
|
if (((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGStack_550)) + 0x10)))) + 8)) == 0x18) &&
|
|
(pGStack_554 = pGStack_550, pGStack_550->_roomList[0]._doors[4] == 0)) &&
|
|
((GHIDRA_CAST<CoopJoinSlot *>(&pGStack_550->_curses))->_controllerIndex == 0)) {
|
|
piVar18 = &pGVar14->_planetariumsVisited;
|
|
*piVar18 = *piVar18 + 1;
|
|
VStack_574.y = (float)*GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
}
|
|
local_540[0] = pGStack_550;
|
|
if ((((GHIDRA_CAST<Game *>(VStack_574.y))->_roomList[0]._doors[4] == 0) && (currentRoom->_roomType == 0x10)) &&
|
|
(pGStack_554 = GHIDRA_CAST<Game *>(0x1), 1 < currentRoom->_gridHeight)) {
|
|
do {
|
|
iVar17 = currentRoom->_gridWidth;
|
|
local_544 = GHIDRA_CAST<Game *>(0x1);
|
|
pGVar21 = pGStack_554;
|
|
if (1 < iVar17) {
|
|
do {
|
|
if (((-1 < GHIDRA_INT(local_544)) && (GHIDRA_INT(local_544) < iVar17)) &&
|
|
((-1 < GHIDRA_INT(pGVar21) && (GHIDRA_INT(pGVar21) < currentRoom->_gridHeight)))) {
|
|
iVar17 = iVar17 * GHIDRA_INT(pGVar21);
|
|
roomDesc = local_544->_roomList;
|
|
uVar7 = GHIDRA_INT(roomDesc->_doors) + iVar17 + -0x30;
|
|
if (uVar7 < 0x1c0) {
|
|
if ((currentRoom->_gridEntities[GHIDRA_INT(roomDesc->_doors) + iVar17 + -0x30] != (void *)0x0
|
|
) && ((iVar8 = *GHIDRA_CAST<int *>((GHIDRA_INT(currentRoom->_gridEntities)
|
|
[GHIDRA_INT(roomDesc->_doors) + iVar17 + -0x30] + 4)),
|
|
iVar8 == 3 || (iVar8 == 0x18)))) {
|
|
if ((-1 < GHIDRA_INT(uVar7)) && (GHIDRA_INT(uVar7) < 0x1c0)) {
|
|
textData = currentRoom->_gridEntities[GHIDRA_INT(roomDesc->_doors) + iVar17 + -0x30];
|
|
currentRoom->_gridEntities[GHIDRA_INT(roomDesc[2]._doors) + iVar17 + 0x32] = (void *)0x0;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + 4));
|
|
}
|
|
local_540[0] = GHIDRA_CAST<Game *>(GHIDRA_UINT((iVar8 == 0x18)));
|
|
if (((((iVar8 == 0x18) &&
|
|
(pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_544[-1]._console) + 3)),
|
|
-1 < GHIDRA_INT(pGStack_54c))) && (GHIDRA_INT(pGStack_54c) < currentRoom->_gridWidth)) &&
|
|
((GHIDRA_INT(pGStack_554) < currentRoom->_gridHeight &&
|
|
(piVar18 = GHIDRA_CAST<int *>((GHIDRA_INT(&pGStack_54c->_stage) +
|
|
currentRoom->_gridWidth * GHIDRA_INT(pGStack_554))),
|
|
-1 < GHIDRA_INT(piVar18))))) &&
|
|
((textData = currentRoom->_gridEntities[GHIDRA_INT(piVar18)], textData != (void *)0x0 &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + 4)) == 0xf && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(textData) + 8)) == 1))))))
|
|
{
|
|
local_540[0] = GHIDRA_CAST<Game *>(0x2);
|
|
}
|
|
iVar8 = 0;
|
|
uVar19 = Random();
|
|
SpawnGridEntity(currentRoom,uVar7,0xf,GHIDRA_UINT(local_540[0]),uVar19,iVar8);
|
|
(**(code **)(*GHIDRA_CAST<int *>(currentRoom->_gridEntities)
|
|
[GHIDRA_INT(roomDesc->_doors) + iVar17 + -0x30] + 4))();
|
|
pGVar21 = pGStack_554;
|
|
}
|
|
}
|
|
}
|
|
iVar17 = currentRoom->_gridWidth;
|
|
local_544 = GHIDRA_CAST<Game *>((GHIDRA_INT(&(GHIDRA_CAST<std_vector *>(&local_544->_stage))->_begin) + 1));
|
|
} while (GHIDRA_INT(local_544) < iVar17);
|
|
}
|
|
pGStack_554 = GHIDRA_CAST<Game *>((GHIDRA_INT(&(GHIDRA_CAST<std_vector *>(&pGVar21->_stage))->_begin) + 1));
|
|
} while (GHIDRA_INT(pGStack_554) < currentRoom->_gridHeight);
|
|
VStack_574.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
}
|
|
pGVar21 = g_game;
|
|
if ((0 < g_game->_stage) && (g_game->_stage < 7)) {
|
|
bVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x30);
|
|
if (bVar5 == 0) goto LAB_007f58b8;
|
|
goto LAB_007f5974;
|
|
}
|
|
LAB_007f58b8:
|
|
iVar17 = currentRoom->_bossId;
|
|
if ((iVar17 == 6) || (iVar17 == 0x59)) {
|
|
if ((pGVar21->_challenge == 0x1f) &&
|
|
(pGVar14 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))), (pGVar14->_roomList[0]._doors[5] & 1) != 0))
|
|
goto LAB_007f58e2;
|
|
LAB_007f5944:
|
|
iVar17 = 0;
|
|
do {
|
|
RemoveDoor(g_game->_room,iVar17);
|
|
iVar17 = iVar17 + 1;
|
|
} while (iVar17 < 8);
|
|
pGVar21 = g_game;
|
|
currentRoom = room;
|
|
}
|
|
else {
|
|
pGVar14 = GHIDRA_CAST<Game *>(VStack_574.y);
|
|
LAB_007f58e2:
|
|
if (iVar17 == 0x37) {
|
|
if (pGVar21->_challenge == 0x1f) goto LAB_007f58f7;
|
|
goto LAB_007f5944;
|
|
}
|
|
if (iVar17 == 0x3e) goto LAB_007f5944;
|
|
LAB_007f58f7:
|
|
if ((currentRoom->_roomType == 5) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar14)) + 0x10)))) + 0x10)) == 0x59)) {
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(pGVar21))))->Level::IsPreAscent();
|
|
if (bVar5 != 0) goto LAB_007f5944;
|
|
pGVar21 = g_game;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<Game *>((pGVar21)))->Game::IsInTimedSet(0x47);
|
|
if (bVar5 != 0) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(pGVar21))))->Level::GetRoomByIdx(pGVar21->_currentRoomIdx,-1);
|
|
pGVar21 = g_game;
|
|
if (roomDesc->ListIndex == g_game->_lastBossRoomListIdx) goto LAB_007f5944;
|
|
}
|
|
}
|
|
LAB_007f5974:
|
|
local_540[0] = GHIDRA_CAST<Game *>(pGVar21->_stageType);
|
|
iVar17 = pGVar21->_stage;
|
|
if ((pGVar21->_difficulty == 2) || (pGStack_560 = GHIDRA_CAST<Game *>(iVar17), pGVar21->_difficulty == 3)) {
|
|
if (iVar17 < 5) {
|
|
iVar17 = iVar17 * 2 + -1;
|
|
pGStack_560 = GHIDRA_CAST<Game *>(iVar17);
|
|
}
|
|
else {
|
|
pGStack_560 = GHIDRA_CAST<Game *>(0x0);
|
|
if (iVar17 == 5) {
|
|
pGStack_560 = GHIDRA_CAST<Game *>(0xa);
|
|
}
|
|
}
|
|
}
|
|
pGStack_54c = GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>((pGVar21)))->Game)::GetStageID((uint8_t)iVar17);
|
|
currentRoom->_brokenWatchState = 0;
|
|
*GHIDRA_CAST<uint8_t *>(currentRoom) = 1;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x40)) == 0) {
|
|
iVar17 = roomConfig->Type;
|
|
if (iVar17 != 5) {
|
|
if (iVar17 == 9) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(9,1);
|
|
}
|
|
else {
|
|
if (((iVar17 == 0x12) || (iVar17 == 0x13)) && (g_game->_currentRoomIdx != -0xc)) {
|
|
pGVar20 = GHIDRA_CAST<Game *>(Random());
|
|
spawnPos = GetCenterPos(&carpetCenter);
|
|
uVar7 = 0;
|
|
uVar19 = 0x4a;
|
|
}
|
|
else {
|
|
if (iVar17 != 0x15) goto LAB_007f5b02;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x5c));
|
|
diceFloorRngShifts = 0x900000005;
|
|
local_544 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
pGStack_554 = GHIDRA_CAST<Game *>(Random());
|
|
if (uVar7 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar7 = uVar7 >> ((uint8_t)diceFloorRngShifts & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 << ((uint8_t)((uint64_t)diceFloorRngShifts >> 0x20) & 0x1f) ^ uVar7;
|
|
uVar7 = (uVar7 >> ((uint8_t)local_544 & 0x1f) ^ uVar7) % 6;
|
|
spawnPos = GetCenterPos(&diceFloorCenter);
|
|
uVar19 = 0x4c;
|
|
pGVar20 = pGStack_554;
|
|
}
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,uVar19,spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,
|
|
GHIDRA_UINT(pGVar20));
|
|
spawned->Update();
|
|
}
|
|
}
|
|
LAB_007f5b02:
|
|
pGVar20 = GHIDRA_CAST<Game *>(&DAT_00000005);
|
|
ambientRng._shift1 = 5;
|
|
ambientRng._shift2 = 9;
|
|
ambientRng._seed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x5c));
|
|
local_544 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
ambientRng._shift3 = 7;
|
|
if (currentRoom->_backdropType == 0x23) {
|
|
if (ambientRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
ambientRng._seed = GHIDRA_UINT(ambientRng._seed) >> 5 ^ ambientRng._seed;
|
|
ambientRng._seed = ambientRng._seed << 9 ^ ambientRng._seed;
|
|
ambientRng._seed = GHIDRA_UINT(ambientRng._seed) >> 7 ^ ambientRng._seed;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(ambientRng._seed) % 0x32 + 1);
|
|
if (0 < GHIDRA_INT(uVar7)) {
|
|
do {
|
|
uVar19 = Random();
|
|
local_544 = GHIDRA_CAST<Game *>((((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar19) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).y));
|
|
uVar19 = Random();
|
|
effect65Pos.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect65Pos.y = (float)local_544;
|
|
pGVar20 = local_544;
|
|
uVar19 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x41,&effect65Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar19);
|
|
spawned->Update();
|
|
uVar7 = uVar7 - 1;
|
|
} while (uVar7 != 0);
|
|
}
|
|
}
|
|
else {
|
|
if (ambientRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
ambientRng._seed = GHIDRA_UINT(ambientRng._seed) >> 5 ^ ambientRng._seed;
|
|
ambientRng._seed = ambientRng._seed << 9 ^ ambientRng._seed;
|
|
ambientRng._seed = GHIDRA_UINT(ambientRng._seed) >> 7 ^ ambientRng._seed;
|
|
if ((((ambientRng._seed & 1U) != 0) && (pGStack_54c != GHIDRA_CAST<Game *>(0xd))) &&
|
|
(currentRoom->_roomType != 8)) {
|
|
uVar7 = g_game->_debugCurses;
|
|
uVar19 = g_game->_curses;
|
|
uVar13 = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
currentRoom = room;
|
|
if (((((~preventedCurses & (uVar13 | uVar7 | uVar19) & 1) == 0) ||
|
|
((room->_roomType != 5 && (room->_roomType != 6)))) && (pGStack_54c != GHIDRA_CAST<Game *>(0x1c)))
|
|
&& ((bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(), bVar5 == 0 ||
|
|
(g_game->_currentDimensionIdx != 1)))) goto LAB_007f68b5;
|
|
}
|
|
if ((currentRoom->_bossId != 0x37) && (currentRoom->_roomType != 0x10)) {
|
|
iVar17 = 0;
|
|
fStack_58c = 0.0;
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x94,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((((player != GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xea,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) || (currentRoom->_roomType == 8)) ||
|
|
((bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(), bVar5 != 0 &&
|
|
(g_game->_currentDimensionIdx == 1)))) {
|
|
iVar17 = 1;
|
|
fStack_58c = 1.4013e-45;
|
|
}
|
|
local_544 = GHIDRA_CAST<Game *>(((iVar17 + 1) * 0xf));
|
|
ppvStack_55c = (void **)GHIDRA_UINT((**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) == g_game->_startingRoomIdx
|
|
));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(local_544));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
VStack_574.y = (float)(uVar7 >> ((uint8_t)ppvStack_55c & 0x1f));
|
|
uVar7 = (GHIDRA_INT(fStack_58c) + 1) * 10;
|
|
uVar19 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7);
|
|
uVar19 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar19 + 1);
|
|
pGStack_550 = GHIDRA_CAST<Game *>((uVar19 >> ((uint8_t)ppvStack_55c & 0x1f)));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
uVar19 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt((GHIDRA_INT(fStack_58c) + 2) * 10);
|
|
uVar19 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar19 + 1);
|
|
(GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar19 + 1);
|
|
pGStack_554 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)ppvStack_55c & 0x1f)));
|
|
if (currentRoom->_gridPaths[currentRoom->_backdropType * 0x4f + 0x585] == 0) {
|
|
pGStack_554 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
if (pGStack_560 == GHIDRA_CAST<Game *>(0x9)) {
|
|
pGVar21 = GHIDRA_CAST<Game *>(&DAT_00000005);
|
|
if (5 < GHIDRA_INT(pGStack_550)) {
|
|
pGVar21 = pGStack_550;
|
|
}
|
|
pGStack_550 = pGVar21;
|
|
}
|
|
if (pGStack_54c == GHIDRA_CAST<Game *>(0x1c)) {
|
|
pGStack_550 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_550) * 2));
|
|
pGStack_554 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGStack_554) * 3));
|
|
VStack_574.y = (float)(GHIDRA_INT(VStack_574.y) * 2);
|
|
}
|
|
if (0 < GHIDRA_INT(VStack_574.y)) {
|
|
pGVar21 = GHIDRA_CAST<Game *>(VStack_574.y);
|
|
do {
|
|
uVar7 = Random();
|
|
VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10 +
|
|
(currentRoom->_topLeftPos).y;
|
|
uVar7 = Random();
|
|
tinyFlyPos.x = ((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10 +
|
|
(currentRoom->_topLeftPos).x;
|
|
tinyFlyPos.y = VStack_574.y;
|
|
pGVar20 = GHIDRA_CAST<Game *>(VStack_574.y);
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x15,&tinyFlyPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
spawned->Update();
|
|
pGVar21 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar21[-1]._console) + 3));
|
|
} while (pGVar21 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
if (0 < GHIDRA_INT(pGStack_550)) {
|
|
pGVar21 = pGStack_550;
|
|
do {
|
|
uVar7 = Random();
|
|
VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10 +
|
|
(currentRoom->_topLeftPos).y;
|
|
uVar7 = Random();
|
|
effect33Pos.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect33Pos.y = VStack_574.y;
|
|
pGVar20 = GHIDRA_CAST<Game *>(VStack_574.y);
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x21,&effect33Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7)
|
|
;
|
|
spawned->Update();
|
|
pGVar21 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar21[-1]._console) + 3));
|
|
} while (pGVar21 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
pGVar21 = pGStack_554;
|
|
if (0 < GHIDRA_INT(pGStack_554)) {
|
|
do {
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x44,&g_vectorOne,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7)
|
|
;
|
|
spawned->Update();
|
|
pGVar21 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar21[-1]._console) + 3));
|
|
} while (pGVar21 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
pGVar21 = pGStack_560;
|
|
if (((pGStack_560 == GHIDRA_CAST<Game *>(0x3)) || (pGStack_560 == GHIDRA_CAST<Game *>(0x4))) ||
|
|
((pGStack_560 == GHIDRA_CAST<Game *>(0x7) ||
|
|
((pGStack_560 == GHIDRA_CAST<Game *>(0x8) || (pGStack_560 == GHIDRA_CAST<Game *>(0x9))))))) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(local_544));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
pGVar14 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)ppvStack_55c & 0x1f)));
|
|
pGStack_554 = pGVar14;
|
|
if ((pGVar21 == GHIDRA_CAST<Game *>(0x9)) && (pGStack_554 = GHIDRA_CAST<Game *>(&DAT_00000005), 5 < GHIDRA_INT(pGVar14))) {
|
|
pGStack_554 = pGVar14;
|
|
}
|
|
if (0 < GHIDRA_INT(pGStack_554)) {
|
|
do {
|
|
iVar17 = 0;
|
|
do {
|
|
uVar7 = Random();
|
|
VStack_574.y = ((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) * 2.3283064e-10
|
|
+ (currentRoom->_topLeftPos).y;
|
|
uVar7 = Random();
|
|
effect63Pos.y = VStack_574.y;
|
|
effect63Pos.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
pGVar20 = GHIDRA_CAST<Game *>(((VStack_574.y - 120.0) / 40.0 + 0.5));
|
|
listIndex = GHIDRA_INT((float)pGVar20);
|
|
iVar8 = GHIDRA_INT(((effect63Pos.x - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar8 < 0) || (currentRoom->_gridWidth <= iVar8)) || (listIndex < 0)) ||
|
|
(currentRoom->_gridHeight <= listIndex)) {
|
|
iVar8 = -1;
|
|
}
|
|
else {
|
|
iVar8 = currentRoom->_gridWidth * listIndex + iVar8;
|
|
}
|
|
uVar7 = GetGridCollision(currentRoom,iVar8);
|
|
if (uVar7 == 0) {
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3f,&effect63Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,
|
|
uVar7);
|
|
spawned->Update();
|
|
break;
|
|
}
|
|
iVar17 = iVar17 + 1;
|
|
} while (iVar17 < 10);
|
|
pGStack_554 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGStack_554[-1]._console) + 3));
|
|
} while (pGStack_554 != GHIDRA_CAST<Game *>(0x0));
|
|
pGStack_554 = GHIDRA_CAST<Game *>(0x0);
|
|
pGVar21 = pGStack_560;
|
|
}
|
|
}
|
|
if (pGVar21 == GHIDRA_CAST<Game *>(0xa)) {
|
|
if (local_540[0] == GHIDRA_CAST<Game *>(0x0)) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(local_544));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
local_544 = GHIDRA_CAST<Game *>((uVar7 >> ((uint8_t)ppvStack_55c & 0x1f)));
|
|
if (0 < GHIDRA_INT(local_544)) {
|
|
do {
|
|
iVar17 = 10;
|
|
do {
|
|
uVar7 = Random();
|
|
pGStack_554 = GHIDRA_CAST<Game *>((((currentRoom->_bottomRightPos).y -
|
|
(currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar7) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).y));
|
|
uVar7 = Random();
|
|
effect63PosB.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect63PosB.y = (float)pGStack_554;
|
|
pGVar20 = pGStack_554;
|
|
uVar7 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3f,&effect63PosB,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),2
|
|
,uVar7);
|
|
spawned->Update();
|
|
iVar17 = iVar17 + -1;
|
|
} while (iVar17 != 0);
|
|
local_544 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_544[-1]._console) + 3));
|
|
} while (local_544 != GHIDRA_CAST<Game *>(0x0));
|
|
local_544 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
}
|
|
LAB_007f64de:
|
|
if (roomConfig->Type == 7) goto LAB_007f6518;
|
|
uVar7 = g_game->_debugCurses;
|
|
uVar19 = g_game->_curses;
|
|
uVar13 = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
currentRoom = room;
|
|
if ((~preventedCurses & (uVar13 | uVar7 | uVar19) & 1) != 0) goto LAB_007f6518;
|
|
}
|
|
else {
|
|
if (((pGVar21 == GHIDRA_CAST<Game *>(0x3)) || (pGVar21 == GHIDRA_CAST<Game *>(0x5))) || (pGVar21 == GHIDRA_CAST<Game *>(0x6))) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(local_544));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
uVar7 = uVar7 >> ((uint8_t)ppvStack_55c & 0x1f);
|
|
if (0 < GHIDRA_INT(uVar7)) {
|
|
do {
|
|
uVar19 = Random();
|
|
local_544 = GHIDRA_CAST<Game *>((((currentRoom->_bottomRightPos).y -
|
|
(currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar19) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).y));
|
|
uVar19 = Random();
|
|
effect64Pos.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect64Pos.y = (float)local_544;
|
|
pGVar20 = local_544;
|
|
uVar19 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x40,&effect64Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar19);
|
|
spawned->Update();
|
|
uVar7 = uVar7 - 1;
|
|
} while (uVar7 != 0);
|
|
}
|
|
pGVar21 = pGStack_560;
|
|
}
|
|
if ((pGVar21 != GHIDRA_CAST<Game *>(0xb)) || (local_540[0] != GHIDRA_CAST<Game *>(0x0))) goto LAB_007f64de;
|
|
LAB_007f6518:
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) >> 9 & 1) == 0) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_INT(fStack_58c) * 0x14 + 0x32);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(uVar7 + 1);
|
|
uVar7 = uVar7 >> ((uint8_t)ppvStack_55c & 0x1f);
|
|
if (0 < GHIDRA_INT(uVar7)) {
|
|
do {
|
|
uVar19 = Random();
|
|
local_544 = GHIDRA_CAST<Game *>((((currentRoom->_bottomRightPos).y -
|
|
(currentRoom->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(uVar19) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).y));
|
|
uVar19 = Random();
|
|
effect65PosB.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect65PosB.y = (float)local_544;
|
|
pGVar20 = local_544;
|
|
uVar19 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x41,&effect65PosB,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar19);
|
|
spawned->Update();
|
|
uVar7 = uVar7 - 1;
|
|
} while (uVar7 != 0);
|
|
}
|
|
}
|
|
}
|
|
if ((pGStack_54c == GHIDRA_CAST<Game *>(0x1b)) &&
|
|
(pGVar20 = GHIDRA_CAST<Game *>(currentRoom->_waterAmount), 0.0 < (float)pGVar20)) {
|
|
if (ambientRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
ambientRng._seed =
|
|
GHIDRA_UINT(ambientRng._seed) >> ((uint8_t)ambientRng._shift1 & 0x1f) ^ ambientRng._seed;
|
|
ambientRng._seed =
|
|
ambientRng._seed << ((uint8_t)ambientRng._shift2 & 0x1f) ^ ambientRng._seed;
|
|
ambientRng._seed =
|
|
GHIDRA_UINT(ambientRng._seed) >> ((uint8_t)ambientRng._shift3 & 0x1f) ^ ambientRng._seed;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt(GHIDRA_UINT(ambientRng._seed) % 0xf + 1);
|
|
uVar7 = uVar7 >> ((uint8_t)ppvStack_55c & 0x1f);
|
|
if (0 < GHIDRA_INT(uVar7)) {
|
|
do {
|
|
uVar19 = Random();
|
|
local_544 = GHIDRA_CAST<Game *>((((currentRoom->_bottomRightPos).y - (currentRoom->_topLeftPos).y)
|
|
* (float)((double)GHIDRA_INT(uVar19) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).y));
|
|
uVar19 = Random();
|
|
effect158Pos.x =
|
|
((currentRoom->_bottomRightPos).x - (currentRoom->_topLeftPos).x) *
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (currentRoom->_topLeftPos).x;
|
|
effect158Pos.y = (float)local_544;
|
|
pGVar20 = local_544;
|
|
bVar5 = IsPositionInRoom(currentRoom,&effect158Pos,0.0);
|
|
if (bVar5 != 0) {
|
|
iVar8 = GHIDRA_INT(((effect158Pos.x - 40.0) / 40.0 + 0.5));
|
|
pGVar20 = GHIDRA_CAST<Game *>(((effect158Pos.y - 120.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT((float)pGVar20);
|
|
if ((((iVar8 < 0) || (currentRoom->_gridWidth <= iVar8)) || (iVar17 < 0)) ||
|
|
(currentRoom->_gridHeight <= iVar17)) {
|
|
iVar8 = -1;
|
|
}
|
|
else {
|
|
iVar8 = iVar17 * currentRoom->_gridWidth + iVar8;
|
|
}
|
|
uVar19 = GetGridCollision(currentRoom,iVar8);
|
|
if (GHIDRA_INT(uVar19) < 2) {
|
|
uVar19 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x9e,&effect158Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0
|
|
,uVar19);
|
|
spawned->Update();
|
|
}
|
|
}
|
|
uVar7 = uVar7 - 1;
|
|
} while (uVar7 != 0);
|
|
}
|
|
if (ambientRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
ambientRng._seed =
|
|
GHIDRA_UINT(ambientRng._seed) >> ((uint8_t)ambientRng._shift1 & 0x1f) ^ ambientRng._seed;
|
|
ambientRng._seed =
|
|
ambientRng._seed << ((uint8_t)ambientRng._shift2 & 0x1f) ^ ambientRng._seed;
|
|
ambientRng._seed =
|
|
GHIDRA_UINT(ambientRng._seed) >> ((uint8_t)ambientRng._shift3 & 0x1f) ^ ambientRng._seed;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&ambientRng)))->RNG::RandomInt((ambientRng._seed & 3U) + 1);
|
|
uVar7 = uVar7 >> ((uint8_t)ppvStack_55c & 0x1f);
|
|
if (0 < GHIDRA_INT(uVar7)) {
|
|
do {
|
|
uVar19 = Random();
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x9f,&g_vectorZero,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar19);
|
|
spawned->Update();
|
|
uVar7 = uVar7 - 1;
|
|
} while (uVar7 != 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007f68b5:
|
|
pGVar21 = g_game;
|
|
if ((g_game->_challenge == 0x1f) &&
|
|
((g_game->_currentRoomIdx == g_game->_startingRoomIdx || (g_game->_currentRoomIdx == -2)))) {
|
|
GetCenterPos(¢erSpawnPos);
|
|
if (pGVar21->_stage == 1) {
|
|
uVar7 = Random();
|
|
uVar13 = 0x172;
|
|
uVar19 = 5;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1))) == '\0') goto LAB_007f6941;
|
|
uVar7 = Random();
|
|
uVar13 = 0x27;
|
|
uVar19 = 1000;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(uVar19,uVar13,¢erSpawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
pGVar21 = g_game;
|
|
}
|
|
LAB_007f6941:
|
|
if (pGVar21->_isRestoringGlowingHourglassState == 0) {
|
|
piVar18 = GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x40));
|
|
*piVar18 = *piVar18 + 1;
|
|
local_544 = GHIDRA_CAST<Game *>(&pGVar21->_scoreSheet);
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
pGStack_554 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<uint32_t *>((iVar17 + 0x44)) >> 10 & 0xffffff01));
|
|
pGStack_54c = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>((iVar17 + 0x10)) + 0x48));
|
|
if (*GHIDRA_CAST<int *>((iVar17 + 0x40)) == 1) {
|
|
bVar5 = (GHIDRA_CAST<Game *>((pGVar21)))->Game::GetStateFlag(0x30);
|
|
pGVar14 = local_544;
|
|
ScoreSheet::find_stage_entry
|
|
(GHIDRA_CAST<ScoreSheet *>(local_544),pGVar21->_stage,pGVar21->_stageType,bVar5);
|
|
if (0.0 < (float)pGVar20) {
|
|
scoreRoomType = currentRoom->_roomType;
|
|
scoreFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(scoreFlag)) + 0x1))),(char)pGStack_554);
|
|
scoreValue = pGVar20;
|
|
local_544 = GHIDRA_CAST<Game *>(FUN_009e6740(pGStack_54c));
|
|
if (0 < GHIDRA_INT(local_544)) {
|
|
do {
|
|
piVar18 = GHIDRA_CAST<int *>(pGVar14->_roomList[0].DecorationSeed);
|
|
if (piVar18 == GHIDRA_CAST<int *>(pGVar14->_roomList[0].SpawnSeed)) {
|
|
msvc::vector<12byte>::_Emplace_reallocate(piVar18,&scoreRoomType);
|
|
}
|
|
else {
|
|
*piVar18 = scoreRoomType;
|
|
piVar18[1] = scoreFlag;
|
|
piVar18[2] = GHIDRA_INT(scoreValue);
|
|
piVar18 = &pGVar14->_roomList[0].DecorationSeed;
|
|
*piVar18 = *piVar18 + 0xc;
|
|
}
|
|
local_544 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_544[-1]._console) + 3));
|
|
} while (local_544 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (((pGStack_560 == GHIDRA_CAST<Game *>(0x1)) || (pGStack_560 == GHIDRA_CAST<Game *>(0x2))) &&
|
|
(local_540[0] == GHIDRA_CAST<Game *>(0x2))) {
|
|
local_540[0] = GHIDRA_CAST<Game *>(0xa);
|
|
do {
|
|
uVar7 = Random();
|
|
spawnPos = GetRandomPosition(currentRoom,&randomPos,0.0);
|
|
effect87Pos.x = spawnPos->x - 0.0;
|
|
effect87Pos.y = spawnPos->y - 100.0;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x57,&effect87Pos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
spawned->Update();
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_INT(local_540[0]) + -1));
|
|
} while (local_540[0] != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
pGVar20 = g_game;
|
|
iVar8 = currentRoom->_aliveEnemyCount + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x12c4))));
|
|
iVar17 = 0;
|
|
if (0 < iVar8) {
|
|
iVar17 = iVar8;
|
|
}
|
|
if ((((iVar17 < 1) && (currentRoom->_roomClearDelay == 0)) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) & 1) == 0)) &&
|
|
(*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) {
|
|
puVar23 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44));
|
|
*puVar23 = *puVar23 | 1;
|
|
}
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4))));
|
|
if ((*GHIDRA_CAST<uint8_t *>((iVar17 + 0x44)) & 1) == 0) {
|
|
if (roomConfig->Type == 6) {
|
|
titleSize = 0;
|
|
titleCapacity = 7;
|
|
titleText[0] = GHIDRA_CAST<wchar_t *******>(0x0);
|
|
uStack_14 = 7;
|
|
uVar7 = roomConfig->Subtype;
|
|
if (uVar7 < 0x10) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT((pGVar20->_itemPool)._pools) + uVar7 * 0x1c + -0x1c0)) == 0) {
|
|
pbVar24 = &s_empty;
|
|
}
|
|
else {
|
|
piVar18 = GHIDRA_CAST<int *>((GHIDRA_INT((pGVar20->_itemPool)._pools) + uVar7 * 0x1c + -0x1d0));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_INT((pGVar20->_itemPool)._pools) + uVar7 * 0x1c + -0x1bc))) {
|
|
piVar18 = GHIDRA_CAST<int *>(*piVar18);
|
|
}
|
|
pbVar24 = GHIDRA_CAST<uint8_t *>(FUN_00958840(&g_manager->_stringTable,"Minibosses",
|
|
*GHIDRA_CAST<uint32_t *>(&g_manager->_stringTable),piVar18));
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((minibossName._buf)))->msvc::string::string_from_cstr(pbVar24);
|
|
}
|
|
else {
|
|
minibossName._size = 0;
|
|
minibossName._buf[0] = '\0';
|
|
minibossName._buf[1] = '\0';
|
|
minibossName._buf[2] = '\0';
|
|
minibossName._buf[3] = '\0';
|
|
minibossName._capacity = 0xf;
|
|
(GHIDRA_CAST<msvc::string *>((minibossName._buf)))->msvc::string::assign(&s_empty,0);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 8;
|
|
pbVar24 = string_table_translate(&g_manager->_stringTable,&DAT_00b6c580);
|
|
(GHIDRA_CAST<msvc::string *>((versusText._buf)))->msvc::string::string_from_cstr(pbVar24);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 9;
|
|
playerName = &versusText;
|
|
if ((versusText._capacity < 0x10) ||
|
|
(playerName = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(versusText._buf))) + 0x0))), (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(versusText._buf)) + 0x0))) != 0)) {
|
|
nameCursor = playerName;
|
|
do {
|
|
pcVar16 = nameCursor->_buf;
|
|
nameCursor = GHIDRA_CAST<std_string *>((nameCursor->_buf + 1));
|
|
} while (*pcVar16 != 0);
|
|
iVar17 = GHIDRA_INT(nameCursor) - GHIDRA_INT((playerName->_buf + 1));
|
|
}
|
|
else {
|
|
iVar17 = 0;
|
|
}
|
|
text_convert_encoding(GHIDRA_CAST<uint8_t *>(playerName),iVar17,0,versusWide,0x20,1);
|
|
playerName = &minibossName;
|
|
if ((minibossName._capacity < 0x10) ||
|
|
(playerName = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(minibossName._buf))) + 0x0))), (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(minibossName._buf)) + 0x0))) != 0)) {
|
|
nameCursor = playerName;
|
|
do {
|
|
pcVar16 = nameCursor->_buf;
|
|
nameCursor = GHIDRA_CAST<std_string *>((nameCursor->_buf + 1));
|
|
} while (*pcVar16 != 0);
|
|
iVar17 = GHIDRA_INT(nameCursor) - GHIDRA_INT((playerName->_buf + 1));
|
|
}
|
|
else {
|
|
iVar17 = 0;
|
|
}
|
|
text_convert_encoding(GHIDRA_CAST<uint8_t *>(playerName),iVar17,0,minibossNameWide,0x40,1);
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
if ((((player->_twinPlayer == 0) ||
|
|
(player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), player->_playerType == 0x23)) ||
|
|
(player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), player->_playerType == 0x1d)) ||
|
|
(player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0), player->_playerType == 0x26)) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
playerName = &player->_name;
|
|
if (0xf < (player->_name)._capacity) {
|
|
playerName = *GHIDRA_CAST<std_string **>(playerName->_buf);
|
|
}
|
|
if (playerName == GHIDRA_CAST<std_string *>(0x0)) {
|
|
iVar17 = 0;
|
|
}
|
|
else {
|
|
nameCursor = playerName;
|
|
do {
|
|
pcVar16 = nameCursor->_buf;
|
|
nameCursor = GHIDRA_CAST<std_string *>((nameCursor->_buf + 1));
|
|
} while (*pcVar16 != '\0');
|
|
iVar17 = GHIDRA_INT(nameCursor) - GHIDRA_INT((playerName->_buf + 1));
|
|
}
|
|
text_convert_encoding(GHIDRA_CAST<uint8_t *>(playerName),iVar17,0,soloPlayerNameWide,0x40,1);
|
|
local_544 = GHIDRA_CAST<Game *>(FUN_00828050(minibossNameWide));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x16;
|
|
local_540[0] = GHIDRA_CAST<Game *>(FUN_00828050(&DAT_00b6c57c));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x17;
|
|
uVar11 = FUN_00828050(versusWide);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x18;
|
|
separatorSegment = FUN_00828050(&DAT_00b6c57c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x19;
|
|
nameSegment = FUN_00828050(soloPlayerNameWide);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x1a;
|
|
FUN_008284d0(local_540[0],nameSegment,separatorSegment);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x1b;
|
|
FUN_008284d0(local_540[0],auStack_41c,uVar11);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x1c;
|
|
FUN_008284d0(local_540[0],auStack_38c,local_540[0]);
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),0x1d);
|
|
FUN_008284d0(local_540[0],auStack_35c,local_544);
|
|
bVar5 = 0xcb;
|
|
FUN_00828010(auStack_344);
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
}
|
|
else {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
playerName = &player->_name;
|
|
if (0xf < (player->_name)._capacity) {
|
|
playerName = *GHIDRA_CAST<std_string **>(playerName->_buf);
|
|
}
|
|
if (playerName == GHIDRA_CAST<std_string *>(0x0)) {
|
|
iVar17 = 0;
|
|
}
|
|
else {
|
|
nameCursor = playerName;
|
|
do {
|
|
pcVar16 = nameCursor->_buf;
|
|
nameCursor = GHIDRA_CAST<std_string *>((nameCursor->_buf + 1));
|
|
} while (*pcVar16 != '\0');
|
|
iVar17 = GHIDRA_INT(nameCursor) - GHIDRA_INT((playerName->_buf + 1));
|
|
}
|
|
text_convert_encoding(GHIDRA_CAST<uint8_t *>(playerName),iVar17,0,playerNameWide,0x40,1);
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
pbVar24 = GHIDRA_CAST<uint8_t *>((player->_twinPlayer + 0x13c4));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((player->_twinPlayer + 0x13d8))) {
|
|
pbVar24 = *GHIDRA_CAST<uint8_t **>(pbVar24);
|
|
}
|
|
if (pbVar24 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
iVar17 = 0;
|
|
}
|
|
else {
|
|
charCursor = pbVar24;
|
|
do {
|
|
bVar5 = *charCursor;
|
|
charCursor = charCursor + 1;
|
|
} while (bVar5 != 0);
|
|
iVar17 = GHIDRA_INT(charCursor) - GHIDRA_INT((pbVar24 + 1));
|
|
}
|
|
text_convert_encoding(pbVar24,iVar17,0,twinNameWide,0x40,1);
|
|
pGStack_54c = GHIDRA_CAST<Game *>(FUN_00828050(minibossNameWide));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 10;
|
|
pGStack_554 = GHIDRA_CAST<Game *>(FUN_00828050(&DAT_00b6c57c));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xb;
|
|
local_544 = GHIDRA_CAST<Game *>(FUN_00828050(versusWide));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xc;
|
|
local_540[0] = GHIDRA_CAST<Game *>(FUN_00828050(&DAT_00b6c57c));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xd;
|
|
uVar11 = FUN_00828050(twinNameWide);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xe;
|
|
separatorSegment = FUN_00828050(&DAT_00b6c518);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0xf;
|
|
nameSegment = FUN_00828050(playerNameWide);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x10;
|
|
FUN_008284d0(local_540[0],nameSegment,separatorSegment);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x11;
|
|
FUN_008284d0(local_540[0],auStack_3a4,uVar11);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x12;
|
|
FUN_008284d0(local_540[0],auStack_374,local_540[0]);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x13;
|
|
FUN_008284d0(local_540[0],auStack_3bc,local_544);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 0x14;
|
|
FUN_008284d0(local_540[0],auStack_3d4,pGStack_554);
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),0x15);
|
|
FUN_008284d0(local_540[0],auStack_3ec,pGStack_54c);
|
|
bVar5 = 0xf5;
|
|
FUN_00828010(auStack_404);
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
FUN_00828ab0();
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 9;
|
|
bVar15 = 0x32;
|
|
FUN_00828ab0();
|
|
title = GHIDRA_CAST<wchar_t *******>(titleText);
|
|
if (7 < titleCapacity) {
|
|
title = titleText[0];
|
|
}
|
|
HUD::ShowStackedItemTextCustomUTF16(&g_game->_hud,GHIDRA_CAST<wchar_t *>(title),L"",bVar5,bVar15);
|
|
(GHIDRA_CAST<msvc::string *>((versusText._buf)))->msvc::string::_Tidy_deallocate();
|
|
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),7);
|
|
if (0xf < minibossName._capacity) {
|
|
uVar7 = minibossName._capacity + 1;
|
|
textData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)minibossName._buf)) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
textData = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(minibossName._buf)) + 0x0))) + -4);
|
|
uVar7 = minibossName._capacity + 0x24;
|
|
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(minibossName._buf)) + 0x0))) - GHIDRA_INT(textData)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(textData,uVar7);
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
minibossName._size = 0;
|
|
minibossName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(minibossName._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(minibossName._buf)) + 0x0))) & 0xffffff00;
|
|
if (7 < titleCapacity) {
|
|
FUN_00828a70(titleText[0],titleCapacity + 1);
|
|
}
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4))));
|
|
currentRoom = room;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((iVar17 + 0x44)) & 1) != 0) goto LAB_007f71f4;
|
|
}
|
|
else {
|
|
LAB_007f71f4:
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x1bbc))) = 1;
|
|
}
|
|
currentRoom->_redHeartDamage = 0;
|
|
init_rain(currentRoom);
|
|
pGVar20 = g_game;
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) >> 10 & 1) == 0) ||
|
|
(currentRoom->_backdropType == 0x35)) {
|
|
if (currentRoom->_roomType == 0x1d) {
|
|
(currentRoom->_floorColor)._colorize[0] = 1.0;
|
|
(currentRoom->_floorColor)._colorize[1] = 0.7;
|
|
(currentRoom->_floorColor)._colorize[2] = 0.7;
|
|
(currentRoom->_floorColor)._colorize[3] = 0.6;
|
|
(currentRoom->_wallColor)._colorize[0] = 1.0;
|
|
(currentRoom->_wallColor)._colorize[1] = 0.4;
|
|
(currentRoom->_wallColor)._colorize[2] = 0.4;
|
|
(currentRoom->_wallColor)._colorize[3] = 0.6;
|
|
}
|
|
else {
|
|
if (((g_game->_stage < 1) || (6 < g_game->_stage)) ||
|
|
(bVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x30), bVar5 == 0)) {
|
|
if ((currentRoom->_backdropType != 6) ||
|
|
(bVar5 = (GHIDRA_CAST<Seeds *>((&pGVar20->_seedEffects)))->Seeds::HasSeedEffect(0x4f), bVar5 == 0))
|
|
goto LAB_007f7445;
|
|
seedFloorColor._tint[0] = 1.0;
|
|
seedFloorColor._tint[1] = 1.0;
|
|
seedFloorColor._tint[2] = 1.0;
|
|
seedFloorColor._tint[3] = 1.0;
|
|
seedFloorColor._offset[0] = 0.0;
|
|
seedFloorColor._colorize[0] = 1.0;
|
|
seedFloorColor._colorize[1] = 1.0;
|
|
seedFloorColor._colorize[2] = 1.0;
|
|
seedFloorColor._colorize[3] = (float)&DAT_bf800000;
|
|
seedFloorColor._offset[1] = 0.0;
|
|
seedFloorColor._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(¤tRoom->_floorColor))))->Color::operator_assign(&seedFloorColor);
|
|
other = &seedWallColor;
|
|
seedWallColor._tint[0] = 1.0;
|
|
seedWallColor._tint[1] = 1.0;
|
|
seedWallColor._tint[2] = 1.0;
|
|
seedWallColor._tint[3] = 1.0;
|
|
seedWallColor._offset[0] = 0.0;
|
|
seedWallColor._colorize[0] = 1.0;
|
|
seedWallColor._colorize[1] = 1.0;
|
|
seedWallColor._colorize[2] = 1.0;
|
|
seedWallColor._colorize[3] = (float)&DAT_bf800000;
|
|
seedWallColor._offset[1] = 0.0;
|
|
seedWallColor._offset[2] = 0.0;
|
|
}
|
|
else {
|
|
ascentFloorColor._tint[0] = 1.0;
|
|
ascentFloorColor._tint[1] = 1.0;
|
|
ascentFloorColor._tint[2] = 1.0;
|
|
ascentFloorColor._tint[3] = 1.0;
|
|
ascentFloorColor._offset[0] = 0.076400004;
|
|
ascentFloorColor._colorize[0] = 1.2;
|
|
ascentFloorColor._colorize[1] = 1.2;
|
|
ascentFloorColor._colorize[2] = 1.2;
|
|
ascentFloorColor._colorize[3] = 0.6;
|
|
ascentFloorColor._offset[1] = -0.0216;
|
|
ascentFloorColor._offset[2] = -0.0884;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(¤tRoom->_floorColor))))->Color::operator_assign(&ascentFloorColor);
|
|
other = &ascentWallColor;
|
|
ascentWallColor._tint[0] = 1.0;
|
|
ascentWallColor._tint[1] = 1.0;
|
|
ascentWallColor._tint[2] = 1.0;
|
|
ascentWallColor._tint[3] = 1.0;
|
|
ascentWallColor._offset[0] = 0.076400004;
|
|
ascentWallColor._colorize[0] = 1.2;
|
|
ascentWallColor._colorize[1] = 1.2;
|
|
ascentWallColor._colorize[2] = 1.2;
|
|
ascentWallColor._colorize[3] = 0.6;
|
|
ascentWallColor._offset[1] = -0.0216;
|
|
ascentWallColor._offset[2] = -0.0884;
|
|
}
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(¤tRoom->_wallColor))))->Color::operator_assign(other);
|
|
}
|
|
}
|
|
else {
|
|
(currentRoom->_floorColor)._colorize[0] = 1.0;
|
|
(currentRoom->_floorColor)._colorize[1] = 0.0;
|
|
(currentRoom->_floorColor)._colorize[2] = 0.0;
|
|
(currentRoom->_floorColor)._colorize[3] = 0.3;
|
|
(currentRoom->_wallColor)._colorize[0] = 1.0;
|
|
(currentRoom->_wallColor)._colorize[1] = 0.2;
|
|
(currentRoom->_wallColor)._colorize[2] = 0.2;
|
|
(currentRoom->_wallColor)._colorize[3] = 0.8;
|
|
}
|
|
LAB_007f7445:
|
|
cVar6 = FUN_008242f0();
|
|
if (cVar6 != '\0') {
|
|
rayTexturePaths[0] = "gfx/backdrop/fx_ray_3.png";
|
|
rayTexturePaths[1] = "gfx/backdrop/fx_ray_4.png";
|
|
if (DAT_00c79834 != GHIDRA_CAST<int *>(0x0)) {
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
|
|
}
|
|
rayRng._shift1 = 1;
|
|
rayRng._shift2 = 0x1b;
|
|
rayRng._seed = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x58));
|
|
rayRng._shift3 = 0x1b;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&rayRng)))->RNG::RandomInt(2);
|
|
textData = Manager::LoadImage(rayImage,GHIDRA_CAST<uint8_t *>(rayTexturePaths[uVar7]));
|
|
uStack_14 = 0x1e;
|
|
FUN_008283d0(textData);
|
|
uStack_14 = 0x1f;
|
|
if (((rayImageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar6 = (**(code **)(*rayImageRefCount + 0xc))(), cVar6 != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(rayImage);
|
|
}
|
|
piVar18 = DAT_00c79834;
|
|
uStack_14 = 0xffffffff;
|
|
if ((DAT_00c79834[0xc] != 1) || (DAT_00c79834[0xd] != 1)) {
|
|
(**(code **)(*DAT_00c79834 + 0x44))(1,1);
|
|
piVar18[0xc] = 1;
|
|
piVar18[0xd] = 1;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x4)))) + 0x44)) & 0x10000) != 0) &&
|
|
(currentRoom->_bossId == 0x57)) {
|
|
currentRoom->_bossId = 0;
|
|
}
|
|
FUN_00823540();
|
|
bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft();
|
|
if ((bVar5 == 0) || (g_game->_currentDimensionIdx != 1)) {
|
|
if (currentRoom->_roomType != 8) goto LAB_007f760e;
|
|
(currentRoom->_floorColor)._colorize[0] = 1.0;
|
|
(currentRoom->_floorColor)._colorize[1] = 0.9;
|
|
(currentRoom->_floorColor)._colorize[2] = 0.8;
|
|
(currentRoom->_wallColor)._colorize[0] = 1.0;
|
|
(currentRoom->_wallColor)._colorize[1] = 0.9;
|
|
(currentRoom->_wallColor)._colorize[2] = 0.8;
|
|
}
|
|
else {
|
|
(currentRoom->_floorColor)._colorize[0] = 0.9;
|
|
(currentRoom->_floorColor)._colorize[1] = 0.8;
|
|
(currentRoom->_floorColor)._colorize[2] = 1.0;
|
|
(currentRoom->_wallColor)._colorize[0] = 0.9;
|
|
(currentRoom->_wallColor)._colorize[1] = 0.8;
|
|
(currentRoom->_wallColor)._colorize[2] = 1.0;
|
|
}
|
|
(currentRoom->_wallColor)._colorize[3] = 0.5;
|
|
(currentRoom->_floorColor)._colorize[3] = 0.4;
|
|
LAB_007f760e:
|
|
update_bounds(currentRoom,0);
|
|
if (currentRoom->_Camera != (void *)0x0) {
|
|
FUN_007ea0c0(currentRoom->_Camera);
|
|
}
|
|
local_540[0] = operator_new(0x94);
|
|
uStack_14 = 0x20;
|
|
if (local_540[0] == GHIDRA_CAST<Game *>(0x0)) {
|
|
textData = (void *)0x0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Camera *>((GHIDRA_CAST<Camera *>(local_540[0]))))->Camera::constructor(currentRoom);
|
|
textData = extraout_EAX_00;
|
|
}
|
|
uStack_14 = 0xffffffff;
|
|
currentRoom->_Camera = textData;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x70d8)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x70dc))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x70f4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentRoom)) + 0x70f8))));
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(¤tRoom->_backdrop))))->Backdrop::load_details();
|
|
TextureCache::Purge();
|
|
textData = g_luaEngine;
|
|
local_540[0] = g_luaEngine;
|
|
lua_gc(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_luaEngine) + 0x18)),2,0);
|
|
lua_gc(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(textData) + 0x18)),4,0);
|
|
lua_gc(GHIDRA_INT(*GHIDRA_CAST<uint64_t *>((GHIDRA_INT(local_540[0]) + 0x18))),3,0);
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Lua mem usage: %d KB and %d bytes\n"));
|
|
if (((room->_bossId == 0x3e) && (g_game->_difficulty == 3)) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) & 1) != 0)) {
|
|
TurnGold(room);
|
|
}
|
|
manager = g_manager;
|
|
pGVar20 = g_game;
|
|
if ((g_game->_levelStateFlags & 0x1000000U) != 0) {
|
|
currentRoom = g_game->_room;
|
|
currentRoom->_brokenWatchState = 1;
|
|
fVar25 = time_scale_update(currentRoom);
|
|
pGVar20 = g_game;
|
|
(manager->_musicManager)._targetPitch = fVar25;
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar20->_room) + 0x722c));
|
|
if (iVar17 < 0x7fffffff) {
|
|
iVar17 = 0x7fffffff;
|
|
}
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar20->_room) + 0x722c)) = iVar17;
|
|
}
|
|
manager = g_manager;
|
|
if ((pGVar20->_levelStateFlags & 0x2000000U) != 0) {
|
|
currentRoom = pGVar20->_room;
|
|
currentRoom->_brokenWatchState = 2;
|
|
fVar25 = time_scale_update(currentRoom);
|
|
pGVar20 = g_game;
|
|
playerManager = &g_game->_playerManager;
|
|
(manager->_musicManager)._targetPitch = fVar25;
|
|
uVar7 = 0;
|
|
if (GHIDRA_INT((pGVar20->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
|
|
>> 2 != 0) {
|
|
do {
|
|
player = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::GetPlayer(uVar7);
|
|
if (player->_variant == 0) {
|
|
local_540[0] = GHIDRA_CAST<Game *>((GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager)::GetPlayer(uVar7);
|
|
player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetPlayer(uVar7);
|
|
textData = (player->_pillRNGs)._end;
|
|
if (GHIDRA_INT((GHIDRA_INT(textData) - GHIDRA_INT((player->_pillRNGs)._begin) & 0xfffffff0U)) < 0x2a1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Pill ID out of bounds!\n"));
|
|
textData = (player->_pillRNGs)._end;
|
|
}
|
|
pillRngs = (player->_pillRNGs)._begin;
|
|
uVar19 = (GHIDRA_INT(textData) - GHIDRA_INT(pillRngs) >> 4) - 1;
|
|
if (0x2a < uVar19) {
|
|
uVar19 = 0x2a;
|
|
}
|
|
uVar19 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>((GHIDRA_INT(pillRngs) + uVar19 * 0x10)))))->RNG::RandomInt(2);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_540[0]) + 0x18e8)) = (uVar19 + 2) * 900;
|
|
player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetPlayer(uVar7);
|
|
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1c,0,1);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar7 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 007f79d0
|
|
Vector * Room::GetDoorSlotPosition(Vector *outPosition, int doorSlot)
|
|
{
|
|
int gridIndex;
|
|
int gridWidth;
|
|
float zeroY;
|
|
|
|
zeroY = g_vectorZero.y;
|
|
if (GHIDRA_UINT(doorSlot) < 8) {
|
|
gridIndex = this->_doorGridPositions[doorSlot];
|
|
gridWidth = this->_gridWidth;
|
|
outPosition->x = (float)(gridIndex % gridWidth) * 40.0 + 40.0;
|
|
outPosition->y = (float)(gridIndex / gridWidth) * 40.0 + 120.0;
|
|
return outPosition;
|
|
}
|
|
outPosition->x = g_vectorZero.x;
|
|
outPosition->y = zeroY;
|
|
return outPosition;
|
|
}
|
|
|
|
// 007f7a40
|
|
uint8_t Room::TrySpawnSecretExit(uint8_t isAnimate, uint8_t isForce)
|
|
{
|
|
Room *door = this;
|
|
int iVar1;
|
|
code *pcVar2;
|
|
bool bVar3;
|
|
Room *pRVar4;
|
|
uint8_t bVar5;
|
|
ChallengeParam *challengeParams;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
RoomDescriptor *currentRoomDesc;
|
|
float fVar6;
|
|
int iVar7;
|
|
Entity_Player *player;
|
|
Vector *doorDir;
|
|
Entity *particle;
|
|
void *doorEntity;
|
|
uint32_t preventedCurses;
|
|
uint32_t uVar9;
|
|
int particleTimeout;
|
|
Game *game;
|
|
float rotationSign;
|
|
uint8_t local_4c [8];
|
|
float local_44;
|
|
Vector particleVelocity;
|
|
float perpDirY;
|
|
ChallengeParam *local_34;
|
|
RoomDescriptor *local_30;
|
|
float local_2c;
|
|
float local_28;
|
|
float local_24;
|
|
float local_20;
|
|
float local_1c;
|
|
Room *local_18;
|
|
char isAltPathUnlocked;
|
|
GridEntity_Door *door;
|
|
|
|
local_24 = 0.0;
|
|
local_18 = door;
|
|
if (isForce == 0) {
|
|
if (g_game->_challenge == 0x2c) {
|
|
return 0;
|
|
}
|
|
if (((door->_roomType == 5) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x10)) + 0x10)) == 0x59)) &&
|
|
(bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsPreAscent(), bVar5 != 0)) {
|
|
return 0;
|
|
}
|
|
if (((0 < g_game->_stage) && (g_game->_stage < 7)) &&
|
|
((g_game->_gameStateFlags & 0x1000000000000) != 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
game = g_game;
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if ((challengeParams->_pathType == 3) ||
|
|
((((g_manager->_persistentGameData)._achievements[0x27b] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) &&
|
|
((game->_challenge == 0 && ((game->_dailyChallenge)._id == 0)))))) {
|
|
isAltPathUnlocked = '\x01';
|
|
}
|
|
else {
|
|
isAltPathUnlocked = '\0';
|
|
}
|
|
if (game->_stage == 6) {
|
|
LAB_007f7b57:
|
|
bVar3 = true;
|
|
}
|
|
else {
|
|
if (game->_stage == 5) {
|
|
preventedCurses = game->_debugCurses;
|
|
uVar9 = game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
door = local_18;
|
|
game = g_game;
|
|
if ((~preventedCurses & (forcedCurses | preventedCurses | uVar9) & 2) != 0) goto LAB_007f7b57;
|
|
}
|
|
bVar3 = false;
|
|
}
|
|
if ((((isAltPathUnlocked == '\0') || (!bVar3)) ||
|
|
(game->_currentRoomIdx != game->_startingRoomIdx)) ||
|
|
((game->_stageType == 4 || (game->_stageType == 5)))) {
|
|
if (isForce == 0) {
|
|
currentRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(game->_currentRoomIdx,-1);
|
|
game = g_game;
|
|
if (currentRoomDesc->ListIndex != g_game->_lastBossRoomListIdx) goto LAB_007f817f;
|
|
}
|
|
local_34 = (GHIDRA_CAST<Game *>((game)))->Game::GetChallengeParams();
|
|
if (((isForce != 0) ||
|
|
((((game->_challenge == 0 && ((game->_dailyChallenge)._id == 0)) ||
|
|
(local_34->_pathType == 2)) &&
|
|
(((g_manager->_persistentGameData)._achievements[0x197] != 0 ||
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))))) &&
|
|
((local_30 = GHIDRA_CAST<RoomDescriptor *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level)::get_secret_exit_kind(),
|
|
local_30 != GHIDRA_CAST<RoomDescriptor *>(0x0) &&
|
|
(((isForce != 0 || (local_30 != GHIDRA_CAST<RoomDescriptor *>(0x4))) ||
|
|
(bVar5 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsMausoleumHeartStage(), bVar5 == 0)))))) {
|
|
pRVar4 = local_18;
|
|
local_20 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4))));
|
|
local_2c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_20) + 0x5c));
|
|
local_4c = (uint8_t [8])0x900000002;
|
|
local_28 = 2.10195e-44;
|
|
if (local_2c == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar5 = (*pcVar2)();
|
|
return bVar5;
|
|
}
|
|
preventedCurses = GHIDRA_UINT(local_2c) >> 2 ^ GHIDRA_UINT(local_2c);
|
|
local_1c = 0.0;
|
|
preventedCurses = preventedCurses << 9 ^ preventedCurses;
|
|
local_2c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_20) + 0x10));
|
|
preventedCurses = (preventedCurses >> 0xf ^ preventedCurses) & 7;
|
|
fVar6 = local_24;
|
|
do {
|
|
uVar9 = 1 << ((uint8_t)preventedCurses & 0x1f);
|
|
if ((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_2c) + 0x38 + (preventedCurses >> 5) * 4)) & uVar9) == 0) ||
|
|
(local_18->_doors[preventedCurses] != (void *)0x0)) ||
|
|
(fVar6 = (float)(GHIDRA_UINT(fVar6) | 1),
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_20) + 0x18 + (preventedCurses >> 5) * 4)) & uVar9) != 0)) {
|
|
bVar3 = false;
|
|
}
|
|
else {
|
|
bVar3 = true;
|
|
}
|
|
if ((GHIDRA_UINT(fVar6) & 1) != 0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
if (bVar3) break;
|
|
preventedCurses = preventedCurses + 1 & 0x80000007;
|
|
if (GHIDRA_INT(preventedCurses) < 0) {
|
|
preventedCurses = (preventedCurses - 1 | 0xfffffff8) + 1;
|
|
}
|
|
local_1c = (float)(GHIDRA_INT(local_1c) + 1);
|
|
} while (GHIDRA_INT(local_1c) < 8);
|
|
if (-1 < GHIDRA_INT(preventedCurses)) {
|
|
local_30 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::get_secret_exit_room(GHIDRA_INT(local_30));
|
|
doorEntity = pRVar4->_doors[preventedCurses];
|
|
local_18 = GHIDRA_CAST<Room *>((pRVar4->_doors + preventedCurses));
|
|
if (doorEntity == (void *)0x0) {
|
|
MakeDoor(pRVar4,preventedCurses);
|
|
doorEntity = *(void **)local_18;
|
|
}
|
|
pRVar4 = local_18;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(doorEntity) + 0x394)) = 0xfffffff6;
|
|
GridEntity_Door::SetRoomTypes
|
|
(*GHIDRA_CAST<GridEntity_Door **>(local_18),1,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_30->Data) + 8)));
|
|
if (local_34->_pathType == 2) {
|
|
door = *GHIDRA_CAST<GridEntity_Door **>(pRVar4);
|
|
local_34 = *GHIDRA_CAST<ChallengeParam **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x8))));
|
|
if ((local_34 != GHIDRA_CAST<ChallengeParam *>(&DAT_00000008)) &&
|
|
(iVar7 = (GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::get_secret_exit_kind(), iVar7 != 4)) {
|
|
if ((local_34 == GHIDRA_CAST<ChallengeParam *>(0x1)) ||
|
|
((local_34 == GHIDRA_CAST<ChallengeParam *>(&DAT_00000004) || (local_34 == GHIDRA_CAST<ChallengeParam *>(0x2)))
|
|
)) {
|
|
bVar5 = 1;
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryUnlock(player,bVar5);
|
|
}
|
|
else {
|
|
bVar5 = 1;
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryUnlock(player,bVar5);
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::Open();
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::TryBlowOpen(0,GHIDRA_CAST<Entity *>(0x0));
|
|
}
|
|
}
|
|
}
|
|
if (isAnimate != 0) {
|
|
preventedCurses = preventedCurses & 0x80000003;
|
|
if (GHIDRA_INT(preventedCurses) < 0) {
|
|
preventedCurses = (preventedCurses - 1 | 0xfffffffc) + 1;
|
|
}
|
|
doorDir = Isaac::GetAxisAlignedUnitVectorFromDir(GHIDRA_CAST<Vector *>((local_4c + 4)),preventedCurses);
|
|
local_1c = -doorDir->x;
|
|
local_20 = -doorDir->y;
|
|
local_34 = GHIDRA_CAST<ChallengeParam *>(cos(1.5707964));
|
|
fVar6 = sin(1.5707964);
|
|
local_30 = GHIDRA_CAST<RoomDescriptor *>((local_1c * (float)local_34 - local_20 * fVar6));
|
|
perpDirY = local_1c * fVar6 + local_20 * (float)local_34;
|
|
preventedCurses = Random();
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
local_28 = (float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*(void **))local_18 + 0x24)) % iVar7) * 40.0 + 40.0;
|
|
local_2c = (float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*(void **))local_18 + 0x24)) / iVar7) * 40.0 + 120.0;
|
|
for (iVar7 = (preventedCurses & 3) + 5; iVar7 != 0; iVar7 = iVar7 + -1) {
|
|
preventedCurses = Random();
|
|
uVar9 = Random();
|
|
local_34 = (ChallengeParam *)
|
|
((float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)])
|
|
* 2.3283064e-10);
|
|
uVar9 = Random();
|
|
fVar6 = (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar6 = (fVar6 + fVar6) - 1.0;
|
|
particleVelocity.x = (float)local_34 * local_1c * 5.0 + (float)local_30 * fVar6;
|
|
particleVelocity.y = (float)local_34 * local_20 * 5.0 + perpDirY * fVar6;
|
|
uVar9 = Random();
|
|
fVar6 = (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_18 = GHIDRA_CAST<Room *>((fVar6 + fVar6));
|
|
uVar9 = Random();
|
|
local_24 = (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar6 = cos((float)local_18);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c)) + 0x4))) = fVar6 * local_24 * 20.0 + local_28;
|
|
fVar6 = sin((float)local_18);
|
|
local_44 = fVar6 * local_24 * 20.0 + local_2c;
|
|
particle = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,GHIDRA_CAST<Vector *>((local_4c + 4)),&particleVelocity,
|
|
GHIDRA_CAST<Entity *>(0x0),0,preventedCurses);
|
|
local_34 = GHIDRA_CAST<ChallengeParam *>((particle->_pos).x);
|
|
local_24 = (particle->_pos).y;
|
|
preventedCurses = Random();
|
|
if (((float)((double)GHIDRA_INT(preventedCurses) + __uint_to_double_fixup[-(GHIDRA_INT(preventedCurses) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0 + 2.0) *
|
|
(float)(((float)local_34 - local_28) * local_1c + (local_24 - local_2c) * local_20 <
|
|
0.0) == 0.0) {
|
|
rotationSign = 1.0;
|
|
}
|
|
else {
|
|
rotationSign = (float)&DAT_bf800000;
|
|
}
|
|
*GHIDRA_CAST<float *>((particle[1]._sprite._animDefaultName._buf + 4)) = rotationSign;
|
|
preventedCurses = Random();
|
|
iVar1 = *GHIDRA_CAST<int *>(particle);
|
|
particleTimeout = preventedCurses % 10 + 0x1e;
|
|
*GHIDRA_CAST<int *>((particle[1]._sprite._filename._buf + 4)) = particleTimeout;
|
|
*GHIDRA_CAST<int *>((particle[1]._sprite._filename._buf + 8)) = particleTimeout;
|
|
(**(code **)(iVar1 + 0xc))();
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
else if (door->_doors[1] == (void *)0x0) {
|
|
MakeDoor(door,1);
|
|
currentRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::get_secret_exit_room(3);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(door->_doors[1]) + 0x394)) = 0xfffffff6;
|
|
GridEntity_Door::SetRoomTypes
|
|
(door->_doors[1],*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x10)) + 8)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(currentRoomDesc->Data) + 8)));
|
|
return 1;
|
|
}
|
|
LAB_007f817f:
|
|
return 0;
|
|
}
|
|
|
|
// 007f8190
|
|
uint8_t Room::TrySpawnSecretShop(uint8_t isForce)
|
|
{
|
|
Entity_Player *memberCardOwner;
|
|
uint32_t uVar1;
|
|
GridEntity *stairs;
|
|
uint32_t index;
|
|
undefined3 in_stack_00000005;
|
|
Vector spawnPos;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int gridWidth;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b012c7;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (isForce == 0) {
|
|
if (this->_roomType == 2) {
|
|
memberCardOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x25a,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((memberCardOwner != GHIDRA_CAST<Entity_Player *>(0x0)) || (**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) < 0))
|
|
goto LAB_007f8201;
|
|
}
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
LAB_007f8201:
|
|
manager = g_manager;
|
|
gridWidth = this->_gridWidth;
|
|
if ((gridWidth < 0xb) || (this->_gridHeight < 2)) {
|
|
index = 0xffffffff;
|
|
}
|
|
else {
|
|
index = gridWidth + 10;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(((*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))[4] + 0x48)) == 6) {
|
|
if ((gridWidth < 0x15) || (this->_gridHeight < 3)) {
|
|
index = 0xffffffff;
|
|
}
|
|
else {
|
|
index = (gridWidth + 10) * 2;
|
|
}
|
|
}
|
|
if (**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) < 0) {
|
|
uVar1 = Random();
|
|
spawnPos.x = (float)(GHIDRA_INT(index) % this->_gridWidth) * 40.0 + 40.0;
|
|
spawnPos.y = (float)(GHIDRA_INT(index) / this->_gridWidth) * 40.0 + 120.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x9c,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar1,0);
|
|
}
|
|
else {
|
|
_isForce = 0x394;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&isForce));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_isForce,1.0,2,0,1.0,0.0);
|
|
_isForce = Random();
|
|
if ((GHIDRA_INT(index) < 0) || (0x1bf < GHIDRA_INT(index))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if (index < 0x1c0) {
|
|
uVar1 = GetGridCollision(this,index);
|
|
if (GHIDRA_INT(uVar1) < 1) {
|
|
stairs = operator_new(0x154);
|
|
local_8 = 0x11;
|
|
spawnPos.y = (float)stairs;
|
|
if (stairs == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
stairs = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((stairs)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(stairs) = IsaacRepentancePlus::GridEntity_Stairs::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (stairs != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((stairs)) + 0x4)))) = 0x12;
|
|
stairs->_gridIndex = index;
|
|
if (this->_gridEntities[index] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[index]))(1);
|
|
}
|
|
this->_gridEntities[index] = stairs;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((stairs)) + 0x8)))) = 2;
|
|
stairs->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((stairs)))->GridEntity::Init(_isForce);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
|
|
// 007f83b0
|
|
uint8_t Room::TrySpawnDevilRoomDoor(uint8_t isAnimate, uint8_t isForce)
|
|
{
|
|
code *pcVar1;
|
|
uint8_t *puVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
RoomDescriptor *roomDesc;
|
|
Entity_Player *dualityOwner;
|
|
void **TargetRoomType;
|
|
Vector *doorDir;
|
|
Entity *dustEffect;
|
|
int *piVar5;
|
|
int iVar6;
|
|
GridEntity_Door *door;
|
|
uint32_t devilRollSeed;
|
|
int iVar7;
|
|
void *ptr;
|
|
Room *room;
|
|
Game *game;
|
|
float angleSin;
|
|
float fVar8;
|
|
uint32_t uVar9;
|
|
TypeDescriptor *pTVar10;
|
|
TypeDescriptor *pTVar11;
|
|
uint32_t uVar12;
|
|
uint8_t local_84 [12];
|
|
int local_78;
|
|
Vector local_74;
|
|
Vector local_6c;
|
|
uint32_t local_64;
|
|
float local_60;
|
|
uint64_t local_58;
|
|
int *freeSlotsCapacity;
|
|
float local_4c;
|
|
uint8_t *local_48;
|
|
uint8_t *local_44;
|
|
uint32_t local_40;
|
|
uint8_t *local_3c;
|
|
void **local_38;
|
|
Room *savedRoom;
|
|
char isAngelDoorPlaced;
|
|
void **local_2c;
|
|
float local_28;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Game *flagsGame;
|
|
Manager *manager;
|
|
|
|
puStack_20 = local_84 + 0x80;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b01315;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((local_84 + 0x74));
|
|
ExceptionList = &local_1c;
|
|
savedRoom = this;
|
|
local_24 = uVar4;
|
|
puVar2 = local_84 + 0x80;
|
|
if (isForce == 0) {
|
|
bVar3 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::CanSpawnDevilRoom();
|
|
if (bVar3 == 0) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
puVar2 = puStack_20;
|
|
}
|
|
puStack_20 = puVar2;
|
|
isAngelDoorPlaced = '\0';
|
|
if ((isForce == 0) &&
|
|
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1),
|
|
roomDesc->ListIndex != g_game->_lastBossRoomListIdx)) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
local_48 = GHIDRA_CAST<uint8_t *>(GetDevilRoomChance(this));
|
|
if (isForce == 0) {
|
|
local_28 = (float)(g_game->_devilAngelRoomRNG)._seed;
|
|
local_58 = 0x1500000002;
|
|
local_3c = GHIDRA_CAST<uint8_t *>(0x9);
|
|
if (local_28 == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
bVar3 = (*pcVar1)();
|
|
return bVar3;
|
|
}
|
|
devilRollSeed = GHIDRA_UINT(local_28) >> 2 ^ GHIDRA_UINT(local_28);
|
|
devilRollSeed = devilRollSeed << 0x15 ^ devilRollSeed;
|
|
devilRollSeed = devilRollSeed >> 9 ^ devilRollSeed;
|
|
if (((float)local_48 <=
|
|
(float)((double)GHIDRA_INT(devilRollSeed) + __uint_to_double_fixup[-(GHIDRA_INT(devilRollSeed) >> 0x1f)])
|
|
* 2.3283062e-10) && ((float)local_48 < 1.0)) {
|
|
g_game->_devilRoomDisabled = 1;
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
}
|
|
dualityOwner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1f2,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
game = g_game;
|
|
if (dualityOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard,uVar4), g_invalidRoomDescriptorGuard == -1
|
|
)) {
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_14 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
roomDesc = &g_roomDescriptorDummy;
|
|
if (GHIDRA_UINT(game->_currentDimensionIdx) < 3) {
|
|
roomDesc = game->_roomList + 0x1fb;
|
|
}
|
|
if (roomDesc->Data == (void *)0x0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_84)) + 0x4))) = 2;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_84)) + 0x8))) = 5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_84)) + 0x0))) = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
local_78 = 0x15;
|
|
local_28 = (float)(GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_84))))->RNG::RandomInt(8);
|
|
local_58 = 0;
|
|
freeSlotsCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_14 = 1;
|
|
msvc::vector<unsigned_int>::_Reallocate(4);
|
|
local_2c = (void **)0x0;
|
|
piVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x4)));
|
|
do {
|
|
room = savedRoom;
|
|
local_48 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_28) + GHIDRA_INT(local_2c) & 0x80000007));
|
|
if (GHIDRA_INT(local_48) < 0) {
|
|
local_48 = GHIDRA_CAST<uint8_t *>(((GHIDRA_UINT((local_48 + -1)) | 0xfffffff8) + 1));
|
|
}
|
|
local_3c = local_48;
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x4)))) + 0x10)) + 0x38 +
|
|
(GHIDRA_UINT(local_48) >> 5) * 4)) & 1 << ((uint8_t)local_48 & 0x1f)) != 0) &&
|
|
(savedRoom->_doors[GHIDRA_INT(local_48)] == (void *)0x0)) {
|
|
if (piVar5 == freeSlotsCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(piVar5,&local_48);
|
|
piVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_58)) + 0x4)));
|
|
}
|
|
else {
|
|
*piVar5 = GHIDRA_INT(local_48);
|
|
local_58 = CONCAT44(piVar5 + 1,GHIDRA_CAST<int *>(local_58));
|
|
piVar5 = piVar5 + 1;
|
|
}
|
|
}
|
|
local_2c = (void **)(GHIDRA_INT(local_2c) + 1);
|
|
} while (GHIDRA_INT(local_2c) < 8);
|
|
if (1 < GHIDRA_UINT((GHIDRA_INT(piVar5) - GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) >> 2))) {
|
|
RNG::Shuffle(GHIDRA_CAST<RNG *>(local_84),GHIDRA_CAST<int *>(local_58),piVar5);
|
|
local_40 = 0;
|
|
do {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) + local_40 * 4));
|
|
local_38 = room->_doors + uVar4;
|
|
if (room->_doors[uVar4] == (void *)0x0) {
|
|
MakeDoor(room,uVar4);
|
|
}
|
|
if ((local_40 == 0) || (isAngelDoorPlaced != '\0')) {
|
|
TargetRoomType = (void **)0xe;
|
|
local_2c = (void **)0xe;
|
|
if (isAngelDoorPlaced == '\0') goto LAB_007f86a4;
|
|
}
|
|
else {
|
|
local_2c = (void **)0xf;
|
|
LAB_007f86a4:
|
|
bVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(7);
|
|
if (bVar3 == 0) {
|
|
TargetRoomType = local_2c;
|
|
if (local_2c != (void **)0xf) goto LAB_007f86ce;
|
|
}
|
|
else {
|
|
TargetRoomType = (void **)2.10195e-44;
|
|
}
|
|
isAngelDoorPlaced = '\x01';
|
|
}
|
|
LAB_007f86ce:
|
|
(GHIDRA_CAST<GridEntity_Door *>((*local_38)))->GridEntity_Door::SetRoomTypes(1,GHIDRA_INT(TargetRoomType));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(*local_38) + 0x394)) = 0xffffffff;
|
|
(GHIDRA_CAST<GridEntity_Door *>((*local_38)))->GridEntity_Door::Open();
|
|
if (isAnimate != 0) {
|
|
uVar4 = uVar4 & 0x80000003;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
doorDir = Isaac::GetAxisAlignedUnitVectorFromDir(GHIDRA_CAST<Vector *>((local_84 + 8)),uVar4);
|
|
local_2c = (void **)-doorDir->x;
|
|
local_3c = GHIDRA_CAST<uint8_t *>((GHIDRA_UINT(doorDir->y) ^ 0x80000000));
|
|
uVar4 = Random();
|
|
local_28 = 0.0;
|
|
local_4c = (float)((uVar4 & 3) + 5);
|
|
if (local_4c != 0.0) {
|
|
local_48 = GHIDRA_CAST<uint8_t *>((GHIDRA_UINT(local_2c) ^ 0x80000000));
|
|
do {
|
|
local_64 = Random();
|
|
uVar4 = Random();
|
|
local_44 = (uint8_t *)
|
|
((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 *
|
|
5.0);
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)])
|
|
* 2.3283064e-10;
|
|
fVar8 = (fVar8 + fVar8) - 1.0;
|
|
local_6c.x = fVar8 * (float)local_3c + (float)local_2c * (float)local_44;
|
|
local_6c.y = fVar8 * (float)local_48 + (float)local_3c * (float)local_44;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24));
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
uVar4 = Random();
|
|
local_60 = (float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 *
|
|
3.14;
|
|
local_60 = local_60 + local_60;
|
|
uVar4 = Random();
|
|
local_44 = (uint8_t *)
|
|
((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 *
|
|
20.0);
|
|
fVar8 = cos(local_60);
|
|
local_74.x = fVar8 * (float)local_44 + (float)(iVar7 % iVar6) * 40.0 + 40.0;
|
|
angleSin = sin(local_60);
|
|
fVar8 = local_28;
|
|
uVar12 = 0;
|
|
pTVar11 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
local_74.y = angleSin * (float)local_44 + (float)(iVar7 / iVar6) * 40.0 + 120.0;
|
|
uVar9 = 0;
|
|
dustEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&local_74,&local_6c,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_UINT((local_28 == 0.0)),local_64);
|
|
piVar5 = GHIDRA_CAST<int *>(__RTDynamicCast(dustEffect,uVar9,pTVar10,pTVar11,uVar12));
|
|
local_44 = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
if (((float)piVar5[0xd0] -
|
|
((float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24)) / iVar7) * 40.0 + 120.0)) *
|
|
(float)local_48 +
|
|
((float)piVar5[0xcf] -
|
|
((float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24)) % iVar7) * 40.0 + 40.0)) *
|
|
(float)local_3c < 0.0) {
|
|
local_44 = &DAT_bf800000;
|
|
}
|
|
uVar4 = Random();
|
|
piVar5[0x11d] =
|
|
GHIDRA_INT((((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 *
|
|
10.0 + 2.0) * (float)local_44));
|
|
uVar4 = Random();
|
|
iVar7 = uVar4 % 10 + 0x1e;
|
|
piVar5[0x117] = iVar7;
|
|
piVar5[0x118] = iVar7;
|
|
(**(code **)(*piVar5 + 0xc))();
|
|
local_28 = (float)(GHIDRA_INT(fVar8) + 1);
|
|
room = savedRoom;
|
|
} while (GHIDRA_INT(local_28) < GHIDRA_INT(local_4c));
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
local_40 = local_40 + 1;
|
|
} while (local_40 < 2);
|
|
if (isAnimate != 0) {
|
|
local_28 = 4.48416e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_28));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_28),1.0,2,0,1.0,0.0);
|
|
manager = g_manager;
|
|
local_28 = 3.22299e-44;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_28));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_28),1.0,2,0,1.0,0.0);
|
|
}
|
|
if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) {
|
|
iVar7 = g_game->_stage + 1;
|
|
}
|
|
else {
|
|
iVar7 = g_game->_stage;
|
|
}
|
|
if (iVar7 < 1) {
|
|
iVar7 = 0;
|
|
}
|
|
iVar6 = 0xd;
|
|
if (iVar7 < 0xd) {
|
|
iVar6 = iVar7;
|
|
}
|
|
g_game->_lastDevilRoomStage = iVar6;
|
|
if (GHIDRA_CAST<int *>(local_58) != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(freeSlotsCapacity) - GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) & 0xfffffffc;
|
|
ptr = GHIDRA_CAST<int *>(local_58);
|
|
if (0xfff < uVar4) {
|
|
ptr = *(void **)(GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) + (-4 - GHIDRA_INT(ptr))))) goto LAB_007f8b59;
|
|
}
|
|
operator_delete(ptr,uVar4);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (GHIDRA_CAST<int *>(local_58) != GHIDRA_CAST<int *>(0x0)) {
|
|
uVar4 = GHIDRA_INT(freeSlotsCapacity) - GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) & 0xfffffffc;
|
|
piVar5 = GHIDRA_CAST<int *>(local_58);
|
|
if (0xfff < uVar4) {
|
|
piVar5 = GHIDRA_CAST<int *>((GHIDRA_CAST<int *>(local_58))[-1]);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(GHIDRA_CAST<int *>(local_58)) + (-4 - GHIDRA_INT(piVar5))))) {
|
|
LAB_007f8b59:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(piVar5,uVar4);
|
|
local_58 = 0;
|
|
freeSlotsCapacity = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
}
|
|
}
|
|
game = g_game;
|
|
bVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(7);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::InitializeDevilAngelRoom(bVar3 != 0,0);
|
|
game = g_game;
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1)) {
|
|
local_14 = 2;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_14 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
flagsGame = g_game;
|
|
if (GHIDRA_UINT(game->_currentDimensionIdx) < 3) {
|
|
roomDesc = game->_roomList + 0x1fb;
|
|
}
|
|
else {
|
|
roomDesc = &g_roomDescriptorDummy;
|
|
}
|
|
local_2c = &roomDesc->Data;
|
|
fVar8 = (float)g_game->_enterDoor;
|
|
if ((((g_game->_lastRoomIdx != -1) || (GHIDRA_INT(fVar8) < 0)) ||
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x4)))) + 0x10)) + 0x38 + (GHIDRA_UINT(fVar8) >> 5) * 4)) &
|
|
1 << (SUB41(fVar8,0) & 0x1f)) == 0)) || (savedRoom->_doors[GHIDRA_INT(fVar8)] != (void *)0x0)) {
|
|
local_38 = *(void ***)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x4)));
|
|
local_4c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_38) + 0x58));
|
|
local_58 = 0x500000002;
|
|
local_64 = 0x15;
|
|
if (local_4c == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
bVar3 = (*pcVar1)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = GHIDRA_UINT(local_4c) >> 2 ^ GHIDRA_UINT(local_4c);
|
|
uVar4 = uVar4 << 5 ^ uVar4;
|
|
local_40 = (uVar4 >> 0x15 ^ uVar4) & 7;
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
local_40 = 4;
|
|
}
|
|
local_28 = 0.0;
|
|
do {
|
|
local_4c = (float)(GHIDRA_INT(local_28) + local_40 & 0x80000007);
|
|
if (GHIDRA_INT(local_4c) < 0) {
|
|
local_4c = (float)((GHIDRA_INT(local_4c) - 1U | 0xfffffff8) + 1);
|
|
}
|
|
uVar4 = GHIDRA_INT(local_4c) + 2U & 0x80000003;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if ((((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + 0x10)) + 0x38 + (GHIDRA_UINT(local_4c) >> 5) * 4)) &
|
|
1 << (SUB41(local_4c,0) & 0x1f)) != 0) &&
|
|
((*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(*local_2c) + (uVar4 >> 5) * 4 + 0x38)) & 1 << ((uint8_t)uVar4 & 0x1f)) != 0))
|
|
&& (savedRoom->_doors[GHIDRA_INT(local_4c)] == (void *)0x0)) {
|
|
fVar8 = local_4c;
|
|
if (-1 < GHIDRA_INT(local_4c)) goto LAB_007f8d89;
|
|
break;
|
|
}
|
|
local_28 = (float)(GHIDRA_INT(local_28) + 1);
|
|
} while (GHIDRA_INT(local_28) < 8);
|
|
local_28 = 0.0;
|
|
while( true ) {
|
|
fVar8 = (float)(local_40 + GHIDRA_INT(local_28) & 0x80000007);
|
|
if (GHIDRA_INT(fVar8) < 0) {
|
|
fVar8 = (float)((GHIDRA_INT(fVar8) - 1U | 0xfffffff8) + 1);
|
|
}
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + 0x10)) + 0x38 + (GHIDRA_UINT(fVar8) >> 5) * 4)) &
|
|
1 << (SUB41(fVar8,0) & 0x1f)) != 0) && (savedRoom->_doors[GHIDRA_INT(fVar8)] == (void *)0x0))
|
|
break;
|
|
local_28 = (float)(GHIDRA_INT(local_28) + 1);
|
|
if (7 < GHIDRA_INT(local_28)) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
}
|
|
if (GHIDRA_INT(fVar8) < 0) {
|
|
ExceptionList = local_1c;
|
|
return 0;
|
|
}
|
|
}
|
|
LAB_007f8d89:
|
|
local_2c = *(void ***)(GHIDRA_INT(*local_2c) + 8);
|
|
if (local_2c == (void **)0xe) {
|
|
*GHIDRA_CAST<uint32_t *>(&g_game->_gameStateFlags) = GHIDRA_UINT(g_game->_gameStateFlags) | 0x20;
|
|
}
|
|
else {
|
|
if (local_2c != (void **)0xf) goto LAB_007f8dc6;
|
|
*GHIDRA_CAST<uint32_t *>(&g_game->_gameStateFlags) = GHIDRA_UINT(g_game->_gameStateFlags) | 1;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&flagsGame->_gameStateFlags) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&flagsGame->_gameStateFlags) + 4));
|
|
LAB_007f8dc6:
|
|
door = savedRoom->_doors[GHIDRA_INT(fVar8)];
|
|
local_38 = savedRoom->_doors + GHIDRA_INT(fVar8);
|
|
if (door == GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
MakeDoor(savedRoom,GHIDRA_INT(fVar8));
|
|
door = *local_38;
|
|
}
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::SetRoomTypes(1,GHIDRA_INT(local_2c));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(*local_38) + 0x394)) = 0xffffffff;
|
|
(GHIDRA_CAST<GridEntity_Door *>((*local_38)))->GridEntity_Door::Open();
|
|
game = g_game;
|
|
if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) {
|
|
iVar7 = g_game->_stage + 1;
|
|
}
|
|
else {
|
|
iVar7 = g_game->_stage;
|
|
}
|
|
if (iVar7 < 1) {
|
|
iVar7 = 0;
|
|
}
|
|
iVar6 = 0xd;
|
|
if (iVar7 < 0xd) {
|
|
iVar6 = iVar7;
|
|
}
|
|
g_game->_lastDevilRoomStage = iVar6;
|
|
manager = g_manager;
|
|
if (isAnimate != 0) {
|
|
local_28 = 4.48416e-43;
|
|
if (local_2c != (void **)0xe) {
|
|
local_28 = 3.22299e-44;
|
|
}
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_28));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_28),1.0,2,0,1.0,0.0);
|
|
uVar4 = GHIDRA_UINT(fVar8) & 0x80000003;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
uVar4 = (uVar4 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
doorDir = Isaac::GetAxisAlignedUnitVectorFromDir(GHIDRA_CAST<Vector *>((local_84 + 8)),uVar4);
|
|
local_28 = -doorDir->x;
|
|
local_44 = GHIDRA_CAST<uint8_t *>((GHIDRA_UINT(doorDir->y) ^ 0x80000000));
|
|
uVar4 = Random();
|
|
local_40 = (uVar4 & 3) + 5;
|
|
if (local_40 != 0) {
|
|
local_60 = -local_28;
|
|
local_2c = (void **)GHIDRA_UINT((local_2c == (void **)0xe));
|
|
do {
|
|
local_64 = Random();
|
|
uVar4 = Random();
|
|
local_4c = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0;
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10;
|
|
fVar8 = (fVar8 + fVar8) - 1.0;
|
|
local_74.x = local_4c * local_28 + fVar8 * (float)local_44;
|
|
local_74.y = local_60 * fVar8 + local_4c * (float)local_44;
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24));
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
uVar4 = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_3c = GHIDRA_CAST<uint8_t *>((fVar8 + fVar8));
|
|
uVar4 = Random();
|
|
local_48 = (uint8_t *)
|
|
((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 20.0);
|
|
fVar8 = cos((float)local_3c);
|
|
local_6c.x = fVar8 * (float)local_48 + (float)(iVar7 % iVar6) * 40.0 + 40.0;
|
|
fVar8 = sin((float)local_3c);
|
|
uVar12 = 0;
|
|
pTVar11 = &IsaacRepentancePlus::Entity_Effect::RTTI_Type_Descriptor;
|
|
local_6c.y = fVar8 * (float)local_48 + (float)(iVar7 / iVar6) * 40.0 + 120.0;
|
|
pTVar10 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar9 = 0;
|
|
dustEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x3b,&local_6c,&local_74,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_2c),
|
|
local_64);
|
|
piVar5 = GHIDRA_CAST<int *>(__RTDynamicCast(dustEffect,uVar9,pTVar10,pTVar11,uVar12));
|
|
local_3c = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
if (((float)piVar5[0xcf] - ((float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24)) % iVar7) * 40.0 + 40.0))
|
|
* (float)local_44 +
|
|
((float)piVar5[0xd0] - ((float)(*GHIDRA_CAST<int *>((GHIDRA_INT(*local_38) + 0x24)) / iVar7) * 40.0 + 120.0)
|
|
) * local_60 < 0.0) {
|
|
local_3c = &DAT_bf800000;
|
|
}
|
|
uVar4 = Random();
|
|
piVar5[0x11d] =
|
|
GHIDRA_INT((((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 * 10.0 + 2.0) * (float)local_3c));
|
|
uVar4 = Random();
|
|
iVar7 = uVar4 % 10 + 0x1e;
|
|
piVar5[0x117] = iVar7;
|
|
piVar5[0x118] = iVar7;
|
|
(**(code **)(*piVar5 + 0xc))();
|
|
local_40 = local_40 - 1;
|
|
} while (local_40 != 0);
|
|
}
|
|
game = g_game;
|
|
}
|
|
uVar4 = (game->_devilAngelRoomRNG)._seed;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar4 = (game->_devilAngelRoomRNG)._seed;
|
|
if (uVar4 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
bVar3 = (*pcVar1)();
|
|
return bVar3;
|
|
}
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)(game->_devilAngelRoomRNG)._shift1 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((uint8_t)(game->_devilAngelRoomRNG)._shift2 & 0x1f) ^ uVar4;
|
|
(game->_devilAngelRoomRNG)._seed =
|
|
uVar4 >> ((uint8_t)(game->_devilAngelRoomRNG)._shift3 & 0x1f) ^ uVar4;
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
|
|
// 007f92b0
|
|
float Room::GetDevilRoomChance()
|
|
{
|
|
uint8_t isHasEffect;
|
|
Entity_Player *owner;
|
|
int iVar1;
|
|
RoomDescriptor *currentRoom;
|
|
int iVar2;
|
|
float chance;
|
|
Game *game;
|
|
|
|
chance = 0.01;
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x33,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = 0.11;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x104,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.15;
|
|
}
|
|
iVar1 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetNumCollectibles(0x33);
|
|
if (1 < iVar1) {
|
|
chance = chance + 0.05;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x22,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((owner != GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x3b,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
owner != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
chance = chance + 0.125;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x4e,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.175;
|
|
}
|
|
if ((g_game->_levelStateFlags & 1) != 0) {
|
|
chance = chance + 0.35;
|
|
}
|
|
currentRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1);
|
|
if ((g_game->_lastBossRoomListIdx == currentRoom->ListIndex) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(g_game->_room) + 0x120c)) != '\0')) {
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x259,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.15;
|
|
}
|
|
}
|
|
else {
|
|
chance = chance + 0.35;
|
|
}
|
|
if ((g_game->_levelStateFlags & 4) == 0) {
|
|
chance = chance + 0.99;
|
|
}
|
|
else {
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x259,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.4;
|
|
}
|
|
}
|
|
if ((g_game->_levelStateFlags & 0x40) != 0) {
|
|
chance = chance + 0.1;
|
|
}
|
|
owner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0xae);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar1 = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::GetTrinketMultiplier(0xae);
|
|
if (iVar1 == 1) {
|
|
chance = chance + 0.1;
|
|
}
|
|
else if (iVar1 == 2) {
|
|
chance = chance + 0.15;
|
|
}
|
|
else if (iVar1 == 3) {
|
|
chance = chance + 0.2;
|
|
}
|
|
}
|
|
owner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(7);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar1 = (GHIDRA_CAST<Entity_Player *>((owner)))->Entity_Player::GetTrinketMultiplier(7);
|
|
if (iVar1 == 2) {
|
|
chance = chance + 0.05;
|
|
}
|
|
else if (iVar1 == 3) {
|
|
chance = chance + 0.1;
|
|
}
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x29d,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
game = g_game;
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = chance + 0.069;
|
|
}
|
|
iVar2 = FUN_0041b770(0x124);
|
|
iVar1 = game->_lastDevilRoomStage;
|
|
chance = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.1 + chance;
|
|
if (iVar1 != 0) {
|
|
if ((game->_stageType == 4) || (game->_stageType == 5)) {
|
|
iVar2 = game->_stage + 1;
|
|
}
|
|
else {
|
|
iVar2 = game->_stage;
|
|
}
|
|
if ((iVar2 == iVar1) || (iVar2 - iVar1 == 1)) {
|
|
chance = chance * 0.25;
|
|
}
|
|
else if (iVar2 - iVar1 == 2) {
|
|
chance = chance * 0.5;
|
|
}
|
|
}
|
|
if (game->_devilRoomDisabled != 0) {
|
|
chance = 0.0;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0xd7,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if ((owner != GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(isHasEffect = (GHIDRA_CAST<TemporaryEffects *>((&this->_temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0xd7),
|
|
isHasEffect != 0)) {
|
|
chance = 66.6;
|
|
}
|
|
if (((g_game->_dailyChallenge)._specialDailyId == 0x11) &&
|
|
((g_game->_gameStateFlags & 0x20000000) == 0)) {
|
|
chance = 1.0;
|
|
}
|
|
owner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,499,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (owner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
chance = 1.0;
|
|
}
|
|
iVar1 = g_game->_difficulty;
|
|
if (((iVar1 == 2) || (iVar1 == 3)) &&
|
|
(chance = 1.0, GHIDRA_UINT(g_game->_greedModeWave) < (iVar1 == 3) + 0xb)) {
|
|
chance = 0.0;
|
|
}
|
|
return chance;
|
|
}
|
|
|
|
// 007f9960
|
|
uint8_t Room::TrySpawnBossRushDoor(uint8_t isIgnoreTime, uint8_t isForce)
|
|
{
|
|
uint32_t *puVar1;
|
|
int iVar2;
|
|
code *pcVar3;
|
|
uint8_t bVar4;
|
|
RoomDescriptor *currentRoom;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
Entity_Player *shovelOwner;
|
|
void **doorSlot;
|
|
GridEntity_Door *this_00;
|
|
Game *game;
|
|
uint32_t uVar5;
|
|
uint32_t uVar6;
|
|
float dy;
|
|
float dx;
|
|
uint32_t entityIndex;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
int *entity;
|
|
int gridWidth;
|
|
int updateList;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01359;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((isForce != 0) ||
|
|
(((((g_game->_challenge != 0x2c &&
|
|
(((this->_roomType != 5 ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10)) != 0x59)) ||
|
|
(bVar4 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsPreAscent(), bVar4 == 0)))) &&
|
|
(((g_game->_stage < 1 || (6 < g_game->_stage)) ||
|
|
((g_game->_gameStateFlags & 0x1000000000000) == 0)))) &&
|
|
((g_game->_currentDimensionIdx == 0 &&
|
|
(currentRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1),
|
|
currentRoom->ListIndex == g_game->_lastBossRoomListIdx)))) &&
|
|
(bVar4 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage(), bVar4 == 0)))) {
|
|
uVar6 = g_game->_debugCurses;
|
|
uVar5 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
updateList = g_game->_stage;
|
|
if ((~preventedCurses & (forcedCurses | uVar6 | uVar5) & 2) != 0) {
|
|
updateList = updateList + 1;
|
|
}
|
|
if ((isForce != 0) || (updateList == 6)) {
|
|
updateList = 0;
|
|
doorSlot = this->_doors;
|
|
do {
|
|
if ((*doorSlot != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_INT(*doorSlot) + 0x394)) == -5)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
updateList = updateList + 1;
|
|
doorSlot = doorSlot + 1;
|
|
} while (updateList < 8);
|
|
shovelOwner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x226,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (shovelOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
isIgnoreTime = 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Mom clear time: %d\n"));
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Par time: %d\n"));
|
|
if (((g_game->_timeCounter <= g_game->_bossRushParTime) || (isIgnoreTime != 0)) ||
|
|
(isForce != 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawning boss rush door\n"));
|
|
uVar6 = g_game->_enterDoor;
|
|
if (((g_game->_lastRoomIdx != -5) || (GHIDRA_INT(uVar6) < 0)) ||
|
|
(this->_doors[uVar6] != (void *)0x0)) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar3 = (code *)swi(3);
|
|
bVar4 = (*pcVar3)();
|
|
return bVar4;
|
|
}
|
|
uVar5 = uVar5 >> 1 ^ uVar5;
|
|
updateList = 0;
|
|
uVar5 = uVar5 << 0xb ^ uVar5;
|
|
do {
|
|
uVar6 = updateList + ((uVar5 >> 0x10 ^ uVar5) & 7) & 0x80000007;
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
uVar6 = (uVar6 - 1 | 0xfffffff8) + 1;
|
|
}
|
|
} while ((((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x38 + (uVar6 >> 5) * 4))
|
|
& 1 << ((uint8_t)uVar6 & 0x1f)) == 0) || (this->_doors[uVar6] != (void *)0x0)) &&
|
|
(updateList = updateList + 1, updateList < 8));
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1))
|
|
{
|
|
uStack_8 = 0;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
uStack_8 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
this_00 = this->_doors[uVar6];
|
|
if (this_00 == GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
MakeDoor(this,uVar6);
|
|
this_00 = this->_doors[uVar6];
|
|
}
|
|
GridEntity_Door::SetRoomTypes
|
|
(this_00,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)),0x11);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_doors[uVar6]) + 0x394)) = 0xfffffffb;
|
|
(GHIDRA_CAST<GridEntity_Door *>((this->_doors[uVar6])))->GridEntity_Door::Open();
|
|
(GHIDRA_CAST<GridEntity_Door *>((this->_doors[uVar6])))->GridEntity_Door::SpawnDust();
|
|
game = g_game;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*puVar1 = *puVar1 | 0x40;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(game->_gameStateFlags);
|
|
if (isIgnoreTime != 0) {
|
|
updateList = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4))));
|
|
uVar5 = (this->_entityList)._updateEL._size;
|
|
uStack_8 = 1;
|
|
entityIndex = 0;
|
|
if (uVar5 != 0) {
|
|
do {
|
|
entity = *GHIDRA_CAST<int **>((updateList + entityIndex * 4));
|
|
if ((entity[10] == 0x2d) && (entity[0xb] == 0)) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT(this->_doors[uVar6]) + 0x24));
|
|
gridWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
dx = ((float)(iVar2 % gridWidth) * 40.0 + 40.0) - (float)entity[0xcf];
|
|
dy = ((float)(iVar2 / gridWidth) * 40.0 + 120.0) - (float)entity[0xd0];
|
|
if (dy * dy + dx * dx < 2500.0) {
|
|
(**(code **)(*entity + 0x28))();
|
|
}
|
|
game = g_game;
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < uVar5);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Did not meet par time, did not spawn boss rush door.\n"));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
|
|
// 007f9df0
|
|
uint8_t Room::TrySpawnMegaSatanRoomDoor(uint8_t isForce)
|
|
{
|
|
char isChallengeOrDaily;
|
|
char extraout_DL;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if (isForce == 0) {
|
|
if (game->_currentRoomIdx != game->_startingRoomIdx) {
|
|
return 0;
|
|
}
|
|
if (game->_stage != 0xb) {
|
|
return 0;
|
|
}
|
|
if (game->_currentDimensionIdx != 0) {
|
|
return 0;
|
|
}
|
|
if ((g_manager->_persistentGameData)._achievements[0x9b] == 0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) {
|
|
return 0;
|
|
}
|
|
if (((game->_dailyChallenge)._id == 0) && (game->_isDebug == 0)) {
|
|
return 0;
|
|
}
|
|
}
|
|
isChallengeOrDaily = (GHIDRA_CAST<Game *>((game)))->Game::IsChallengeOrDaily();
|
|
if ((isChallengeOrDaily != '\0') && (extraout_DL == '\0')) {
|
|
return 0;
|
|
}
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawning Mega Satan door\n"));
|
|
if (this->_doors[1] == (void *)0x0) {
|
|
MakeDoor(this,1);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_doors[1]) + 0x394)) = 0xfffffff9;
|
|
GridEntity_Door::SetRoomTypes
|
|
(this->_doors[1],*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)),5);
|
|
return 1;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] no space for Mega Satan door\n"));
|
|
return 0;
|
|
}
|
|
|
|
// 007f9ee0
|
|
void Room::clear_reward_position(Vector *position)
|
|
{
|
|
int gridY;
|
|
uint32_t gridCollision;
|
|
Vector *freePos;
|
|
int iVar1;
|
|
int gridIndex;
|
|
GridEntity *pit;
|
|
GridEntity *local_3c;
|
|
Vector local_38;
|
|
uint32_t local_30;
|
|
uint32_t local_2c;
|
|
uint32_t local_28;
|
|
uint32_t local_24;
|
|
float local_20;
|
|
float local_1c;
|
|
float local_18;
|
|
float local_14;
|
|
uint32_t local_10;
|
|
uint32_t local_c;
|
|
int *gridEntity;
|
|
|
|
iVar1 = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar1 < 0) || (this->_gridWidth <= iVar1)) ||
|
|
(gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
(this->_gridHeight <= gridY)) {
|
|
gridIndex = -1;
|
|
LAB_007f9f79:
|
|
pit = GHIDRA_CAST<GridEntity *>(0x0);
|
|
LAB_007f9f7f:
|
|
local_30 = 0;
|
|
local_2c = 0;
|
|
local_28 = 0;
|
|
local_24 = 0;
|
|
local_20 = g_vectorZero.x;
|
|
local_1c = g_vectorZero.y;
|
|
local_18 = g_vectorZero.x;
|
|
local_14 = g_vectorZero.y;
|
|
local_10 = 0;
|
|
local_c = 0;
|
|
if ((GHIDRA_UINT(gridIndex) < GHIDRA_CAST<GridEntity *>(0x1c0)) &&
|
|
(gridEntity = this->_gridEntities[gridIndex], gridEntity != GHIDRA_CAST<int *>(0x0))) {
|
|
if (gridEntity[1] == 5) {
|
|
gridEntity[1] = 2;
|
|
}
|
|
(**(code **)(*gridEntity + 0x14))(1,&local_30);
|
|
}
|
|
if (pit == GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_007fa044;
|
|
}
|
|
else {
|
|
gridIndex = this->_gridWidth * gridY + iVar1;
|
|
if (0x1bf < GHIDRA_UINT(gridIndex)) goto LAB_007f9f79;
|
|
pit = this->_gridEntities[gridIndex];
|
|
local_3c = pit;
|
|
if ((pit == GHIDRA_CAST<GridEntity *>(0x0)) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pit)) + 0x4)))) != 7)) goto LAB_007f9f7f;
|
|
TryMakeBridge(this,pit,GHIDRA_CAST<GridEntity *>(0x0));
|
|
pit = local_3c;
|
|
}
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pit)) + 0x4)))) == 0xe) &&
|
|
(local_3c = GHIDRA_CAST<GridEntity *>(gridIndex), GHIDRA_UINT(gridIndex) < GHIDRA_CAST<GridEntity *>(0x1c0))) &&
|
|
((this->_gridEntities[gridIndex] != (void *)0x0 &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT(this->_gridEntities[gridIndex]) + 4)) != 1)))) {
|
|
this->_gridPaths[gridIndex] = 900;
|
|
msvc::set<int>::insert(&local_38,&local_3c);
|
|
}
|
|
LAB_007fa044:
|
|
iVar1 = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar1 < 0) || (this->_gridWidth <= iVar1)) || (gridY < 0)) || (this->_gridHeight <= gridY))
|
|
{
|
|
iVar1 = -1;
|
|
}
|
|
else {
|
|
iVar1 = this->_gridWidth * gridY + iVar1;
|
|
}
|
|
gridCollision = GetGridCollision(this,iVar1);
|
|
if (gridCollision != 0) {
|
|
freePos = FindFreePickupSpawnPosition(this,&local_38,position,0.0,0,0,0);
|
|
position->x = freePos->x;
|
|
position->y = freePos->y;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007fa0e0
|
|
void Room::clear_grid_for_pickup(int *gridIndex)
|
|
{
|
|
uint32_t gridCollision;
|
|
Vector *freePos;
|
|
int gridY;
|
|
int gridX;
|
|
float index;
|
|
Vector local_40;
|
|
Vector VStack_38;
|
|
uint32_t destroySource;
|
|
uint32_t local_2c;
|
|
uint32_t local_28;
|
|
uint32_t local_24;
|
|
float local_20;
|
|
float local_1c;
|
|
float local_18;
|
|
float local_14;
|
|
uint32_t local_10;
|
|
uint32_t local_c;
|
|
int *gridEntity;
|
|
void *poopGrid;
|
|
|
|
destroySource = 0;
|
|
local_2c = 0;
|
|
local_28 = 0;
|
|
local_24 = 0;
|
|
local_20 = g_vectorZero.x;
|
|
local_1c = g_vectorZero.y;
|
|
local_18 = g_vectorZero.x;
|
|
local_14 = g_vectorZero.y;
|
|
local_10 = 0;
|
|
local_c = 0;
|
|
if ((GHIDRA_UINT(*gridIndex) < 0x1c0) &&
|
|
(gridEntity = this->_gridEntities[*gridIndex], gridEntity != GHIDRA_CAST<int *>(0x0))) {
|
|
if (gridEntity[1] == 5) {
|
|
gridEntity[1] = 2;
|
|
}
|
|
(**(code **)(*gridEntity + 0x14))(1,&destroySource);
|
|
}
|
|
index = (float)*gridIndex;
|
|
if ((((GHIDRA_UINT(index) < 0x1c0) &&
|
|
(poopGrid = this->_gridEntities[GHIDRA_INT(index)], poopGrid != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(poopGrid) + 4)) == 0xe)) &&
|
|
((local_40.x = index, poopGrid != (void *)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(poopGrid) + 4)) != 1)))) {
|
|
this->_gridPaths[GHIDRA_INT(index)] = 900;
|
|
msvc::set<int>::insert(&VStack_38,&local_40);
|
|
index = (float)*gridIndex;
|
|
}
|
|
gridCollision = GetGridCollision(this,GHIDRA_INT(index));
|
|
if (gridCollision != 0) {
|
|
local_40.x = (float)(GHIDRA_INT(index) % this->_gridWidth) * 40.0 + 40.0;
|
|
local_40.y = (float)(GHIDRA_INT(index) / this->_gridWidth) * 40.0 + 120.0;
|
|
freePos = FindFreePickupSpawnPosition(this,&VStack_38,&local_40,0.0,0,0,0);
|
|
gridX = GHIDRA_INT(((freePos->x - 40.0) / 40.0 + 0.5));
|
|
if (((-1 < gridX) && (gridX < this->_gridWidth)) &&
|
|
((gridY = GHIDRA_INT(((freePos->y - 120.0) / 40.0 + 0.5)), -1 < gridY && (gridY < this->_gridHeight)
|
|
))) {
|
|
*gridIndex = this->_gridWidth * gridY + gridX;
|
|
return;
|
|
}
|
|
*gridIndex = -1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 007fa360
|
|
void Room::remove_grid_entity_for_spawn(int *gridIndex)
|
|
{
|
|
int *piVar1;
|
|
uint32_t uVar2;
|
|
int iVar3;
|
|
int npcGridIndex;
|
|
void *listData;
|
|
Vector *freePos;
|
|
int iVar4;
|
|
float npcIndex;
|
|
float neighborY;
|
|
uint32_t neighborDestroyRef;
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
uint32_t local_78;
|
|
float local_74;
|
|
float local_70;
|
|
float local_6c;
|
|
float local_68;
|
|
uint32_t local_64;
|
|
uint32_t local_60;
|
|
uint32_t destroyRef;
|
|
uint32_t local_58;
|
|
uint32_t local_54;
|
|
uint32_t local_50;
|
|
float local_4c;
|
|
float local_48;
|
|
float local_44;
|
|
float local_40;
|
|
uint32_t local_3c;
|
|
uint32_t local_38;
|
|
uint8_t local_34 [8];
|
|
Vector local_2c;
|
|
Vector local_24;
|
|
int rowsLeft;
|
|
int dx;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t *gridEntity;
|
|
GridEntity_Pit *neighborGrid;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0138d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((local_34 + 0x30));
|
|
ExceptionList = &local_10;
|
|
if (-1 < *gridIndex) {
|
|
gridEntity = this->_gridEntities[*gridIndex];
|
|
if (gridEntity != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
if (gridEntity[1] == 7) {
|
|
this->_gridPaths[gridEntity[9]] = 0;
|
|
this->_gridEntities[gridEntity[9]] = (void *)0x0;
|
|
(**(code **)*gridEntity)(1);
|
|
local_24.y = (float)(*gridIndex % this->_gridWidth);
|
|
dx = -1;
|
|
local_2c.y = (float)(*gridIndex / this->_gridWidth - 1);
|
|
do {
|
|
npcGridIndex = dx + GHIDRA_INT(local_24.y);
|
|
rowsLeft = 3;
|
|
iVar4 = dx;
|
|
npcIndex = local_2c.y;
|
|
do {
|
|
if (((-1 < npcGridIndex) && (npcGridIndex < this->_gridWidth)) &&
|
|
((-1 < GHIDRA_INT(npcIndex) &&
|
|
((GHIDRA_INT(npcIndex) < this->_gridHeight &&
|
|
(iVar3 = this->_gridWidth * GHIDRA_INT(npcIndex) + iVar4 + GHIDRA_INT(local_24.y), -1 < iVar3))))
|
|
)) {
|
|
piVar1 = this->_gridEntities[iVar3];
|
|
if ((piVar1 != GHIDRA_CAST<int *>(0x0)) && (piVar1[1] == 7)) {
|
|
(**(code **)(*piVar1 + 4))();
|
|
}
|
|
iVar4 = dx;
|
|
}
|
|
npcIndex = (float)(GHIDRA_INT(npcIndex) + 1);
|
|
rowsLeft = rowsLeft + -1;
|
|
} while (rowsLeft != 0);
|
|
dx = iVar4 + 1;
|
|
} while (dx < 2);
|
|
rowsLeft = 0;
|
|
}
|
|
else {
|
|
if (gridEntity[1] == 0xe) {
|
|
EntityList::QuerySublist(&this->_entityList,GHIDRA_CAST<EntityList_EL *>(local_34),0x60,-1,-1,0,0);
|
|
npcIndex = 0.0;
|
|
local_8 = 0;
|
|
if (local_2c.y != 0.0) {
|
|
listData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_34)) + 0x4)));
|
|
do {
|
|
piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(listData) + GHIDRA_INT(npcIndex) * 4));
|
|
if (piVar1[0xef] == 0) {
|
|
npcGridIndex = GHIDRA_INT((((float)piVar1[0xcd] - 40.0) / 40.0 + 0.5));
|
|
iVar4 = GHIDRA_INT((((float)piVar1[0xce] - 120.0) / 40.0 + 0.5));
|
|
if ((((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) || (iVar4 < 0)) ||
|
|
(this->_gridHeight <= iVar4)) {
|
|
npcGridIndex = -1;
|
|
}
|
|
else {
|
|
npcGridIndex = this->_gridWidth * iVar4 + npcGridIndex;
|
|
}
|
|
if (npcGridIndex == *gridIndex) {
|
|
piVar1[0x2d9] = 0x10;
|
|
(**(code **)(*piVar1 + 0xc))();
|
|
}
|
|
listData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_34)) + 0x4)));
|
|
}
|
|
npcIndex = (float)(GHIDRA_INT(npcIndex) + 1);
|
|
} while (GHIDRA_UINT(npcIndex) < GHIDRA_UINT(local_2c.y));
|
|
}
|
|
if (local_34[0] == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_34)) + 0x4))),0);
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
destroyRef = 0;
|
|
local_58 = 0;
|
|
local_54 = 0;
|
|
local_50 = 0;
|
|
local_4c = g_vectorZero.x;
|
|
local_48 = g_vectorZero.y;
|
|
local_44 = g_vectorZero.x;
|
|
local_40 = g_vectorZero.y;
|
|
local_3c = 0;
|
|
local_38 = 0;
|
|
if ((GHIDRA_UINT(*gridIndex) < 0x1c0) &&
|
|
(piVar1 = this->_gridEntities[*gridIndex], piVar1 != GHIDRA_CAST<int *>(0x0))) {
|
|
if (piVar1[1] == 5) {
|
|
piVar1[1] = 2;
|
|
}
|
|
(**(code **)(*piVar1 + 0x14))(1,&destroyRef,uVar2);
|
|
}
|
|
}
|
|
}
|
|
npcGridIndex = *gridIndex;
|
|
uVar2 = GetGridCollision(this,npcGridIndex);
|
|
if (uVar2 != 0) {
|
|
local_2c.x = (float)(npcGridIndex % this->_gridWidth) * 40.0 + 40.0;
|
|
local_2c.y = (float)(npcGridIndex / this->_gridWidth) * 40.0 + 120.0;
|
|
freePos = FindFreePickupSpawnPosition(this,&local_24,&local_2c,0.0,0,0,0);
|
|
npcGridIndex = GHIDRA_INT(((freePos->x - 40.0) / 40.0 + 0.5));
|
|
iVar4 = GHIDRA_INT(((freePos->y - 120.0) / 40.0 + 0.5));
|
|
if ((((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) || (iVar4 < 0)) ||
|
|
(this->_gridHeight <= iVar4)) {
|
|
npcGridIndex = -1;
|
|
}
|
|
else {
|
|
npcGridIndex = this->_gridWidth * iVar4 + npcGridIndex;
|
|
}
|
|
*gridIndex = npcGridIndex;
|
|
}
|
|
iVar4 = npcGridIndex / this->_gridWidth;
|
|
npcGridIndex = npcGridIndex % this->_gridWidth;
|
|
npcIndex = (float)(npcGridIndex + 1);
|
|
npcGridIndex = npcGridIndex + -1;
|
|
if (npcGridIndex <= GHIDRA_INT(npcIndex)) {
|
|
neighborY = (float)(iVar4 + -1);
|
|
local_2c.y = npcIndex;
|
|
local_24.y = neighborY;
|
|
do {
|
|
if (GHIDRA_INT(neighborY) <= iVar4 + 1) {
|
|
do {
|
|
if (((npcGridIndex < 0) || (this->_gridWidth <= npcGridIndex)) ||
|
|
((GHIDRA_INT(neighborY) < 0 || (this->_gridHeight <= GHIDRA_INT(neighborY))))) {
|
|
uVar2 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar2 = this->_gridWidth * GHIDRA_INT(neighborY) + npcGridIndex;
|
|
}
|
|
neighborGrid = this->_gridEntities[uVar2];
|
|
if ((neighborGrid != GHIDRA_CAST<GridEntity_Pit *>(0x0)) &&
|
|
((((piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), piVar1 == GHIDRA_CAST<int *>(0x0) ||
|
|
(piVar1[2] != 0x10)) || (*piVar1 != 0x23)) &&
|
|
((GHIDRA_INT(uVar2) < 0 || (neighborGrid->_collisionClass != 0)))))) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((neighborGrid)) + 0x4)))) == 7) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((neighborGrid)) + 0xc)))) == 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((neighborGrid)) + 0xc)))) = 2;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((neighborGrid)))->GridEntity_Pit::UpdateCollision();
|
|
}
|
|
}
|
|
else {
|
|
neighborDestroyRef = 0;
|
|
local_80 = 0;
|
|
local_7c = 0;
|
|
local_78 = 0;
|
|
local_74 = g_vectorZero.x;
|
|
local_70 = g_vectorZero.y;
|
|
local_6c = g_vectorZero.x;
|
|
local_68 = g_vectorZero.y;
|
|
local_64 = 0;
|
|
local_60 = 0;
|
|
if (uVar2 < 0x1c0) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((neighborGrid)) + 0x4)))) == 5) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((neighborGrid)) + 0x4)))) = 2;
|
|
}
|
|
neighborGrid->Destroy(1,&neighborDestroyRef);
|
|
}
|
|
}
|
|
}
|
|
neighborY = (float)(GHIDRA_INT(neighborY) + 1);
|
|
} while (GHIDRA_INT(neighborY) <= iVar4 + 1);
|
|
npcIndex = local_2c.y;
|
|
neighborY = local_24.y;
|
|
}
|
|
npcGridIndex = npcGridIndex + 1;
|
|
} while (npcGridIndex <= GHIDRA_INT(npcIndex));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007fb250
|
|
void Room::SpawnClearAward()
|
|
{
|
|
Room *itemPool = this;
|
|
uint8_t *flagsHigh;
|
|
code *pcVar2;
|
|
bool bVar3;
|
|
Vector VVar4;
|
|
char cVar5;
|
|
uint8_t bVar6;
|
|
uint32_t uVar7;
|
|
Entity_Player *pEVar8;
|
|
int iVar9;
|
|
Entity_Player *pEVar10;
|
|
RNG *this_00;
|
|
Entity_Pickup *spawned;
|
|
undefined3 extraout_var;
|
|
ChallengeParam *challengeParams;
|
|
RoomDescriptor *roomDesc;
|
|
Vector *targetPos;
|
|
Entity *spawnedEntity;
|
|
uint8_t *lobbyEntry;
|
|
int extraout_ECX;
|
|
PlayerManager *playerManager;
|
|
int *piVar11;
|
|
void *trinketRngEnd;
|
|
uint32_t uVar12;
|
|
int iVar13;
|
|
float fVar14;
|
|
PersistentGameData *persistentData;
|
|
Room *roomAlias;
|
|
Game *game;
|
|
float fVar15;
|
|
float fVar16;
|
|
Vector cantrippedCardPos;
|
|
Vector leftItemPos;
|
|
Vector rightItemPos;
|
|
Vector local_e0;
|
|
Vector local_d8;
|
|
Vector tmpPos;
|
|
Vector local_c8;
|
|
Vector local_c0;
|
|
Entity_Player *local_b8;
|
|
float local_b4;
|
|
RNG awardRng;
|
|
Vector spawnPos;
|
|
uint8_t local_95;
|
|
float local_94;
|
|
Entity_Player *local_90;
|
|
Room *room;
|
|
Entity_Player *local_88;
|
|
uint8_t local_81;
|
|
Vector rewardPos;
|
|
Entity_Player *local_78;
|
|
char isShopItems;
|
|
Entity_Player *local_70;
|
|
bool local_6a;
|
|
bool local_69;
|
|
Entity_Player *local_68;
|
|
float playerColor;
|
|
float local_60;
|
|
float local_5c;
|
|
uint32_t local_58;
|
|
uint32_t local_54;
|
|
uint32_t uStack_50;
|
|
uint32_t uStack_4c;
|
|
uint32_t uStack_48;
|
|
uint32_t local_44;
|
|
uint32_t local_40;
|
|
uint32_t local_3c;
|
|
RNG local_38;
|
|
KColor local_28;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
TypeDescriptor *castDstType;
|
|
uint32_t castIsReference;
|
|
uint32_t castOffset;
|
|
TypeDescriptor *castSrcType;
|
|
uint32_t *flagsHigh;
|
|
ItemPool *itemPool;
|
|
Manager *manager;
|
|
uint64_t oldFlags;
|
|
void *trinketRngBegin;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b013bd;
|
|
local_10 = ExceptionList;
|
|
uVar7 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
awardRng._shift1 = 5;
|
|
awardRng._shift2 = 9;
|
|
awardRng._seed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) + 0x60));
|
|
local_c0.y = 9.80909e-45;
|
|
awardRng._shift3 = 7;
|
|
room = itemPool;
|
|
local_14 = uVar7;
|
|
GetCenterPos(&rewardPos);
|
|
cVar5 = FUN_00866220(&awardRng,&rewardPos,uVar7);
|
|
if (cVar5 != '\0') {
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
local_94 = (float)FUN_00823ec0();
|
|
fVar16 = 40.0;
|
|
spawnPos.x = rewardPos.x + 0.0;
|
|
local_e0.y = rewardPos.y + 80.0;
|
|
local_b4 = 0.0;
|
|
leftItemPos.x = spawnPos.x - 40.0;
|
|
leftItemPos.y = local_e0.y + 0.0;
|
|
rightItemPos.x = spawnPos.x + 40.0;
|
|
isShopItems = '\0';
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
|
|
local_d8.x = spawnPos.x - 80.0;
|
|
local_c8.y = leftItemPos.y;
|
|
local_c8.x = spawnPos.x + 80.0;
|
|
fVar15 = rewardPos.y;
|
|
rightItemPos.y = leftItemPos.y;
|
|
local_d8.y = leftItemPos.y;
|
|
local_b8 = GHIDRA_CAST<Entity_Player *>(local_e0.y);
|
|
spawnPos.y = local_e0.y;
|
|
local_88 = GHIDRA_CAST<Entity_Player *>(spawnPos.x);
|
|
pEVar8 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstPlayerByType(0x21);
|
|
if (pEVar8 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if (((g_game->_levelStateFlags & 0x20000U) != 0) && (itemPool->_roomType == 5)) {
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(0xfffffffe);
|
|
local_b8 = GHIDRA_CAST<Entity_Player *>((fVar15 + fVar16));
|
|
spawnPos.y = (float)local_b8;
|
|
goto LAB_007fb3f3;
|
|
}
|
|
}
|
|
else {
|
|
LAB_007fb3f3:
|
|
isShopItems = '\x01';
|
|
}
|
|
if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) {
|
|
piVar11 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) + 0x10));
|
|
if ((piVar11 != GHIDRA_CAST<int *>(0x0)) && ((piVar11[2] == 0x10 && (*piVar11 == 0x23)))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(1,1);
|
|
PlayerManager::unlock_completion_mark(0xe);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x1ec,1);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::End(0xe);
|
|
goto switchD_007fd7f9_caseD_3;
|
|
}
|
|
iVar9 = itemPool->_roomType;
|
|
if ((iVar9 != 5) && (iVar9 != 0x11)) {
|
|
if ((iVar9 == 0x10) ||
|
|
((bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(), bVar6 != 0 &&
|
|
(g_game->_currentDimensionIdx == 1)))) goto switchD_007fd7f9_caseD_3;
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(RoomClear_PickVariant(&awardRng,0));
|
|
local_90 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_b8 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(0x1);
|
|
local_88 = pEVar8;
|
|
local_78 = pEVar8;
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0xf1);
|
|
if ((bVar6 != 0) && (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x15e))) {
|
|
iVar9 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetNumCollectibles(0xf1);
|
|
local_68 = GHIDRA_CAST<Entity_Player *>((iVar9 + 1));
|
|
local_70 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<RNG *>((&awardRng)))->RNG)::RandomFloat();
|
|
fVar15 = pow(0.666,(float)GHIDRA_INT((GHIDRA_INT(local_68) - 1)));
|
|
if ((float)local_70 < fVar15 * 0.5) {
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
}
|
|
}
|
|
if ((g_game->_difficulty == 1) && (pEVar8 == GHIDRA_CAST<Entity_Player *>(0xa))) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(100);
|
|
local_68 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_68) & -GHIDRA_UINT((uVar7 < 0x42))));
|
|
}
|
|
bVar6 = Entity_Pickup::IsChest(GHIDRA_INT(pEVar8));
|
|
if (bVar6 == 0) {
|
|
pEVar10 = PlayerManager::RandomCollectibleOwner
|
|
(&g_game->_playerManager,0x1d0,awardRng._seed,GHIDRA_CAST<RNG **>(0x0));
|
|
if (pEVar10 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Player *>((pEVar10)))->Entity_Player::GetGlyphOfBalanceDrop(GHIDRA_CAST<int *>(&local_88),GHIDRA_CAST<int *>(&local_b8));
|
|
local_78 = local_88;
|
|
local_90 = local_b8;
|
|
pEVar8 = local_88;
|
|
}
|
|
}
|
|
if ((**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) == -0x10) &&
|
|
(pEVar10 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x96),
|
|
pEVar10 != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
iVar9 = (GHIDRA_CAST<Entity_Player *>((pEVar10)))->Entity_Player::GetTrinketMultiplier(0x96);
|
|
local_68 = GHIDRA_CAST<Entity_Player *>((iVar9 * GHIDRA_INT(local_68)));
|
|
}
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0x202);
|
|
if ((((bVar6 == 0) || (uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(4), uVar7 != 0)) ||
|
|
(GHIDRA_INT(local_68) < 1)) ||
|
|
(((pEVar8 != GHIDRA_CAST<Entity_Player *>(&DAT_00000014) && (pEVar8 != GHIDRA_CAST<Entity_Player *>(0xa))) &&
|
|
((pEVar8 != GHIDRA_CAST<Entity_Player *>(0x1e) &&
|
|
((pEVar8 != GHIDRA_CAST<Entity_Player *>(0x45) && (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x28))))))))) {
|
|
local_6a = false;
|
|
}
|
|
else {
|
|
local_6a = true;
|
|
}
|
|
if ((((pEVar8 == GHIDRA_CAST<Entity_Player *>(&DAT_00000014)) || (pEVar8 == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
|
(local_68 == GHIDRA_CAST<Entity_Player *>(0x0))) &&
|
|
(pEVar10 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1a0,GHIDRA_CAST<RNG **>(&g_game->_playerManager),0),
|
|
pEVar10 != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(&DAT_00000014);
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(&DAT_00000014);
|
|
(GHIDRA_CAST<RNG *>((&local_38)))->RNG::game_constructor(awardRng._seed,0x13);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((this_00)))->RNG::RandomInt(3);
|
|
uVar7 = uVar7 + GHIDRA_INT(local_68);
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(1);
|
|
if (1 < uVar7) {
|
|
local_68 = GHIDRA_CAST<Entity_Player *>(uVar7);
|
|
}
|
|
LAB_007fb6b7:
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x54);
|
|
if ((bVar6 != 0) &&
|
|
(local_88 = (Entity_Player *)
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x54),
|
|
1 < GHIDRA_INT(local_88))) {
|
|
local_70 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x54);
|
|
trinketRngEnd = (local_70->_trinketRNGs)._end;
|
|
if (GHIDRA_INT((GHIDRA_INT(trinketRngEnd) - GHIDRA_INT((local_70->_trinketRNGs)._begin) & 0xfffffff0U)) < 0x541
|
|
) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Trinket ID out of bounds!\n"));
|
|
trinketRngEnd = (local_70->_trinketRNGs)._end;
|
|
}
|
|
trinketRngBegin = (local_70->_trinketRNGs)._begin;
|
|
uVar7 = (GHIDRA_INT(trinketRngEnd) - GHIDRA_INT(trinketRngBegin) >> 4) - 1;
|
|
if (0x54 < uVar7) {
|
|
uVar7 = 0x54;
|
|
}
|
|
local_70 = GHIDRA_CAST<Entity_Player *>((uVar7 * 0x10 + GHIDRA_INT(trinketRngBegin)));
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_70))))->RNG::RandomInt(10000);
|
|
uVar12 = 0x29a;
|
|
if (2 < GHIDRA_INT(local_88)) {
|
|
uVar12 = 0x514;
|
|
}
|
|
if (uVar7 < uVar12) {
|
|
local_28._red = 5.60519e-45;
|
|
local_28._green = 2.8026e-45;
|
|
local_28._blue = 4.2039e-45;
|
|
local_28._alpha = 7.00649e-45;
|
|
local_28._unk = 7;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_70))))->RNG::RandomInt(5);
|
|
local_90 = GHIDRA_CAST<Entity_Player *>((&local_28._red)[uVar7]);
|
|
}
|
|
}
|
|
}
|
|
else if (pEVar8 == GHIDRA_CAST<Entity_Player *>(&DAT_00000014)) goto LAB_007fb6b7;
|
|
local_94 = 0.0;
|
|
pEVar10 = local_68;
|
|
if (0 < GHIDRA_INT(local_68)) {
|
|
do {
|
|
if (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
FindFreePickupSpawnPosition(itemPool,&spawnPos,&rewardPos,0.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
spawned = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(pEVar8),&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_UINT(local_90),uVar7);
|
|
bVar6 = Entity_Pickup::IsChest(spawned->_variant);
|
|
if (bVar6 == 0) {
|
|
local_90 = GHIDRA_CAST<Entity_Player *>(spawned->_subtype);
|
|
}
|
|
if ((spawned->_type == 5) && ((extraout_ECX == 0x34 || (extraout_ECX == 0x36)))) {
|
|
bVar6 = 0;
|
|
iVar9 = GetGridIndex(itemPool,&spawnPos);
|
|
bVar6 = CanSpawnObstacleAtPosition(itemPool,iVar9,bVar6);
|
|
if (bVar6 == 0) {
|
|
Entity_Pickup::Morph(spawned,5,0x32,1,0,0,0);
|
|
local_90 = GHIDRA_CAST<Entity_Player *>(0x1);
|
|
}
|
|
}
|
|
if ((local_6a != false) && (local_94 == 0.0)) {
|
|
oldFlags = spawned->_flags;
|
|
flagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x100;
|
|
*GHIDRA_CAST<int *>(&spawned->_flags) = GHIDRA_INT(oldFlags);
|
|
}
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x29e,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
spawn_options_alternative(itemPool,spawned);
|
|
}
|
|
pEVar10 = local_68;
|
|
pEVar8 = local_78;
|
|
}
|
|
local_94 = (float)(GHIDRA_INT(local_94) + 1);
|
|
} while (GHIDRA_INT(local_94) < GHIDRA_INT(pEVar10));
|
|
}
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x8f);
|
|
game = g_game;
|
|
if (bVar6 != 0) {
|
|
iVar9 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::GetTrinketMultiplier(0x8f);
|
|
fVar16 = (float)iVar9;
|
|
fVar15 = PlayerManager::get_total_luck(&game->_playerManager);
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(((fVar15 * 0.03 + 0.2) * fVar16));
|
|
local_88 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<RNG *>((&awardRng)))->RNG)::RandomFloat();
|
|
itemPool = room;
|
|
pEVar8 = local_70;
|
|
if (0.33 <= (float)local_70) {
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(0x3ea8f5c3);
|
|
}
|
|
if ((float)local_88 < (float)pEVar8) {
|
|
FindFreePickupSpawnPosition(room,&tmpPos,&rewardPos,0.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
spawned = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x5a,&tmpPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0x29e);
|
|
if (bVar6 != 0) {
|
|
spawn_options_alternative(itemPool,spawned);
|
|
}
|
|
}
|
|
}
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0xb1);
|
|
if ((bVar6 != 0) && (itemPool->_roomType == 0xb)) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) + 0x10)) + 0x10)) == 1) {
|
|
FindFreePickupSpawnPosition(itemPool,&tmpPos,&rewardPos,0.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
targetPos = &tmpPos;
|
|
uVar12 = 100;
|
|
}
|
|
else {
|
|
FindFreePickupSpawnPosition(itemPool,&local_c8,&rewardPos,0.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
targetPos = &local_c8;
|
|
uVar12 = 0x32;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar12,targetPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
uVar7 = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
local_88 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::GetPlayer(uVar7);
|
|
local_70 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>((local_88)))->Entity_Player)::GetTrinketMultiplier(0xb1);
|
|
if (1 < GHIDRA_INT(local_70)) {
|
|
(GHIDRA_CAST<Entity_Player *>((local_88)))->Entity_Player::add_random_stat_up(&awardRng);
|
|
}
|
|
if (2 < GHIDRA_INT(local_70)) {
|
|
(GHIDRA_CAST<Entity_Player *>((local_88)))->Entity_Player::add_random_stat_up(&awardRng);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (uVar7 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
if (g_game->_challenge == 0x2b) {
|
|
FindFreePickupSpawnPosition(itemPool,&cantrippedCardPos,&rewardPos,0.0,0,0,0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,300,&cantrippedCardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar7);
|
|
}
|
|
goto switchD_007fd7f9_caseD_3;
|
|
}
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(g_game->_stage);
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(g_game->_stageType);
|
|
local_68 = pEVar8;
|
|
local_90 = pEVar8;
|
|
if (g_game->_currentRoomIdx == -0x11) {
|
|
Level::boss_count_adjust(GHIDRA_CAST<int *>(&local_90),GHIDRA_CAST<int *>(&local_78));
|
|
pEVar8 = local_90;
|
|
LAB_007fbbc4:
|
|
local_68 = pEVar8;
|
|
}
|
|
else {
|
|
uVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(2);
|
|
if (((uVar7 != 0) && (GHIDRA_INT(pEVar8) < 8)) || (g_game->_challenge == 0x2c)) {
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar8)) + 0x0))) + 1));
|
|
goto LAB_007fbbc4;
|
|
}
|
|
}
|
|
local_90 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Game *>((g_game)))->Game)::GetChallengeParams();
|
|
local_95 = Level::IsStageWithinEnd(10,0);
|
|
local_81 = Level::IsStageWithinEnd(10,1);
|
|
iVar9 = CONCAT31(extraout_var,local_81);
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
LAB_007fbc83:
|
|
local_69 = false;
|
|
}
|
|
else {
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
iVar9 = 0xc;
|
|
if (challengeParams->_endStage != 0xc) {
|
|
if ((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) {
|
|
itemPool = room;
|
|
if (((g_manager->_persistentGameData)._achievements[0x140] != 0) ||
|
|
((pEVar8 = local_68, *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game->_isDebug != 0))))
|
|
goto LAB_007fbc61;
|
|
}
|
|
iVar9 = 0xb;
|
|
}
|
|
LAB_007fbc61:
|
|
iVar13 = iVar9;
|
|
if (challengeParams->_isPathTypeSet != 0) {
|
|
iVar13 = challengeParams->_endStage;
|
|
if (challengeParams->_endStage == 0) {
|
|
iVar13 = iVar9;
|
|
}
|
|
if (challengeParams->_pathType == 3) goto LAB_007fbc83;
|
|
}
|
|
local_69 = 0xb < iVar13;
|
|
}
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(CONCAT31((int3)(GHIDRA_UINT(iVar9) >> 8),1));
|
|
if (*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(local_90->_sprite)._animState._animData) + 3)) != 0) {
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(GHIDRA_UINT((GHIDRA_INT(pEVar8) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_90)) + 0x40)))))));
|
|
}
|
|
if (itemPool->_roomType == 0x11) {
|
|
PlayerManager::unlock_completion_mark(3);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x6f,1);
|
|
game = g_game;
|
|
oldFlags = g_game->_gameStateFlags;
|
|
flagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*flagsHigh = *flagsHigh | 2;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(oldFlags);
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) == 0) ||
|
|
(iVar9 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))) + 0x10)), iVar9 == 0))
|
|
goto switchD_007fbd6e_caseD_e79;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((iVar9 + 0xc));
|
|
if (uVar7 < 0xeb6) {
|
|
if (uVar7 != 0xeb5) {
|
|
if (0xcc2 < uVar7) {
|
|
switch(uVar7) {
|
|
case 0xe78:
|
|
case 0xe7b:
|
|
case 0xe7e:
|
|
case 0xe82:
|
|
case 0xeb0:
|
|
goto switchD_007fbd6e_caseD_e78;
|
|
default:
|
|
goto switchD_007fbd6e_caseD_e79;
|
|
}
|
|
}
|
|
if (uVar7 != 0xcc2) {
|
|
if (uVar7 < 0x7ea) {
|
|
if (((uVar7 == 0x7e9) || (uVar7 == 0x421)) || (uVar7 == 0x43f))
|
|
goto switchD_007fbd6e_caseD_e78;
|
|
}
|
|
else if ((uVar7 == 0x810) || (uVar7 == 0xcc1)) goto switchD_007fbd6e_caseD_e78;
|
|
goto switchD_007fbd6e_caseD_e79;
|
|
}
|
|
}
|
|
switchD_007fbd6e_caseD_e78:
|
|
FUN_007fa7d0();
|
|
}
|
|
else {
|
|
if (0x1436 < uVar7) {
|
|
switch(uVar7) {
|
|
case 0x143c:
|
|
case 0x143d:
|
|
case 0x1466:
|
|
case 0x146d:
|
|
case 0x14f1:
|
|
goto switchD_007fbd6e_caseD_e78;
|
|
default:
|
|
goto switchD_007fbd6e_caseD_e79;
|
|
}
|
|
}
|
|
if (uVar7 == 0x1436) goto switchD_007fbd6e_caseD_e78;
|
|
if (uVar7 < 0xfca) {
|
|
if (((uVar7 == 0xfc9) || (uVar7 == 0xeeb)) || (uVar7 == 0xfb6))
|
|
goto switchD_007fbd6e_caseD_e78;
|
|
}
|
|
else if ((uVar7 == 0x13ef) || (uVar7 == 0x1418)) goto switchD_007fbd6e_caseD_e78;
|
|
}
|
|
switchD_007fbd6e_caseD_e79:
|
|
bVar6 = IsCurrentRoomLastBoss(itemPool);
|
|
if ((bVar6 == 0) && ((g_game->_currentRoomIdx != -10 || (itemPool->_roomType != 5)))) {
|
|
local_6a = false;
|
|
}
|
|
else {
|
|
local_6a = true;
|
|
}
|
|
if (g_game->_challenge == 0x2c) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,
|
|
g_game->_currentDimensionIdx);
|
|
local_6a = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(roomDesc->Data) + 8)) == 5;
|
|
}
|
|
game = g_game;
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::IsCoopPlay();
|
|
if ((bVar6 != 0) && (local_6a != false)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::revive_player_ghosts();
|
|
}
|
|
if ((g_game->_currentRoomIdx == -10) && (itemPool->_roomType == 5)) {
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x6)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(1,1);
|
|
PlayerManager::unlock_completion_mark(0);
|
|
}
|
|
else if (local_68 == GHIDRA_CAST<Entity_Player *>(0x8)) {
|
|
PlayerManager::unlock_completion_mark(0xd);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x1eb,1);
|
|
if (*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(local_90->_sprite)._animState._animData) + 3)) != 0) {
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
goto LAB_007fbea9;
|
|
}
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x154,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
if ((((char)local_78 != '\0') && (local_69 != false)) &&
|
|
(1 < GHIDRA_UINT((g_manager->_persistentGameData)._eventCounters[0x1eb]))) {
|
|
spawnPos.x = rewardPos.x + 0.0;
|
|
spawnPos.y = rewardPos.y + 40.0;
|
|
targetPos = FindFreePickupSpawnPosition(itemPool,&tmpPos,&spawnPos,80.0,1,0,0);
|
|
local_88 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(itemPool,targetPos));
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_88));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_88),0x11,0,uVar7,1);
|
|
}
|
|
}
|
|
goto LAB_007fd75c;
|
|
}
|
|
if ((GHIDRA_INT(local_68) < 8) && (local_68 != GHIDRA_CAST<Entity_Player *>(0x6))) {
|
|
LAB_007fcf52:
|
|
if (local_6a != false) {
|
|
if ((char)local_78 == '\0') {
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
uVar7 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x172,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
else {
|
|
uVar7 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::filter_curses(2);
|
|
local_95 = uVar7 != 0;
|
|
if ((local_90->_sprite)._animState._layerFrames == (void *)0x3) {
|
|
cVar5 = FUN_007ed240();
|
|
local_81 = 1;
|
|
if (cVar5 == '\0') goto LAB_007fcf96;
|
|
}
|
|
else {
|
|
LAB_007fcf96:
|
|
local_81 = 0;
|
|
}
|
|
game = g_game;
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if ((challengeParams->_pathType == 2) &&
|
|
(((bVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::IsAltPath(), bVar6 == 0 || (local_95 != 0)) ||
|
|
((local_68 != GHIDRA_CAST<Entity_Player *>(0x1) &&
|
|
(((local_68 != GHIDRA_CAST<Entity_Player *>(0x3) && (local_68 != GHIDRA_CAST<Entity_Player *>(0x5))) &&
|
|
(local_68 != GHIDRA_CAST<Entity_Player *>(0x7))))))))) {
|
|
bVar3 = true;
|
|
}
|
|
else {
|
|
bVar3 = false;
|
|
}
|
|
if ((g_game->_challenge == 0x2c) || ((local_81 == 0 && (!bVar3)))) {
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_94));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_94),0x11,0,uVar7,0);
|
|
}
|
|
}
|
|
}
|
|
LAB_007fd052:
|
|
if ((itemPool->_bossId == 0x26) &&
|
|
(bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0xb5,1), bVar6 != 0)) {
|
|
uVar7 = 0xb5;
|
|
LAB_007fd2ec:
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0);
|
|
}
|
|
else {
|
|
if ((itemPool->_bossId == 0x16) &&
|
|
(bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x82,1), bVar6 != 0)) {
|
|
uVar7 = 0x82;
|
|
goto LAB_007fd2ec;
|
|
}
|
|
if ((itemPool->_bossId == 0x15) &&
|
|
(bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x60,1), bVar6 != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x19);
|
|
uVar7 = 0x60;
|
|
goto LAB_007fd2ec;
|
|
}
|
|
if ((itemPool->_bossId == 0x13) &&
|
|
(bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(99,1), bVar6 != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x17);
|
|
uVar7 = 99;
|
|
goto LAB_007fd2ec;
|
|
}
|
|
if ((itemPool->_bossId == 0x14) &&
|
|
((bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x32,1), bVar6 != 0 ||
|
|
(bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(100,1), bVar6 != 0)))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x18);
|
|
bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(100,1);
|
|
if ((bVar6 == 0) || (uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(6), uVar7 == 0)) {
|
|
uVar7 = 0x32;
|
|
}
|
|
else {
|
|
uVar7 = 100;
|
|
}
|
|
goto LAB_007fd2ec;
|
|
}
|
|
iVar9 = itemPool->_bossId;
|
|
if ((((8 < iVar9) && (iVar9 < 0xd)) || (iVar9 == 0x26)) || (iVar9 == 0x16)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(7);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(2);
|
|
uVar7 = (-GHIDRA_UINT((uVar7 != 0)) & 0x86) + 0x49;
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x49,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (pEVar8 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xcf,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar7 = 0xcf;
|
|
}
|
|
}
|
|
else {
|
|
uVar7 = 0x49;
|
|
}
|
|
goto LAB_007fd2ec;
|
|
}
|
|
if ((itemPool->_roomType == 0x11) &&
|
|
(pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x226,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
uVar7 = 0x227;
|
|
goto LAB_007fd2ec;
|
|
}
|
|
if ((itemPool->_bossId == 0x54) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x73f0)))) == -1)) {
|
|
bVar6 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x28a,1);
|
|
manager = g_manager;
|
|
if (bVar6 != 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x73f0)))) = 0;
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x19a);
|
|
uVar7 = 0x28a;
|
|
goto LAB_007fd2ec;
|
|
}
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar7 = ItemPool::GetSeededCollectible(uVar7,0,*GHIDRA_CAST<RoomDescriptor **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))));
|
|
}
|
|
if (g_game->_challenge == 0x2b) {
|
|
spawnPos.x = (float)local_88;
|
|
spawnPos.y = (float)local_b8;
|
|
clear_reward_position(itemPool,&spawnPos);
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1;
|
|
FUN_007fa2a0(&spawnPos);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xfb,uVar7);
|
|
spawned = (Entity_Pickup *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,castIsReference);
|
|
if (isShopItems != '\0') {
|
|
(GHIDRA_CAST<Entity_Pickup *>((spawned)))->Entity_Pickup::MakeShopItem(-2);
|
|
}
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1;
|
|
spawned->_coopDuplicateIndex = 0;
|
|
}
|
|
else {
|
|
local_b4 = 0.0;
|
|
local_94 = 0.0;
|
|
local_69 = (bool)pick_special_clear_award(itemPool,GHIDRA_CAST<int *>(&local_b4),GHIDRA_CAST<uint32_t *>(&local_94),&awardRng)
|
|
;
|
|
local_c0.x = (float)local_88;
|
|
local_c0.y = (float)local_b8;
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xf9,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((pEVar8 == GHIDRA_CAST<Entity_Player *>(0x0)) || (local_69 == false)) {
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xf9,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) != local_69) {
|
|
local_c0.x = leftItemPos.x;
|
|
local_c0.y = leftItemPos.y;
|
|
}
|
|
}
|
|
else {
|
|
local_c0.x = (float)local_88;
|
|
local_c0.y = local_e0.y;
|
|
}
|
|
clear_reward_position(itemPool,&local_c0);
|
|
FUN_007fa2a0(&local_c0);
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_c0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar12)
|
|
;
|
|
pEVar8 = (Entity_Player *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,castIsReference);
|
|
local_70 = pEVar8;
|
|
if (isShopItems != '\0') {
|
|
(GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(pEVar8))))->Entity_Pickup::MakeShopItem(-2);
|
|
}
|
|
playerManager = &g_game->_playerManager;
|
|
(pEVar8->_crownOfLightSprite)._overlayAnimState._layerFrames = (void *)0x0;
|
|
iVar9 = -1;
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner(playerManager,0xf9,GHIDRA_CAST<RNG **>(playerManager),1);
|
|
if (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar7 = ItemPool::GetSeededCollectible(uVar7,0,*GHIDRA_CAST<RoomDescriptor **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemPool)) + 0x4)))));
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0);
|
|
targetPos = &local_d8;
|
|
if (local_69 == false) {
|
|
targetPos = &rightItemPos;
|
|
}
|
|
local_c0.x = (float)targetPos->x;
|
|
local_c0.y = targetPos->y;
|
|
clear_reward_position(room,&local_c0);
|
|
FUN_007fa2a0(&local_c0);
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_c0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar12);
|
|
spawned = (Entity_Pickup *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,castIsReference
|
|
);
|
|
if (isShopItems != '\0') {
|
|
(GHIDRA_CAST<Entity_Pickup *>((spawned)))->Entity_Pickup::MakeShopItem(-2);
|
|
}
|
|
iVar9 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_70))))->Entity_Pickup::AssignOptionsIndex();
|
|
spawned->_coopDuplicateIndex = 0;
|
|
spawned->_optionsPickupIndex = iVar9;
|
|
itemPool = room;
|
|
}
|
|
if (local_69 != false) {
|
|
pEVar8 = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0xf9,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
targetPos = &local_c8;
|
|
if (pEVar8 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
targetPos = &rightItemPos;
|
|
}
|
|
local_c0.x = (float)targetPos->x;
|
|
local_c0.y = targetPos->y;
|
|
if (local_b4 != 0.0) {
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,GHIDRA_INT(local_b4),0,0);
|
|
clear_reward_position(itemPool,&local_c0);
|
|
FUN_007fa2a0(&local_c0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_c0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_b4),uVar7);
|
|
spawned = (Entity_Pickup *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,
|
|
castIsReference);
|
|
if (isShopItems != '\0') {
|
|
(GHIDRA_CAST<Entity_Pickup *>((spawned)))->Entity_Pickup::MakeShopItem(-2);
|
|
}
|
|
if (iVar9 == -1) {
|
|
iVar9 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_70))))->Entity_Pickup::AssignOptionsIndex();
|
|
}
|
|
spawned->_optionsPickupIndex = iVar9;
|
|
spawned->_coopDuplicateIndex = 0;
|
|
}
|
|
fVar15 = local_94;
|
|
if (local_94 != 0.0) {
|
|
uVar7 = Random();
|
|
targetPos = &local_c0;
|
|
uVar12 = 0x15e;
|
|
goto LAB_007fd74c;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (((local_68 == GHIDRA_CAST<Entity_Player *>(0x8)) || (local_68 == GHIDRA_CAST<Entity_Player *>(0x6))) &&
|
|
(local_6a == false)) goto LAB_007fd052;
|
|
if ((itemPool->_roomType == 0x11) || ((g_game->_challenge == 0x2c && (GHIDRA_INT(local_68) < 8))))
|
|
goto LAB_007fcf52;
|
|
if (itemPool->_bossId == 0x37) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x1a,1);
|
|
FUN_0092a5e0(0x37);
|
|
PlayerManager::unlock_completion_mark(6);
|
|
if ((uint8_t)(local_90->_sprite)._animDefaultName._capacity == 0) {
|
|
if (((char)local_78 == '\0') || (local_69 == false)) {
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::End(8);
|
|
}
|
|
else {
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x154,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
targetPos = FindFreePickupSpawnPosition(itemPool,&tmpPos,&rewardPos,80.0,1,0,0);
|
|
local_88 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(itemPool,targetPos));
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_88));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_88),0x11,0,uVar7,1);
|
|
}
|
|
goto LAB_007fd75c;
|
|
}
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
uVar7 = Random();
|
|
fVar15 = 0.0;
|
|
targetPos = &rewardPos;
|
|
uVar12 = 0x172;
|
|
LAB_007fd74c:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar12,targetPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(fVar15),uVar7);
|
|
}
|
|
else {
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x6)) {
|
|
if (((g_manager->_persistentGameData)._achievements[4] == 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) {
|
|
if (*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(local_90->_sprite)._animState._animData) + 3)) != 0) {
|
|
if ((char)local_78 == '\0') goto LAB_007fc202;
|
|
if (((uint8_t)(local_90->_sprite)._animDefaultName._capacity != 0) ||
|
|
(6 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_90)) + 0x40)))))) goto LAB_007fc1ca;
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(4);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(5);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(6);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x281);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::End(2);
|
|
goto LAB_007fd75c;
|
|
}
|
|
if ((char)local_78 == '\0') {
|
|
LAB_007fc202:
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
uVar7 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x172,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
else {
|
|
LAB_007fc1ca:
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(local_90->_sprite)._animState._animData) + 3)) == 0) ||
|
|
((local_90->_sprite)._animState._layerFrames != (void *)0x3)) {
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_94));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_94),0x11,0,uVar7,0);
|
|
}
|
|
}
|
|
game = g_game;
|
|
local_d8.x = 320.0;
|
|
local_d8.y = 360.0;
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
roomAlias = room;
|
|
if ((challengeParams->_pathType == 3) ||
|
|
((((g_manager->_persistentGameData)._achievements[0x39] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))) && (local_81 != 0))
|
|
)) {
|
|
bVar6 = 1;
|
|
if (challengeParams->_pathType != 3) goto LAB_007fc299;
|
|
LAB_007fc2d1:
|
|
bVar3 = true;
|
|
}
|
|
else {
|
|
bVar6 = 0;
|
|
LAB_007fc299:
|
|
if ((((g_manager->_persistentGameData)._achievements[0x4e] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) &&
|
|
(local_95 != 0)) goto LAB_007fc2d1;
|
|
bVar3 = false;
|
|
}
|
|
if (bVar6 == 0) {
|
|
if (bVar3) goto LAB_007fc47e;
|
|
bVar6 = 0;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar7 = GetSeededCollectible(itemPool,uVar7,bVar6);
|
|
roomAlias = room;
|
|
clear_reward_position(room,&local_d8);
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
spawned = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_d8,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar12);
|
|
if (isShopItems != '\0') {
|
|
(GHIDRA_CAST<Entity_Pickup *>((spawned)))->Entity_Pickup::MakeShopItem(GHIDRA_INT(local_70));
|
|
}
|
|
spawned->_coopDuplicateIndex = 0;
|
|
}
|
|
else if (!bVar3) {
|
|
LAB_007fc47e:
|
|
uVar12 = (bVar6 ^ 1) + 0x147;
|
|
clear_reward_position(room,&local_d8);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_d8,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar12,uVar7);
|
|
itemPool = &g_game->_itemPool;
|
|
spawnedEntity[1]._colorParams._end = (void *)0x0;
|
|
spawnedEntity[1]._collisionPoints._begin = (void *)0x0;
|
|
ItemPool::RemoveCollectible(itemPool,uVar12,0,0);
|
|
}
|
|
else {
|
|
clear_reward_position(itemPool,&leftItemPos);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&leftItemPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x147,uVar7);
|
|
spawned = (Entity_Pickup *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,
|
|
castIsReference);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0x147,0,0);
|
|
iVar9 = (GHIDRA_CAST<Entity_Pickup *>((spawned)))->Entity_Pickup::AssignOptionsIndex();
|
|
spawned->_cycleCollectibleCount = 0;
|
|
spawned->_coopDuplicateIndex = 0;
|
|
clear_reward_position(room,&rightItemPos);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&rightItemPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0x148,uVar7);
|
|
iVar13 = __RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,
|
|
castIsReference);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,0x148,0,0);
|
|
*GHIDRA_CAST<int *>((iVar13 + 0x528)) = iVar9;
|
|
*GHIDRA_CAST<uint32_t *>((iVar13 + 0x5c0)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((iVar13 + 0x588)) = 0;
|
|
roomAlias = room;
|
|
}
|
|
if (((char)local_78 != '\0') && (local_69 != false)) {
|
|
local_94 = 0.0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
uVar7 = 0;
|
|
do {
|
|
pEVar8 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar7);
|
|
if (pEVar8->_variant == 0) {
|
|
iVar9 = 0;
|
|
piVar11 = (pEVar8->_collectibleCounts)._begin;
|
|
for (iVar13 = GHIDRA_INT((pEVar8->_collectibleCounts)._end) - GHIDRA_INT(piVar11) >> 2;
|
|
iVar13 != 0; iVar13 = iVar13 + -1) {
|
|
iVar9 = iVar9 + *piVar11;
|
|
piVar11 = piVar11 + 1;
|
|
}
|
|
fVar15 = pEVar8->_damage;
|
|
if (pEVar8->_damage <= local_b4) {
|
|
fVar15 = local_b4;
|
|
}
|
|
local_94 = (float)(GHIDRA_INT(local_94) + iVar9);
|
|
local_b4 = fVar15;
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
roomAlias = room;
|
|
}
|
|
fVar15 = local_94;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(0x14);
|
|
if ((uVar7 == 0) && ((0x13 < GHIDRA_INT(fVar15) || (100.0 < local_b4)))) {
|
|
targetPos = FindFreePickupSpawnPosition(roomAlias,&tmpPos,&rewardPos,80.0,1,0,0);
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(roomAlias,targetPos));
|
|
remove_grid_entity_for_spawn(roomAlias,GHIDRA_CAST<int *>(&local_70));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(roomAlias,GHIDRA_INT(local_70),0x11,0,uVar7,1);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(4);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(5);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(6);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x281);
|
|
goto LAB_007fd75c;
|
|
}
|
|
if ((local_68 == GHIDRA_CAST<Entity_Player *>(0x8)) || (local_68 == GHIDRA_CAST<Entity_Player *>(0x9))) {
|
|
if (((((g_manager->_persistentGameData)._achievements[0x22] == 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) ||
|
|
(local_68 != GHIDRA_CAST<Entity_Player *>(0x8))) &&
|
|
((((g_manager->_persistentGameData)._eventCounters[0x9e] == 0 ||
|
|
(local_68 != GHIDRA_CAST<Entity_Player *>(0x9))) &&
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(local_90->_sprite)._animState._animData) + 3)) == 0 ||
|
|
(((uint8_t)(local_90->_sprite)._animDefaultName._capacity == 0 &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_90)) + 0x40)))) <= GHIDRA_INT(local_68))))))))) {
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
if ((char)local_78 == '\0') goto LAB_007fce68;
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar12 = 0x154;
|
|
LAB_007fce80:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar12,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
else {
|
|
if ((char)local_78 == '\0') {
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
LAB_007fce68:
|
|
uVar7 = Random();
|
|
uVar12 = 0x172;
|
|
goto LAB_007fce80;
|
|
}
|
|
if (local_95 != 0) {
|
|
targetPos = GetCenterPos(&tmpPos);
|
|
spawnPos.y = 280.0;
|
|
spawnPos.x = targetPos->x - 40.0;
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(itemPool,&spawnPos));
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_70));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_70),0x11,0,uVar7,0);
|
|
}
|
|
if (local_81 != 0) {
|
|
targetPos = GetCenterPos(&tmpPos);
|
|
spawnPos.y = 280.0;
|
|
spawnPos.x = targetPos->x + 40.0;
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(itemPool,&spawnPos));
|
|
clear_grid_for_pickup(itemPool,GHIDRA_CAST<int *>(&local_70));
|
|
uVar7 = Random();
|
|
targetPos = GetGridPosition(room,&tmpPos,GHIDRA_INT(local_70));
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x27,targetPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
itemPool = room;
|
|
}
|
|
}
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x8)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(1,1);
|
|
PlayerManager::unlock_completion_mark(0);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(10);
|
|
if ((((uVar7 == 0) && ((char)local_78 != '\0')) && (local_69 != false)) &&
|
|
(challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams(),
|
|
challengeParams->_endStage != 0xc)) {
|
|
targetPos = &local_c8;
|
|
goto LAB_007fca07;
|
|
}
|
|
}
|
|
else if (local_68 == GHIDRA_CAST<Entity_Player *>(0x9)) {
|
|
PlayerManager::unlock_completion_mark(9);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x9e,1);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x140);
|
|
Game::SetStateFlag(0x28,1);
|
|
}
|
|
}
|
|
else if (local_68 == GHIDRA_CAST<Entity_Player *>(0xb)) {
|
|
if (g_game->_stageType == 0) {
|
|
PlayerManager::unlock_completion_mark(5);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x19,1);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x15c);
|
|
if (g_game->_timeCounter < 36000) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x146);
|
|
}
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x29);
|
|
if (bVar6 == 0) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x147);
|
|
}
|
|
if (0 < g_game->_victoryLap) {
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::AchievementUnlocksDisallowed();
|
|
FUN_009299e0(bVar6);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x141);
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0x1))) = 1;
|
|
}
|
|
if (1 < g_game->_victoryLap) {
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::AchievementUnlocksDisallowed();
|
|
FUN_009299e0(bVar6);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x168);
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0x1))) = 1;
|
|
}
|
|
if (2 < g_game->_victoryLap) {
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::AchievementUnlocksDisallowed();
|
|
FUN_009299e0(bVar6);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x151);
|
|
manager = g_manager;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Setting PersistentGameData ReadOnly to %s\n"));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0x1))) = 1;
|
|
}
|
|
game = g_game;
|
|
if (((g_game->_challenge == 0) && ((g_game->_dailyChallenge)._id == 0)) &&
|
|
(bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode(), bVar6 == 0)) {
|
|
if ((g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) ||
|
|
(uVar7 = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::count_main_players(), uVar7 < 2)) {
|
|
(GHIDRA_CAST<GenericPrompt *>((&game->_genericPrompt)))->GenericPrompt::Show(0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GenericPrompt *>((&game->_genericPrompt)))->GenericPrompt::Show(1);
|
|
online_vote_start(game,1,2);
|
|
}
|
|
}
|
|
itemPool = room;
|
|
}
|
|
else {
|
|
PlayerManager::unlock_completion_mark(4);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x18,1);
|
|
}
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if (challengeParams->_endStage == 0xc) {
|
|
LAB_007fc9db:
|
|
if ((char)local_78 == '\0') goto LAB_007fd75c;
|
|
}
|
|
else {
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
if ((char)local_78 == '\0') {
|
|
LAB_007fbea9:
|
|
uVar7 = Random();
|
|
fVar15 = 0.0;
|
|
targetPos = &rewardPos;
|
|
uVar12 = 0x172;
|
|
goto LAB_007fd74c;
|
|
}
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x154,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
}
|
|
if (local_69 != false) {
|
|
targetPos = &tmpPos;
|
|
LAB_007fca07:
|
|
targetPos = FindFreePickupSpawnPosition(itemPool,targetPos,&rewardPos,80.0,1,0,0);
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(GetGridIndex(itemPool,targetPos));
|
|
remove_grid_entity_for_spawn(itemPool,GHIDRA_CAST<int *>(&local_70));
|
|
uVar7 = Random();
|
|
SpawnGridEntity(itemPool,GHIDRA_INT(local_70),0x11,0,uVar7,1);
|
|
}
|
|
}
|
|
else if (local_68 == GHIDRA_CAST<Entity_Player *>(0xa)) {
|
|
if (g_game->_stageType == 0) {
|
|
PlayerManager::unlock_completion_mark(2);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(3);
|
|
iVar9 = 0xd;
|
|
}
|
|
else {
|
|
PlayerManager::unlock_completion_mark(1);
|
|
iVar9 = 0xb;
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(iVar9,1);
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
if ((char)local_78 == '\0') {
|
|
uVar7 = Random();
|
|
uVar12 = 0x172;
|
|
}
|
|
else {
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar12 = 0x154;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar12,&rewardPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if ((challengeParams->_endStage != 0xc) &&
|
|
(uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(100), uVar7 < 0xf)) goto LAB_007fc9db;
|
|
}
|
|
else if (local_68 == GHIDRA_CAST<Entity_Player *>(0xc)) {
|
|
if (itemPool->_bossId == 0x46) {
|
|
PlayerManager::unlock_completion_mark(0xc);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x152);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x165);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0xbb,1);
|
|
clear_reward_position(itemPool,&rewardPos);
|
|
if ((char)local_78 != '\0') {
|
|
(g_manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
fVar15 = 0.0;
|
|
targetPos = &rewardPos;
|
|
uVar12 = 0x154;
|
|
goto LAB_007fd74c;
|
|
}
|
|
goto LAB_007fbea9;
|
|
}
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(0x11);
|
|
game = g_game;
|
|
if (uVar7 == 0x10) {
|
|
uVar7 = 0x19;
|
|
}
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar7 = ItemPool::GetCollectible(&game->_itemPool,uVar7,uVar12,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0);
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0xf9);
|
|
targetPos = &leftItemPos;
|
|
if (bVar6 == 0) {
|
|
targetPos = &spawnPos;
|
|
}
|
|
local_e0.x = targetPos->x;
|
|
local_e0.y = targetPos->y;
|
|
clear_reward_position(room,&local_e0);
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&local_e0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar12);
|
|
local_70 = (Entity_Player *)
|
|
__RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,
|
|
castIsReference);
|
|
playerManager = &g_game->_playerManager;
|
|
(local_70->_crownOfLightSprite)._overlayAnimState._layerFrames = (void *)0x0;
|
|
bVar6 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::AnyoneHasCollectible(0xf9);
|
|
if (bVar6 != 0) {
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::RandomInt(0x11);
|
|
game = g_game;
|
|
if (uVar7 == 0x10) {
|
|
uVar7 = 0x19;
|
|
}
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
uVar7 = ItemPool::GetCollectible(&game->_itemPool,uVar7,uVar12,0,0,0);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar7,0,0);
|
|
clear_reward_position(room,&rightItemPos);
|
|
uVar12 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
castIsReference = 0;
|
|
castDstType = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
castSrcType = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
castOffset = 0;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&rightItemPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar7,uVar12);
|
|
iVar9 = __RTDynamicCast(spawnedEntity,castOffset,castSrcType,castDstType,castIsReference
|
|
);
|
|
iVar13 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_70))))->Entity_Pickup::AssignOptionsIndex();
|
|
*GHIDRA_CAST<int *>((iVar9 + 0x528)) = iVar13;
|
|
*GHIDRA_CAST<uint32_t *>((iVar9 + 0x588)) = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
LAB_007fd75c:
|
|
manager = g_manager;
|
|
persistentData = &g_manager->_persistentGameData;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_manager->_persistentGameData))) + 0x1))) == '\0') {
|
|
piVar11 = (g_manager->_persistentGameData)._cutsceneCounters + GHIDRA_INT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_68[-1])) + 0x2eca))))
|
|
;
|
|
*piVar11 = *piVar11 + 1;
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0xdd0))));
|
|
*GHIDRA_CAST<uint8_t *>(persistentData) = 1;
|
|
if (0x27 < uVar7) {
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::TryUnlock(0x10);
|
|
}
|
|
if (0x1d < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0xdd8))))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::TryUnlock(0x11);
|
|
}
|
|
if (0x13 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0xde0))))) {
|
|
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::TryUnlock(0x12);
|
|
}
|
|
}
|
|
pEVar8 = local_68;
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x2)) {
|
|
iVar9 = 0xd;
|
|
LAB_007fd7ca:
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(iVar9);
|
|
}
|
|
else {
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0x4)) {
|
|
iVar9 = 0xe;
|
|
goto LAB_007fd7ca;
|
|
}
|
|
if (local_68 == GHIDRA_CAST<Entity_Player *>(0xb)) {
|
|
iVar9 = 0x9b;
|
|
goto LAB_007fd7ca;
|
|
}
|
|
}
|
|
if (local_6a != false) {
|
|
iVar9 = g_game->_lastLevelWithDamage;
|
|
switch(pEVar8) {
|
|
case GHIDRA_CAST<Entity_Player *>(0x2):
|
|
if (iVar9 < 1) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x25);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x15f);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x4):
|
|
if (iVar9 < 3) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x26);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x16d);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x6):
|
|
if (iVar9 < 5) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x27);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x170);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0x8):
|
|
if (iVar9 < 7) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x28);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x176);
|
|
}
|
|
break;
|
|
case GHIDRA_CAST<Entity_Player *>(0xb):
|
|
if (iVar9 < 0xb) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x53);
|
|
}
|
|
}
|
|
}
|
|
goto switchD_007fd7f9_caseD_3;
|
|
}
|
|
if (itemPool->_roomType != 1) {
|
|
if ((itemPool->_roomType == 5) && (itemPool->_bossId == 0x3e)) {
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::Crossfade(0x25,0.08);
|
|
EntityList::QuerySublist(&itemPool->_entityList,GHIDRA_CAST<EntityList_EL *>(&local_38),0x196,0,-1,0,0);
|
|
local_8 = 0;
|
|
local_b4 = g_vectorZero.x;
|
|
local_90 = GHIDRA_CAST<Entity_Player *>(g_vectorZero.y);
|
|
if (local_38._shift3 != 0) {
|
|
targetPos = GHIDRA_CAST<Vector *>((*GHIDRA_CAST<int *>(local_38._shift1) + 0x33c));
|
|
local_b4 = targetPos->x;
|
|
local_90 = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(local_38._shift1) + 0x340));
|
|
local_c8 = *targetPos;
|
|
uVar7 = GetGridIndex(itemPool,&local_c8);
|
|
if (uVar7 < 0x1c0) {
|
|
itemPool->_gridPaths[uVar7] = 1000;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
local_b8 = GHIDRA_CAST<Entity_Player *>(0x1);
|
|
}
|
|
else {
|
|
local_b8 = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager)::count_main_players();
|
|
if (local_b8 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
LAB_007fdb1d:
|
|
local_d8.x = rewardPos.x;
|
|
local_d8.y = rewardPos.y;
|
|
if ((local_b4 != g_vectorZero.x) || ((float)local_90 != g_vectorZero.y)) {
|
|
tmpPos.x = local_b4 + 0.0;
|
|
tmpPos.y = (float)local_90 + 40.0;
|
|
GetClampedPositionImpl(itemPool,&local_c8,&tmpPos,40.0,40.0,40.0,40.0);
|
|
local_d8.y = local_c8.y;
|
|
local_d8.x = local_c8.x;
|
|
if (local_c8.y - (float)local_90 < 20.0) {
|
|
if (0.0 <= rewardPos.x - local_c8.x) {
|
|
local_d8.x = 40.0;
|
|
}
|
|
else {
|
|
local_d8.x = -40.0;
|
|
}
|
|
local_d8.x = local_c8.x + local_d8.x;
|
|
}
|
|
}
|
|
clear_reward_position(itemPool,&local_d8);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&awardRng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x154,&local_d8,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar7);
|
|
PlayerManager::unlock_completion_mark(7);
|
|
if (g_game->_difficulty == 3) {
|
|
PlayerManager::unlock_completion_mark(0xb);
|
|
}
|
|
if ((char)local_38._seed == '\0') {
|
|
local_8 = 1;
|
|
tracked_alloc(1,(void *)local_38._shift1,0);
|
|
}
|
|
goto switchD_007fd7f9_caseD_3;
|
|
}
|
|
}
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
do {
|
|
local_88 = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::get_main_player(GHIDRA_INT(local_78));
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
LAB_007fdd45:
|
|
local_94 = (local_88->_pos).x;
|
|
local_68 = GHIDRA_CAST<Entity_Player *>((local_88->_pos).y);
|
|
uVar7 = Random();
|
|
fVar15 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_e0.y = fVar15 + fVar15;
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(sin(local_e0.y));
|
|
fVar15 = cos(local_e0.y);
|
|
tmpPos.x = fVar15 * 80.0 + local_94;
|
|
tmpPos.y = (float)local_70 * 80.0 + (float)local_68;
|
|
GetClampedPositionImpl(itemPool,&spawnPos,&tmpPos,40.0,40.0,40.0,40.0);
|
|
if ((ABS(spawnPos.x - local_b4) < 20.0) && (spawnPos.y < (float)local_90)) {
|
|
if (0.0 <= rewardPos.x - spawnPos.x) {
|
|
fVar15 = 40.0;
|
|
}
|
|
else {
|
|
fVar15 = -40.0;
|
|
}
|
|
spawnPos.x = fVar15 + spawnPos.x;
|
|
}
|
|
clear_reward_position(itemPool,&spawnPos);
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
pEVar8 = local_88;
|
|
}
|
|
if (awardRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
awardRng._seed = GHIDRA_UINT(awardRng._seed) >> ((uint8_t)awardRng._shift1 & 0x1f) ^ awardRng._seed;
|
|
awardRng._seed = awardRng._seed << ((uint8_t)awardRng._shift2 & 0x1f) ^ awardRng._seed;
|
|
awardRng._seed = GHIDRA_UINT(awardRng._seed) >> (SUB41(local_c0.y,0) & 0x1f) ^ awardRng._seed;
|
|
spawnedEntity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(6,0xb,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(pEVar8),0,awardRng._seed);
|
|
*GHIDRA_CAST<uint32_t *>(&spawnedEntity->_flags) = GHIDRA_UINT(spawnedEntity->_flags) | 4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawnedEntity->_flags) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawnedEntity->_flags) + 4));
|
|
if (GHIDRA_CAST<Entity_Player *>(0x1) < local_b8) {
|
|
iVar9 = 0;
|
|
piVar11 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x60))));
|
|
do {
|
|
if (*piVar11 == local_88->_controllerIndex) goto LAB_007fdf6a;
|
|
iVar9 = iVar9 + 1;
|
|
piVar11 = piVar11 + 1;
|
|
} while (iVar9 < 4);
|
|
iVar9 = 5;
|
|
LAB_007fdf6a:
|
|
PlayerManager::GetPlayerColorValue(&local_28,iVar9);
|
|
local_44 = 0;
|
|
local_54 = 0;
|
|
uStack_50 = 0;
|
|
uStack_4c = 0;
|
|
uStack_48 = 0;
|
|
playerColor = local_28._red;
|
|
local_60 = local_28._green;
|
|
local_40 = 0;
|
|
local_3c = 0;
|
|
local_5c = local_28._blue;
|
|
local_58 = 0x3f800000;
|
|
spawnedEntity->SetColor(&playerColor,0xffffffff,0xff,0,1);
|
|
}
|
|
spawnedEntity->Update();
|
|
itemPool = room;
|
|
}
|
|
else {
|
|
local_6a = false;
|
|
local_e0.y = (float)FUN_0090b010(local_88->_controllerIndex);
|
|
if (GHIDRA_CAST<Entity_Player *>(local_e0.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
local_70 = (g_manager->_lobbyMembers)._begin;
|
|
local_94 = (float)((GHIDRA_INT((g_manager->_lobbyMembers)._end) - GHIDRA_INT(local_70)) / 0x14);
|
|
if (local_94 != 0.0) {
|
|
lobbyEntry = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_70)) + 0x8)));
|
|
fVar15 = ((GHIDRA_CAST<Entity_Player *>(local_e0.y))->_sizeMulti).x;
|
|
do {
|
|
if (fVar15 == 0.0) {
|
|
local_c8.x = 0.0;
|
|
local_c8.y = 0.0;
|
|
VVar4 = local_c8;
|
|
local_c8.x = 0.0;
|
|
local_70 = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
fVar16 = local_c8.x;
|
|
local_c8 = VVar4;
|
|
}
|
|
else {
|
|
local_70 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(fVar15) + 0xc));
|
|
fVar16 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar15) + 8));
|
|
}
|
|
iVar9 = *GHIDRA_CAST<int *>((lobbyEntry + -4));
|
|
if (iVar9 == 0) {
|
|
local_c8.x = 0.0;
|
|
local_c8.y = 0.0;
|
|
VVar4 = local_c8;
|
|
local_c8.y = 0.0;
|
|
local_c8.x = 0.0;
|
|
pEVar8 = GHIDRA_CAST<Entity_Player *>(local_c8.y);
|
|
fVar14 = local_c8.x;
|
|
local_c8 = VVar4;
|
|
}
|
|
else {
|
|
pEVar8 = *GHIDRA_CAST<Entity_Player **>((iVar9 + 0xc));
|
|
fVar14 = *GHIDRA_CAST<float *>((iVar9 + 8));
|
|
}
|
|
if ((fVar16 == fVar14) && (local_70 == pEVar8)) {
|
|
local_6a = (bool)(*lobbyEntry & 1);
|
|
}
|
|
lobbyEntry = lobbyEntry + 0x14;
|
|
local_94 = (float)(GHIDRA_INT(local_94) - 1);
|
|
} while (local_94 != 0.0);
|
|
local_94 = 0.0;
|
|
itemPool = room;
|
|
if (local_6a != false) goto LAB_007fdd45;
|
|
}
|
|
}
|
|
}
|
|
local_78 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_78)) + 0x1))));
|
|
if (local_b8 <= local_78) goto LAB_007fdb1d;
|
|
game = g_game;
|
|
} while( true );
|
|
}
|
|
goto switchD_007fd7f9_caseD_3;
|
|
}
|
|
switch((g_manager->_musicManager)._currentMusicID) {
|
|
case 9:
|
|
fVar15 = (g_manager->_optionsConfig)._musicVolume;
|
|
iVar9 = 0x53;
|
|
break;
|
|
default:
|
|
flagsHigh = &(g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel].
|
|
field_0x16c;
|
|
*GHIDRA_CAST<uint32_t *>(flagsHigh) = *GHIDRA_CAST<uint32_t *>(flagsHigh) & 0xfffffffe;
|
|
goto switchD_007fd7f9_caseD_3;
|
|
case 0x17:
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::Crossfade(0x25,0.08);
|
|
goto switchD_007fd7f9_caseD_3;
|
|
case 0x1a:
|
|
fVar15 = (g_manager->_optionsConfig)._musicVolume;
|
|
iVar9 = 0x61;
|
|
break;
|
|
case 0x26:
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(0x5c,(g_manager->_optionsConfig)._musicVolume);
|
|
if (0x23 < (GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60) {
|
|
(g_manager->_musicManager)._queuedMusicID = 0x23;
|
|
}
|
|
goto switchD_007fd7f9_caseD_3;
|
|
case 0x29:
|
|
fVar15 = (g_manager->_optionsConfig)._musicVolume;
|
|
iVar9 = 0x2a;
|
|
}
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(iVar9,fVar15);
|
|
if (0x25 < (GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60) {
|
|
(g_manager->_musicManager)._queuedMusicID = 0x25;
|
|
}
|
|
switchD_007fd7f9_caseD_3:
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x60)) = awardRng._seed;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007fe220
|
|
void Room::card_against_humanity_fill()
|
|
{
|
|
Room *playerManager = this;
|
|
code *pcVar1;
|
|
GridEntity *pGVar2;
|
|
ANM2 *pAVar3;
|
|
uint8_t bVar4;
|
|
Entity_Player *pEVar5;
|
|
Entity *spawnedEffect;
|
|
uint32_t uVar6;
|
|
ItemConfig_Item *item;
|
|
void *pvVar7;
|
|
Game *pGVar8;
|
|
GridEntity *pGVar9;
|
|
int iVar10;
|
|
PlayerManager *playerManager;
|
|
int iVar11;
|
|
uint32_t pickIdx;
|
|
int *piVar12;
|
|
uint32_t *puVar13;
|
|
uint32_t pickIdx;
|
|
uint32_t *cardRng;
|
|
int iVar15;
|
|
uint32_t *puVar16;
|
|
Room *pRVar17;
|
|
float fVar18;
|
|
uint8_t local_5c [8];
|
|
void *local_54;
|
|
uint32_t *local_50;
|
|
uint32_t *freeCellsEnd;
|
|
uint32_t *local_48;
|
|
Vector local_44;
|
|
void *occupiedCells;
|
|
uint32_t occupiedCellsSize;
|
|
GridEntity *local_34;
|
|
uint32_t local_30;
|
|
uint32_t meconiumRoll;
|
|
uint32_t *local_28;
|
|
uint32_t *freeCellsCapEnd;
|
|
Game *local_20;
|
|
uint32_t *freeCells;
|
|
Room *local_18;
|
|
char isMeconiumBackupCounts;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int roomShape;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01417;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((playerManager)) + 0x11f4))) = 0;
|
|
occupiedCells = (void *)0x0;
|
|
occupiedCellsSize = 0;
|
|
local_18 = playerManager;
|
|
occupiedCells = operator_new(0x14);
|
|
*(void **)occupiedCells = occupiedCells;
|
|
*(void **)(GHIDRA_CAST<char *>(occupiedCells) + 4) = occupiedCells;
|
|
*(void **)(GHIDRA_CAST<char *>(occupiedCells) + 8) = occupiedCells;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(occupiedCells) + 0xc)) = 0x101;
|
|
pickIdx = 0;
|
|
local_8 = 0;
|
|
if ((playerManager->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
iVar10 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((playerManager->_entityList)._updateEL)) + 0x4)))) + pickIdx * 4));
|
|
if ((((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((iVar10 + 0x28)) == 1)) ||
|
|
(iVar11 = *GHIDRA_CAST<int *>((iVar10 + 0x28)), iVar11 - 10U < 0x3de)) ||
|
|
((iVar11 == 1 || (iVar11 == 6)))) || (iVar11 == 5)) || (iVar11 == 4)) {
|
|
iVar11 = GHIDRA_INT(((*GHIDRA_CAST<float *>((iVar10 + 0x33c)) - 40.0) / 40.0 + 0.5));
|
|
iVar10 = GHIDRA_INT(((*GHIDRA_CAST<float *>((iVar10 + 0x340)) - 120.0) / 40.0 + 0.5));
|
|
if (((iVar11 < 0) || (iVar15 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc)), iVar15 <= iVar11)) ||
|
|
((iVar10 < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x10)) <= iVar10)))) {
|
|
local_28 = GHIDRA_CAST<uint32_t *>(0xffffffff);
|
|
}
|
|
else {
|
|
local_28 = GHIDRA_CAST<uint32_t *>((iVar15 * iVar10 + iVar11));
|
|
}
|
|
msvc::set<int>::insert(&local_44,&local_28);
|
|
}
|
|
pickIdx = pickIdx + 1;
|
|
} while (pickIdx < GHIDRA_UINT((playerManager->_entityList)._updateEL._size));
|
|
}
|
|
pGVar8 = g_game;
|
|
piVar12 = (g_game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(piVar12) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
piVar12 = (pGVar8->_playerManager)._playerList._begin;
|
|
}
|
|
iVar10 = *piVar12;
|
|
iVar11 = *GHIDRA_CAST<int *>((iVar10 + 0x1798));
|
|
if (iVar11 - *GHIDRA_CAST<int *>((iVar10 + 0x1794)) >> 4 < 0x2e) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Card ID out of bounds!\n"));
|
|
iVar11 = *GHIDRA_CAST<int *>((iVar10 + 0x1798));
|
|
}
|
|
pickIdx = (iVar11 - *GHIDRA_CAST<int *>((iVar10 + 0x1794)) >> 4) - 1;
|
|
if (0x2d < pickIdx) {
|
|
pickIdx = 0x2d;
|
|
}
|
|
cardRng = GHIDRA_CAST<uint32_t *>((pickIdx * 0x10 + *GHIDRA_CAST<int *>((iVar10 + 0x1794))));
|
|
pickIdx = *cardRng;
|
|
local_28 = cardRng;
|
|
if (pickIdx == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pickIdx = *cardRng;
|
|
if (pickIdx == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[1] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx << ((uint8_t)cardRng[2] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[3] & 0x1f) ^ pickIdx;
|
|
*cardRng = pickIdx;
|
|
if ((pickIdx & 7) == 0) {
|
|
pickIdx = Random();
|
|
pEVar5 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetRandomPlayer(&g_vectorZero,9999999.0);
|
|
local_44.x = (pEVar5->_pos).x;
|
|
local_44.y = (pEVar5->_pos).y;
|
|
spawnedEffect = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x21,&local_44,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,pickIdx);
|
|
spawnedEffect->Update();
|
|
}
|
|
freeCells = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_50 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
freeCellsEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
freeCellsCapEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_48 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
iVar10 = playerManager->_gridWidth;
|
|
pickIdx = (playerManager->_gridHeight * iVar10) / 2;
|
|
if (pickIdx != 0) {
|
|
if (0x3fffffff < pickIdx) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::_Xlen();
|
|
}
|
|
msvc::vector<unsigned_int>::_Reallocate(pickIdx);
|
|
iVar10 = playerManager->_gridWidth;
|
|
freeCellsCapEnd = local_48;
|
|
freeCells = local_50;
|
|
}
|
|
iVar11 = 1;
|
|
local_50 = freeCells;
|
|
local_48 = freeCellsCapEnd;
|
|
if (1 < iVar10) {
|
|
do {
|
|
iVar10 = playerManager->_gridHeight;
|
|
iVar15 = 1;
|
|
if (1 < iVar10) {
|
|
do {
|
|
roomShape = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_18)) + 0x4)))) + 0x10)) + 0x48));
|
|
if (roomShape == 0xb) {
|
|
if (local_18->_gridWidth / 2 <= iVar11) goto LAB_007fe72c;
|
|
joined_r0x007fe6ae:
|
|
if (iVar15 <= iVar10 / 2) goto LAB_007fe72c;
|
|
}
|
|
else {
|
|
if (roomShape == 0xc) {
|
|
if (local_18->_gridWidth / 2 < iVar11) goto joined_r0x007fe6ae;
|
|
}
|
|
else if (roomShape == 9) {
|
|
if (iVar11 < local_18->_gridWidth / 2) {
|
|
joined_r0x007fe6d3:
|
|
if (iVar15 < iVar10 / 2) goto LAB_007fe51b;
|
|
}
|
|
}
|
|
else if (roomShape == 10) {
|
|
if (local_18->_gridWidth / 2 < iVar11) goto joined_r0x007fe6d3;
|
|
}
|
|
else if ((((roomShape == 2) || (roomShape == 7)) && (2 < iVar15 - 3U)) ||
|
|
(((roomShape == 3 || (roomShape == 5)) && (4 < iVar11 - 5U))))
|
|
goto LAB_007fe51b;
|
|
LAB_007fe72c:
|
|
pvVar7 = g_game->_room;
|
|
if (((iVar11 < 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0xc)) <= iVar11)) ||
|
|
((iVar15 < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x10)) <= iVar15)))) {
|
|
local_20 = GHIDRA_CAST<Game *>(0xffffffff);
|
|
}
|
|
else {
|
|
local_20 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0xc)) * iVar15 + iVar11));
|
|
if (((local_20 < GHIDRA_CAST<Game *>(0x1c0)) &&
|
|
(iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + GHIDRA_INT(local_20) * 4 + 0x24)), iVar10 != 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar10 + 4)) != 1)) goto LAB_007fe51b;
|
|
}
|
|
pGVar8 = local_20;
|
|
msvc::set<int>::find_node(local_5c,&local_20);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_54) + 0xd)) != '\0') ||
|
|
(pvVar7 = local_54, GHIDRA_INT(pGVar8) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_54) + 0x10)))) {
|
|
pvVar7 = occupiedCells;
|
|
}
|
|
if (pvVar7 == occupiedCells) {
|
|
if (freeCellsEnd == freeCellsCapEnd) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(freeCellsEnd,&local_20);
|
|
freeCellsCapEnd = local_48;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_18)) + 0x11f4))) = 1;
|
|
}
|
|
else {
|
|
*freeCellsEnd = pGVar8;
|
|
freeCellsEnd = freeCellsEnd + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_18)) + 0x11f4))) = 1;
|
|
}
|
|
}
|
|
}
|
|
LAB_007fe51b:
|
|
iVar10 = local_18->_gridHeight;
|
|
iVar15 = iVar15 + 1;
|
|
} while (iVar15 < iVar10);
|
|
}
|
|
iVar11 = iVar11 + 1;
|
|
playerManager = local_18;
|
|
} while (iVar11 < local_18->_gridWidth);
|
|
freeCells = local_50;
|
|
}
|
|
puVar13 = freeCellsEnd;
|
|
local_50 = freeCells;
|
|
if (freeCells != freeCellsEnd) {
|
|
do {
|
|
cardRng = local_28;
|
|
pickIdx = *local_28;
|
|
if (pickIdx == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pickIdx = *cardRng;
|
|
if (pickIdx == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[1] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx << ((uint8_t)cardRng[2] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[3] & 0x1f) ^ pickIdx;
|
|
*cardRng = pickIdx;
|
|
if ((pickIdx & 3) == 0) break;
|
|
local_18 = GHIDRA_CAST<Room *>(0x0);
|
|
if (pickIdx == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pickIdx = *cardRng;
|
|
if (pickIdx == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[1] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx << ((uint8_t)cardRng[2] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[3] & 0x1f) ^ pickIdx;
|
|
*cardRng = pickIdx;
|
|
uVar6 = pickIdx;
|
|
if (pickIdx == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = *cardRng;
|
|
}
|
|
if (uVar6 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)cardRng[1] & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)cardRng[2] & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 >> ((uint8_t)cardRng[3] & 0x1f) ^ uVar6;
|
|
*cardRng = uVar6;
|
|
meconiumRoll = uVar6;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = *cardRng;
|
|
}
|
|
if (uVar6 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)cardRng[1] & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)cardRng[2] & 0x1f) ^ uVar6;
|
|
local_30 = uVar6 >> ((uint8_t)cardRng[3] & 0x1f) ^ uVar6;
|
|
playerManager = &g_game->_playerManager;
|
|
*cardRng = local_30;
|
|
pEVar5 = PlayerManager::FirstCollectibleOwner(playerManager,0x21f,GHIDRA_CAST<RNG **>(playerManager),1);
|
|
pGVar8 = g_game;
|
|
local_20 = g_game;
|
|
if (pEVar5 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
pvVar7 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar7) >> 2 < 0x220) {
|
|
item = GHIDRA_CAST<ItemConfig_Item *>(0x0);
|
|
}
|
|
else {
|
|
item = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar7) + 0x87c));
|
|
}
|
|
bVar4 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::HasTemporaryEffect(item);
|
|
if (bVar4 != 0) goto LAB_007fe7f7;
|
|
}
|
|
else {
|
|
LAB_007fe7f7:
|
|
if (pickIdx % 100 < 0x21) {
|
|
local_18 = GHIDRA_CAST<Room *>(&DAT_00000006);
|
|
}
|
|
}
|
|
pvVar7 = (g_manager->_itemConfig)._trinkets._begin;
|
|
if (((GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar7) >> 2 < 0x5c) ||
|
|
(iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar7) + 0x16c)), iVar10 == 0)) ||
|
|
(isMeconiumBackupCounts = '\x01', (*GHIDRA_CAST<uint32_t *>((iVar10 + 0xb8)) & 0x80000000) == 0)) {
|
|
isMeconiumBackupCounts = '\0';
|
|
}
|
|
puVar16 = (pGVar8->_playerManager)._playerList._begin;
|
|
if (puVar16 != (pGVar8->_playerManager)._playerList._end) {
|
|
do {
|
|
pEVar5 = GHIDRA_CAST<Entity_Player *>(*puVar16);
|
|
if (pEVar5->_variant == 0) {
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar5)))->Entity_Player::HasTrinket(0x5b,0);
|
|
if (bVar4 == 0) {
|
|
if (((isMeconiumBackupCounts == '\0') ||
|
|
(pEVar5->_backupPlayer == GHIDRA_CAST<Entity_Player *>(0x0))) ||
|
|
(bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar5->_backupPlayer)))->Entity_Player::HasTrinket(0x5b,0), bVar4 == 0)) {
|
|
pGVar8 = local_20;
|
|
goto LAB_007fe8a2;
|
|
}
|
|
pEVar5 = pEVar5->_backupPlayer;
|
|
}
|
|
if (pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
if (meconiumRoll % 100 < 0x21) {
|
|
local_18 = GHIDRA_CAST<Room *>(&DAT_00000005);
|
|
}
|
|
pGVar8 = g_game;
|
|
goto LAB_007fe8b6;
|
|
}
|
|
break;
|
|
}
|
|
LAB_007fe8a2:
|
|
puVar16 = puVar16 + 1;
|
|
} while (puVar16 != (pGVar8->_playerManager)._playerList._end);
|
|
pGVar8 = g_game;
|
|
}
|
|
LAB_007fe8b6:
|
|
pRVar17 = local_18;
|
|
pEVar5 = PlayerManager::FirstCollectibleOwner
|
|
(&pGVar8->_playerManager,0xca,GHIDRA_CAST<RNG **>(&pGVar8->_playerManager),1);
|
|
cardRng = local_28;
|
|
if (pEVar5 != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
fVar18 = 0.0;
|
|
for (piVar12 = (g_game->_playerManager)._playerList._begin;
|
|
piVar12 != (g_game->_playerManager)._playerList._end; piVar12 = piVar12 + 1) {
|
|
iVar10 = *piVar12;
|
|
if ((*GHIDRA_CAST<int *>((iVar10 + 0x2c)) == 0) && (*GHIDRA_CAST<char *>((iVar10 + 0x20a9)) == '\0')) {
|
|
fVar18 = fVar18 + *GHIDRA_CAST<float *>((iVar10 + 0x156c));
|
|
}
|
|
}
|
|
if (GHIDRA_INT((GHIDRA_INT((fVar18 * -5.0)) + (local_30 / 100) * -100 + local_30)) < 0xb) {
|
|
pRVar17 = GHIDRA_CAST<Room *>(0x3);
|
|
}
|
|
local_18 = pRVar17;
|
|
}
|
|
uVar6 = GHIDRA_INT(puVar13) - GHIDRA_INT(freeCells) >> 2;
|
|
pickIdx = *local_28;
|
|
if (pickIdx == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pickIdx = *cardRng;
|
|
if (pickIdx == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[1] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx << ((uint8_t)cardRng[2] & 0x1f) ^ pickIdx;
|
|
pickIdx = pickIdx >> ((uint8_t)cardRng[3] & 0x1f) ^ pickIdx;
|
|
pickIdx = 0;
|
|
*cardRng = pickIdx;
|
|
if (uVar6 != 0) {
|
|
pickIdx = pickIdx % uVar6;
|
|
}
|
|
pickIdx = freeCells[pickIdx];
|
|
puVar16 = freeCells + pickIdx;
|
|
memmove(puVar16,puVar16 + 1,GHIDRA_INT(puVar13) - GHIDRA_INT((puVar16 + 1)));
|
|
cardRng = local_28;
|
|
puVar13 = puVar13 + -1;
|
|
uVar6 = *local_28;
|
|
local_20 = g_game->_room;
|
|
freeCellsEnd = puVar13;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar6 = *cardRng;
|
|
if (uVar6 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)cardRng[1] & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)cardRng[2] & 0x1f) ^ uVar6;
|
|
local_30 = uVar6 >> ((uint8_t)cardRng[3] & 0x1f) ^ uVar6;
|
|
*cardRng = local_30;
|
|
if ((GHIDRA_INT(pickIdx) < 0) || (0x1bf < GHIDRA_INT(pickIdx))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if ((pickIdx < 0x1c0) && (local_20->_roomMap[pickIdx - 0x5cdc] < 0x385)) {
|
|
pGVar9 = operator_new(0x19c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
|
|
local_34 = pGVar9;
|
|
if (pGVar9 == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
pGVar9 = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((pGVar9)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(pGVar9) = IsaacRepentancePlus::GridEntity_Poop::vftable;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGVar9[1])) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGVar9[1])) + 0x14)))) = 0;
|
|
pGVar9[1]._varData = 0xf;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGVar9[1])) + 0x4))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGVar9[1])) + 0x20)))) = 0;
|
|
pGVar9[1]._gridIndex = 0;
|
|
pGVar9[1]._spawnFrame = 0;
|
|
pGVar9[1]._rng._seed = 0;
|
|
fVar18 = g_vectorZero.y;
|
|
pGVar9[1]._rng._shift1 = GHIDRA_INT(g_vectorZero.x);
|
|
pGVar9[1]._rng._shift2 = GHIDRA_INT(fVar18);
|
|
fVar18 = g_vectorZero.y;
|
|
pGVar9[1]._rng._shift3 = GHIDRA_INT(g_vectorZero.x);
|
|
pGVar9[1]._collisionClass = GHIDRA_INT(fVar18);
|
|
pGVar2 = pGVar9 + 1;
|
|
(pGVar2->_sprite)._filename._buf[0] = '\0';
|
|
(pGVar2->_sprite)._filename._buf[1] = '\0';
|
|
(pGVar2->_sprite)._filename._buf[2] = '\0';
|
|
(pGVar2->_sprite)._filename._buf[3] = '\0';
|
|
pAVar3 = &pGVar9[1]._sprite;
|
|
(pAVar3->_filename)._buf[4] = '\0';
|
|
(pAVar3->_filename)._buf[5] = '\0';
|
|
(pAVar3->_filename)._buf[6] = '\0';
|
|
(pAVar3->_filename)._buf[7] = '\0';
|
|
}
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
if (pGVar9 != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x4)))) = 0xe;
|
|
pGVar9->_gridIndex = pickIdx;
|
|
if (GHIDRA_CAST<uint32_t *>(local_20->_roomMap[pickIdx - 0x5eae]) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(local_20->_roomMap[pickIdx - 0x5eae]))(1);
|
|
}
|
|
local_20->_roomMap[pickIdx - 0x5eae] = GHIDRA_INT(pGVar9);
|
|
*GHIDRA_CAST<Room **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x8)))) = local_18;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x14)))) = local_30;
|
|
pGVar9->_varData = 0;
|
|
pGVar9->_collisionClass = 0;
|
|
pGVar9->BeginBatches();
|
|
pGVar8 = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x10)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x10)))) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar9)) + 0x1c))) = 1;
|
|
pGVar9->_spawnFrame = pGVar8->_frameCount;
|
|
}
|
|
}
|
|
} while (freeCells != puVar13);
|
|
}
|
|
if (freeCells != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
pickIdx = GHIDRA_INT(freeCellsCapEnd) - GHIDRA_INT(freeCells) & 0xfffffffc;
|
|
puVar13 = freeCells;
|
|
if (0xfff < pickIdx) {
|
|
puVar13 = GHIDRA_CAST<uint32_t *>(freeCells[-1]);
|
|
pickIdx = pickIdx + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(freeCells) + (-4 - GHIDRA_INT(puVar13))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(puVar13,pickIdx);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&occupiedCells,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&occupiedCells
|
|
,*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(occupiedCells) + 4));
|
|
operator_delete(occupiedCells,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 007fec00
|
|
void Room::TriggerBossDeath(Entity *entity)
|
|
{
|
|
void *pvVar1;
|
|
uint8_t bVar2;
|
|
uint8_t isFiligreeFeathersOwned;
|
|
RoomDescriptor *returnRoom;
|
|
uint32_t uVar3;
|
|
RNG *this_00;
|
|
uint32_t uVar4;
|
|
int *node;
|
|
uint3 extraout_var;
|
|
Entity_Player *player;
|
|
Vector *pVVar5;
|
|
uint32_t uVar6;
|
|
float fVar7;
|
|
float extraout_ECX;
|
|
ItemOverlay *itemOverlay;
|
|
int iVar8;
|
|
int *piVar9;
|
|
Game *game;
|
|
int iVar10;
|
|
code *pcVar11;
|
|
int bossType;
|
|
bool bVar12;
|
|
Vector *position;
|
|
EntityRef damageSource;
|
|
uint8_t auStack_b0 [12];
|
|
Entity *bossEntity;
|
|
uint8_t auStack_a0 [12];
|
|
int iStack_94;
|
|
uint8_t auStack_90 [12];
|
|
int iStack_84;
|
|
Vector VStack_80;
|
|
Vector VStack_78;
|
|
Vector VStack_70;
|
|
Vector VStack_68;
|
|
Vector VStack_60;
|
|
Vector VStack_58;
|
|
Vector VStack_50;
|
|
RNG rng;
|
|
Vector VStack_38;
|
|
Room *local_30;
|
|
Vector VStack_2c;
|
|
uint8_t bStack_23;
|
|
uint8_t bStack_22;
|
|
char local_21;
|
|
int iStack_20;
|
|
RNG subRng;
|
|
uint32_t local_c;
|
|
uint8_t auStack_8 [4];
|
|
bool isAngelSpawnRoom;
|
|
int *nodeEntityType;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
|
bossEntity = entity;
|
|
if (entity->_type == 0x19b) {
|
|
if (entity->_variant == 1) {
|
|
return;
|
|
}
|
|
if (entity->_variant == 2) {
|
|
return;
|
|
}
|
|
}
|
|
if (((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) ||
|
|
(local_21 = '\x01', this->_roomType != 1)) {
|
|
local_21 = '\0';
|
|
}
|
|
uVar4 = GHIDRA_UINT(entity->_flags);
|
|
if ((uVar4 & 0x80100000) != 0) {
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&entity->_flags) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&entity->_flags) + 4));
|
|
*GHIDRA_CAST<uint32_t *>(&entity->_flags) = uVar4 | 0x100000;
|
|
if ((uVar4 & 0x20000000) != 0) {
|
|
return;
|
|
}
|
|
local_30 = this;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] "));
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("TriggerBossDeath: %d bosses remaining.\n"));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7224)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7224)))) + -1;
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7224))))) goto LAB_00800060;
|
|
bossType = entity->_type;
|
|
VStack_58.y = (float)entity->_variant;
|
|
VStack_38.y = (float)entity->_subtype;
|
|
if ((g_game->_ambush)._isActive == 0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x4)))) + 100));
|
|
}
|
|
else {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x265f4))));
|
|
}
|
|
rng._shift1 = 4;
|
|
rng._shift2 = 3;
|
|
rng._shift3 = 0x11;
|
|
VStack_68.y = (float)bossType;
|
|
rng._seed = uVar4;
|
|
if (((((GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x2e)) && (GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(&DAT_0000002f)))
|
|
&& ((GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x30) &&
|
|
((GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x31) && (GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x32))))))) &&
|
|
(GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(&DAT_00000033))) && (GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x34))) {
|
|
if (GHIDRA_CAST<Entity *>(bossType) == GHIDRA_CAST<Entity *>(0x51)) {
|
|
bVar12 = VStack_58.y == 1.4013e-45;
|
|
LAB_007fed8f:
|
|
if (bVar12) goto LAB_007ff7d4;
|
|
}
|
|
else if (GHIDRA_CAST<Entity *>(bossType) == GHIDRA_CAST<Entity *>(0x26)) {
|
|
bVar12 = VStack_58.y == 2.8026e-45;
|
|
goto LAB_007fed8f;
|
|
}
|
|
if ((local_30->_roomType == 0x10) &&
|
|
((iVar10 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x4)))) + 0x10)) + 0x10)), iVar10 == 2 ||
|
|
(iVar10 == 3)))) {
|
|
if ((GHIDRA_CAST<Entity *>(bossType) == GHIDRA_CAST<Entity *>(0x38f)) && (iVar10 == 3)) {
|
|
returnRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_dungeonReturnRoomIndex,-1);
|
|
if ((returnRoom->Data != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(returnRoom->Data) + 8)) == 5)) {
|
|
returnRoom->Flags = returnRoom->Flags | 0x10000;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("deathspawn_boss, color idx %d\n"));
|
|
VStack_80.x = (entity->_pos).x;
|
|
VStack_80.y = (entity->_pos).y;
|
|
VStack_50.y = (float)local_30->_roomType;
|
|
if (((GHIDRA_CAST<uint8_t *>(VStack_50.y) == &DAT_00000005) ||
|
|
((((GHIDRA_CAST<uint8_t *>(VStack_50.y) == &DAT_0000000f ||
|
|
(iVar10 = (g_manager->_musicManager)._currentMusicID, iVar10 == 9)) || (iVar10 == 0x1a)
|
|
) || (iVar10 == 0x29)))) &&
|
|
(((((g_game->_ambush)._isActive == 0 &&
|
|
((bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode(), bVar2 == 0 || ((code *)VStack_50.y != (code *)0x1))
|
|
)) && (uVar6 = GetBossVictoryJingle(local_30), uVar6 != 0)) &&
|
|
(((g_manager->_musicManager)._currentMusicID != uVar6 &&
|
|
((GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(uVar6,
|
|
(g_manager->_optionsConfig)._musicVolume),
|
|
0x25 < (GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60)))))) {
|
|
(g_manager->_musicManager)._queuedMusicID = 0x25;
|
|
}
|
|
if ((local_30->_roomType == 5) || (local_30->_roomType == 0x11)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x0))) = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
VStack_78.y = (float)entity->_initSeed;
|
|
VStack_70.y = 9.80909e-45;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x4))) = 0x900000002;
|
|
iStack_84 = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auStack_b0)) + 0x0))) = 0xd00000003;
|
|
VStack_50.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auStack_90)) + 0x0)));
|
|
if (local_30->_roomType == 0x11) {
|
|
VStack_60.y = 1.4013e-45;
|
|
if (((g_manager->_persistentGameData)._achievements[0x21] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(auStack_90))))->RNG::RandomInt(2);
|
|
VStack_60.y = (float)(1 - uVar4);
|
|
VStack_50.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)auStack_90)) + 0x0)));
|
|
}
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x0))) = VStack_50.y;
|
|
bVar2 = Game::IsHardMode();
|
|
if (bVar2 == 0) {
|
|
fVar7 = VStack_60.y;
|
|
goto LAB_007feffd;
|
|
}
|
|
LAB_007fef9b:
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(auStack_90))))->RNG::RandomInt(2);
|
|
fVar7 = (float)(GHIDRA_INT(VStack_60.y) - uVar4);
|
|
pcVar11 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((code *)auStack_90)) + 0x0)));
|
|
VStack_60.y = fVar7;
|
|
}
|
|
else {
|
|
if (((g_manager->_persistentGameData)._achievements[0x21] == 0) &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 || (g_game == GHIDRA_CAST<Game *>(0x0))) ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) {
|
|
VStack_60.y = 2.8026e-45;
|
|
}
|
|
else {
|
|
VStack_60.y = 1.4013e-45;
|
|
}
|
|
bVar2 = Game::IsHardMode();
|
|
fVar7 = extraout_ECX;
|
|
if (bVar2 != 0) goto LAB_007fef9b;
|
|
LAB_007feffd:
|
|
pcVar11 = (code *)VStack_50.y;
|
|
}
|
|
uVar4 = rng._seed;
|
|
if (0 < GHIDRA_INT(fVar7)) {
|
|
do {
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar4;
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x16);
|
|
if ((bVar2 == 0) || (uVar4 == (uVar4 / 5) * 5)) {
|
|
if (pcVar11 == (code *)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar6 = GHIDRA_UINT(pcVar11) >> (auStack_90[4] & 0x1f) ^ GHIDRA_UINT(pcVar11);
|
|
uVar6 = uVar6 << (auStack_90[8] & 0x1f) ^ uVar6;
|
|
pcVar11 = (code *)(uVar6 >> ((uint8_t)iStack_84 & 0x1f) ^ uVar6);
|
|
if (VStack_78.y == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar6 = GHIDRA_UINT(VStack_78.y) >> (auStack_b0[0] & 0x1f) ^ GHIDRA_UINT(VStack_78.y);
|
|
subRng._shift1 = 3;
|
|
subRng._shift2 = 1;
|
|
uVar6 = uVar6 << (auStack_b0[4] & 0x1f) ^ uVar6;
|
|
VStack_78.y = (float)(uVar6 >> (SUB41(VStack_70.y,0) & 0x1f) ^ uVar6);
|
|
VStack_50.y = 1.96182e-44;
|
|
if (VStack_78.y == 0.0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar6 = GHIDRA_UINT(VStack_78.y) >> 3 ^ GHIDRA_UINT(VStack_78.y);
|
|
uVar6 = uVar6 << 1 ^ uVar6;
|
|
uVar6 = uVar6 >> 0xe ^ uVar6;
|
|
fVar7 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) *
|
|
2.3283062e-10 * 3.14;
|
|
VStack_50.y = fVar7 + fVar7;
|
|
VStack_2c.x = cos(VStack_50.y);
|
|
VStack_2c.x = VStack_2c.x * 7.0;
|
|
VStack_2c.y = sin(VStack_50.y);
|
|
VStack_2c.y = VStack_2c.y * 7.0;
|
|
pVVar5 = FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_a0 + 8)),&VStack_80,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,pVVar5,&VStack_2c,entity,0,GHIDRA_UINT(pcVar11));
|
|
}
|
|
VStack_60.y = (float)(GHIDRA_INT(VStack_60.y) + -1);
|
|
} while (VStack_60.y != 0.0);
|
|
VStack_60.y = 0.0;
|
|
rng._seed = uVar4;
|
|
}
|
|
}
|
|
if ((GHIDRA_CAST<PlayerManager *>(VStack_38.y) != GHIDRA_CAST<PlayerManager *>(0x0)) && (local_21 == '\0')) {
|
|
uVar4 = 0;
|
|
iVar10 = *GHIDRA_CAST<int *>(entity[3]._sprite._filename._buf);
|
|
switch(VStack_68.y) {
|
|
case 2.66247e-44:
|
|
if ((VStack_58.y == 0.0) && (iVar10 == 1)) goto DAT_007ff20d;
|
|
break;
|
|
case 6.30584e-44:
|
|
DAT_007ff20d:
|
|
uVar4 = 3;
|
|
break;
|
|
case 8.82818e-44:
|
|
if ((VStack_58.y == 0.0) && (iVar10 == 0)) {
|
|
uVar4 = 3;
|
|
}
|
|
break;
|
|
case 1.10703e-43:
|
|
if (((VStack_58.y == 0.0) || (VStack_58.y == 1.4013e-44)) && (iVar10 == 1)) {
|
|
uVar4 = 3;
|
|
}
|
|
break;
|
|
case 1.38729e-43:
|
|
if (iVar10 == 0) {
|
|
uVar4 = 3;
|
|
}
|
|
}
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x16);
|
|
if ((bVar2 == 0) || (uVar6 == (uVar6 / 5) * 5)) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x0))) = entity->_initSeed;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x4))) = 0x500000003;
|
|
iStack_84 = 0x16;
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar3 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(auStack_90))))->RNG::Next();
|
|
pVVar5 = RandomVector(GHIDRA_CAST<Vector *>((auStack_b0 + 4)),uVar3);
|
|
VStack_78.y = pVVar5->y * 7.0;
|
|
VStack_78.x = pVVar5->x * 7.0;
|
|
pVVar5 = FindFreePickupSpawnPosition(g_game->_room,&VStack_60,&VStack_80,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,pVVar5,&VStack_78,entity,uVar4,uVar6);
|
|
}
|
|
uVar4 = rng._seed;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x4)))) + 8)) == g_game->_lastBossRoomListIdx) &&
|
|
(player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x24c,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
uVar6 = 0;
|
|
VStack_70.y = 3.50325e-44;
|
|
pvVar1 = g_game->_room;
|
|
subRng._shift1 = 5;
|
|
subRng._shift2 = 0x1b;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1264)) != 0) {
|
|
do {
|
|
VStack_68.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x125c)) + uVar6 * 4));
|
|
bVar2 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(VStack_68.y))))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if (bVar2 != 0) {
|
|
VStack_50.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(VStack_68.y) + 0x20));
|
|
VStack_38.y = (float)&g_game->_playerManager;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)subRng._shift1 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((uint8_t)subRng._shift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (SUB41(VStack_70.y,0) & 0x1f) ^ uVar4;
|
|
player = PlayerManager::RandomCollectibleOwner
|
|
(GHIDRA_CAST<PlayerManager *>(VStack_38.y),0x24c,uVar4,GHIDRA_CAST<RNG **>(0x0));
|
|
(GHIDRA_CAST<EntityRef *>((&damageSource)))->EntityRef::constructor(GHIDRA_CAST<Entity *>(player));
|
|
(*(code *)VStack_50.y)(0x42c80000,0,0,&damageSource,0x1e);
|
|
}
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1264)));
|
|
entity = bossEntity;
|
|
}
|
|
uVar4 = 0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar4);
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::SetFullHearts();
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::FullCharge(-1,0,0);
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x24c,0);
|
|
if (((bVar2 != 0) &&
|
|
(pvVar1 = (g_manager->_itemConfig)._nullItems._begin,
|
|
0xe0 < GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) &
|
|
0xfffffffcU)))) &&
|
|
(pcVar11 = *(code **)(GHIDRA_CAST<char *>(pvVar1) + 0xe0), pcVar11 != (code *)0x0)) {
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x4))) = (uint64_t)*GHIDRA_CAST<uint32_t *>((pcVar11 + 0x78)) << 0x20;
|
|
iStack_84 = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_90)) + 0x0))) = pcVar11;
|
|
(GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::AddEffect(auStack_90,1,1);
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::RemoveCurses(0xffffffff);
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::ShowMap();
|
|
itemOverlay = &g_game->_itemOverlay;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(g_game->_room) + 0x745c)) = 1;
|
|
(GHIDRA_CAST<ItemOverlay *>((itemOverlay)))->ItemOverlay::Show(5,0,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
if ((entity->_type == 0x38a) && (entity->_dead != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x222);
|
|
game = g_game;
|
|
iStack_20 = 0x100;
|
|
subRng._seed = 0xdc;
|
|
subRng._shift1 = 0x13;
|
|
subRng._shift2 = 0x89;
|
|
subRng._shift3 = 0x286;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar4 = ItemPool::GetCollectibleFromList(&game->_itemPool,&iStack_20,5,uVar4,0,0,0);
|
|
if ((uVar4 == 0) || (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(7), uVar6 != 0)) {
|
|
(GHIDRA_CAST<RNG *>((&subRng)))->RNG::game_constructor(entity->_initSeed,0x17);
|
|
iVar10 = 3;
|
|
do {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&subRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(&VStack_58,uVar6);
|
|
VStack_38.y = (entity->_pos).y;
|
|
VStack_38.x = (entity->_pos).x;
|
|
VStack_80.y = pVVar5->y * 7.0;
|
|
VStack_80.x = pVVar5->x * 7.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x28,&VStack_38,&VStack_80,entity,0,uVar4);
|
|
iVar10 = iVar10 + -1;
|
|
} while (iVar10 != 0);
|
|
}
|
|
else {
|
|
VStack_80.y = (entity->_pos).y;
|
|
VStack_80.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,&VStack_50,&VStack_80,0.0,0,0,0);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&VStack_50,&g_vectorZero,entity,uVar4,uVar6);
|
|
pvVar1 = (g_game->_itemPool)._removedCollectibles._begin;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + (uVar4 >> 5) * 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + (uVar4 >> 5) * 4)) | 1 << (uVar4 & 0x1f);
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x4)))) + 8)) == g_game->_lastBossRoomListIdx) &&
|
|
(1 < g_game->_stagesWithoutDamage)) &&
|
|
(((g_game->_levelStateFlags & 0x20) == 0 &&
|
|
(bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x2d), bVar2 == 0)))) {
|
|
Game::SetStateFlag(0x2d,1);
|
|
(GHIDRA_CAST<RNG *>((&subRng)))->RNG::game_constructor(entity->_initSeed,0x18);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&subRng)))->RNG::Next();
|
|
pVVar5 = RandomVector(GHIDRA_CAST<Vector *>((auStack_90 + 8)),uVar6);
|
|
VStack_68.y = (entity->_pos).y;
|
|
VStack_68.x = (entity->_pos).x;
|
|
VStack_70.y = pVVar5->y * 7.0;
|
|
VStack_70.x = pVVar5->x * 7.0;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x15e,&VStack_68,&VStack_70,entity,0x91,uVar4);
|
|
}
|
|
iVar10 = (GHIDRA_CAST<Entity *>((entity)))->Entity::GetBossID();
|
|
FUN_0092a5e0(iVar10);
|
|
if (entity->_type == 0x38c) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0x1ed,1);
|
|
}
|
|
}
|
|
goto LAB_00800032;
|
|
}
|
|
LAB_007ff7d4:
|
|
if ((((local_30->_roomType == 6) || ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x7228))) != '\0')) ||
|
|
((local_30->_roomType == 5 && (bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode(), bVar2 != 0)))) &&
|
|
((uVar4 = GetBossVictoryJingle(local_30), uVar4 != 0 &&
|
|
((GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(uVar4,(g_manager->_optionsConfig)._musicVolume),
|
|
0x25 < (GHIDRA_INT((g_manager->_musicManager)._entries._end) -
|
|
GHIDRA_INT((g_manager->_musicManager)._entries._begin)) / 0x60)))) {
|
|
(g_manager->_musicManager)._queuedMusicID = 0x25;
|
|
}
|
|
if (local_21 != '\0') goto LAB_007fffcd;
|
|
if (GHIDRA_CAST<Entity *>(bossType) == GHIDRA_CAST<Entity *>(0x2e)) {
|
|
if (VStack_58.y != 2.8026e-45) goto LAB_007ffad3;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
pVVar5 = FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_90 + 8)),&VStack_2c,0.0,0,0,0);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x15e,pVVar5,&g_vectorZero,entity,0x3d,uVar4);
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x4d);
|
|
bossType = GHIDRA_INT(VStack_68.y);
|
|
goto LAB_00800005;
|
|
}
|
|
if (GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x26)) {
|
|
if ((GHIDRA_CAST<Entity *>(bossType) != GHIDRA_CAST<Entity *>(0x51)) || (VStack_58.y != 1.4013e-45)) goto LAB_007ffad3;
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,&VStack_58,&VStack_2c,0.0,0,0,0);
|
|
uVar4 = 0x84;
|
|
bVar2 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x125,1);
|
|
if ((bVar2 != 0) && (uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(2), uVar6 != 0)) {
|
|
uVar4 = 0x125;
|
|
}
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&VStack_58,&g_vectorZero,entity,uVar4,uVar6);
|
|
ItemPool::RemoveCollectible(&g_game->_itemPool,uVar4,0,0);
|
|
goto LAB_0080001f;
|
|
}
|
|
if (VStack_58.y == 2.8026e-45) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(4);
|
|
if (((uVar4 == 0) &&
|
|
(bVar2 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(0x261,0), bVar2 != 0)) &&
|
|
(bVar2 = ItemPool::RemoveCollectible(&g_game->_itemPool,0x261,0,0), bVar2 != 0)) {
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,&VStack_78,&VStack_2c,0.0,0,0,0);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar3 = 0x261;
|
|
pVVar5 = &VStack_78;
|
|
uVar6 = 100;
|
|
}
|
|
else {
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,&VStack_60,&VStack_2c,0.0,0,0,0);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar3 = 0;
|
|
pVVar5 = &VStack_60;
|
|
uVar6 = 0x1e;
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar6,pVVar5,&g_vectorZero,entity,uVar3,uVar4);
|
|
goto LAB_00800005;
|
|
}
|
|
LAB_007ffad3:
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(4);
|
|
if ((uVar4 != 0) && ((uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(7), uVar4 != 0 || (VStack_58.y != 1.4013e-45))))
|
|
goto LAB_007ffaf7;
|
|
switch(bossType) {
|
|
case 0x2e:
|
|
uVar4 = 0x2a;
|
|
uVar6 = 0x8c;
|
|
break;
|
|
case 0x2f:
|
|
uVar4 = 0xd;
|
|
uVar6 = 0x2d;
|
|
break;
|
|
case 0x30:
|
|
uVar4 = 0x25;
|
|
uVar6 = 0x6a;
|
|
break;
|
|
case 0x31:
|
|
uVar4 = 0xf;
|
|
uVar6 = 0x81;
|
|
break;
|
|
case 0x32:
|
|
if ((VStack_58.y == 1.4013e-45) &&
|
|
(((g_manager->_persistentGameData)._achievements[10] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
uVar4 = 0x4a;
|
|
}
|
|
else {
|
|
uVar4 = 0x40;
|
|
}
|
|
goto code_r0x007ffbb6;
|
|
case 0x33:
|
|
uVar4 = (-GHIDRA_UINT((GHIDRA_UINT(VStack_58.y) % 10 != 1)) & 0xffffffb1) + 0x80;
|
|
goto code_r0x007ffbb6;
|
|
case 0x34:
|
|
uVar4 = 0x41;
|
|
uVar6 = 0x51;
|
|
break;
|
|
default:
|
|
goto LAB_007ffaf7;
|
|
}
|
|
if (VStack_58.y == 1.4013e-45) {
|
|
uVar4 = uVar6;
|
|
}
|
|
code_r0x007ffbb6:
|
|
bVar2 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(uVar4,0);
|
|
if (bVar2 != 0) {
|
|
bVar2 = ItemPool::RemoveCollectible(&g_game->_itemPool,uVar4,0,0);
|
|
if (bVar2 != 0) {
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,GHIDRA_CAST<Vector *>((auStack_b0 + 4)),&VStack_2c,0.0,0,0,0);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
pVVar5 = &g_vectorZero;
|
|
position = GHIDRA_CAST<Vector *>((auStack_b0 + 4));
|
|
uVar3 = 100;
|
|
goto code_r0x007fffc0;
|
|
}
|
|
LAB_007ffaf7:
|
|
if (GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&((GHIDRA_CAST<Entity *>((bossType + -0x410)))->_dropRNG)._shift1) + 2)) <
|
|
&DAT_00000007) goto code_r0x007ffb03;
|
|
goto LAB_007fffcd;
|
|
}
|
|
code_r0x007ffb03:
|
|
switch((&PTR_DAT_008004c0)[GHIDRA_INT((GHIDRA_INT(&((GHIDRA_CAST<Entity *>((bossType + -0x410)))->_dropRNG)._shift1) + 2))])
|
|
{
|
|
case GHIDRA_CAST<uint8_t *>(0x7ffc4e):
|
|
uVar3 = 0x46;
|
|
break;
|
|
case GHIDRA_CAST<uint8_t *>(0x7ffc58):
|
|
uVar3 = 10;
|
|
code_r0x007ffe1d:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_a0)) + 0x0))) = entity->_initSeed;
|
|
iStack_94 = 0x1d;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_a0)) + 0x4))) = 3;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_a0)) + 0x8))) = 3;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(auStack_a0))))->RNG::Next();
|
|
pVVar5 = RandomVector(GHIDRA_CAST<Vector *>((auStack_90 + 8)),uVar4);
|
|
VStack_70.y = pVVar5->y * 5.0;
|
|
VStack_70.x = pVVar5->x * 5.0;
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
VStack_2c.x = (entity->_pos).x;
|
|
VStack_2c.y = (entity->_pos).y;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar3,&VStack_2c,&VStack_70,entity,0,uVar4);
|
|
VStack_38.y = (float)(GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
if (((uVar3 != 10) ||
|
|
(bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x16), bVar2 == 0)) ||
|
|
((GHIDRA_UINT(VStack_38.y) & 1) == 0)) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
VStack_38.x = VStack_70.x * -1.0;
|
|
VStack_68.x = (entity->_pos).x;
|
|
VStack_68.y = (entity->_pos).y;
|
|
uVar4 = 0;
|
|
pVVar5 = &VStack_38;
|
|
VStack_38.y = VStack_70.y * -1.0;
|
|
position = &VStack_68;
|
|
goto code_r0x007fffc0;
|
|
}
|
|
goto LAB_007fffcd;
|
|
case GHIDRA_CAST<uint8_t *>(0x7ffc62):
|
|
uVar4 = entity->_initSeed;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_a0)) + 0x4))) = 3;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auStack_a0)) + 0x8))) = 3;
|
|
VStack_38.y = (float)&DAT_0000001d;
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomInt(5);
|
|
VStack_60.y = (float)(uVar6 + 4);
|
|
if (0 < GHIDRA_INT(VStack_60.y)) {
|
|
uVar6 = rng._seed;
|
|
do {
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (auStack_a0[4] & 0x1f) ^ uVar4;
|
|
subRng._shift1 = 3;
|
|
subRng._shift2 = 1;
|
|
uVar4 = uVar4 << (auStack_a0[8] & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (SUB41(VStack_38.y,0) & 0x1f) ^ uVar4;
|
|
VStack_70.y = 1.96182e-44;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar3 = uVar4 >> 3 ^ uVar4;
|
|
uVar3 = uVar3 << 1 ^ uVar3;
|
|
uVar3 = uVar3 >> 0xe ^ uVar3;
|
|
fVar7 = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283062e-10 * 3.14;
|
|
VStack_50.y = fVar7 + fVar7;
|
|
uVar3 = Random();
|
|
VStack_78.y = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) *
|
|
2.3283064e-10 * 5.0 + 2.0;
|
|
VStack_2c.x = cos(VStack_50.y);
|
|
VStack_2c.x = VStack_2c.x * VStack_78.y;
|
|
VStack_2c.y = sin(VStack_50.y);
|
|
VStack_2c.y = VStack_2c.y * VStack_78.y;
|
|
if (uVar6 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar11 = (code *)swi(3);
|
|
(*pcVar11)();
|
|
return;
|
|
}
|
|
uVar6 = uVar6 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar6;
|
|
uVar6 = uVar6 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar6;
|
|
VStack_80.y = (entity->_pos).y;
|
|
uVar6 = uVar6 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar6;
|
|
VStack_80.x = (entity->_pos).x;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,&VStack_80,&VStack_2c,entity,0,uVar6);
|
|
VStack_60.y = (float)(GHIDRA_INT(VStack_60.y) + -1);
|
|
} while (VStack_60.y != 0.0);
|
|
VStack_60.y = 0.0;
|
|
bossType = GHIDRA_INT(VStack_68.y);
|
|
}
|
|
goto LAB_007fffcd;
|
|
case GHIDRA_CAST<uint8_t *>(0x7ffe18):
|
|
uVar3 = 0x28;
|
|
goto code_r0x007ffe1d;
|
|
case GHIDRA_CAST<uint8_t *>(0x7fff34):
|
|
uVar3 = 300;
|
|
break;
|
|
case GHIDRA_CAST<uint8_t *>(0x7fff3b):
|
|
uVar3 = 0x1e;
|
|
break;
|
|
case GHIDRA_CAST<uint8_t *>(0x7fff97):
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
VStack_50.x = (entity->_pos).x;
|
|
VStack_50.y = (entity->_pos).y;
|
|
uVar4 = 3;
|
|
pVVar5 = &g_vectorZero;
|
|
position = &VStack_50;
|
|
uVar3 = 0x28;
|
|
goto code_r0x007fffc0;
|
|
}
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(g_game->_room,GHIDRA_CAST<Vector *>((auStack_a0 + 8)),&VStack_2c,0.0,0,0,0);
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar4 = 0;
|
|
pVVar5 = &g_vectorZero;
|
|
position = GHIDRA_CAST<Vector *>((auStack_a0 + 8));
|
|
code_r0x007fffc0:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,uVar3,position,pVVar5,entity,uVar4,uVar6);
|
|
LAB_007fffcd:
|
|
if ((bossType < 0x2e) || (0x34 < bossType)) {
|
|
fVar7 = VStack_58.y;
|
|
if (bossType != 0x26) goto LAB_00800015;
|
|
if (VStack_58.y == 2.8026e-45) goto LAB_00800005;
|
|
}
|
|
else if ((bossType == 0x2e) && (VStack_58.y == 2.8026e-45)) {
|
|
LAB_00800005:
|
|
fVar7 = VStack_58.y;
|
|
FUN_0092a520(6);
|
|
LAB_00800015:
|
|
if ((GHIDRA_CAST<Entity *>(bossType) == GHIDRA_CAST<Entity *>(0x51)) && (fVar7 == 1.4013e-45)) {
|
|
LAB_0080001f:
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x8f);
|
|
}
|
|
}
|
|
else {
|
|
FUN_0092a520(bossType + -0x2e);
|
|
}
|
|
LAB_00800032:
|
|
this = local_30;
|
|
if ((g_game->_ambush)._isActive == 0) {
|
|
(GHIDRA_CAST<RNG *>((&subRng)))->RNG::game_constructor(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_30)) + 0x4)))) + 100)),4);
|
|
uVar4 = (GHIDRA_CAST<RNG *>((this_00)))->RNG::Next();
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 100)) = uVar4;
|
|
}
|
|
LAB_00800060:
|
|
if ((entity->_type == 0x10f) || (entity->_type == 0x110)) {
|
|
bVar12 = true;
|
|
}
|
|
else {
|
|
bVar12 = false;
|
|
}
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8));
|
|
if (((iVar10 == 0xf) || (iVar10 == 0xd)) || (iVar10 == 8)) {
|
|
isAngelSpawnRoom = true;
|
|
}
|
|
else {
|
|
isAngelSpawnRoom = false;
|
|
}
|
|
if (!bVar12) {
|
|
return;
|
|
}
|
|
if (!isAngelSpawnRoom) {
|
|
return;
|
|
}
|
|
piVar9 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7300))));
|
|
node = GHIDRA_CAST<int *>(*piVar9);
|
|
if (node != piVar9) {
|
|
iVar10 = 0;
|
|
do {
|
|
nodeEntityType = node + 4;
|
|
node = GHIDRA_CAST<int *>(*node);
|
|
iVar8 = iVar10 + 1;
|
|
if (*nodeEntityType != entity->_type) {
|
|
iVar8 = iVar10;
|
|
}
|
|
iVar10 = iVar8;
|
|
} while (node != piVar9);
|
|
this = local_30;
|
|
if (iVar8 != 0) {
|
|
return;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<RNG *>((&rng)))->RNG::game_constructor(entity->_initSeed,0x1e);
|
|
game = g_game;
|
|
iVar10 = entity->_type;
|
|
if (iVar10 == 0x10f) {
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStateFlag(0x32);
|
|
if (bVar2 == 0) {
|
|
Game::SetStateFlag(0x32,1);
|
|
game = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x2675c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x2675c)))) + 1;
|
|
iVar10 = entity->_type;
|
|
goto LAB_00800123;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00800123:
|
|
if ((iVar10 == 0x110) && (bVar2 = (GHIDRA_CAST<Game *>((game)))->Game::GetStateFlag(0x33), bVar2 == 0)) {
|
|
Game::SetStateFlag(0x33,1);
|
|
game = g_game;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x2675c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_game)) + 0x2675c)))) + 1;
|
|
}
|
|
}
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
FindFreePickupSpawnPosition(game->_room,&VStack_38,&VStack_2c,0.0,0,0,0);
|
|
bStack_23 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0xee);
|
|
bStack_22 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasCollectible(0xef);
|
|
iVar10 = (this->_entityList)._updateEL._size;
|
|
VStack_68.y = (float)(GHIDRA_UINT(extraout_var) << 8);
|
|
local_21 = '\0';
|
|
if (iVar10 != 0) {
|
|
piVar9 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4))));
|
|
do {
|
|
iVar8 = *piVar9;
|
|
if ((*GHIDRA_CAST<int *>((iVar8 + 0x28)) == 5) && (*GHIDRA_CAST<int *>((iVar8 + 0x2c)) == 100)) {
|
|
if (*GHIDRA_CAST<int *>((iVar8 + 0x30)) == 0xee) {
|
|
local_21 = '\x01';
|
|
}
|
|
else {
|
|
VStack_68.y = (float)(GHIDRA_UINT(VStack_68.y) & 0xff);
|
|
if (*GHIDRA_CAST<int *>((iVar8 + 0x30)) == 0xef) {
|
|
VStack_68.y = 1.4013e-45;
|
|
}
|
|
}
|
|
}
|
|
piVar9 = piVar9 + 1;
|
|
iVar10 = iVar10 + -1;
|
|
} while (iVar10 != 0);
|
|
entity = bossEntity;
|
|
}
|
|
bVar2 = bStack_22;
|
|
if (((bStack_23 == 0) && (local_21 == '\0')) &&
|
|
((isFiligreeFeathersOwned = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x7b),
|
|
bVar2 = bStack_22, isFiligreeFeathersOwned == 0 || (bStack_22 != 0)))) {
|
|
bStack_22 = '\x01';
|
|
}
|
|
else {
|
|
bStack_22 = '\0';
|
|
}
|
|
if (((bVar2 == 0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(VStack_68.y)) + 0x0))) == '\0')) &&
|
|
((bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x7b), bVar2 == 0 ||
|
|
(bStack_23 != 0)))) {
|
|
bStack_23 = '\x01';
|
|
}
|
|
else {
|
|
bStack_23 = '\0';
|
|
}
|
|
if (entity->_type == 0x10f) {
|
|
if (bStack_22 == '\0') {
|
|
LAB_008002a5:
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x7b);
|
|
game = g_game;
|
|
if (bVar2 == 0) {
|
|
uVar4 = 0;
|
|
}
|
|
else {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
uVar4 = ItemPool::GetCollectible(&game->_itemPool,4,uVar4,0,0,0);
|
|
player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x7b);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar10 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x7b);
|
|
if (iVar10 == 2) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,&VStack_38,&g_vectorZero,entity,8,uVar6);
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
pVVar5 = FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_90 + 8)),&VStack_2c,0.0,0,0,0);
|
|
VStack_38.x = pVVar5->x;
|
|
VStack_38.y = pVVar5->y;
|
|
}
|
|
else if (iVar10 == 3) {
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,10,&VStack_38,&g_vectorZero,entity,3,uVar6);
|
|
VStack_2c.y = (entity->_pos).y;
|
|
VStack_2c.x = (entity->_pos).x;
|
|
pVVar5 = FindFreePickupSpawnPosition
|
|
(g_game->_room,GHIDRA_CAST<Vector *>((auStack_90 + 8)),&VStack_2c,0.0,0,0,0);
|
|
VStack_38.x = pVVar5->x;
|
|
VStack_38.y = pVVar5->y;
|
|
}
|
|
}
|
|
}
|
|
if (bStack_22 == '\0') {
|
|
if (bStack_23 == '\0') {
|
|
if (uVar4 == 0) {
|
|
return;
|
|
}
|
|
goto LAB_0080041c;
|
|
}
|
|
goto LAB_0080029b;
|
|
}
|
|
}
|
|
uVar4 = 0xee;
|
|
}
|
|
else {
|
|
if ((entity->_type != 0x110) || (bStack_23 == '\0')) goto LAB_008002a5;
|
|
LAB_0080029b:
|
|
uVar4 = 0xef;
|
|
}
|
|
LAB_0080041c:
|
|
uVar6 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,100,&VStack_38,&g_vectorZero,entity,uVar4,uVar6);
|
|
return;
|
|
}
|
|
|
|
// 00800500
|
|
void Room::update_ambient_sounds()
|
|
{
|
|
Room *sfxManager = this;
|
|
uint8_t bVar1;
|
|
LayerState *layer;
|
|
float *pfVar2;
|
|
int iVar3;
|
|
void *playerListEnd;
|
|
SoundEffects *sfxManager;
|
|
Game *game;
|
|
PlayerManager *playerManager;
|
|
int *piVar4;
|
|
uint32_t playerIdx;
|
|
int iVar5;
|
|
void **ppvVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
float flyBuzzPitch;
|
|
float avgPlayerVelY;
|
|
float avgPlayerVelX;
|
|
float sfxA3Volume;
|
|
float local_6c;
|
|
float portalVolume;
|
|
float minecartVolume;
|
|
float flyBuzzVolume;
|
|
float sfx1d9Volume;
|
|
int flyCount;
|
|
float fireVolume;
|
|
float visFattyLaserVolume;
|
|
float ballAndChainVolume;
|
|
float sfx217Volume;
|
|
float sfx22eVolume;
|
|
float dogmaVolume;
|
|
float dogmaAngelVolume;
|
|
float dogmaAngelPitch;
|
|
float sfx264Volume;
|
|
float local_24;
|
|
float laserLoopVolume;
|
|
float sfx1dcVolume;
|
|
float local_18;
|
|
float local_14;
|
|
Vector playersCenter;
|
|
Manager *manager;
|
|
|
|
players_center_position(&g_game->_playerManager,&playersCenter,1);
|
|
if (g_manager->_framecount == DAT_00c5c4d8) {
|
|
avgPlayerVelX = DAT_00c94374;
|
|
avgPlayerVelY = DAT_00c94378;
|
|
}
|
|
else {
|
|
playerManager = &g_game->_playerManager;
|
|
local_6c = 0.0;
|
|
fVar9 = 0.0;
|
|
fVar10 = 0.0;
|
|
playerIdx = 0;
|
|
avgPlayerVelY = 0.0;
|
|
avgPlayerVelX = 0.0;
|
|
fVar8 = (float)0;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
|
|
2 != 0) {
|
|
do {
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (playerManager->_playerList)._end;
|
|
fVar9 = avgPlayerVelY;
|
|
fVar10 = avgPlayerVelX;
|
|
}
|
|
piVar4 = (playerManager->_playerList)._begin;
|
|
if (playerIdx < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(piVar4) >> 2))) {
|
|
piVar4 = piVar4 + playerIdx;
|
|
}
|
|
iVar3 = *piVar4;
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x13c0)) == 0x23) goto LAB_0080060f;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(bVar1 = NetplayManager::IsIdxLocalPlayer
|
|
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),
|
|
*GHIDRA_CAST<uint32_t *>((iVar3 + 0x1618))), bVar1 == 0)) {
|
|
fVar9 = avgPlayerVelY;
|
|
fVar10 = avgPlayerVelX;
|
|
goto LAB_0080060f;
|
|
}
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar3 + 0x360)) + avgPlayerVelX;
|
|
fVar9 = *GHIDRA_CAST<float *>((iVar3 + 0x364)) + avgPlayerVelY;
|
|
local_6c = (float)(GHIDRA_INT(local_6c) + 1);
|
|
avgPlayerVelY = fVar9;
|
|
avgPlayerVelX = fVar10;
|
|
}
|
|
else {
|
|
LAB_0080060f:
|
|
}
|
|
playerIdx = playerIdx + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
fVar8 = local_6c;
|
|
} while (playerIdx <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
DAT_00c5c4d8 = g_manager->_framecount;
|
|
if (GHIDRA_INT(fVar8) < 1) {
|
|
avgPlayerVelY = g_vectorZero.y;
|
|
avgPlayerVelX = g_vectorZero.x;
|
|
}
|
|
else {
|
|
avgPlayerVelY = fVar9 / (float)GHIDRA_INT(fVar8);
|
|
avgPlayerVelX = fVar10 / (float)GHIDRA_INT(fVar8);
|
|
}
|
|
}
|
|
fireVolume = 0.0;
|
|
flyBuzzVolume = 0.0;
|
|
flyBuzzPitch = 0.0;
|
|
laserLoopVolume = 0.0;
|
|
visFattyLaserVolume = 0.0;
|
|
sfxA3Volume = 0.0;
|
|
sfx1d9Volume = 0.0;
|
|
sfx1dcVolume = 0.0;
|
|
local_6c = 0.0;
|
|
portalVolume = 0.0;
|
|
minecartVolume = 0.0;
|
|
sfx217Volume = 0.0;
|
|
sfx22eVolume = 0.0;
|
|
dogmaAngelVolume = 0.0;
|
|
dogmaAngelPitch = 0.0;
|
|
dogmaVolume = 0.0;
|
|
ballAndChainVolume = 0.0;
|
|
sfx264Volume = 0.0;
|
|
DAT_00c94374 = avgPlayerVelX;
|
|
DAT_00c94378 = avgPlayerVelY;
|
|
bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if ((bVar1 != 0) && (*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0)) goto LAB_00801544;
|
|
flyCount = 0;
|
|
local_24 = 0.0;
|
|
game = g_game;
|
|
fVar8 = playersCenter.y;
|
|
fVar9 = playersCenter.x;
|
|
if ((sfxManager->_entityList)._updateEL._size == 0) {
|
|
LAB_00801137:
|
|
local_24 = 1.0;
|
|
}
|
|
else {
|
|
do {
|
|
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((sfxManager->_entityList)._updateEL)) + 0x4)))) + GHIDRA_INT(local_24) * 4));
|
|
if (((*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) || (iVar5 = 1, *GHIDRA_CAST<int *>((iVar3 + 0x28)) != 1)) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>((iVar3 + 0x28)), 0x3dd < iVar5 - 10U)) {
|
|
if (iVar5 != 7) {
|
|
if (iVar5 == 1000) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xa8) {
|
|
fVar10 = 1.0;
|
|
if (1.0 <= sfxA3Volume) {
|
|
fVar10 = sfxA3Volume;
|
|
}
|
|
sfxA3Volume = fVar10;
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xb2) {
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar3 + 0x478)) * 1.6;
|
|
if (fVar10 <= sfx217Volume) {
|
|
fVar10 = sfx217Volume;
|
|
}
|
|
sfx217Volume = fVar10;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xb4) {
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 450.0;
|
|
portalVolume = fVar8 * fVar8 * 0.2 * *GHIDRA_CAST<float *>((iVar3 + 0xe4)) + portalVolume;
|
|
goto LAB_008008f0;
|
|
}
|
|
if (((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xab) && (*GHIDRA_CAST<int *>((iVar3 + 0x30)) == 0)) &&
|
|
(*GHIDRA_CAST<int *>((iVar3 + 0x450)) == 1)) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x7c)) == 0) goto switchD_00800885_caseD_f;
|
|
if (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((iVar3 + 0x7c)) + 0x34)) != '\0') {
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 2000.0;
|
|
sfx22eVolume = fVar8 * fVar8 + sfx22eVolume;
|
|
goto LAB_008008f0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xc1) && (*GHIDRA_CAST<int *>((iVar3 + 0x30)) == 0)) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x45c)) - 1U < 0x59) {
|
|
local_18 = 1.0;
|
|
local_14 = (float)(0x5a - *GHIDRA_CAST<int *>((iVar3 + 0x45c))) / 30.0;
|
|
pfVar2 = &local_14;
|
|
if (1.0 <= local_14) {
|
|
pfVar2 = &local_18;
|
|
}
|
|
fVar10 = *pfVar2;
|
|
if (fVar10 <= sfx264Volume) {
|
|
fVar10 = sfx264Volume;
|
|
}
|
|
sfx264Volume = fVar10;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
goto switchD_00800885_caseD_f;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) != 6) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) != 0xf) goto switchD_00800885_caseD_f;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x458)) != 0) {
|
|
laserLoopVolume = 1.2;
|
|
}
|
|
goto LAB_00801103;
|
|
}
|
|
if (iVar3 == 0) goto switchD_00800885_caseD_f;
|
|
if ((*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) || (iVar5 != 1)) {
|
|
if (0x3dd < iVar5 - 10U) goto switchD_00800885_caseD_f;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((iVar3 + 0x173)) != '\0') goto switchD_00800885_caseD_f;
|
|
if (0 < *GHIDRA_CAST<short *>((iVar3 + 0xc74))) goto switchD_00800885_caseD_f;
|
|
if (*GHIDRA_CAST<float *>((iVar3 + 0x39c)) <= 0.0) goto switchD_00800885_caseD_f;
|
|
if (0 < *GHIDRA_CAST<int *>((iVar3 + 0x31c))) goto switchD_00800885_caseD_f;
|
|
if ((*GHIDRA_CAST<uint32_t *>((iVar3 + 0x168)) & 0x20) != 0 || (*GHIDRA_CAST<uint32_t *>((iVar3 + 0x16c)) & 0x2000000) != 0)
|
|
goto switchD_00800885_caseD_f;
|
|
if (iVar5 != 0x3c5) {
|
|
fVar10 = ABS(*GHIDRA_CAST<float *>((iVar3 + 0x340)) - fVar8);
|
|
fVar7 = ABS(*GHIDRA_CAST<float *>((iVar3 + 0x33c)) - fVar9);
|
|
if (fVar10 <= fVar7) {
|
|
fVar10 = fVar7;
|
|
}
|
|
if (fVar10 <= 450.0) {
|
|
if (iVar5 < 0x11a) {
|
|
if (iVar5 == 0x119) {
|
|
switchD_00800885_caseD_d:
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar7 = *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - fVar10;
|
|
flyCount = flyCount + 1;
|
|
fVar8 = fVar8 - fVar7;
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 450.0;
|
|
fVar8 = fVar8 * fVar8;
|
|
if (iVar5 == 0x128) {
|
|
fVar8 = fVar8 * 0.05;
|
|
}
|
|
else {
|
|
fVar8 = fVar8 * 0.35;
|
|
}
|
|
flyBuzzVolume = fVar8 + flyBuzzVolume;
|
|
fVar10 = fVar10 - playersCenter.x;
|
|
if (1.5 <= flyBuzzVolume) {
|
|
flyBuzzVolume = 1.5;
|
|
}
|
|
fVar7 = fVar7 - playersCenter.y;
|
|
fVar8 = sqrtf(fVar10 * fVar10 + fVar7 * fVar7);
|
|
if (0.0 < fVar8) {
|
|
fVar7 = fVar7 * (1.0 / fVar8);
|
|
fVar10 = fVar10 * (1.0 / fVar8);
|
|
}
|
|
flyBuzzPitch = flyBuzzPitch +
|
|
(fVar7 * avgPlayerVelY + fVar10 * avgPlayerVelX + 100.0) /
|
|
(*GHIDRA_CAST<float *>((iVar3 + 0x364)) * fVar7 + *GHIDRA_CAST<float *>((iVar3 + 0x360)) * fVar10
|
|
+ 100.0);
|
|
game = g_game;
|
|
fVar8 = playersCenter.y;
|
|
fVar9 = playersCenter.x;
|
|
goto LAB_00801103;
|
|
}
|
|
switch(iVar5) {
|
|
case 0xd:
|
|
case 0xe:
|
|
case 0x12:
|
|
case 0x19:
|
|
case 0x3d:
|
|
case 0x50:
|
|
case 0xd6:
|
|
case 0xde:
|
|
case 0xf9:
|
|
case 0x100:
|
|
goto switchD_00800885_caseD_d;
|
|
case 0x21:
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x188)) != 0) {
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 450.0;
|
|
fireVolume = fVar8 * fVar8 * 0.6 + fireVolume;
|
|
goto LAB_008008f0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (0x364 < iVar5) goto code_r0x008009bf;
|
|
if (iVar5 == 0x364) goto switchD_00800885_caseD_d;
|
|
if (iVar5 < 0x329) {
|
|
if ((iVar5 == 0x328) || (iVar5 == 0x128)) goto switchD_00800885_caseD_d;
|
|
if (iVar5 == 0x132) {
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 450.0;
|
|
portalVolume = fVar8 * fVar8 * 0.6 + portalVolume;
|
|
goto LAB_008008f0;
|
|
}
|
|
}
|
|
else if ((iVar5 == 0x333) || (iVar5 == 0x346)) goto switchD_00800885_caseD_d;
|
|
}
|
|
}
|
|
goto switchD_00800885_caseD_f;
|
|
}
|
|
code_r0x008009bf:
|
|
switch(iVar5) {
|
|
case 0x376:
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0) && (iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0xbec)), iVar3 != 0)) {
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x28)) == 7) {
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar3 + 0xe4)) * 0.5;
|
|
if (fVar10 <= visFattyLaserVolume) {
|
|
fVar10 = visFattyLaserVolume;
|
|
}
|
|
visFattyLaserVolume = fVar10;
|
|
}
|
|
goto LAB_00801103;
|
|
}
|
|
break;
|
|
case 0x37d:
|
|
if ((*GHIDRA_CAST<float *>((iVar3 + 0x334)) != g_vectorZero.x) ||
|
|
(*GHIDRA_CAST<float *>((iVar3 + 0x338)) != g_vectorZero.y)) {
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 1200.0;
|
|
ballAndChainVolume = fVar8 * fVar8 * 0.4 + ballAndChainVolume;
|
|
goto LAB_008008f0;
|
|
}
|
|
break;
|
|
case 0x3b6:
|
|
if (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0) {
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar3 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar9 = 1.0 - fVar8 / 1500.0;
|
|
fVar8 = 0.0;
|
|
if (0.0 <= fVar9) {
|
|
fVar8 = fVar9;
|
|
}
|
|
fVar9 = (layer->_color)._colorize[2];
|
|
if (1.0 <= fVar9) {
|
|
fVar9 = 1.0;
|
|
}
|
|
dogmaVolume = fVar9 * fVar8 * fVar8 + dogmaVolume;
|
|
if (dogmaVolume <= 0.02) {
|
|
dogmaVolume = 0.02;
|
|
}
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) != 2) || (*GHIDRA_CAST<int *>((iVar3 + 0xb64)) != 10)) break;
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
local_14 = *GHIDRA_CAST<float *>((iVar3 + 0x360));
|
|
fVar9 = 1.0 - fVar8 / 450.0;
|
|
fVar8 = 0.0;
|
|
if (0.0 <= fVar9) {
|
|
fVar8 = fVar9;
|
|
}
|
|
local_18 = *GHIDRA_CAST<float *>((iVar3 + 0x364));
|
|
fVar9 = sqrtf(local_14 * local_14 + local_18 * local_18);
|
|
fVar9 = fVar9 * 0.125;
|
|
if (1.0 <= fVar9) {
|
|
fVar9 = 1.0;
|
|
}
|
|
fVar10 = *GHIDRA_CAST<float *>((iVar3 + 0x33c)) - playersCenter.x;
|
|
dogmaAngelVolume = fVar9 * fVar8 * fVar8 + dogmaAngelVolume;
|
|
fVar8 = *GHIDRA_CAST<float *>((iVar3 + 0x340)) - playersCenter.y;
|
|
fVar9 = sqrtf(fVar10 * fVar10 + fVar8 * fVar8);
|
|
if (0.0 < fVar9) {
|
|
fVar8 = fVar8 * (1.0 / fVar9);
|
|
fVar10 = fVar10 * (1.0 / fVar9);
|
|
}
|
|
dogmaAngelPitch =
|
|
(fVar8 * avgPlayerVelY + fVar10 * avgPlayerVelX + 100.0) /
|
|
(local_18 * fVar8 + local_14 * fVar10 + 100.0) + dogmaAngelPitch;
|
|
}
|
|
goto LAB_008008f0;
|
|
case 0x3b7:
|
|
if ((*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0xb) || (*GHIDRA_CAST<int *>((iVar3 + 0x2c)) == 0x15))
|
|
goto switchD_00800885_caseD_d;
|
|
break;
|
|
case 0x3c5:
|
|
fVar8 = fVar8 - *GHIDRA_CAST<float *>((iVar3 + 0x340));
|
|
fVar9 = fVar9 - *GHIDRA_CAST<float *>((iVar3 + 0x33c));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar9 = 1.0 - fVar8 / 1200.0;
|
|
fVar8 = sqrtf(*GHIDRA_CAST<float *>((iVar3 + 0x364)) * *GHIDRA_CAST<float *>((iVar3 + 0x364)) +
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x360)) * *GHIDRA_CAST<float *>((iVar3 + 0x360)));
|
|
fVar8 = fVar8 / 30.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
if (1.0 <= fVar8) {
|
|
fVar8 = 1.0;
|
|
}
|
|
minecartVolume = fVar8 * fVar9 * fVar9 + minecartVolume;
|
|
LAB_008008f0:
|
|
game = g_game;
|
|
fVar8 = playersCenter.y;
|
|
fVar9 = playersCenter.x;
|
|
}
|
|
switchD_00800885_caseD_f:
|
|
LAB_00801103:
|
|
local_24 = (float)(GHIDRA_INT(local_24) + 1);
|
|
} while (GHIDRA_UINT(local_24) < GHIDRA_UINT((sfxManager->_entityList)._updateEL._size));
|
|
if (flyCount == 0) goto LAB_00801137;
|
|
local_24 = flyBuzzPitch / (float)flyCount;
|
|
}
|
|
fVar8 = sin((float)game->_frameCount / 53.0);
|
|
game = g_game;
|
|
fVar9 = sin((float)g_game->_frameCount / 61.0);
|
|
fVar10 = sin((float)game->_frameCount / 23.0);
|
|
flyBuzzPitch = (fVar8 + fVar9 + fVar10) * 0.02 + local_24;
|
|
if (0 < sfxManager->_numRainSpawners) {
|
|
pfVar2 = GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x73f4))));
|
|
local_24 = (float)sfxManager->_numRainSpawners;
|
|
do {
|
|
fVar8 = sqrtf((pfVar2[1] - playersCenter.y) * (pfVar2[1] - playersCenter.y) +
|
|
(*pfVar2 - playersCenter.x) * (*pfVar2 - playersCenter.x));
|
|
pfVar2 = pfVar2 + 6;
|
|
local_24 = (float)(GHIDRA_INT(local_24) + -1);
|
|
fVar8 = 1.0 - fVar8 / 900.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
sfx1d9Volume = sfxManager->_rainIntensity * fVar8 * fVar8 * 0.6 + sfx1d9Volume;
|
|
} while (local_24 != 0.0);
|
|
if (1.0 <= sfx1d9Volume) {
|
|
sfx1d9Volume = 1.0;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if (((sfxManager->_waterCurrent).x != g_vectorZero.x) || ((sfxManager->_waterCurrent).y != g_vectorZero.y)) {
|
|
sfx1dcVolume = 1.0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x4))));
|
|
piVar4 = *GHIDRA_CAST<int **>((iVar3 + 0x10));
|
|
if (((piVar4 == GHIDRA_CAST<int *>(0x0)) || (piVar4[2] != 0x10)) || (*piVar4 != 0x23)) {
|
|
if (sfxManager->_backdropType != 0x20) goto LAB_0080141b;
|
|
if (((*GHIDRA_CAST<uint32_t *>((iVar3 + 0x44)) >> 5 & 1) != 0) && (0 < *GHIDRA_CAST<int *>((iVar3 + 0x54)))) {
|
|
local_24 = (float)(sfxManager->_gridHeight * sfxManager->_gridWidth);
|
|
if (0 < GHIDRA_INT(local_24)) {
|
|
ppvVar6 = sfxManager->_gridEntities;
|
|
do {
|
|
playerListEnd = *ppvVar6;
|
|
if ((playerListEnd != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 4)) == 7)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
fVar8 = ((float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 0x24)) / iVar3) * 40.0 + 120.0) -
|
|
playersCenter.y;
|
|
fVar9 = ((float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 0x24)) % iVar3) * 40.0 + 40.0) -
|
|
playersCenter.x;
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 900.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
local_6c = fVar8 * fVar8 * 0.1 + local_6c;
|
|
}
|
|
ppvVar6 = ppvVar6 + 1;
|
|
local_24 = (float)(GHIDRA_INT(local_24) + -1);
|
|
} while (local_24 != 0.0);
|
|
}
|
|
local_6c = local_6c * sfxManager->_lavaIntensity;
|
|
if (1.0 <= local_6c) {
|
|
local_6c = 1.0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
fVar8 = 1.0 - (((sfxManager->_bottomRightPos).y - 30.0) - playersCenter.y) / 900.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
local_6c = fVar8 * fVar8 + 0.0;
|
|
if (1.0 <= local_6c) {
|
|
local_6c = 1.0;
|
|
}
|
|
LAB_0080141b:
|
|
if (((sfxManager->_backdropType == 9) && ((*GHIDRA_CAST<uint32_t *>((iVar3 + 0x44)) >> 5 & 1) != 0)) &&
|
|
(0 < *GHIDRA_CAST<int *>((iVar3 + 0x54)))) {
|
|
local_24 = (float)(sfxManager->_gridHeight * sfxManager->_gridWidth);
|
|
if (0 < GHIDRA_INT(local_24)) {
|
|
ppvVar6 = sfxManager->_gridEntities;
|
|
do {
|
|
playerListEnd = *ppvVar6;
|
|
if ((playerListEnd != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 4)) == 7)) {
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
|
|
fVar8 = ((float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 0x24)) / iVar3) * 40.0 + 120.0) -
|
|
playersCenter.y;
|
|
fVar9 = ((float)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerListEnd) + 0x24)) % iVar3) * 40.0 + 40.0) -
|
|
playersCenter.x;
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
fVar8 = 1.0 - fVar8 / 900.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
sfxA3Volume = fVar8 * fVar8 * 0.1 + sfxA3Volume;
|
|
}
|
|
ppvVar6 = ppvVar6 + 1;
|
|
local_24 = (float)(GHIDRA_INT(local_24) + -1);
|
|
} while (local_24 != 0.0);
|
|
}
|
|
if (1.0 <= sfxA3Volume) {
|
|
sfxA3Volume = 1.0;
|
|
}
|
|
}
|
|
}
|
|
if (2.0 <= minecartVolume) {
|
|
minecartVolume = 2.0;
|
|
}
|
|
LAB_00801544:
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7084))));
|
|
if (0.5 < ABS(fVar8 - fireVolume)) {
|
|
if (fireVolume <= fVar8) {
|
|
fireVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
fireVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7084)))) = fireVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x10d,fireVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7088))));
|
|
if (0.5 < ABS(fVar8 - flyBuzzVolume)) {
|
|
if (flyBuzzVolume <= fVar8) {
|
|
flyBuzzVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
flyBuzzVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7088)))) = flyBuzzVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(4,flyBuzzVolume,flyBuzzPitch);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x708c))));
|
|
if (0.5 < ABS(fVar8 - laserLoopVolume)) {
|
|
if (laserLoopVolume <= fVar8) {
|
|
laserLoopVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
laserLoopVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x708c)))) = laserLoopVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x117,laserLoopVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7094))));
|
|
if (0.5 < ABS(fVar8 - visFattyLaserVolume)) {
|
|
if (visFattyLaserVolume <= fVar8) {
|
|
visFattyLaserVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
visFattyLaserVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7094)))) = visFattyLaserVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x119,visFattyLaserVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7090))));
|
|
if (0.03 < ABS(fVar8 - sfxA3Volume)) {
|
|
if (sfxA3Volume <= fVar8) {
|
|
sfxA3Volume = fVar8 - 0.03;
|
|
}
|
|
else {
|
|
sfxA3Volume = fVar8 + 0.03;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7090)))) = sfxA3Volume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0xa3,sfxA3Volume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7098))));
|
|
if (0.03 < ABS(fVar8 - sfx1d9Volume)) {
|
|
if (sfx1d9Volume <= fVar8) {
|
|
sfx1d9Volume = fVar8 - 0.03;
|
|
}
|
|
else {
|
|
sfx1d9Volume = fVar8 + 0.03;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x7098)))) = sfx1d9Volume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x1d9,sfx1d9Volume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a0))));
|
|
if (0.03 < ABS(fVar8 - sfx1dcVolume)) {
|
|
if (sfx1dcVolume <= fVar8) {
|
|
sfx1dcVolume = fVar8 - 0.03;
|
|
}
|
|
else {
|
|
sfx1dcVolume = fVar8 + 0.03;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a0)))) = sfx1dcVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x1dc,sfx1dcVolume * 0.8,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x709c))));
|
|
if (0.03 < ABS(fVar8 - local_6c)) {
|
|
if (local_6c <= fVar8) {
|
|
local_6c = fVar8 - 0.03;
|
|
}
|
|
else {
|
|
local_6c = fVar8 + 0.03;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x709c)))) = local_6c;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x1e0,local_6c,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a4))));
|
|
if (0.5 < ABS(fVar8 - portalVolume)) {
|
|
if (portalVolume <= fVar8) {
|
|
portalVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
portalVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a4)))) = portalVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0xa1,portalVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a8))));
|
|
if (0.5 < ABS(fVar8 - minecartVolume)) {
|
|
if (minecartVolume <= fVar8) {
|
|
minecartVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
minecartVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70a8)))) = minecartVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x1f9,minecartVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70bc))));
|
|
if (0.5 < ABS(fVar8 - ballAndChainVolume)) {
|
|
if (ballAndChainVolume <= fVar8) {
|
|
ballAndChainVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
ballAndChainVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70bc)))) = ballAndChainVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x244,ballAndChainVolume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70ac))));
|
|
if (0.5 < ABS(fVar8 - sfx217Volume)) {
|
|
if (sfx217Volume <= fVar8) {
|
|
sfx217Volume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
sfx217Volume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70ac)))) = sfx217Volume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x217,sfx217Volume,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b0))));
|
|
if (0.5 < ABS(fVar8 - sfx22eVolume)) {
|
|
if (sfx22eVolume <= fVar8) {
|
|
sfx22eVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
sfx22eVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b0)))) = sfx22eVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x22e,sfx22eVolume * 1.3,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b8))));
|
|
if (0.5 < ABS(fVar8 - dogmaVolume)) {
|
|
if (dogmaVolume <= fVar8) {
|
|
dogmaVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
dogmaVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b8)))) = dogmaVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x229,dogmaVolume * 1.5,1.0);
|
|
manager = g_manager;
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b4))));
|
|
if (0.5 < ABS(fVar8 - dogmaAngelVolume)) {
|
|
if (dogmaAngelVolume <= fVar8) {
|
|
dogmaAngelVolume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
dogmaAngelVolume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70b4)))) = dogmaAngelVolume;
|
|
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::SetAmbientSound(0x22b,dogmaAngelVolume * 1.5,dogmaAngelPitch);
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70c0))));
|
|
if (0.5 < ABS(fVar8 - sfx264Volume)) {
|
|
if (sfx264Volume <= fVar8) {
|
|
sfx264Volume = fVar8 - 0.5;
|
|
}
|
|
else {
|
|
sfx264Volume = fVar8 + 0.5;
|
|
}
|
|
}
|
|
sfxManager = &g_manager->_sfxManager;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x70c0)))) = sfx264Volume;
|
|
(GHIDRA_CAST<SFXManager *>((sfxManager)))->SFXManager::SetAmbientSound(0x264,sfx264Volume,1.0);
|
|
if (-1 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x72fc))))) {
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x72fc)))) + 1;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x72fc)))) = iVar3;
|
|
if (iVar3 == 10) {
|
|
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x1cc,1.0,2,0,1.0,0.0);
|
|
return;
|
|
}
|
|
if (10 < iVar3) {
|
|
bVar1 = (GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::IsPlaying(0x1cc);
|
|
if (bVar1 == 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x72fc)))) = 0xffffffff;
|
|
}
|
|
else {
|
|
iVar3 = g_game->_currentRoomIdx;
|
|
local_14 = (float)g_game->_startingRoomIdx;
|
|
if (-1 < iVar3) {
|
|
fVar8 = (float)(GHIDRA_INT(local_14) / 0xd - iVar3 / 0xd);
|
|
fVar9 = (float)(((iVar3 / 0xd - GHIDRA_INT(local_14) / 0xd) * 0xd - iVar3) + GHIDRA_INT(local_14));
|
|
fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9);
|
|
if (0.0 < fVar8) {
|
|
fVar9 = fVar9 * (1.0 / fVar8);
|
|
}
|
|
fVar8 = (float)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((sfxManager)) + 0x72fc)))) + -10) / 60.0;
|
|
if (fVar8 <= 0.0) {
|
|
fVar8 = 0.0;
|
|
}
|
|
if (1.0 <= fVar8) {
|
|
fVar8 = 1.0;
|
|
}
|
|
(GHIDRA_CAST<SFXManager *>((&g_manager->_sfxManager)))->SFXManager::adjust_pan(0x1cc,fVar8 * fVar9);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00801ee0
|
|
void Room::UpdateGreedWave()
|
|
{
|
|
Room *game = this;
|
|
int iVar1;
|
|
Entity_Player *player;
|
|
Entity *spawned;
|
|
int enemyCount;
|
|
Game *game;
|
|
int greedWaveTimer;
|
|
uint32_t uVar2;
|
|
Vector local_10;
|
|
uint32_t *descriptorFlags;
|
|
uint32_t flagsHigh;
|
|
Manager *manager;
|
|
float *playerY;
|
|
|
|
game = g_game;
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
if (0 < game->_greedWaveTimer) {
|
|
greedWaveTimer = game->_greedWaveTimer + -1;
|
|
game->_greedWaveTimer = greedWaveTimer;
|
|
enemyCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x12c4)))) + game->_aliveEnemyCount;
|
|
iVar1 = 0;
|
|
if (0 < enemyCount) {
|
|
iVar1 = enemyCount;
|
|
}
|
|
if ((iVar1 < 1) && (0x13 < greedWaveTimer)) {
|
|
game->_greedLastBeatenWave = game->_greedModeWave;
|
|
game->_greedWaveTimer = 0x13;
|
|
}
|
|
else if (greedWaveTimer == 0) {
|
|
SpawnGreedModeWave(game,1);
|
|
game = g_game;
|
|
}
|
|
}
|
|
if ((((game->_stage == 7) && (game->_roomType == 5)) &&
|
|
((game->_levelStateFlags & 0x1000U) == 0)) &&
|
|
(uVar2 = 0,
|
|
GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT((game->_playerManager)._playerList._begin)
|
|
>> 2 != 0)) {
|
|
while( true ) {
|
|
player = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(uVar2);
|
|
playerY = &(player->_pos).y;
|
|
if (*playerY <= 320.0 && *playerY != 320.0) break;
|
|
uVar2 = uVar2 + 1;
|
|
game = g_game;
|
|
if (GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)) <= uVar2) {
|
|
return;
|
|
}
|
|
}
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(9,(g_manager->_optionsConfig)._musicVolume);
|
|
descriptorFlags = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x4)))) + 0x44));
|
|
*descriptorFlags = *descriptorFlags & 0xffffffbf;
|
|
g_game->_levelStateFlags = g_game->_levelStateFlags | 0x1000;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x4)))) + 0x10)) + 0xc)) == 0) {
|
|
uVar2 = Random();
|
|
local_10.x = (player->_pos).x;
|
|
local_10.y = (player->_pos).y;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(0x14,0,&local_10,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0xffffffff,
|
|
uVar2,0);
|
|
flagsHigh = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4));
|
|
iVar1 = *GHIDRA_CAST<int *>(spawned);
|
|
*GHIDRA_CAST<uint32_t *>(&spawned->_flags) = GHIDRA_UINT(spawned->_flags) & 0xfffffffb;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawned->_flags) + 4)) = flagsHigh;
|
|
(**(code **)(iVar1 + 0xc))();
|
|
}
|
|
TriggerOutput(game,0);
|
|
manager = g_manager;
|
|
local_10.x = 2.66247e-43;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10.x),1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 008020d0
|
|
void Room::update_deaths_list()
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
Entity_Player *player;
|
|
uint32_t *playerSlot;
|
|
uint32_t uVar3;
|
|
Entity *rootParent;
|
|
Vector *freePos;
|
|
Entity *rewardPickup;
|
|
Room *in_ECX;
|
|
void *playersEnd;
|
|
PlayerManager *playerManager;
|
|
RNG rng;
|
|
Vector freePosOut;
|
|
Vector playerPos;
|
|
Vector markerPos;
|
|
uint32_t pickupVariant;
|
|
uint32_t variantRoll;
|
|
int *local_1c;
|
|
int *local_18;
|
|
Entity *local_14;
|
|
Room *savedRoom;
|
|
uint32_t playerIndex;
|
|
int rngShift3;
|
|
int candidate;
|
|
uint8_t *markedEnemyRef;
|
|
Entity *nextParent;
|
|
Room *room;
|
|
|
|
savedRoom = in_ECX;
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x212,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
markedEnemyRef = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bb8)));
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bbc))) = 1;
|
|
}
|
|
else if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bbc))) == '\0') {
|
|
if ((*GHIDRA_CAST<int *>(markedEnemyRef) == 0) && (uVar3 = 0, (in_ECX->_entityList)._updateEL._size != 0)) {
|
|
do {
|
|
rewardPickup = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((in_ECX->_entityList)._updateEL)) + 0x4)))) + uVar3 * 4));
|
|
bVar2 = (GHIDRA_CAST<Entity *>((rewardPickup)))->Entity::IsVulnerableEnemy(GHIDRA_CAST<Entity *>(0x0));
|
|
if ((bVar2 != 0) &&
|
|
((((rewardPickup->_flags & 0x20000000) == 0 &&
|
|
((rewardPickup->_flags & 0x40000000000) == 0)) && (rewardPickup->_type != 0x322)))) {
|
|
bVar2 = (GHIDRA_CAST<Entity *>((rewardPickup)))->Entity::DoesEntityShareStatus();
|
|
if ((bVar2 != 0) &&
|
|
(nextParent = GHIDRA_CAST<Entity *>(rewardPickup->_parent),
|
|
GHIDRA_CAST<Entity *>(rewardPickup->_parent) != GHIDRA_CAST<Entity *>(0x0))) {
|
|
do {
|
|
rootParent = nextParent;
|
|
nextParent = GHIDRA_CAST<Entity *>(rootParent->_parent);
|
|
} while (nextParent != GHIDRA_CAST<Entity *>(0x0));
|
|
if (rootParent != rewardPickup) goto LAB_008022c4;
|
|
}
|
|
markedEnemyRef = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bb8)));
|
|
candidate = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((in_ECX->_entityList)._updateEL)) + 0x4)))) + uVar3 * 4));
|
|
if (*GHIDRA_CAST<int *>(markedEnemyRef) != candidate) {
|
|
if (*GHIDRA_CAST<int *>(markedEnemyRef) != 0) {
|
|
local_18 = GHIDRA_CAST<int *>(markedEnemyRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_18);
|
|
}
|
|
*GHIDRA_CAST<int *>(markedEnemyRef) = candidate;
|
|
if (candidate != 0) {
|
|
msvc::multiset<unsigned_int>::insert(markedEnemyRef);
|
|
}
|
|
}
|
|
uVar3 = Random();
|
|
markerPos.x = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(markedEnemyRef) + 0x33c));
|
|
markerPos.y = *GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>(markedEnemyRef) + 0x340));
|
|
local_14 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x6d,&markerPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
|
candidate = *GHIDRA_CAST<int *>(markedEnemyRef);
|
|
playerSlot = &local_14->_target;
|
|
if (local_14->_target != 0) {
|
|
local_1c = playerSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_1c);
|
|
}
|
|
*playerSlot = candidate;
|
|
if (candidate != 0) {
|
|
msvc::multiset<unsigned_int>::insert(playerSlot);
|
|
}
|
|
local_14->Update();
|
|
break;
|
|
}
|
|
LAB_008022c4:
|
|
uVar3 = uVar3 + 1;
|
|
} while (uVar3 < GHIDRA_UINT((in_ECX->_entityList)._updateEL._size));
|
|
}
|
|
goto LAB_0080212a;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(markedEnemyRef) != 0) {
|
|
local_1c = GHIDRA_CAST<int *>(markedEnemyRef);
|
|
msvc::multiset<unsigned_int>::erase(&local_1c);
|
|
*GHIDRA_CAST<uint32_t *>(markedEnemyRef) = 0;
|
|
}
|
|
LAB_0080212a:
|
|
if (((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0x44)) & 1) != 0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bbc))) == '\0')) {
|
|
playerManager = &g_game->_playerManager;
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0x60));
|
|
rng._shift1 = 1;
|
|
rng._shift2 = 0x1b;
|
|
rngShift3 = 0x1b;
|
|
rng._shift3 = 0x1b;
|
|
playerIndex = 0;
|
|
rng._seed = uVar3;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
|
|
2 != 0) {
|
|
do {
|
|
playersEnd = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(playersEnd) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playersEnd = (playerManager->_playerList)._end;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (playerIndex < GHIDRA_UINT((GHIDRA_INT(playersEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + playerIndex;
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>(*playerSlot);
|
|
if (player->_variant == 0) {
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x212,0);
|
|
room = savedRoom;
|
|
if (bVar2 != 0) {
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = uVar3 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar3;
|
|
rng._seed = uVar3 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar3;
|
|
if ((rng._seed & 3U) == 0) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::add_random_stat_up(&rng);
|
|
rngShift3 = rng._shift3;
|
|
in_ECX = savedRoom;
|
|
uVar3 = rng._seed;
|
|
}
|
|
else {
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
variantRoll = GHIDRA_UINT(rng._seed) >> ((uint8_t)rng._shift1 & 0x1f) ^ rng._seed;
|
|
variantRoll = variantRoll << ((uint8_t)rng._shift2 & 0x1f) ^ variantRoll;
|
|
variantRoll = variantRoll >> ((uint8_t)rngShift3 & 0x1f) ^ variantRoll;
|
|
pickupVariant = *GHIDRA_CAST<uint32_t *>((&DAT_00b6c9c0 + (variantRoll % 5) * 4));
|
|
local_14 = GHIDRA_CAST<Entity *>(0x0);
|
|
if (pickupVariant == 0x14) {
|
|
local_14 = GHIDRA_CAST<Entity *>(0x2);
|
|
}
|
|
else if (pickupVariant == 10) {
|
|
local_14 = GHIDRA_CAST<Entity *>(0x3);
|
|
}
|
|
if ((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x1bc0)))) == g_vectorZero.x) &&
|
|
(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x1bc4)))) == g_vectorZero.y)) {
|
|
playerPos.y = (player->_pos).y;
|
|
playerPos.x = (player->_pos).x;
|
|
freePos = FindFreePickupSpawnPosition(savedRoom,&freePosOut,&playerPos,40.0,0,0,0);
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x1bc0)))) = freePos->x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x1bc4)))) = freePos->y;
|
|
}
|
|
if (variantRoll == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = variantRoll >> ((uint8_t)rng._shift1 & 0x1f) ^ variantRoll;
|
|
uVar3 = uVar3 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar3;
|
|
rng._seed = uVar3;
|
|
rewardPickup = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,pickupVariant,GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x1bc0)))),
|
|
&g_vectorZero,GHIDRA_CAST<Entity *>(player),GHIDRA_UINT(local_14),uVar3);
|
|
rewardPickup->Update();
|
|
in_ECX = room;
|
|
}
|
|
}
|
|
}
|
|
playerManager = &g_game->_playerManager;
|
|
playerIndex = playerIndex + 1;
|
|
} while (playerIndex <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x1bbc))) = 1;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 008024f0
|
|
void Room::update_pressure_plates()
|
|
{
|
|
uint32_t *puVar1;
|
|
int iVar2;
|
|
Entity_NPC *fireplace;
|
|
int remaining;
|
|
int plateCount;
|
|
void **gridSlot;
|
|
int iVar3;
|
|
uint32_t i;
|
|
void *gridEntity;
|
|
bool isRewardPlatePressed;
|
|
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 1 & 1) == 0) {
|
|
isRewardPlatePressed = false;
|
|
remaining = this->_gridHeight * this->_gridWidth;
|
|
plateCount = 0;
|
|
iVar3 = 0;
|
|
if (0 < remaining) {
|
|
gridSlot = this->_gridEntities;
|
|
plateCount = 0;
|
|
do {
|
|
gridEntity = *gridSlot;
|
|
if ((gridEntity != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 4)) == 0x14)) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 8)) == 0) {
|
|
plateCount = plateCount + 1;
|
|
iVar2 = iVar3 + 1;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0xc)) != 0) {
|
|
iVar2 = iVar3;
|
|
}
|
|
iVar3 = iVar2;
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 8)) == 9) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0xc)) != 0)) {
|
|
isRewardPlatePressed = true;
|
|
}
|
|
}
|
|
gridSlot = gridSlot + 1;
|
|
remaining = remaining + -1;
|
|
} while (remaining != 0);
|
|
}
|
|
this->_hasTriggerPressurePlates = plateCount != 0;
|
|
if (((plateCount != 0) || (isRewardPlatePressed)) && (iVar3 == 0)) {
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
*puVar1 = *puVar1 | 2;
|
|
i = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + i * 4));
|
|
if ((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (*GHIDRA_CAST<int *>((iVar3 + 0x28)) == 1)) ||
|
|
(*GHIDRA_CAST<int *>((iVar3 + 0x28)) - 10U < 0x3de)) &&
|
|
(fireplace = (Entity_NPC *)
|
|
__RTDynamicCast(iVar3,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor
|
|
,&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0)
|
|
, fireplace->_type == 0x21)) {
|
|
iVar3 = fireplace->_variant;
|
|
if (iVar3 == 1) {
|
|
(GHIDRA_CAST<Entity_NPC *>((fireplace)))->Entity_NPC::Morph(0x21,0,fireplace->_subtype,-1);
|
|
fireplace->_state = 0;
|
|
fireplace->Update();
|
|
iVar3 = fireplace->_variant;
|
|
}
|
|
if (iVar3 == 3) {
|
|
(GHIDRA_CAST<Entity_NPC *>((fireplace)))->Entity_NPC::Morph(fireplace->_type,2,fireplace->_subtype,-1);
|
|
fireplace->_state = 0;
|
|
fireplace->Update();
|
|
}
|
|
}
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00802670
|
|
void Room::update_door_targets()
|
|
{
|
|
Room *door = this;
|
|
int idx;
|
|
int TargetRoomType;
|
|
RoomDescriptor *pRVar1;
|
|
uint32_t slot;
|
|
int slotOffset;
|
|
GridEntity_Door *door;
|
|
|
|
slot = 0;
|
|
slotOffset = 0x1c;
|
|
do {
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x18 + (slot >> 5) * 4)) & 1 << ((uint8_t)slot & 0x1f)) !=
|
|
0) {
|
|
MakeDoor(door,slot);
|
|
door = *GHIDRA_CAST<GridEntity_Door **>((GHIDRA_CAST<char *>(door->_gridEntities) + slotOffset + 0x6e4));
|
|
idx = *GHIDRA_CAST<int *>((slotOffset + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4))))));
|
|
if (-1 < idx) {
|
|
pRVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(idx,-1);
|
|
if ((pRVar1->Data != (void *)0x0) && (door != GHIDRA_CAST<GridEntity_Door *>(0x0))) {
|
|
pRVar1 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(idx,-1);
|
|
TargetRoomType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pRVar1->Data) + 8));
|
|
door->_targetRoomIdx = idx;
|
|
GridEntity_Door::SetRoomTypes
|
|
(door,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x10)) + 8)),TargetRoomType);
|
|
door->_slot = slot;
|
|
}
|
|
}
|
|
}
|
|
slotOffset = slotOffset + 4;
|
|
slot = slot + 1;
|
|
} while (slotOffset < 0x3c);
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::UpdateVisibility();
|
|
return;
|
|
}
|
|
|
|
// 00802980
|
|
void Room::Update()
|
|
{
|
|
uint32_t *puVar1;
|
|
std_vector *psVar2;
|
|
uint8_t *puVar3;
|
|
int iVar4;
|
|
int iVar5;
|
|
int iVar6;
|
|
int iVar7;
|
|
int iVar8;
|
|
int iVar9;
|
|
int iVar10;
|
|
int iVar11;
|
|
GridEntity_Door *this_00;
|
|
code *pcVar12;
|
|
ColorMod color;
|
|
RNG rng;
|
|
uint64_t qVar13;
|
|
float fVar14;
|
|
Level *this_01;
|
|
uint8_t bVar15;
|
|
Entity_Player *player;
|
|
int iVar17;
|
|
float fVar18;
|
|
uint32_t uVar19;
|
|
Entity_Pickup *pEVar20;
|
|
uint32_t uVar21;
|
|
char cVar16;
|
|
Game *pGVar22;
|
|
Vector *pVVar23;
|
|
void *pvVar24;
|
|
uint8_t *pbVar25;
|
|
Vector *pVVar26;
|
|
std_vector *psVar27;
|
|
int *piVar28;
|
|
GridEntity_Pit *this_02;
|
|
Entity_NPC *this_03;
|
|
int iVar29;
|
|
short sVar30;
|
|
void *pvVar31;
|
|
uint8_t *pbVar32;
|
|
uint32_t clearDelay;
|
|
int iVar33;
|
|
uint64_t *allocatedBytes;
|
|
uint32_t *puVar34;
|
|
float *pfVar35;
|
|
void **ppvVar36;
|
|
PlayerManager *playerManager;
|
|
Entity *pEVar37;
|
|
int *gridOccupiedIter;
|
|
float *segmentedListEnd;
|
|
Entity *listedEntity;
|
|
bool bVar38;
|
|
Game *pGVar39;
|
|
float fVar40;
|
|
Color aCStackY_2148 [128];
|
|
uint32_t in_stack_fffff4f4;
|
|
uint32_t in_stack_fffff4f8;
|
|
Entity *in_stack_fffff4fc;
|
|
Vector *in_stack_fffff500;
|
|
uint8_t isAllowPits;
|
|
uint8_t isAvoidDoors;
|
|
EntityRef slowSource;
|
|
uint8_t local_a90 [12];
|
|
int local_a84;
|
|
uint64_t myosotisRngShifts;
|
|
uint32_t myosotisRngShift3;
|
|
uint8_t local_a70 [16];
|
|
Vector local_a60;
|
|
uint8_t local_a58 [24];
|
|
Vector local_a40;
|
|
Vector local_a38;
|
|
Vector local_a30;
|
|
Vector local_a28;
|
|
Vector local_a20;
|
|
Vector local_a18;
|
|
void *local_a10;
|
|
float *local_a0c;
|
|
float *local_a08;
|
|
Vector local_a04;
|
|
uint8_t local_9f8 [12];
|
|
void *local_9ec;
|
|
Vector local_9e8;
|
|
Vector local_9e0;
|
|
char isAnyGenesisOutcome;
|
|
Vector local_9d4;
|
|
Level *local_9cc;
|
|
Vector local_9c8;
|
|
RNG *local_9c0;
|
|
Game *local_9bc;
|
|
std_vector local_9b8;
|
|
ItemPool *local_9ac;
|
|
Entity *local_9a8;
|
|
Game *local_9a4;
|
|
Game *local_9a0;
|
|
Entity *local_99c;
|
|
int gridOccupied [448];
|
|
int pairOffsets [3];
|
|
int aiStack_28c [5];
|
|
float local_278;
|
|
uint32_t uStack_274;
|
|
uint32_t uStack_270;
|
|
int iStack_26c;
|
|
int local_268;
|
|
int iStack_264;
|
|
int iStack_260;
|
|
int iStack_25c;
|
|
int local_258;
|
|
int iStack_254;
|
|
uint32_t uStack_250;
|
|
uint32_t uStack_24c;
|
|
uint32_t local_248;
|
|
char acStack_244 [48];
|
|
void *pvStack_214;
|
|
void *pvStack_210;
|
|
void *pvStack_20c;
|
|
void *local_208;
|
|
float fStack_204;
|
|
uint32_t uStack_200;
|
|
int iStack_1fc;
|
|
int cornerTopLeft;
|
|
int cornerTopRight;
|
|
int cornerBottomLeft;
|
|
int cornerBottomRight;
|
|
int local_1e8 [113];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
RNG *genesisRng;
|
|
Manager *manager;
|
|
|
|
pGVar22 = g_game;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_1e8 + 0x79));
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00b014a8;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((local_1e8 + 0x76));
|
|
ExceptionList = &local_1c;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7220))) = 0;
|
|
manager = g_manager;
|
|
local_9cc = GHIDRA_CAST<Level *>(this);
|
|
piVar28 = local_1e8 + 0x79;
|
|
if (*GHIDRA_CAST<char *>(this) != '\0') {
|
|
piVar28 = local_1e8 + 0x79;
|
|
if (pGVar22->_frameCount - this->_enterFrame == 1) {
|
|
piVar28 = local_1e8 + 0x79;
|
|
if (this->_roomType == 5) {
|
|
piVar28 = local_1e8 + 0x79;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x40)) == 1) {
|
|
if ((((pGVar22->_difficulty == 2) || (pGVar22->_difficulty == 3)) &&
|
|
(pGVar22->_stage == 7)) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10)) == 0)) {
|
|
piVar28 = local_1e8 + 0x79;
|
|
if ((pGVar22->_levelStateFlags & 0x1000U) == 0) goto LAB_00802a8d;
|
|
}
|
|
piVar28 = local_1e8 + 0x79;
|
|
if (this->_bossId != 0) {
|
|
local_9b8._capacity = GHIDRA_CAST<Entity *>(0xbe);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_9b8._capacity));
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
in_stack_fffff4f8 = 0x802a87;
|
|
in_stack_fffff4fc = local_9b8._capacity;
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_9b8._capacity),1.0,2,0,1.0,0.0);
|
|
pGVar22 = g_game;
|
|
piVar28 = GHIDRA_CAST<int *>(puStack_20);
|
|
}
|
|
}
|
|
}
|
|
LAB_00802a8d:
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(piVar28);
|
|
piVar28 = GHIDRA_CAST<int *>(puStack_20);
|
|
if ((pGVar22->_levelStateFlags & 0x80000U) == 0) {
|
|
pGVar22->_levelStateFlags = pGVar22->_levelStateFlags | 0x80000;
|
|
iVar17 = this->_gridWidth;
|
|
iVar33 = this->_gridHeight;
|
|
if ((iVar17 < 2) || (iVar33 < 2)) {
|
|
cornerTopLeft = -1;
|
|
}
|
|
else {
|
|
cornerTopLeft = iVar17 + 1;
|
|
}
|
|
local_9a4 = GHIDRA_CAST<Game *>((iVar17 + -2));
|
|
if (((GHIDRA_INT(local_9a4) < 0) || (iVar17 <= GHIDRA_INT(local_9a4))) || (iVar33 < 2)) {
|
|
cornerTopRight = -1;
|
|
if (1 < this->_gridWidth) goto LAB_00802b01;
|
|
LAB_00802b10:
|
|
cornerBottomLeft = -1;
|
|
}
|
|
else {
|
|
cornerTopRight = iVar17 + GHIDRA_INT(local_9a4);
|
|
LAB_00802b01:
|
|
iVar17 = iVar33 + -2;
|
|
if ((iVar17 < 0) || (iVar33 <= iVar17)) goto LAB_00802b10;
|
|
cornerBottomLeft = iVar17 * this->_gridWidth + 1;
|
|
}
|
|
iVar17 = iVar33 + -2;
|
|
if ((((GHIDRA_INT(local_9a4) < 0) || (iVar29 = this->_gridWidth, iVar29 <= GHIDRA_INT(local_9a4))) ||
|
|
(iVar17 < 0)) || (iVar33 <= iVar17)) {
|
|
cornerBottomRight = -1;
|
|
}
|
|
else {
|
|
cornerBottomRight = iVar17 * iVar29 + iVar29 + -2;
|
|
}
|
|
if ((pGVar22->_myosotisPickups)._begin != (pGVar22->_myosotisPickups)._end) {
|
|
FUN_00752830();
|
|
local_14 = 0.0;
|
|
player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0x89);
|
|
pfVar35 = GHIDRA_CAST<float *>(&DAT_00000004);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
iVar17 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetTrinketMultiplier(0x89);
|
|
if (iVar17 == 2) {
|
|
pfVar35 = GHIDRA_CAST<float *>(&DAT_00000006);
|
|
}
|
|
else if (iVar17 == 3) {
|
|
pfVar35 = GHIDRA_CAST<float *>(&DAT_00000008);
|
|
}
|
|
}
|
|
myosotisRngShifts = 0x900000001;
|
|
local_9b8._end = (void *)((GHIDRA_INT(local_a0c) - GHIDRA_INT(local_a10)) / 0x78);
|
|
if (pfVar35 < local_9b8._end) {
|
|
local_9b8._end = pfVar35;
|
|
}
|
|
local_9a4 = GHIDRA_CAST<Game *>(0x0);
|
|
local_9bc = GHIDRA_CAST<Game *>(&DAT_0000001d);
|
|
myosotisRngShift3 = 0x1d;
|
|
if (0 < GHIDRA_INT(local_9b8._end)) {
|
|
local_99c = GHIDRA_CAST<Entity *>(0x0);
|
|
local_9a8 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
do {
|
|
fVar18 = (float)(GHIDRA_INT(local_9b8._end) - GHIDRA_INT(local_9a4));
|
|
if (local_9a8 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_9a8 = GHIDRA_CAST<Entity *>(fVar18);
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = GHIDRA_UINT(local_9a8) >> ((uint8_t)myosotisRngShifts & 0x1f) ^ GHIDRA_UINT(local_9a8);
|
|
uVar19 = uVar19 << (SUB81(myosotisRngShifts,4) & 0x1f) ^ uVar19;
|
|
local_9c0 = GHIDRA_CAST<RNG *>((uVar19 >> ((uint8_t)local_9bc & 0x1f) ^ uVar19));
|
|
uVar19 = 0;
|
|
if (fVar18 != 0.0) {
|
|
uVar19 = GHIDRA_UINT(local_9c0) % GHIDRA_UINT(fVar18);
|
|
}
|
|
local_9a8 = GHIDRA_CAST<Entity *>(fVar18);
|
|
if (GHIDRA_CAST<Game *>((uVar19 + GHIDRA_INT(local_9a4))) != local_9a4) {
|
|
EntitySaveState::copy
|
|
(GHIDRA_CAST<EntitySaveState *>(&uStack_270),
|
|
(void *)(GHIDRA_INT(local_a10) + GHIDRA_INT((&local_99c->_sprite + -1)) + 0xcc));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
FUN_004d3230();
|
|
FUN_004d3230();
|
|
local_14 = (float)((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8);
|
|
invoke_pending_callbacks(&uStack_270);
|
|
this = GHIDRA_CAST<Room *>(local_9cc);
|
|
}
|
|
local_9b8._begin = (void *)(GHIDRA_INT(local_a10) + GHIDRA_INT(local_99c));
|
|
if (local_9c0 == GHIDRA_CAST<RNG *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = GHIDRA_UINT(local_9c0) >> ((uint8_t)myosotisRngShifts & 0x1f) ^ GHIDRA_UINT(local_9c0);
|
|
uVar19 = uVar19 << (SUB81(myosotisRngShifts,4) & 0x1f) ^ uVar19;
|
|
local_9a8 = GHIDRA_CAST<Entity *>((uVar19 >> ((uint8_t)local_9bc & 0x1f) ^ uVar19));
|
|
uVar19 = (GHIDRA_CAST<Game *>(local_9b8._begin))->_roomList[0]._doors[1];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uVar21)) + 0x0))) = (GHIDRA_CAST<Game *>(local_9b8._begin))->_bossChallenge;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uVar21)) + 0x1))) = (GHIDRA_CAST<Game *>(local_9b8._begin))->_devilRoomDisabled;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(uVar21)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(local_9b8._begin)))) + 0xa))));
|
|
local_a38.x = (float)(local_1e8[(GHIDRA_UINT(local_9a8) & 3) - 4] % (GHIDRA_CAST<Level *>(this))->_curses)
|
|
* 40.0 + 40.0;
|
|
local_a38.y = (float)(local_1e8[(GHIDRA_UINT(local_9a8) & 3) - 4] / (GHIDRA_CAST<Level *>(this))->_curses)
|
|
* 40.0 + 120.0;
|
|
in_stack_fffff500 =
|
|
FindFreePickupSpawnPosition(GHIDRA_CAST<Room *>(local_9cc),&local_a60,&local_a38,24.0,0,0,0);
|
|
pvVar31 = local_9b8._begin;
|
|
in_stack_fffff4fc = *GHIDRA_CAST<Entity **>((GHIDRA_CAST<char *>(local_9b8._begin) + 4));
|
|
in_stack_fffff4f8 = *GHIDRA_CAST<uint32_t *>(local_9b8._begin);
|
|
in_stack_fffff4f4 = 0x802dc9;
|
|
pEVar20 = (Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(in_stack_fffff4f8,GHIDRA_UINT(in_stack_fffff4fc),
|
|
in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),uVar21,uVar19);
|
|
this = GHIDRA_CAST<Room *>(local_9cc);
|
|
Entity_Pickup::RestoreState(GHIDRA_CAST<Room *>(local_9cc),pEVar20,pvVar31);
|
|
local_99c = GHIDRA_CAST<Entity *>(&(local_99c->_sprite)._animState);
|
|
local_9a4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_9a4) + 1));
|
|
pEVar20->_spawnGridIndex = -1;
|
|
} while (GHIDRA_INT(local_9a4) < GHIDRA_INT(local_9b8._end));
|
|
}
|
|
local_14 = -NAN;
|
|
msvc::vector<RoomEntry>::_Tidy();
|
|
pGVar22 = g_game;
|
|
piVar28 = GHIDRA_CAST<int *>(puStack_20);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(piVar28);
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_roomList[0xa6].GridIndex;
|
|
if (-1 < iVar17) {
|
|
if ((iVar17 == 0) && (pGVar22->_currentRoomIdx == -0xc)) {
|
|
player = (GHIDRA_CAST<Game *>((pGVar22)))->Game::GetPlayer(0);
|
|
pvVar31 = (player->_collectibleRNGs)._end;
|
|
if (GHIDRA_INT(pvVar31) - GHIDRA_INT((player->_collectibleRNGs)._begin) >> 4 < 0x26f) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Collectible ID out of bounds!\n"));
|
|
pvVar31 = (player->_collectibleRNGs)._end;
|
|
}
|
|
pvVar24 = (player->_collectibleRNGs)._begin;
|
|
uVar21 = (GHIDRA_INT(pvVar31) - GHIDRA_INT(pvVar24) >> 4) - 1;
|
|
uVar19 = 0x26e;
|
|
if (uVar21 < 0x26e) {
|
|
uVar19 = uVar21;
|
|
}
|
|
local_9c0 = GHIDRA_CAST<RNG *>((uVar19 * 0x10 + GHIDRA_INT(pvVar24)));
|
|
local_9bc = g_game;
|
|
local_9a8 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<RNG *>((local_9c0)))->RNG)::Next();
|
|
pvVar31 = (void *)0x0;
|
|
pGVar22 = GHIDRA_CAST<Game *>(0x0);
|
|
local_9ec = (void *)0x0;
|
|
pfVar35 = GHIDRA_CAST<float *>(0x0);
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x0);
|
|
local_9e8.x = 0.0;
|
|
local_9e8.y = 0.0;
|
|
local_14 = 2.8026e-45;
|
|
isAnyGenesisOutcome = '\0';
|
|
fVar18 = 0.0;
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_9bc)) + 0x1af30))));
|
|
do {
|
|
if (0 < *GHIDRA_CAST<short *>(local_99c)) {
|
|
local_9a4 = GHIDRA_CAST<Game *>(GHIDRA_INT(*GHIDRA_CAST<short *>(local_99c)));
|
|
uVar21 = GHIDRA_INT(pfVar35) - GHIDRA_INT(pvVar31) >> 3;
|
|
uVar19 = 0;
|
|
if (uVar21 != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar31) + uVar19 * 8)) == fVar18) {
|
|
piVar28 = GHIDRA_CAST<int *>((GHIDRA_INT(pvVar31) + uVar19 * 8 + 4));
|
|
*piVar28 = GHIDRA_INT((*piVar28 + GHIDRA_INT(local_9a4)));
|
|
if (*piVar28 < 0) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar31) + uVar19 * 8 + 4)) = 0;
|
|
}
|
|
goto LAB_00802f53;
|
|
}
|
|
uVar19 = uVar19 + 1;
|
|
} while (uVar19 < uVar21);
|
|
}
|
|
if (GHIDRA_INT(local_9a4) < 1) {
|
|
LAB_00802f53:
|
|
}
|
|
else {
|
|
local_a30.x = fVar18;
|
|
local_a30.y = (float)local_9a4;
|
|
if (GHIDRA_CAST<Game *>(pfVar35) != local_9a0) {
|
|
*pfVar35 = fVar18;
|
|
pfVar35[1] = (float)local_9a4;
|
|
pfVar35 = pfVar35 + 2;
|
|
local_9e8.x = (float)pfVar35;
|
|
goto LAB_00802f53;
|
|
}
|
|
msvc::vector<8byte>::_Emplace_reallocate();
|
|
local_9a0 = GHIDRA_CAST<Game *>(local_9e8.y);
|
|
pvVar31 = local_9ec;
|
|
pfVar35 = GHIDRA_CAST<float *>(local_9e8.x);
|
|
}
|
|
isAnyGenesisOutcome = '\x01';
|
|
pGVar22 = local_9a0;
|
|
}
|
|
this = GHIDRA_CAST<Room *>(local_9cc);
|
|
fVar18 = (float)(GHIDRA_INT(fVar18) + 1);
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x2))));
|
|
} while (GHIDRA_UINT(fVar18) < 0x1f);
|
|
if (isAnyGenesisOutcome == '\0') {
|
|
local_14 = -NAN;
|
|
if (pvVar31 == (void *)0x0) goto LAB_008030f1;
|
|
uVar19 = (GHIDRA_INT(pGVar22) - GHIDRA_INT(pvVar31) >> 3) * 8;
|
|
pvVar24 = pvVar31;
|
|
if (0xfff < uVar19) {
|
|
pvVar24 = *(void **)(GHIDRA_CAST<char *>(pvVar31) + -4);
|
|
uVar19 = uVar19 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar31) + (-4 - GHIDRA_INT(pvVar24))))) goto LAB_008030be;
|
|
}
|
|
operator_delete(pvVar24,uVar19);
|
|
local_9ec = (void *)0x0;
|
|
local_9e8.x = 0.0;
|
|
local_9e8.y = 0.0;
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].GridIndex = 0x3c;
|
|
}
|
|
else {
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(0x803072);
|
|
rng._shift1 = 5;
|
|
rng._seed = GHIDRA_INT(local_9a8);
|
|
rng._shift2 = 9;
|
|
rng._shift3 = 7;
|
|
listedEntity = (Entity *)
|
|
(GHIDRA_CAST<WeightedOutcomePicker *>((GHIDRA_CAST<WeightedOutcomePicker *>(&local_9ec))))->WeightedOutcomePicker::PickOutcome(rng);
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>((&local_9bc->_itemPool + 1)) + GHIDRA_INT(listedEntity) * 2 + 0x4c)) =
|
|
*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>((&local_9bc->_itemPool + 1)) + GHIDRA_INT(listedEntity) * 2 + 0x4c)) + -1;
|
|
local_14 = -NAN;
|
|
local_9a8 = listedEntity;
|
|
if (local_9ec != (void *)0x0) {
|
|
uVar19 = GHIDRA_INT(local_9e8.y) - GHIDRA_INT(local_9ec) & 0xfffffff8;
|
|
pvVar31 = local_9ec;
|
|
if (0xfff < uVar19) {
|
|
pvVar31 = *(void **)(GHIDRA_CAST<char *>(local_9ec) + -4);
|
|
uVar19 = uVar19 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_9ec) + (-4 - GHIDRA_INT(pvVar31))))) {
|
|
LAB_008030be:
|
|
local_14 = -NAN;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar31,uVar19);
|
|
local_9ec = (void *)0x0;
|
|
local_9e8.x = 0.0;
|
|
local_9e8.y = 0.0;
|
|
}
|
|
if (listedEntity == GHIDRA_CAST<Entity *>(0xffffffff)) {
|
|
LAB_008030f1:
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].GridIndex = 0x3c;
|
|
}
|
|
else {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_stageType;
|
|
local_99c = GHIDRA_CAST<Entity *>(0x0);
|
|
if (*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>((iVar17 + 0x10)) + 0x44)) != 0) {
|
|
local_9a4 = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
genesisRng = local_9c0;
|
|
local_9bc = GHIDRA_CAST<Game *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar17 + 0x10)) + 0x40)) + GHIDRA_INT(local_9a4)));
|
|
if (((local_9bc->_bossChallenge == 1) &&
|
|
(piVar28 = GHIDRA_CAST<int *>(local_9bc->_stageType), *piVar28 == 5)) &&
|
|
(((short)piVar28[1] == 100 && (*GHIDRA_CAST<short *>((GHIDRA_CAST<char *>(piVar28) + 6)) == 0)))) {
|
|
iVar17 = (short)local_9bc->_stage + 1 +
|
|
(*GHIDRA_CAST<short *>((GHIDRA_INT(&local_9bc->_stage) + 2)) + 1) * (GHIDRA_CAST<Level *>(this))->_curses;
|
|
local_9ac = &g_game->_itemPool;
|
|
uVar19 = local_9c0->_seed;
|
|
local_a04.x = (float)(iVar17 % (GHIDRA_CAST<Level *>(this))->_curses) * 40.0 + 40.0;
|
|
local_a04.y = (float)(iVar17 / (GHIDRA_CAST<Level *>(this))->_curses) * 40.0 + 120.0;
|
|
if (uVar19 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar19 = genesisRng->_seed;
|
|
if (uVar19 == 0) {
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
}
|
|
uVar19 = uVar19 >> ((uint8_t)genesisRng->_shift1 & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 << ((uint8_t)genesisRng->_shift2 & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 >> ((uint8_t)genesisRng->_shift3 & 0x1f) ^ uVar19;
|
|
genesisRng->_seed = uVar19;
|
|
local_9ac = (ItemPool *)
|
|
ItemPool::GetCollectible(local_9ac,GHIDRA_INT(local_9a8),uVar19,0,0,0);
|
|
uVar19 = genesisRng->_seed;
|
|
if (uVar19 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar19 = genesisRng->_seed;
|
|
if (uVar19 == 0) {
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
}
|
|
pGVar22 = g_game;
|
|
uVar19 = uVar19 >> ((uint8_t)genesisRng->_shift1 & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 << ((uint8_t)genesisRng->_shift2 & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 >> ((uint8_t)genesisRng->_shift3 & 0x1f) ^ uVar19;
|
|
genesisRng->_seed = uVar19;
|
|
in_stack_fffff500 = &local_a04;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x64);
|
|
in_stack_fffff4f8 = 5;
|
|
in_stack_fffff4f4 = 0x803273;
|
|
listedEntity = (GHIDRA_CAST<Game *>((pGVar22)))->Game::Spawn(5,100,in_stack_fffff500,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_9ac),uVar19);
|
|
if ((listedEntity == GHIDRA_CAST<Entity *>(0x0)) || (listedEntity->_type != 5)) {
|
|
listedEntity = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
sVar30 = *GHIDRA_CAST<short *>((GHIDRA_INT(&local_9bc->_stage) + 2));
|
|
iVar33 = local_9bc->_stage;
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
*GHIDRA_CAST<uint32_t *>(&listedEntity->_flags) = GHIDRA_UINT(listedEntity->_flags) | 0x40000;
|
|
listedEntity->_spawnGridIndex = (short)iVar33 + 1 + (sVar30 + 1) * iVar17;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&listedEntity->_flags) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&listedEntity->_flags) + 4));
|
|
if (((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0') &&
|
|
(4 < g_game->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c))))))
|
|
{
|
|
uVar19 = Random();
|
|
in_stack_fffff500 = &local_a04;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(&DAT_0000000f);
|
|
in_stack_fffff4f8 = 1000;
|
|
in_stack_fffff4f4 = 0x8032f5;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar19);
|
|
}
|
|
}
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_stageType;
|
|
local_9a4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_9a4) + 0x10));
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x1))));
|
|
} while (local_99c < GHIDRA_CAST<uint8_t *>(GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>((iVar17 + 0x10)) + 0x44)))));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].GridIndex = (GHIDRA_CAST<Level *>(this))->_roomList[0xa6].GridIndex + -1;
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x28d,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
*GHIDRA_CAST<bool *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].SafeGridIndex) = player != GHIDRA_CAST<Entity_Player *>(0x0);
|
|
bVar15 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x9f].Group),0x2a5);
|
|
manager = g_manager;
|
|
if (bVar15 != 0) {
|
|
fVar18 = time_scale_update(this);
|
|
(manager->_musicManager)._targetPitch = fVar18;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa0].Dimension) + 1)) == '\0') {
|
|
for (piVar28 = GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_roomList[0xa0].GridIndex);
|
|
piVar28 != GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_roomList[0xa0].SafeGridIndex); piVar28 = piVar28 + 4) {
|
|
if ((*GHIDRA_CAST<int *>(*piVar28) == 0) && ((GHIDRA_CAST<int *>(*piVar28))[1] == 0x40)) {
|
|
Game::start_poop_cloud_screen_effect
|
|
(GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x1e].SavedEntities),GHIDRA_CAST<ColorMod *>(&DAT_00c5d108)
|
|
);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_stageType) == -0x14) {
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(0x3e8);
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(local_a90);
|
|
in_stack_fffff4f8 = 0x8033e4;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].Dimension),
|
|
GHIDRA_CAST<EntityList_EL *>(in_stack_fffff4fc),1000,0xa1,-1,0,0);
|
|
local_14 = 4.2039e-45;
|
|
if (local_a84 == 0) {
|
|
isAvoidDoors = 0;
|
|
isAllowPits = 0;
|
|
bVar15 = 1;
|
|
fVar18 = 40.0;
|
|
pVVar23 = GetCenterPos(GHIDRA_CAST<Vector *>((local_a70 + 8)));
|
|
FindFreePickupSpawnPosition(this,&local_a18,pVVar23,fVar18,bVar15,isAllowPits,isAvoidDoors);
|
|
uVar19 = Random();
|
|
in_stack_fffff500 = &local_a18;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0xa1);
|
|
in_stack_fffff4f8 = 1000;
|
|
in_stack_fffff4f4 = 0x803455;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xa1,in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
g_game->_lastRoomIdx + 1000,uVar19);
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>((*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<int *>(local_a90))) + 0x4))) + 0x30)) = g_game->_lastRoomIdx + 1000;
|
|
}
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_INT(&(GHIDRA_CAST<Level *>(this))->_stage) + 1)) != '\0') &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))) == g_game->_frameCount)) {
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x5c));
|
|
local_9a4 = GHIDRA_CAST<Game *>(&DAT_00000007);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x8))) = &DAT_00000007;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) = (void *)0x5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x4))) = (void *)0x9;
|
|
FindFreePickupSpawnPosition(this,&local_9e0,GHIDRA_CAST<Vector *>((GHIDRA_CAST<Level *>(this))->_roomList),0.0,1,0,0);
|
|
if (uVar19 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = uVar19 >> (local_9f8[0] & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 << (local_9f8[4] & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 >> ((uint8_t)local_9a4 & 0x1f) ^ uVar19;
|
|
uVar21 = uVar19 % 100;
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x32);
|
|
if (uVar21 < 4) {
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x35);
|
|
}
|
|
else if (uVar21 < 9) {
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x34);
|
|
}
|
|
else if (uVar21 < 0x13) {
|
|
local_9a0 = GHIDRA_CAST<Game *>(&DAT_00000033);
|
|
}
|
|
else if (uVar21 < 0x1d) {
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x168);
|
|
}
|
|
else if (uVar21 < 0x36) {
|
|
local_9a0 = GHIDRA_CAST<Game *>(&DAT_0000003c);
|
|
}
|
|
uVar21 = Random();
|
|
in_stack_fffff4f4 = 0x8035a6;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(local_9a0),&local_9e0,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar21);
|
|
in_stack_fffff500 = &local_a28;
|
|
local_a28.x = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex + 0.0;
|
|
local_a28.y = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].Dimension + 32.0;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(local_a70);
|
|
in_stack_fffff4f8 = 0x8035f2;
|
|
pVVar23 = FindFreePickupSpawnPosition
|
|
(this,GHIDRA_CAST<Vector *>(in_stack_fffff4fc),in_stack_fffff500,0.0,1,0,0);
|
|
local_9e0.x = pVVar23->x;
|
|
local_9e0.y = pVVar23->y;
|
|
if (uVar19 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = uVar19 >> (local_9f8[0] & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 << (local_9f8[4] & 0x1f) ^ uVar19;
|
|
listedEntity = GHIDRA_CAST<Entity *>((uVar19 >> ((uint8_t)local_9a4 & 0x1f) ^ uVar19));
|
|
uVar19 = GHIDRA_UINT(listedEntity) % 100;
|
|
local_9a8 = listedEntity;
|
|
if (uVar19 < 0x19) {
|
|
uVar19 = Random();
|
|
uVar21 = 0x31;
|
|
LAB_0080366d:
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x12c);
|
|
LAB_0080377c:
|
|
in_stack_fffff500 = &local_9e0;
|
|
in_stack_fffff4f8 = 5;
|
|
in_stack_fffff4f4 = 0x803789;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,GHIDRA_UINT(in_stack_fffff4fc),in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
uVar21,uVar19);
|
|
}
|
|
else if (uVar19 < 0x32) {
|
|
if (((g_manager->_persistentGameData)._achievements[0x168] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
uVar19 = Random();
|
|
uVar21 = 0x7a;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x15e);
|
|
goto LAB_0080377c;
|
|
}
|
|
}
|
|
else if (uVar19 < 0x3c) {
|
|
if (((g_manager->_persistentGameData)._achievements[0x273] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
uVar19 = Random();
|
|
uVar21 = 0x5a;
|
|
goto LAB_0080366d;
|
|
}
|
|
}
|
|
else if ((uVar19 < 0x3d) &&
|
|
(((g_manager->_persistentGameData)._achievements[0x16e] != 0 ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))) {
|
|
uVar19 = Random();
|
|
uVar21 = 0x20b;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x64);
|
|
goto LAB_0080377c;
|
|
}
|
|
if (listedEntity == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = GHIDRA_UINT(listedEntity) >> (local_9f8[0] & 0x1f) ^ GHIDRA_UINT(listedEntity);
|
|
uVar19 = uVar19 << (local_9f8[4] & 0x1f) ^ uVar19;
|
|
if (((uVar19 >> ((uint8_t)local_9a4 & 0x1f) ^ uVar19) & 3) == 0) {
|
|
local_a40.y = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].Dimension;
|
|
local_a40.x = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
FindFreePickupSpawnPosition(this,GHIDRA_CAST<Vector *>((local_a58 + 0x10)),&local_a40,0.0,1,0,0);
|
|
uVar19 = Random();
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>((local_a58 + 0x10));
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x5a);
|
|
in_stack_fffff4f8 = 5;
|
|
in_stack_fffff4f4 = 0x803822;
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x5a,in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar19);
|
|
}
|
|
}
|
|
local_14 = -NAN;
|
|
if (local_a90[0] == '\0') {
|
|
local_14 = 5.60519e-45;
|
|
tracked_alloc(1,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_a90)) + 0x4))),0);
|
|
local_14 = -NAN;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < DAT_00c82670) &&
|
|
(_Init_thread_header(), DAT_00c82670 == -1)) {
|
|
_atexit(FUN_00b16550);
|
|
_Init_thread_footer();
|
|
}
|
|
if (DAT_00c82674 != DAT_00c82678) {
|
|
DAT_00c82678 = DAT_00c82674;
|
|
}
|
|
if (((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0') &&
|
|
(g_game->_frameCount == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))))) {
|
|
if ((g_game->_challenge == 0x28) &&
|
|
(local_9a4 = GHIDRA_CAST<Game *>(0x0), (GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed != 0)) {
|
|
do {
|
|
pGVar22 = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].PoopCount) +
|
|
GHIDRA_INT(local_9a4) * 4));
|
|
if ((pGVar22 == GHIDRA_CAST<Game *>(0x0)) ||
|
|
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 ||
|
|
(pGVar22->_roomList[0].OverrideData != (void *)0x1)) &&
|
|
(0x3dd < GHIDRA_INT(pGVar22->_roomList[0].OverrideData) - 10U)))) {
|
|
local_9bc = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
else {
|
|
local_9bc = pGVar22;
|
|
if ((((((*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pGVar22->_roomList[1])) + 0x9c)))) & 0x20000000) == 0) &&
|
|
(cVar16 = (**(code **)(pGVar22->_stage + 0x48))(), cVar16 != '\0')) &&
|
|
((-1 < pGVar22->_roomList[4]._doors[7] &&
|
|
((pvVar31 = pGVar22->_roomList[0].OverrideData, pvVar31 != (void *)0x2d &&
|
|
(pvVar31 != (void *)0x54)))))) && (pvVar31 != (void *)0x112)) &&
|
|
((pvVar31 != (void *)0x113 &&
|
|
((pvVar31 != (void *)0x4e || (pGVar22->_roomList[0].AllowedDoors != 10)))))) {
|
|
if (DAT_00c82678 == DAT_00c8267c) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
}
|
|
else {
|
|
*DAT_00c82678 = pGVar22;
|
|
DAT_00c82678 = DAT_00c82678 + 1;
|
|
}
|
|
}
|
|
}
|
|
local_9a4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_9a4) + 1));
|
|
} while (local_9a4 < GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed));
|
|
}
|
|
local_9a8 = GHIDRA_CAST<Entity *>(PlayerManager)::GetGFuelCount();
|
|
if ((3 < GHIDRA_INT(local_9a8)) &&
|
|
(local_9b8._begin = GHIDRA_CAST<Game *>(0x0), (GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed != 0)) {
|
|
do {
|
|
pGVar22 = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].PoopCount) +
|
|
GHIDRA_INT(local_9b8._begin) * 4));
|
|
if ((pGVar22 == GHIDRA_CAST<Game *>(0x0)) ||
|
|
(((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 0x28)) != 1)) &&
|
|
(0x3dd < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 0x28)) - 10U)))) {
|
|
local_9a4 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
else {
|
|
local_9a4 = pGVar22;
|
|
if ((((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pGVar22) + 0x168)) & 0x20000000) == 0) &&
|
|
(cVar16 = (**(code **)(pGVar22->_stage + 0x48))(), cVar16 != '\0')) &&
|
|
((-1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 0x32c)) &&
|
|
(cVar16 = (**(code **)(pGVar22->_stage + 0x4c))(), cVar16 == '\0')))) {
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_9a8[-1])) + 0x40d))));
|
|
do {
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pGVar22) + 0x3dc));
|
|
if (uVar19 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pGVar22) + 0x3dc));
|
|
if (uVar19 == 0) {
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
}
|
|
uVar19 = uVar19 >> ((uint8_t)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 0x3e0)) & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 << ((uint8_t)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 0x3e4)) & 0x1f) ^ uVar19;
|
|
uVar19 = uVar19 >> ((uint8_t)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar22) + 1000)) & 0x1f) ^ uVar19;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pGVar22) + 0x3dc)) = uVar19;
|
|
if ((uVar19 & 1) == 0) {
|
|
if (DAT_00c82678 == DAT_00c8267c) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
pGVar22 = local_9a4;
|
|
}
|
|
else {
|
|
*DAT_00c82678 = pGVar22;
|
|
DAT_00c82678 = DAT_00c82678 + 1;
|
|
}
|
|
}
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_99c[-1])) + 0x40f))));
|
|
} while (0 < GHIDRA_INT(local_99c));
|
|
}
|
|
}
|
|
local_9b8._begin = (void *)(GHIDRA_INT(local_9b8._begin) + 1);
|
|
} while (local_9b8._begin < GHIDRA_CAST<Game *>((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed));
|
|
}
|
|
}
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9f].DisplayFlags;
|
|
if (0 < iVar17) {
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9f].DisplayFlags = iVar17 + -1;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x94)))) != 0) {
|
|
pGVar22 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._capacity;
|
|
local_9b8._begin = (void *)pGVar22->_stage;
|
|
if (local_9b8._begin != pGVar22) {
|
|
do {
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_9b8._begin) + 0x10));
|
|
if (((-1 < iVar17) &&
|
|
(iVar17 < *GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked) * (GHIDRA_CAST<Level *>(this))->_curses)) &&
|
|
(GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<Level *>(this))->_roomMap[iVar17 + -0x5eae]) != GHIDRA_CAST<uint32_t *>(0x0))) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<Level *>(this))->_roomMap[iVar17 + -0x5eae]))();
|
|
(GHIDRA_CAST<Level *>(this))->_roomMap[iVar17 + -0x5eae] = 0;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_9b8);
|
|
pGVar22 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._capacity;
|
|
} while (local_9b8._begin != pGVar22);
|
|
}
|
|
ppvVar36 = &(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._capacity;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(ppvVar36,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)ppvVar36,
|
|
(_Tree_node<unsigned_int,void*> *)pGVar22->_stageType);
|
|
pGVar22->_stageType = GHIDRA_INT(pGVar22);
|
|
pGVar22->_stage = GHIDRA_INT(pGVar22);
|
|
*GHIDRA_CAST<Game **>(&pGVar22->_bossChallenge) = pGVar22;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x94)))) = 0;
|
|
}
|
|
iVar17 = *GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked);
|
|
iVar33 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
local_99c = GHIDRA_CAST<Entity *>(0x0);
|
|
if (0 < iVar17 * iVar33) {
|
|
ppvVar36 = &(GHIDRA_CAST<Level *>(this))->_roomList[0].Data;
|
|
do {
|
|
if (*ppvVar36 != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(*ppvVar36) + 8))();
|
|
}
|
|
iVar33 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x1))));
|
|
ppvVar36 = ppvVar36 + 1;
|
|
} while (GHIDRA_INT(local_99c) < iVar33 * *GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar17)) + 0x0))) = (GHIDRA_CAST<Level *>(this))->_isHeartPicked;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar17)) + 0x1))) = (GHIDRA_CAST<Level *>(this))->_isCanSeeEverything;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar17)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x12))));
|
|
}
|
|
local_9ac = GHIDRA_CAST<ItemPool *>(0x3);
|
|
local_9c0 = (void *)0x3e8;
|
|
if ((g_game->_frameCount % 3 == 0) && (local_9b8._end = GHIDRA_CAST<float *>(0x0), 0 < iVar33 * iVar17)) {
|
|
local_99c = GHIDRA_CAST<Entity *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x13].DeliriumDistance);
|
|
piVar28 = (GHIDRA_CAST<Level *>(this))->_roomList[10]._doors + 3;
|
|
local_9b8._end = GHIDRA_CAST<float *>(0x0);
|
|
do {
|
|
iVar17 = *piVar28;
|
|
iVar33 = iVar17 % 1000;
|
|
if (iVar17 == 3999) {
|
|
*piVar28 = 900;
|
|
}
|
|
else if (iVar33 < 0x385) {
|
|
if (100 < iVar33) {
|
|
iVar33 = 100;
|
|
}
|
|
*piVar28 = iVar17 - iVar33;
|
|
}
|
|
if ((uint16_t)(*GHIDRA_CAST<short *>(local_99c) - 1U) < 99) {
|
|
iVar17 = *GHIDRA_CAST<short *>(local_99c) + -1;
|
|
local_9d4.y = 0.0;
|
|
sVar30 = 0;
|
|
if (0 < iVar17) {
|
|
sVar30 = (short)iVar17;
|
|
}
|
|
*GHIDRA_CAST<short *>(local_99c) = sVar30;
|
|
}
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x2))));
|
|
local_9b8._end = (void *)(GHIDRA_INT(local_9b8._end) + 1);
|
|
piVar28 = piVar28 + 1;
|
|
} while (GHIDRA_INT(local_9b8._end) <
|
|
*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked) * (GHIDRA_CAST<Level *>(this))->_curses);
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x226,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((((player != GHIDRA_CAST<Entity_Player *>(0x0)) && ((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0')) &&
|
|
(g_game->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))) == 4)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x11 &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) >> 3 & 1) == 0)))) {
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(&DAT_00000005);
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(local_a58);
|
|
in_stack_fffff4f8 = 0x803d67;
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].Dimension),
|
|
GHIDRA_CAST<EntityList_EL *>(in_stack_fffff4fc),5,100,-1,0,0);
|
|
local_14 = 7.00649e-45;
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0xc))) == 0) {
|
|
(GHIDRA_CAST<Ambush *>((&g_game->_ambush)))->Ambush::StartChallenge();
|
|
}
|
|
local_14 = -NAN;
|
|
if (local_a58[0] == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0x4))) != 0) {
|
|
uVar19 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0x4))) + -4));
|
|
qVar13 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar19;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar13) < uVar19));
|
|
free((void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0x4))) + -4));
|
|
}
|
|
local_14 = -NAN;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8)))) == 0xb) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8)))) == 0x11)
|
|
) && ((g_game->_ambush)._isActive != 0)) {
|
|
(GHIDRA_CAST<Ambush *>((&g_game->_ambush)))->Ambush::Update();
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0xa0))) != '\0') {
|
|
card_against_humanity_fill(this);
|
|
}
|
|
pvVar24 = (void *)((GHIDRA_CAST<Level *>(this))->_roomList[0x1a].SafeGridIndex +
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x1a].ListIndex);
|
|
pvVar31 = (void *)0x0;
|
|
if (0 < GHIDRA_INT(pvVar24)) {
|
|
pvVar31 = pvVar24;
|
|
}
|
|
if ((GHIDRA_INT(pvVar31) < 1) && (0 < GHIDRA_INT((GHIDRA_CAST<Level *>(this))->_roomList[0x9e].RestrictedGridIndexes._head)))
|
|
{
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[Frame %d] "));
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] last boss died without triggering the deathspawn.\n"));
|
|
}
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].RestrictedGridIndexes._head = pvVar31;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].Dimension))))->EntityList::Update(0);
|
|
(GHIDRA_CAST<Camera *>((GHIDRA_CAST<Camera *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x1e].SavedEntities))))->Camera::Update(0);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT((GHIDRA_CAST<Level *>(this))->_roomList[0x28]._doors) + 0x1d)) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x27].AllowedDoors))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(((GHIDRA_CAST<Level *>(this))->_roomList[0x27]._doors + 7)))))->AnimationState::Update();
|
|
}
|
|
if ((GHIDRA_CAST<Level *>(this))->_roomList[0x28].Flags == 0x1a) {
|
|
pbVar25 = GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<Level *>(this))->_roomList[0x27]._doors[0]);
|
|
if (pbVar25 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar25 + 0x14))) {
|
|
pbVar25 = *GHIDRA_CAST<uint8_t **>(pbVar25);
|
|
}
|
|
pbVar32 = s_Idle;
|
|
do {
|
|
bVar15 = *pbVar25;
|
|
bVar38 = bVar15 < *pbVar32;
|
|
if (bVar15 != *pbVar32) {
|
|
LAB_00803ee0:
|
|
uVar19 = -GHIDRA_UINT(bVar38) | 1;
|
|
goto LAB_00803ee5;
|
|
}
|
|
if (bVar15 == 0) break;
|
|
bVar15 = pbVar25[1];
|
|
bVar38 = bVar15 < pbVar32[1];
|
|
if (bVar15 != pbVar32[1]) goto LAB_00803ee0;
|
|
pbVar25 = pbVar25 + 2;
|
|
pbVar32 = pbVar32 + 2;
|
|
} while (bVar15 != 0);
|
|
uVar19 = 0;
|
|
LAB_00803ee5:
|
|
if ((uVar19 == 0) &&
|
|
((*GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this))->_roomList[0x27]._doors[0] + 0x34)) == '\0' ||
|
|
((char)(GHIDRA_CAST<Level *>(this))->_roomList[0x27]._doors[4] != '\0')))) goto LAB_00803f16;
|
|
}
|
|
bVar15 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x26])) + 0xa0)))))))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar15 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x27].AllowedDoors))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<uint8_t *>(((GHIDRA_CAST<Level *>(this))->_roomList[0x27]._doors + 4)) = 1;
|
|
}
|
|
}
|
|
LAB_00803f16:
|
|
(GHIDRA_CAST<BeastArena *>((&(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].ListIndex)))->BeastArena::update();
|
|
if (((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0') &&
|
|
(g_game->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))) == 1)) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(this))))->Level::UpdateBackwardsPathStages();
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa0].Dimension) + 1)) == '\0') {
|
|
for (piVar28 = GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_roomList[0xa0].GridIndex);
|
|
piVar28 != GHIDRA_CAST<int *>((GHIDRA_CAST<Level *>(this))->_roomList[0xa0].SafeGridIndex); piVar28 = piVar28 + 4) {
|
|
iVar17 = *GHIDRA_CAST<int *>(*piVar28);
|
|
if ((((iVar17 == 1) || (iVar17 == 3)) || (iVar17 == 4)) && ((GHIDRA_CAST<int *>(*piVar28))[1] == 0x1e1)) {
|
|
uVar19 = Random();
|
|
manager = g_manager;
|
|
if (uVar19 % 10 == 0) {
|
|
uVar19 = Random();
|
|
if ((uVar19 & 1) == 0) {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.1 + 0.2;
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.5 + 1.5;
|
|
}
|
|
(manager->_musicManager)._pitch = fVar18;
|
|
(manager->_musicManager)._targetPitch = fVar18;
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(((manager->_musicManager)._channels +
|
|
(manager->_musicManager)._currentChannel)))))->Music::SetPitchAll(fVar18);
|
|
manager = g_manager;
|
|
uVar19 = Random();
|
|
if ((uVar19 & 3) == 0) {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.7 + 0.3;
|
|
}
|
|
else {
|
|
fVar18 = 1.0;
|
|
}
|
|
fVar18 = fVar18 * (g_manager->_optionsConfig)._musicVolume;
|
|
(manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._targetVolume
|
|
= fVar18;
|
|
(manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._volume =
|
|
fVar18;
|
|
}
|
|
else {
|
|
iVar17 = (g_manager->_musicManager)._currentChannel;
|
|
(g_manager->_musicManager)._pitch = 1.0;
|
|
(manager->_musicManager)._targetPitch = 1.0;
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(((manager->_musicManager)._channels + iVar17)))))->Music::SetPitchAll(1.0);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x9f].Group))))->TemporaryEffects::Update();
|
|
update_deaths_list();
|
|
pvVar31 = (void *)(GHIDRA_CAST<Level *>(this))->_stageType;
|
|
local_9c8.y = (float)pvVar31;
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar31) + 0x44)) & 1) == 0) && ((g_game->_ambush)._isActive == 0)) {
|
|
iVar33 = (GHIDRA_CAST<Level *>(this))->_roomList[0x19].Group + (GHIDRA_CAST<Level *>(this))->_roomList[0x1a].GridIndex;
|
|
iVar17 = 0;
|
|
if (0 < iVar33) {
|
|
iVar17 = iVar33;
|
|
}
|
|
if (((iVar17 < 1) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x98)))) < 1)) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98)))) < 1)) {
|
|
TriggerOutput(this,9);
|
|
pvVar31 = (void *)(GHIDRA_CAST<Level *>(this))->_stageType;
|
|
}
|
|
}
|
|
pGVar22 = g_game;
|
|
if ((g_game->_ambush)._isActive == 0) {
|
|
iVar33 = (GHIDRA_CAST<Level *>(this))->_roomList[0x19].Group + (GHIDRA_CAST<Level *>(this))->_roomList[0x1a].GridIndex;
|
|
iVar17 = 0;
|
|
if (0 < iVar33) {
|
|
iVar17 = iVar33;
|
|
}
|
|
if ((0 < iVar17) || (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x98))))))
|
|
goto LAB_00804293;
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98))));
|
|
if (iVar17 < 1) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8)))) == 0x10) {
|
|
iVar17 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x10)) + 0x10));
|
|
if (iVar17 != 2) {
|
|
if (iVar17 != 3) goto LAB_00804212;
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(g_game->_dungeonReturnRoomIndex);
|
|
g_game->_enterDoor = -1;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x80420d);
|
|
Game::StartRoomTransition(pGVar22,GHIDRA_INT(in_stack_fffff500),-1,0,GHIDRA_CAST<Entity_Player *>(0x0),-1);
|
|
}
|
|
}
|
|
else {
|
|
LAB_00804212:
|
|
iVar17 = g_game->_stage;
|
|
if ((iVar17 != 0xd) &&
|
|
(((iVar17 < 1 || (6 < iVar17)) || ((g_game->_gameStateFlags & 0x1000000000000) == 0)))) {
|
|
puVar3 = &(g_manager->_musicManager)._channels[(g_manager->_musicManager)._currentChannel]
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&()) + 0x16c)));
|
|
*GHIDRA_CAST<uint32_t *>(puVar3) = *GHIDRA_CAST<uint32_t *>(puVar3) & 0xfffffffe;
|
|
}
|
|
puVar34 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[9])) + 0x98))));
|
|
local_99c = GHIDRA_CAST<Entity *>(&DAT_00000008);
|
|
do {
|
|
if (GHIDRA_CAST<GridEntity_Door *>(*puVar34) != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((GHIDRA_CAST<GridEntity_Door *>(*puVar34))))->GridEntity_Door::Open();
|
|
}
|
|
puVar34 = puVar34 + 1;
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_99c[-1])) + 0x40f))));
|
|
} while (local_99c != GHIDRA_CAST<Entity *>(0x0));
|
|
if ((*GHIDRA_CAST<uint8_t *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x44)) & 9) == 0) {
|
|
TriggerClear(this,0);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98)))) = iVar17 + -1;
|
|
}
|
|
}
|
|
else {
|
|
LAB_00804293:
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98)))) = 10;
|
|
if (iVar17 == 0x10) {
|
|
clearDelay = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98))));
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar31) + 0x10)) + 0x10)) == 3) {
|
|
clearDelay = 0x14;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x98)))) = clearDelay;
|
|
}
|
|
}
|
|
puVar34 = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[9])) + 0x98))));
|
|
local_99c = GHIDRA_CAST<Entity *>(&DAT_00000008);
|
|
do {
|
|
this_00 = GHIDRA_CAST<GridEntity_Door *>(*puVar34);
|
|
if ((this_00 != GHIDRA_CAST<GridEntity_Door *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0xc)))) == 5)) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::Open();
|
|
}
|
|
puVar34 = puVar34 + 1;
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_99c[-1])) + 0x40f))));
|
|
} while (local_99c != GHIDRA_CAST<Entity *>(0x0));
|
|
update_pressure_plates(this);
|
|
update_door_transitions(this);
|
|
local_9a0 = g_game;
|
|
local_9c8.y = (float)g_game->_stageType;
|
|
iVar17 = g_game->_stage;
|
|
if ((g_game->_difficulty == 2) || (iVar33 = iVar17, g_game->_difficulty == 3)) {
|
|
if (iVar17 < 5) {
|
|
iVar33 = iVar17 * 2 + -1;
|
|
}
|
|
else {
|
|
iVar33 = 0;
|
|
if (iVar17 == 5) {
|
|
iVar33 = 10;
|
|
}
|
|
}
|
|
local_9c8.y = 0.0;
|
|
}
|
|
if (((((iVar33 == 3) || (iVar33 == 4)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x0))) ||
|
|
(((iVar33 == 7 || (iVar33 == 8)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x0))))) ||
|
|
(((iVar33 == 5 || (iVar33 == 6)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x2))))) {
|
|
uVar19 = Random();
|
|
if (uVar19 % 0x1e != 0) {
|
|
local_9a0 = g_game;
|
|
goto LAB_0080439a;
|
|
}
|
|
LAB_00804511:
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
local_a20.y = -10.0;
|
|
in_stack_fffff500 = &local_a20;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x29);
|
|
in_stack_fffff4f8 = 1000;
|
|
local_a20.x = ((float)(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex -
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex) *
|
|
(float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)]) *
|
|
2.3283064e-10 + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
in_stack_fffff4f4 = 0x804585;
|
|
listedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x29,in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar19);
|
|
listedEntity->Update();
|
|
}
|
|
else {
|
|
LAB_0080439a:
|
|
if (((iVar33 == 3) || (iVar33 == 4)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x2))) {
|
|
g_game = local_9a0;
|
|
uVar19 = Random();
|
|
if (uVar19 % 6 == 0) goto LAB_00804511;
|
|
local_9a0 = g_game;
|
|
}
|
|
if (((iVar33 == 7) || (iVar33 == 8)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x2))) {
|
|
g_game = local_9a0;
|
|
uVar19 = Random();
|
|
if ((uVar19 & 7) == 0) goto LAB_00804511;
|
|
local_9a0 = g_game;
|
|
}
|
|
g_game = local_9a0;
|
|
if ((iVar33 == 1) || (iVar33 == 2)) {
|
|
if (GHIDRA_CAST<uint8_t *>(local_9c8.y) == &DAT_00000004) {
|
|
uVar19 = Random();
|
|
if ((uVar19 & 3) == 0) goto LAB_00804511;
|
|
local_9a0 = g_game;
|
|
}
|
|
g_game = local_9a0;
|
|
if ((iVar33 == 1) || (iVar33 == 2)) {
|
|
if (GHIDRA_CAST<uint8_t *>(local_9c8.y) == &DAT_00000005) {
|
|
uVar19 = Random();
|
|
if ((uVar19 & 3) == 0) goto LAB_00804511;
|
|
local_9a0 = g_game;
|
|
}
|
|
g_game = local_9a0;
|
|
if ((((iVar33 == 1) || (iVar33 == 2)) && (GHIDRA_CAST<uint8_t *>(local_9c8.y) == GHIDRA_CAST<uint8_t *>(0x2)))
|
|
&& (uVar19 = Random(), uVar19 % 0x14 == 0)) {
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
local_9c8.y = -10.0;
|
|
in_stack_fffff500 = &local_9c8;
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x57);
|
|
in_stack_fffff4f8 = 1000;
|
|
local_9c8.x = ((float)(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex -
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex) *
|
|
(float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)]
|
|
) * 2.3283064e-10 + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
in_stack_fffff4f4 = 0x8044ff;
|
|
listedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x57,in_stack_fffff500,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
0,uVar19);
|
|
listedEntity->Update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pGVar22 = g_game;
|
|
if (g_game->_challenge == 0x2c) {
|
|
uVar19 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomStageType(g_game->_currentRoomIdx);
|
|
}
|
|
else {
|
|
if (g_game->_currentDimensionIdx == 2) goto LAB_008046e2;
|
|
uVar19 = g_game->_stageType;
|
|
}
|
|
pGVar39 = g_game;
|
|
uVar19 = RoomConfig::GetStageID(pGVar22->_stage,uVar19,-1);
|
|
if (uVar19 == 0x1b) {
|
|
uVar19 = pGVar39->_frameCount & 0x80000003;
|
|
bVar38 = uVar19 == 0;
|
|
if (GHIDRA_INT(uVar19) < 0) {
|
|
bVar38 = (uVar19 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if ((bVar38) && (uVar19 = Random(), uVar19 % 100 == 0)) {
|
|
uVar19 = Random();
|
|
g_game->_lightningIntensity =
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.6 + 1.3;
|
|
uVar19 = Random();
|
|
manager = g_manager;
|
|
local_99c = GHIDRA_CAST<Entity *>(0x1d8);
|
|
local_9a8 = (Entity *)
|
|
((float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 0.2 + 0.9);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_99c));
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
in_stack_fffff4f8 = 0x8046e2;
|
|
in_stack_fffff4fc = local_99c;
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_99c),1.0,0x5a,0,(float)local_9a8,0.0);
|
|
}
|
|
}
|
|
LAB_008046e2:
|
|
update_ambient_spawns(this);
|
|
update_ambient_effects(this);
|
|
update_water_current(this);
|
|
bVar15 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
pGVar22 = g_game;
|
|
if (bVar15 != 0) {
|
|
if ((*GHIDRA_CAST<char *>(g_game->_room) == '\0') ||
|
|
(g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f0)) < 2)) {
|
|
g_game->_darknessModifier = 1.0;
|
|
}
|
|
pGVar22->_darknessStrength = 1.0;
|
|
pGVar22->_darknessTimeout = 10;
|
|
}
|
|
piVar28 = *GHIDRA_CAST<int **>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x10));
|
|
if (((piVar28 != GHIDRA_CAST<int *>(0x0)) && (piVar28[2] == 0x10)) && (*piVar28 == 0x23)) {
|
|
pGVar39 = GHIDRA_CAST<Game *>(((float)(GHIDRA_CAST<Level *>(this))->_roomList[0].Dimension - 30.0));
|
|
local_9a0 = pGVar39;
|
|
if ((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0') {
|
|
uVar19 = pGVar22->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))) &
|
|
0x80000003;
|
|
bVar38 = uVar19 == 0;
|
|
if (GHIDRA_INT(uVar19) < 0) {
|
|
bVar38 = (uVar19 - 1 | 0xfffffffc) == 0xffffffff;
|
|
}
|
|
if (bVar38) {
|
|
playerManager = &pGVar22->_playerManager;
|
|
if (GHIDRA_INT((pGVar22->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
uVar19 = 0;
|
|
pGVar22 = g_game;
|
|
do {
|
|
pvVar31 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar31) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar31 = (playerManager->_playerList)._end;
|
|
pGVar22 = g_game;
|
|
pGVar39 = local_9a0;
|
|
}
|
|
pfVar35 = (playerManager->_playerList)._begin;
|
|
if (uVar19 < GHIDRA_UINT((GHIDRA_INT(pvVar31) - GHIDRA_INT(pfVar35) >> 2))) {
|
|
pfVar35 = pfVar35 + uVar19;
|
|
}
|
|
local_9a8 = GHIDRA_CAST<Entity *>(*pfVar35);
|
|
if ((float)pGVar39 <= (local_9a8->_pos).y + local_9a8->_size) {
|
|
if (local_9a8->_entityCollisionClass != 0) {
|
|
bVar15 = 0;
|
|
slowSource._position.x = g_vectorZero.x;
|
|
slowSource._velocity.x = g_vectorZero.x;
|
|
slowSource._type = 0;
|
|
slowSource._variant = 0;
|
|
slowSource._spawnerType = 0;
|
|
slowSource._spawnerVariant = 0;
|
|
slowSource._position.y = g_vectorZero.y;
|
|
slowSource._velocity.y = g_vectorZero.y;
|
|
slowSource._flags = 0;
|
|
slowSource._entity = (void *)0x0;
|
|
(GHIDRA_CAST<Color *>((aCStackY_2148 + 0x81)))->Color::Reset();
|
|
listedEntity = local_9a8;
|
|
color._tint[2] = 1.3;
|
|
color._tint[0] = 1.0;
|
|
color._tint[1] = 1.0;
|
|
color._tint[3] = 1.0;
|
|
color._colorize[0] = (float)in_stack_fffff4f4;
|
|
color._colorize[1] = (float)in_stack_fffff4f8;
|
|
color._colorize[2] = (float)in_stack_fffff4fc;
|
|
color._colorize[3] = (float)in_stack_fffff500;
|
|
color._offset[0] = 0.15686275;
|
|
color._offset[1] = 0.15686275;
|
|
color._offset[2] = 0.15686275;
|
|
(GHIDRA_CAST<Entity *>((local_9a8)))->Entity::AddSlowing(&slowSource,4,0.6,color,bVar15);
|
|
in_stack_fffff500 = GHIDRA_CAST<Vector *>(0x3f800000);
|
|
in_stack_fffff4fc = GHIDRA_CAST<Entity *>(0x804968);
|
|
listedEntity->TakeDamage();
|
|
pGVar22 = g_game;
|
|
pGVar39 = local_9a0;
|
|
}
|
|
}
|
|
playerManager = &pGVar22->_playerManager;
|
|
uVar19 = uVar19 + 1;
|
|
} while (uVar19 < GHIDRA_UINT((GHIDRA_INT((pGVar22->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
this = GHIDRA_CAST<Room *>(local_9cc);
|
|
}
|
|
}
|
|
}
|
|
uVar19 = Random();
|
|
if ((uVar19 & 1) == 0) {
|
|
uVar19 = Random();
|
|
local_9a8 = (Entity *)
|
|
((float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * -2.8799999);
|
|
uVar19 = Random();
|
|
local_a20.x = ((float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 - 0.5) * 0.4;
|
|
local_a20.y = (float)local_9a8;
|
|
uVar19 = Random();
|
|
fVar18 = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex + 40.0;
|
|
local_9a0 = GHIDRA_CAST<Game *>((((float)local_9a0 - fVar18) *
|
|
(float)((double)GHIDRA_INT(uVar19) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) * 2.3283064e-10 +
|
|
fVar18));
|
|
uVar19 = Random();
|
|
local_a40.y = (float)local_9a0;
|
|
local_a40.x = ((GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex))->x -
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex) *
|
|
(float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
uVar19 = Random();
|
|
listedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x42,&local_a40,&local_a20,GHIDRA_CAST<Entity *>(0x0),10,uVar19);
|
|
uVar19 = Random();
|
|
fVar40 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 1.2 + 0.8;
|
|
fVar18 = fVar40 * g_vectorOne.x;
|
|
(listedEntity->_sprite)._scale.y = fVar40 * g_vectorOne.y;
|
|
(listedEntity->_sprite)._scale.x = fVar18;
|
|
uVar19 = Random();
|
|
if (uVar19 % GHIDRA_UINT(local_9ac) == 0) {
|
|
listedEntity->_renderDepthOffset = 80.0;
|
|
}
|
|
else {
|
|
listedEntity->_sortingLayer = 1;
|
|
fVar18 = (listedEntity->_sprite)._scale.x;
|
|
fVar40 = (listedEntity->_sprite)._scale.y;
|
|
(listedEntity->_sprite)._color._tint[3] = 0.6;
|
|
(listedEntity->_sprite)._scale.x = fVar18 * 0.6;
|
|
(listedEntity->_sprite)._scale.y = fVar40 * 0.6;
|
|
}
|
|
listedEntity->Update();
|
|
}
|
|
}
|
|
iVar17 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0xa4))));
|
|
if (iVar17 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0xa8))))) {
|
|
fVar18 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0xa0))));
|
|
fVar40 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0x98))));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0xa4)))) = iVar17 + 1;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9c])) + 0x98)))) = fVar18 + fVar40;
|
|
}
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9d].ListIndex;
|
|
if (iVar17 < (GHIDRA_CAST<Level *>(this))->_roomList[0x9d].Dimension) {
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9c].Group =
|
|
GHIDRA_INT(((float)(GHIDRA_CAST<Level *>(this))->_roomList[0x9d].SafeGridIndex +
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0x9c].Group));
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9d].ListIndex = iVar17 + 1;
|
|
}
|
|
pvVar31 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedGridEntities._capacity;
|
|
if (0 < GHIDRA_INT(pvVar31)) {
|
|
psVar2 = &(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEntities;
|
|
local_9bc = GHIDRA_CAST<Game *>(((float)(GHIDRA_CAST<Level *>(this))->_roomList[0].Dimension -
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0].SafeGridIndex));
|
|
local_9a4 = GHIDRA_CAST<Game *>(((float)(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex -
|
|
(float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex));
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedGridEntities._capacity = (void *)(GHIDRA_INT(pvVar31) + -1);
|
|
local_9b8._begin = GHIDRA_CAST<Game *>(0x20);
|
|
psVar27 = &local_9b8;
|
|
if (GHIDRA_INT(psVar2->_begin) < 0x20) {
|
|
psVar27 = psVar2;
|
|
}
|
|
local_9b8._capacity = GHIDRA_CAST<Entity *>(0x0);
|
|
if (0 < GHIDRA_INT(psVar27->_begin)) {
|
|
local_9ac = GHIDRA_CAST<ItemPool *>(((float)local_9a4 + (float)local_9a4));
|
|
local_9a8 = GHIDRA_CAST<Entity *>(((float)local_9bc + (float)local_9bc + (float)local_9ac));
|
|
do {
|
|
uVar19 = Random();
|
|
local_99c = (Entity *)
|
|
((float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * (float)local_9a8);
|
|
if ((float)local_9a4 <= (float)local_99c) {
|
|
if ((float)local_9a4 + (float)local_9bc <= (float)local_99c) {
|
|
if ((float)local_9bc + (float)local_9ac <= (float)local_99c) {
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_9b8._end = (void *)(fVar18 + fVar18);
|
|
local_9a0 = GHIDRA_CAST<Game *>(sin((float)local_9b8._end));
|
|
local_9c8.x = cos((float)local_9b8._end);
|
|
pVVar23 = &local_9c8;
|
|
local_9c8.y = (float)local_9a0 * 5.0;
|
|
local_9c8.x = local_9c8.x * 5.0;
|
|
local_a18.x = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
pVVar26 = &local_a18;
|
|
local_a18.y = (((float)local_99c + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].SafeGridIndex)
|
|
- (float)local_9ac) - (float)local_9bc;
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_9b8._end = (void *)(fVar18 + fVar18);
|
|
local_9a0 = GHIDRA_CAST<Game *>(sin((float)local_9b8._end));
|
|
fVar18 = cos((float)local_9b8._end);
|
|
pVVar23 = &local_9e0;
|
|
local_9e0.y = (float)local_9a0 * 5.0;
|
|
local_9e0.x = fVar18 * 5.0;
|
|
local_9d4.y = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].Dimension;
|
|
pVVar26 = &local_9d4;
|
|
local_9d4.x = (((float)local_99c + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex) -
|
|
(float)local_9a4) - (float)local_9bc;
|
|
}
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_9b8._end = (void *)(fVar18 + fVar18);
|
|
local_9a0 = GHIDRA_CAST<Game *>(sin((float)local_9b8._end));
|
|
local_a38.x = cos((float)local_9b8._end);
|
|
pVVar23 = &local_a38;
|
|
local_a38.y = (float)local_9a0 * 5.0;
|
|
local_a38.x = local_a38.x * 5.0;
|
|
local_a04.x = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].ListIndex;
|
|
local_a04.y = ((float)local_99c + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].SafeGridIndex) -
|
|
(float)local_9a4;
|
|
pVVar26 = &local_a04;
|
|
}
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
uVar21 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar21) + __uint_to_double_fixup[-(GHIDRA_INT(uVar21) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_9b8._end = (void *)(fVar18 + fVar18);
|
|
local_9a0 = GHIDRA_CAST<Game *>(sin((float)local_9b8._end));
|
|
local_a28.x = cos((float)local_9b8._end);
|
|
pVVar23 = &local_a28;
|
|
local_a28.y = (float)local_9a0 * 5.0;
|
|
local_a28.x = local_a28.x * 5.0;
|
|
local_a30.x = (float)local_99c + (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].GridIndex;
|
|
local_a30.y = (float)(GHIDRA_CAST<Level *>(this))->_roomList[0].SafeGridIndex;
|
|
pVVar26 = &local_a30;
|
|
}
|
|
listedEntity = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,5,pVVar26,pVVar23,GHIDRA_CAST<Entity *>(0x0),0,uVar19);
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_roomList[0x28].Flags;
|
|
if (((iVar17 == 0x22) || (iVar17 == 0x2b)) || (iVar17 == 0x2c)) {
|
|
listedEntity->SetColor();
|
|
fVar14 = g_colorGreenSplat._tint[3];
|
|
fVar40 = g_colorGreenSplat._tint[2];
|
|
fVar18 = g_colorGreenSplat._tint[1];
|
|
if (&listedEntity->_splatColor != &g_colorGreenSplat) {
|
|
(listedEntity->_splatColor)._tint[0] = g_colorGreenSplat._tint[0];
|
|
(listedEntity->_splatColor)._tint[1] = fVar18;
|
|
(listedEntity->_splatColor)._tint[2] = fVar40;
|
|
(listedEntity->_splatColor)._tint[3] = fVar14;
|
|
fVar14 = g_colorGreenSplat._colorize[3];
|
|
fVar40 = g_colorGreenSplat._colorize[2];
|
|
fVar18 = g_colorGreenSplat._colorize[1];
|
|
(listedEntity->_splatColor)._colorize[0] = g_colorGreenSplat._colorize[0];
|
|
(listedEntity->_splatColor)._colorize[1] = fVar18;
|
|
(listedEntity->_splatColor)._colorize[2] = fVar40;
|
|
(listedEntity->_splatColor)._colorize[3] = fVar14;
|
|
*GHIDRA_CAST<uint64_t *>((listedEntity->_splatColor)._offset) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(g_colorGreenSplat._offset)) + 0x0)));
|
|
(listedEntity->_splatColor)._offset[2] = g_colorGreenSplat._offset[2];
|
|
}
|
|
}
|
|
listedEntity->Update();
|
|
psVar2 = &(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEntities;
|
|
local_9b8._capacity = (void *)(GHIDRA_INT(local_9b8._capacity) + 1);
|
|
psVar27 = &local_9b8;
|
|
if (GHIDRA_INT(psVar2->_begin) < 0x20) {
|
|
psVar27 = psVar2;
|
|
}
|
|
} while (GHIDRA_INT(local_9b8._capacity) < GHIDRA_INT(psVar27->_begin));
|
|
}
|
|
}
|
|
bVar15 = TemporaryEffects::HasCollectibleEffect
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_INT(g_game->_room) + 0x7310)),0x123);
|
|
if ((bVar15 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8)))) != 0x10)) {
|
|
fVar18 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x9c)))) + 0.1;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x9c)))) = fVar18;
|
|
if ((0.89 < fVar18) &&
|
|
((fVar18 < 0.91 &&
|
|
(puVar1 = GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x44)), *puVar1 = *puVar1 | 0x100,
|
|
(*GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x44)) >> 5 & 1) != 0)))) {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
local_99c = GHIDRA_CAST<Entity *>(0x1);
|
|
if (1 < iVar17 + -1) {
|
|
do {
|
|
iVar33 = *GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked);
|
|
local_9b8._capacity = GHIDRA_CAST<Entity *>(0x1);
|
|
if (1 < iVar33 + -1) {
|
|
do {
|
|
if ((((GHIDRA_INT(local_99c) < 0) ||
|
|
(iVar17 = (GHIDRA_CAST<Level *>(this))->_curses, iVar17 <= GHIDRA_INT(local_99c))) ||
|
|
(GHIDRA_INT(local_9b8._capacity) < 0)) || (iVar33 <= GHIDRA_INT(local_9b8._capacity))) {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
}
|
|
else if (((-1 < GHIDRA_INT((&(local_99c->_sprite)._filename + -3)) +
|
|
GHIDRA_INT(local_9b8._capacity) * iVar17) &&
|
|
(local_9ac = (ItemPool *)
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0]._doors
|
|
[GHIDRA_INT(((local_99c->_sprite)._filename._buf +
|
|
GHIDRA_INT(local_9b8._capacity) * iVar17 + -0x4b))],
|
|
local_9ac != GHIDRA_CAST<ItemPool *>(0x0))) &&
|
|
(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_9ac) + 4)) == 9.80909e-45)) {
|
|
piVar28 = GHIDRA_CAST<int *>(__RTDynamicCast());
|
|
(**(code **)(*piVar28 + 0x20))();
|
|
(**(code **)(*piVar28 + 4))();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar33)) + 0x0))) = (GHIDRA_CAST<Level *>(this))->_isHeartPicked;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar33)) + 0x1))) = (GHIDRA_CAST<Level *>(this))->_isCanSeeEverything;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar33)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x12))));
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
}
|
|
local_9b8._capacity = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Entity *>(local_9b8._capacity)))) + 0x1)));
|
|
} while (GHIDRA_INT(local_9b8._capacity) < iVar33 + -1);
|
|
}
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x1))));
|
|
} while (GHIDRA_INT(local_99c) < iVar17 + -1);
|
|
}
|
|
}
|
|
if (1.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x9c))))) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x9c)))) = 0x3f800000;
|
|
}
|
|
}
|
|
if ((0.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x9e])) + 0x9c))))) &&
|
|
(fVar18 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0xa5])) + 0x94)))), 0.0 < fVar18)) {
|
|
fVar40 = fVar18 * 0.92;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0xa5])) + 0x94)))) = fVar40;
|
|
if ((fVar40 < 0.2) && (0.2 <= fVar18)) {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
local_99c = GHIDRA_CAST<Entity *>(0x1);
|
|
if (1 < iVar17 + -1) {
|
|
do {
|
|
iVar29 = *GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked);
|
|
iVar33 = 1;
|
|
if (1 < iVar29 + -1) {
|
|
do {
|
|
if ((((GHIDRA_INT(local_99c) < 0) ||
|
|
(iVar17 = (GHIDRA_CAST<Level *>(this))->_curses, iVar17 <= GHIDRA_INT(local_99c))) || (iVar33 < 0))
|
|
|| (iVar29 <= iVar33)) {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
}
|
|
else if (((-1 < GHIDRA_INT((&(local_99c->_sprite)._filename + -3)) + iVar33 * iVar17) &&
|
|
(local_9ac = (ItemPool *)
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0]._doors
|
|
[GHIDRA_INT(((local_99c->_sprite)._filename._buf +
|
|
iVar33 * iVar17 + -0x4b))], local_9ac != GHIDRA_CAST<ItemPool *>(0x0)))
|
|
&& (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_9ac) + 4)) == 9.80909e-45)) {
|
|
this_02 = GHIDRA_CAST<GridEntity_Pit *>(__RTDynamicCast());
|
|
(GHIDRA_CAST<GridEntity_Pit *>((this_02)))->GridEntity_Pit::UpdateCollision();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar29)) + 0x0))) = (GHIDRA_CAST<Level *>(this))->_isHeartPicked;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar29)) + 0x1))) = (GHIDRA_CAST<Level *>(this))->_isCanSeeEverything;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar29)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x12))));
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_curses;
|
|
}
|
|
iVar33 = iVar33 + 1;
|
|
} while (iVar33 < iVar29 + -1);
|
|
}
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x1))));
|
|
} while (GHIDRA_INT(local_99c) < iVar17 + -1);
|
|
fVar40 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0xa5])) + 0x94))));
|
|
}
|
|
}
|
|
if (fVar40 < 0.001) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0xa5])) + 0x94)))) = 0;
|
|
}
|
|
FUN_00823540();
|
|
}
|
|
if ((((g_game->_levelStateFlags & 0x4000U) != 0) &&
|
|
((*GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0x44)) & 0x4000) == 0)) &&
|
|
(((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0' &&
|
|
((g_game->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))) == 1 &&
|
|
(bVar15 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar15 == 0)))))) {
|
|
MamaMegaExplosion(this,&g_vectorZero,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
}
|
|
pvVar31 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._begin;
|
|
if (0 < GHIDRA_INT(pvVar31)) {
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._begin = (void *)(GHIDRA_INT(pvVar31) + -1);
|
|
}
|
|
UpdateGreedWave(this);
|
|
update_ambient_sounds(this);
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9c]._doors[7];
|
|
if ((0 < iVar17) &&
|
|
(iVar17 = iVar17 + -1, (GHIDRA_CAST<Level *>(this))->_roomList[0x9c]._doors[7] = iVar17, iVar17 < 1)) {
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9c]._doors[7] = -1;
|
|
ShopRestockPartial(this);
|
|
}
|
|
if ((((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x8)))) == 2) &&
|
|
(player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x209,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
player != GHIDRA_CAST<Entity_Player *>(0x0))) && ((char)(GHIDRA_CAST<Level *>(this))->_stage != '\0')) &&
|
|
(1 < g_game->_frameCount - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Level *>(this))->_roomList[0x18])) + 0x9c)))))) {
|
|
iVar17 = (GHIDRA_CAST<Level *>(this))->_stageType;
|
|
sVar30 = *GHIDRA_CAST<short *>((iVar17 + 0xac));
|
|
if ((0 < sVar30) && ((sVar30 <= *GHIDRA_CAST<short *>((iVar17 + 0xae)) || (*GHIDRA_CAST<short *>((iVar17 + 0xae)) == -1)))
|
|
) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0x0))) = *GHIDRA_CAST<int *>((iVar17 + 0x58));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0xc))) = 0x1b;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_a58)) + 0x4))) = 0x1b00000001;
|
|
uVar19 = (GHIDRA_CAST<RNG *>((GHIDRA_CAST<RNG *>(local_a58))))->RNG::RandomInt(GHIDRA_INT(sVar30));
|
|
*GHIDRA_CAST<short *>(((GHIDRA_CAST<Level *>(this))->_stageType + 0xae)) = (short)uVar19;
|
|
}
|
|
}
|
|
pvVar31 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._end;
|
|
if (0 < GHIDRA_INT(pvVar31)) {
|
|
if (GHIDRA_INT(pvVar31) % 5 == 0) {
|
|
get_random_pickup_position(g_game->_room,GHIDRA_CAST<Vector *>((local_a58 + 0x10)),0,0);
|
|
uVar19 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(4,3,GHIDRA_CAST<Vector *>((local_a58 + 0x10)),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar19);
|
|
__RTDynamicCast();
|
|
pvVar31 = (GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._end;
|
|
}
|
|
(GHIDRA_CAST<Level *>(this))->_roomList[0x9e].SavedEffects._end = (void *)(GHIDRA_INT(pvVar31) + -1);
|
|
}
|
|
if (*GHIDRA_CAST<char *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa7].SavedEntities._end) != '\0') {
|
|
uVar19 = 0;
|
|
if ((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed != 0) {
|
|
do {
|
|
pEVar20 = *(Entity_Pickup **)
|
|
(*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].PoopCount) + uVar19 * 4);
|
|
iVar17 = pEVar20->_type;
|
|
if (iVar17 == 5) {
|
|
(GHIDRA_CAST<Entity_Pickup *>((pEVar20)))->Entity_Pickup::UpdateLootPreview();
|
|
}
|
|
else if ((((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (iVar17 == 1)) ||
|
|
(iVar17 - 10U < 0x3de)) &&
|
|
(this_03 = GHIDRA_CAST<Entity_NPC *>(__RTDynamicCast()), this_03 != GHIDRA_CAST<Entity_NPC *>(0x0))) {
|
|
(GHIDRA_CAST<Entity_NPC *>((this_03)))->Entity_NPC::UpdatePickupGhosts();
|
|
}
|
|
uVar19 = uVar19 + 1;
|
|
} while (uVar19 < GHIDRA_UINT((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed));
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa7].SavedEntities._end) = 0;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&(GHIDRA_CAST<Level *>(this))->_roomList[0xa6].SafeGridIndex) + 1)) != '\0') {
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + 1;
|
|
local_9ec = (void *)0x0;
|
|
local_9e8.x = 0.0;
|
|
local_9b8._end = GHIDRA_CAST<float *>(0x0);
|
|
local_9e8.y = 0.0;
|
|
local_14 = 9.80909e-45;
|
|
memset(local_1e8,0,0x1c0);
|
|
local_9a8 = GHIDRA_CAST<Entity *>((*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_isHeartPicked) * (GHIDRA_CAST<Level *>(this))->_curses));
|
|
iVar17 = 0;
|
|
if (0 < GHIDRA_INT(local_9a8)) {
|
|
do {
|
|
uVar19 = GetGridCollision(this,iVar17);
|
|
*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_1e8) + iVar17)) = -(uVar19 != 0);
|
|
iVar17 = iVar17 + 1;
|
|
} while (iVar17 < GHIDRA_INT(local_9a8));
|
|
}
|
|
local_9b8._capacity = GHIDRA_CAST<Entity *>(0x0);
|
|
if ((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed != 0) {
|
|
do {
|
|
pfVar35 = *(float **)
|
|
(*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Level *>(this))->_roomList[0x19].PoopCount) +
|
|
GHIDRA_INT(local_9b8._capacity) * 4);
|
|
if ((pfVar35 == GHIDRA_CAST<float *>(0x0)) || (pfVar35[10] != 7.00649e-45)) {
|
|
local_9ac = GHIDRA_CAST<ItemPool *>(0x0);
|
|
}
|
|
else {
|
|
local_9ac = GHIDRA_CAST<ItemPool *>(pfVar35);
|
|
if (pfVar35[0xb] == 1.4013e-43) {
|
|
iVar33 = GHIDRA_INT(((pfVar35[0xcf] - 40.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT(((pfVar35[0xd0] - 120.0) / 40.0 + 0.5));
|
|
if ((((-1 < iVar33) && (iVar33 < (GHIDRA_CAST<Level *>(this))->_curses)) && (-1 < iVar17)) &&
|
|
(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar4)) + 0x0))) = (GHIDRA_CAST<Level *>(this))->_isHeartPicked,
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar4)) + 0x1))) = (GHIDRA_CAST<Level *>(this))->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar4)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Level *>(this)))) + 0x12)))), iVar17 < iVar4 &&
|
|
(iVar33 = iVar17 * (GHIDRA_CAST<Level *>(this))->_curses + iVar33, -1 < iVar33)))) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_1e8) + iVar33)) = 1;
|
|
}
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pfVar35) + 0x173)) == '\0') && (pfVar35[0x14d] == 0.0)) &&
|
|
(((GHIDRA_UINT(pfVar35[0x5a]) & 0x80000) != 0 &&
|
|
(cVar16 = ItemConfig::collectible_has_tags(), cVar16 == '\0')))) {
|
|
pfVar35[0x5a] = (float)(GHIDRA_UINT(pfVar35[0x5a]) & 0xfff7ffff);
|
|
pfVar35[0x5b] = pfVar35[0x5b];
|
|
if ((void *)local_9e8.x == local_9b8._end) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
local_9b8._end = (void *)local_9e8.y;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float **>(local_9e8.x) = pfVar35;
|
|
local_9e8.x = (float)(GHIDRA_INT(local_9e8.x) + 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_9b8._capacity = (void *)(GHIDRA_INT(local_9b8._capacity) + 1);
|
|
} while (local_9b8._capacity < GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<Level *>(this))->_roomList[0x19].DecorationSeed));
|
|
}
|
|
local_9e0.x = 0.0;
|
|
local_9e0.y = 0.0;
|
|
local_9e0.x = (float)operator_new(0x18);
|
|
this_01 = local_9cc;
|
|
*GHIDRA_CAST<float *>(local_9e0.x) = local_9e0.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_9e0.x) + 4)) = local_9e0.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_9e0.x) + 8)) = local_9e0.x;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(local_9e0.x) + 0xc)) = 0x101;
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),8);
|
|
pairOffsets[0] = -1;
|
|
pairOffsets[1] = 0;
|
|
pairOffsets[2] = 1;
|
|
aiStack_28c[0] = 0;
|
|
local_9a4 = GHIDRA_CAST<Game *>(0x0);
|
|
aiStack_28c[1] = 0;
|
|
aiStack_28c[2] = 0xffffffff;
|
|
aiStack_28c[3] = 0;
|
|
aiStack_28c[4] = 1;
|
|
local_9a0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_9e8.x) - GHIDRA_INT(local_9ec) >> 2));
|
|
local_278 = -NAN;
|
|
uStack_274 = 0xffffffff;
|
|
uStack_270 = 1;
|
|
iStack_26c = 1;
|
|
local_9bc = GHIDRA_CAST<Game *>(0xffffffff);
|
|
local_268 = -1;
|
|
iStack_264 = 1;
|
|
iStack_260 = 1;
|
|
iStack_25c = -1;
|
|
local_258 = 1;
|
|
iStack_254 = -1;
|
|
uStack_250 = 0xffffffff;
|
|
uStack_24c = 1;
|
|
local_99c = GHIDRA_CAST<Entity *>(aiStack_28c);
|
|
local_248 = 1;
|
|
acStack_244[0] = '\x01';
|
|
acStack_244[1] = '\0';
|
|
acStack_244[2] = '\0';
|
|
acStack_244[3] = '\0';
|
|
acStack_244[4] = -1;
|
|
acStack_244[5] = -1;
|
|
acStack_244[6] = -1;
|
|
acStack_244[7] = -1;
|
|
acStack_244[8] = -1;
|
|
acStack_244[9] = -1;
|
|
acStack_244[10] = -1;
|
|
acStack_244[0xb] = -1;
|
|
acStack_244[0xc] = -1;
|
|
acStack_244[0xd] = -1;
|
|
acStack_244[0xe] = -1;
|
|
acStack_244[0xf] = -1;
|
|
acStack_244[0x10] = '\0';
|
|
acStack_244[0x11] = '\0';
|
|
acStack_244[0x12] = '\0';
|
|
acStack_244[0x13] = '\0';
|
|
acStack_244[0x14] = '\0';
|
|
acStack_244[0x15] = '\0';
|
|
acStack_244[0x16] = '\0';
|
|
acStack_244[0x17] = '\0';
|
|
acStack_244[0x18] = '\0';
|
|
acStack_244[0x19] = '\0';
|
|
acStack_244[0x1a] = '\0';
|
|
acStack_244[0x1b] = '\0';
|
|
acStack_244[0x1c] = '\0';
|
|
acStack_244[0x1d] = '\0';
|
|
acStack_244[0x1e] = '\0';
|
|
acStack_244[0x1f] = '\0';
|
|
acStack_244[0x20] = '\0';
|
|
acStack_244[0x21] = '\0';
|
|
acStack_244[0x22] = '\0';
|
|
acStack_244[0x23] = '\0';
|
|
acStack_244[0x24] = '\x01';
|
|
acStack_244[0x25] = '\0';
|
|
acStack_244[0x26] = '\0';
|
|
acStack_244[0x27] = '\0';
|
|
acStack_244[0x28] = '\0';
|
|
acStack_244[0x29] = '\0';
|
|
acStack_244[0x2a] = '\0';
|
|
acStack_244[0x2b] = '\0';
|
|
acStack_244[0x2c] = '\0';
|
|
acStack_244[0x2d] = '\0';
|
|
acStack_244[0x2e] = '\0';
|
|
acStack_244[0x2f] = '\0';
|
|
pvStack_214 = (void *)0xffffffff;
|
|
pvStack_210 = (void *)0x0;
|
|
pvStack_20c = (void *)0x0;
|
|
local_208 = (void *)0x0;
|
|
fStack_204 = 0.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_200)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_200)) + 0x1))) = 0;
|
|
iStack_1fc = 1;
|
|
pGVar22 = local_9a0;
|
|
LAB_008058a0:
|
|
local_9b8._begin = GHIDRA_CAST<Game *>(0x0);
|
|
piVar28 = local_1e8;
|
|
gridOccupiedIter = gridOccupied;
|
|
for (iVar17 = 0x70; iVar17 != 0; iVar17 = iVar17 + -1) {
|
|
*gridOccupiedIter = *piVar28;
|
|
piVar28 = piVar28 + 1;
|
|
gridOccupiedIter = gridOccupiedIter + 1;
|
|
}
|
|
pGVar39 = GHIDRA_CAST<Game *>(0x0);
|
|
local_9c8.y = local_9e0.x;
|
|
if (pGVar22 != GHIDRA_CAST<Game *>(0x0)) {
|
|
listedEntity = GHIDRA_CAST<Entity *>(local_9cc->_curses);
|
|
local_9a8 = listedEntity;
|
|
do {
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_9ec) + GHIDRA_INT(local_9b8._begin) * 4));
|
|
fVar18 = *GHIDRA_CAST<float *>((iVar17 + 0x33c));
|
|
fVar40 = *GHIDRA_CAST<float *>((iVar17 + 0x340));
|
|
iVar33 = GHIDRA_INT(((fVar18 - 40.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT(((fVar40 - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar33 < 0) || (GHIDRA_INT(listedEntity) <= iVar33)) || (iVar17 < 0)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar5)) + 0x0))) = local_9cc->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar5)) + 0x1))) = local_9cc->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar5)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_9cc)) + 0x12)))), iVar5 <= iVar17)) {
|
|
iVar33 = -1;
|
|
}
|
|
else {
|
|
iVar33 = GHIDRA_INT(listedEntity) * iVar17 + iVar33;
|
|
}
|
|
local_9ac = GHIDRA_CAST<ItemPool *>((iVar33 / GHIDRA_INT(listedEntity)));
|
|
local_9b8._capacity = (void *)(iVar33 % GHIDRA_INT(listedEntity));
|
|
if (((float)GHIDRA_INT(local_9b8._capacity) * 40.0 + 40.0 == fVar18) &&
|
|
((float)GHIDRA_INT(local_9ac) * 40.0 + 120.0 == fVar40)) {
|
|
iVar17 = GHIDRA_INT(local_99c[-1]._luaBridgeRef) + GHIDRA_INT(local_9ac);
|
|
iVar29 = GHIDRA_INT((&((GHIDRA_CAST<Entity *>(local_9b8._capacity))->_sprite)._filename + -3)) +
|
|
GHIDRA_INT(local_99c[-1]._scoreMultiplier);
|
|
if (((iVar29 < 0) || ((GHIDRA_INT(listedEntity) <= iVar29 || (iVar17 < 0)))) ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar6)) + 0x0))) = local_9cc->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar6)) + 0x1))) = local_9cc->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar6)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_9cc)) + 0x12)))), iVar6 <= iVar17)) {
|
|
iVar29 = -1;
|
|
}
|
|
else {
|
|
iVar29 = iVar17 * GHIDRA_INT(listedEntity) + iVar29;
|
|
}
|
|
iVar17 = *GHIDRA_CAST<int *>(local_99c) + GHIDRA_INT(local_9ac);
|
|
local_9ac = (ItemPool *)
|
|
(GHIDRA_INT((&((GHIDRA_CAST<Entity *>(local_9b8._capacity))->_sprite)._filename + -3)) +
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_99c[-1])) + 0x40c)))));
|
|
if ((((GHIDRA_INT(local_9ac) < 0) || (GHIDRA_INT(listedEntity) <= GHIDRA_INT(local_9ac))) || (iVar17 < 0)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar7)) + 0x0))) = local_9cc->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar7)) + 0x1))) = local_9cc->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar7)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_9cc)) + 0x12)))), iVar7 <= iVar17)) {
|
|
pfVar35 = GHIDRA_CAST<float *>(0xffffffff);
|
|
}
|
|
else {
|
|
pfVar35 = GHIDRA_CAST<float *>((GHIDRA_INT(listedEntity) * iVar17 + GHIDRA_INT(local_9ac)));
|
|
}
|
|
if (((iVar29 < 0) || (GHIDRA_INT(pfVar35) < 0)) ||
|
|
((gridOccupied[iVar29] != 0 || (gridOccupied[GHIDRA_INT(pfVar35)] != 0)))) goto LAB_00805bb8;
|
|
gridOccupied[iVar29] = 1;
|
|
gridOccupied[GHIDRA_INT(pfVar35)] = 1;
|
|
gridOccupied[iVar33] = 0;
|
|
listedEntity = local_9a8;
|
|
}
|
|
local_9b8._begin = (void *)(GHIDRA_INT(local_9b8._begin) + 1);
|
|
pGVar39 = local_9a0;
|
|
if (local_9a0 <= local_9b8._begin) break;
|
|
} while( true );
|
|
}
|
|
local_9bc = local_9a4;
|
|
if (pGVar39 == GHIDRA_CAST<Game *>(0x0)) goto LAB_0080603d;
|
|
LAB_00805a6e:
|
|
local_9a0 = GHIDRA_CAST<Game *>(0x0);
|
|
do {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) = (void *)0x3;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x4))) = (void *)0x3;
|
|
local_9b8._begin = *(void **)(GHIDRA_CAST<char *>(local_9ec) + GHIDRA_INT(local_9a0) * 4);
|
|
local_9a4 = GHIDRA_CAST<Game *>(&DAT_0000001d);
|
|
local_9a8 = GHIDRA_CAST<Entity *>((GHIDRA_CAST<Game *>(local_9b8._begin))->_roomList[5].VisitedCount);
|
|
if (local_9a8 == GHIDRA_CAST<Entity *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar19 = GHIDRA_UINT(local_9a8) >> 3 ^ GHIDRA_UINT(local_9a8);
|
|
uVar19 = uVar19 << 3 ^ uVar19;
|
|
local_9ac = GHIDRA_CAST<ItemPool *>((uVar19 >> 0x1d ^ uVar19));
|
|
if (local_9ac == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
local_a04.x = *GHIDRA_CAST<float *>(&(GHIDRA_CAST<Game *>(local_9b8._begin))->_roomList[4].TotalMoneySpent);
|
|
local_a04.y = (float)(GHIDRA_CAST<Game *>(local_9b8._begin))->_roomList[4].GreedSubType;
|
|
uVar19 = uVar19 >> 3 ^ GHIDRA_UINT(local_9ac);
|
|
uVar19 = uVar19 << 3 ^ uVar19;
|
|
local_9ac = GHIDRA_CAST<ItemPool *>((uVar19 >> 0x1d ^ uVar19));
|
|
iVar17 = GHIDRA_INT(((local_a04.x - 40.0) / 40.0 + 0.5));
|
|
iVar33 = GHIDRA_INT(((local_a04.y - 120.0) / 40.0 + 0.5));
|
|
if (((iVar17 < 0) || (this_01->_curses <= iVar17)) ||
|
|
((iVar33 < 0 ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar8)) + 0x0))) = this_01->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar8)) + 0x1))) = this_01->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar8)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_01)) + 0x12)))), iVar8 <= iVar33)))) {
|
|
uVar19 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar19 = iVar33 * this_01->_curses + iVar17;
|
|
}
|
|
local_9d4.y = 0.0;
|
|
local_9d4.x = 0.0;
|
|
if (((GHIDRA_INT(local_9bc) < 0) ||
|
|
((float)(GHIDRA_INT(uVar19) % this_01->_curses) * 40.0 + 40.0 != local_a04.x)) ||
|
|
((float)(GHIDRA_INT(uVar19) / this_01->_curses) * 40.0 + 120.0 != local_a04.y)) {
|
|
pVVar23 = FindFreePickupSpawnPosition
|
|
(GHIDRA_CAST<Room *>(this_01),GHIDRA_CAST<Vector *>(local_a70),&local_a04,60.0,0,0,0);
|
|
local_9b8._capacity = (void *)pVVar23->x;
|
|
local_99c = GHIDRA_CAST<Entity *>(pVVar23->y);
|
|
iVar33 = GHIDRA_INT((((float)local_9b8._capacity - 40.0) / 40.0 + 0.5));
|
|
iVar17 = GHIDRA_INT((((float)local_99c - 120.0) / 40.0 + 0.5));
|
|
if (((-1 < iVar33) && (iVar33 < this_01->_curses)) &&
|
|
((-1 < iVar17 &&
|
|
(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar9)) + 0x0))) = this_01->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar9)) + 0x1))) = this_01->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar9)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_01)) + 0x12)))), iVar17 < iVar9 &&
|
|
(local_9a8 = GHIDRA_CAST<Entity *>((iVar17 * this_01->_curses + iVar33)), local_9a8 < 0x1c0)))))) {
|
|
iVar17 = this_01->_roomMap[GHIDRA_INT(local_9a8) - 0x5cdc] % GHIDRA_INT(local_9c0);
|
|
if (iVar17 < 900) {
|
|
this_01->_roomMap[GHIDRA_INT(local_9a8) - 0x5cdc] =
|
|
(this_01->_roomMap[GHIDRA_INT(local_9a8) - 0x5cdc] - iVar17) + 900;
|
|
}
|
|
}
|
|
pVVar23 = FindFreePickupSpawnPosition
|
|
(GHIDRA_CAST<Room *>(this_01),GHIDRA_CAST<Vector *>((local_a70 + 8)),&local_a04,60.0,1,0,0);
|
|
local_9d4.x = pVVar23->x;
|
|
local_9d4.y = pVVar23->y;
|
|
}
|
|
else {
|
|
local_99c = GHIDRA_CAST<Entity *>(((float)pairOffsets[GHIDRA_INT(local_9bc) * 4 + 1] * 40.0 + local_a04.y));
|
|
local_9d4.y = (float)aiStack_28c[GHIDRA_INT(local_9bc) * 4] * 40.0 + local_a04.y;
|
|
local_9b8._capacity =
|
|
GHIDRA_CAST<Entity *>(((float)pairOffsets[GHIDRA_INT(local_9bc) * 4] * 40.0 + local_a04.x));
|
|
local_9d4.x = (float)pairOffsets[GHIDRA_INT(local_9bc) * 4 + 2] * 40.0 + local_a04.x;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_01)) + 0x8)))) == 0x10) {
|
|
local_9d4.y = local_9d4.y + 30.0;
|
|
local_99c = GHIDRA_CAST<Entity *>(((float)local_99c + 30.0));
|
|
}
|
|
if (local_9ac == GHIDRA_CAST<ItemPool *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
uVar21 = GHIDRA_UINT(local_9ac) >> (local_9f8[0] & 0x1f) ^ GHIDRA_UINT(local_9ac);
|
|
uVar21 = uVar21 << (local_9f8[4] & 0x1f) ^ uVar21;
|
|
local_9a4 = GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>((g_game)))->Game)::Spawn(GHIDRA_UINT((GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14))
|
|
)->OverrideData),
|
|
(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))->
|
|
AllowedDoors,&local_9d4,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar21 >> ((uint8_t)local_9a4 & 0x1f) ^ uVar21);
|
|
iVar17 = (GHIDRA_CAST<Entity_Pickup *>((local_9b8._begin)))->Entity_Pickup::GetAlternatePedestal();
|
|
(GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_9a4))))->Entity_Pickup::SetAlternatePedestal(iVar17);
|
|
pvVar31 = local_9b8._begin;
|
|
if (-1 < GHIDRA_INT(uVar19)) {
|
|
if (0x1bf < uVar19) {
|
|
FUN_00aef86f();
|
|
pcVar12 = (code *)swi(3);
|
|
(*pcVar12)();
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_1e8) + uVar19)) = 0;
|
|
}
|
|
iVar17 = GHIDRA_INT(((local_9d4.x - 40.0) / 40.0 + 0.5));
|
|
iVar33 = GHIDRA_INT(((local_9d4.y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar17 < 0) || (this_01->_curses <= iVar17)) || (iVar33 < 0)) ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x0))) = this_01->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x1))) = this_01->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_01)) + 0x12)))), iVar10 <= iVar33)) {
|
|
iVar17 = -1;
|
|
}
|
|
else {
|
|
iVar17 = iVar33 * this_01->_curses + iVar17;
|
|
}
|
|
iVar29 = GHIDRA_INT((((float)local_9b8._capacity - 40.0) / 40.0 + 0.5));
|
|
iVar33 = GHIDRA_INT((((float)local_99c - 120.0) / 40.0 + 0.5));
|
|
if (((iVar29 < 0) || (this_01->_curses <= iVar29)) ||
|
|
((iVar33 < 0 ||
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar11)) + 0x0))) = this_01->_isHeartPicked, (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar11)) + 0x1))) = this_01->_isCanSeeEverything,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar11)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_01)) + 0x12)))), iVar11 <= iVar33)))) {
|
|
iVar29 = -1;
|
|
}
|
|
else {
|
|
iVar29 = iVar33 * this_01->_curses + iVar29;
|
|
}
|
|
if (-1 < iVar17) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_1e8) + iVar17)) = 1;
|
|
}
|
|
if (-1 < iVar29) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_1e8) + iVar29)) = 1;
|
|
}
|
|
*(void **)&(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))[4].TotalMoneySpent =
|
|
local_9b8._capacity;
|
|
(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))[4].GreedSubType = GHIDRA_INT(local_99c);
|
|
(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))[4].VisitedCount = GHIDRA_INT(local_9b8._capacity);
|
|
(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))[4].Flags = GHIDRA_INT(local_99c);
|
|
fVar18 = (float)(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_9b8._begin) + 0x14)))[7].Dimension;
|
|
if (0 < GHIDRA_INT(fVar18)) {
|
|
local_9a8 = GHIDRA_CAST<Entity *>(fVar18);
|
|
msvc::set<int>::find_node();
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_a08) + 0xd)) != '\0') ||
|
|
(pfVar35 = local_a08,
|
|
(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(pvVar31) + 0x14)))[7].Dimension < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a08) + 0x10)))
|
|
) {
|
|
pfVar35 = GHIDRA_CAST<float *>(local_9e0.x);
|
|
}
|
|
if (pfVar35 == GHIDRA_CAST<float *>(local_9e0.x)) {
|
|
local_a18.y = (float)(GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_9a4))))->Entity_Pickup::AssignOptionsIndex();
|
|
local_a18.x = (float)(GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(pvVar31) + 0x14)))[7].Dimension;
|
|
std_map_int_insert(&local_9e0,&local_a60,GHIDRA_CAST<int *>(&local_a18));
|
|
}
|
|
else {
|
|
local_9a4->_roomList[7].Dimension = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pfVar35) + 0x14));
|
|
}
|
|
}
|
|
local_9a0 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_9a0->_stage) + 1));
|
|
} while (local_9a0 < GHIDRA_CAST<Game *>((GHIDRA_INT(local_9e8.x) - GHIDRA_INT(local_9ec) >> 2)));
|
|
LAB_0080603d:
|
|
g_pickupIgnoreModifiers = g_pickupIgnoreModifiers + -1;
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&this_01->_roomList[0xa6].SafeGridIndex) + 1)) = 0;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&local_9e0,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&local_9e0,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(local_9e0.x) + 4));
|
|
operator_delete((void *)local_9e0.x,0x18);
|
|
local_14 = -NAN;
|
|
if (local_9ec != (void *)0x0) {
|
|
deallocate(local_9ec,GHIDRA_INT(local_9b8._end) - GHIDRA_INT(local_9ec) >> 2);
|
|
}
|
|
}
|
|
if (DAT_00c82674 != DAT_00c82678) {
|
|
segmentedListEnd = GHIDRA_CAST<float *>(0x0);
|
|
local_a10 = (void *)0x0;
|
|
pfVar35 = GHIDRA_CAST<float *>(0x0);
|
|
local_9c8.y = 0.0;
|
|
local_a0c = GHIDRA_CAST<float *>(0x0);
|
|
local_9a4 = GHIDRA_CAST<Game *>(0x0);
|
|
local_a08 = GHIDRA_CAST<float *>(0x0);
|
|
local_14 = 1.26117e-44;
|
|
local_9c0 = (void *)0x0;
|
|
puVar34 = DAT_00c82674;
|
|
if (GHIDRA_INT(DAT_00c82678) - GHIDRA_INT(DAT_00c82674) >> 2 != 0) {
|
|
do {
|
|
fVar18 = (float)puVar34[GHIDRA_INT(local_9c0)];
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(fVar18) + 0x28));
|
|
if (((iVar17 == 0x1c) || (iVar17 == 0x13)) || (iVar17 == 0xef)) {
|
|
LAB_008060ff:
|
|
if (segmentedListEnd == pfVar35) {
|
|
local_9a8 = GHIDRA_CAST<Entity *>(fVar18);
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
pfVar35 = local_a08;
|
|
}
|
|
else {
|
|
*segmentedListEnd = fVar18;
|
|
local_a0c = segmentedListEnd + 1;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x16c)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x16c)) | 0x4000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x168)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x168));
|
|
puVar34 = DAT_00c82674;
|
|
segmentedListEnd = local_a0c;
|
|
}
|
|
else if (iVar17 == 0x59) goto LAB_008060ff;
|
|
local_9c0 = GHIDRA_CAST<RNG *>((GHIDRA_INT(local_9c0) + 1));
|
|
} while (local_9c0 < (void *)(GHIDRA_INT(DAT_00c82678) - GHIDRA_INT(puVar34) >> 2));
|
|
local_9c8.y = (float)segmentedListEnd;
|
|
local_9a4 = GHIDRA_CAST<Game *>(pfVar35);
|
|
}
|
|
local_9a8 = GHIDRA_CAST<Entity *>(0x0);
|
|
pfVar35 = GHIDRA_CAST<float *>(local_9c8.y);
|
|
if (GHIDRA_INT(DAT_00c82678) - GHIDRA_INT(puVar34) >> 2 != 0) {
|
|
do {
|
|
listedEntity = GHIDRA_CAST<Entity *>(puVar34[GHIDRA_INT(local_9a8)]);
|
|
local_9b8._begin = (void *)listedEntity->_variant;
|
|
local_99c = GHIDRA_CAST<Entity *>((listedEntity->_pos).x);
|
|
local_9a0 = GHIDRA_CAST<Game *>((listedEntity->_pos).y);
|
|
local_9bc = GHIDRA_CAST<Game *>(listedEntity->_type);
|
|
local_9b8._end = (void *)listedEntity->_subtype;
|
|
local_9cc = GHIDRA_CAST<Level *>(listedEntity->_initSeed);
|
|
local_9d4.y = (float)listedEntity;
|
|
if ((listedEntity->_flags & 0x400000000000) == 0) {
|
|
if (((((local_9bc == GHIDRA_CAST<Game *>(0x4e)) || (local_9bc == GHIDRA_CAST<Game *>(0x24))) ||
|
|
((local_9bc == GHIDRA_CAST<Game *>(0x10a) ||
|
|
((local_9bc == GHIDRA_CAST<Game *>(0x54) || (local_9bc == GHIDRA_CAST<Game *>(0x106))))))) ||
|
|
(local_9bc == GHIDRA_CAST<Game *>(0x107))) || (local_9bc == GHIDRA_CAST<Game *>(&DAT_00000065))) {
|
|
local_a38.x = (float)local_99c - 60.0;
|
|
local_a38.y = (float)local_9a0 - 0.0;
|
|
pVVar23 = random_position_away_from_players
|
|
(GHIDRA_CAST<Vector *>((local_a58 + 0x10)),&local_a38,listedEntity->_size,0.0);
|
|
local_9b8._capacity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_9bc),GHIDRA_UINT(local_9b8._begin),pVVar23,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_9b8._end),GHIDRA_UINT(local_9cc));
|
|
pVVar23 = &local_a04;
|
|
local_a04.x = (float)local_99c + 60.0;
|
|
pVVar26 = &local_9e0;
|
|
local_a04.y = (float)local_9a0 + 0.0;
|
|
LAB_008067bb:
|
|
pVVar23 = random_position_away_from_players(pVVar26,pVVar23,listedEntity->_size,0.0);
|
|
(listedEntity->_pos).x = pVVar23->x;
|
|
(listedEntity->_pos).y = pVVar23->y;
|
|
pEVar37 = local_9b8._capacity;
|
|
}
|
|
else {
|
|
if (local_9bc == GHIDRA_CAST<Game *>(0x66)) {
|
|
local_a20.x = (float)local_99c + 0.0;
|
|
local_a20.y = (float)local_9a0 + 30.0;
|
|
pVVar23 = random_position_away_from_players
|
|
(GHIDRA_CAST<Vector *>(local_a70),&local_a20,listedEntity->_size,0.0);
|
|
local_9b8._capacity =
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_9bc),GHIDRA_UINT(local_9b8._begin),pVVar23,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_9b8._end),GHIDRA_UINT(local_9cc));
|
|
pVVar23 = &local_a40;
|
|
pVVar26 = GHIDRA_CAST<Vector *>((local_a70 + 8));
|
|
local_a40.x = (float)local_99c - 0.0;
|
|
local_a40.y = (float)local_9a0 - 30.0;
|
|
goto LAB_008067bb;
|
|
}
|
|
local_9c0 = GHIDRA_CAST<RNG *>(listedEntity->_size);
|
|
if (listedEntity->_entityGridCollisionClass == 5) {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_9d4.y = fVar18 + fVar18;
|
|
fVar18 = cos(local_9d4.y);
|
|
local_a28.x = fVar18 * 20.0 + (float)local_99c;
|
|
fVar18 = sin(local_9d4.y);
|
|
pVVar23 = &local_a28;
|
|
pVVar26 = &local_a60;
|
|
local_a28.y = fVar18 * 20.0 + (float)local_9a0;
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
local_9d4.y = fVar18 + fVar18;
|
|
fVar18 = cos(local_9d4.y);
|
|
local_a30.x = fVar18 * 20.0 + (float)local_99c;
|
|
fVar18 = sin(local_9d4.y);
|
|
pVVar23 = &local_a30;
|
|
pVVar26 = &local_9e8;
|
|
local_a30.y = fVar18 * 20.0 + (float)local_9a0;
|
|
}
|
|
pVVar23 = random_position_away_from_players(pVVar26,pVVar23,(float)local_9c0,0.0);
|
|
pEVar37 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_9bc),GHIDRA_UINT(local_9b8._begin),pVVar23,
|
|
&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),GHIDRA_UINT(local_9b8._end),GHIDRA_UINT(local_9cc));
|
|
}
|
|
if (pEVar37 != GHIDRA_CAST<Entity *>(0x0)) {
|
|
qVar13 = pEVar37->_flags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pEVar37->_flags) + 4));
|
|
*puVar1 = *puVar1 | 0x80;
|
|
*GHIDRA_CAST<int *>(&pEVar37->_flags) = GHIDRA_INT(qVar13);
|
|
pEVar37->_spawnGridIndex = listedEntity->_spawnGridIndex;
|
|
}
|
|
}
|
|
else {
|
|
uVar19 = Random();
|
|
fVar18 = (float)((double)GHIDRA_INT(uVar19) + __uint_to_double_fixup[-(GHIDRA_INT(uVar19) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_9c0 = GHIDRA_CAST<RNG *>((fVar18 + fVar18));
|
|
local_9ac = GHIDRA_CAST<ItemPool *>(sin((float)local_9c0));
|
|
fVar18 = cos((float)local_9c0);
|
|
if (listedEntity->_child == 0) {
|
|
pEVar37 = GHIDRA_CAST<Entity *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) = (void *)0x0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x4))) = (void *)0x0;
|
|
local_9b8._capacity = GHIDRA_CAST<Entity *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x8))) = GHIDRA_CAST<Entity *>(0x0);
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),10);
|
|
local_9a0 = GHIDRA_CAST<Game *>(((float)local_9a0 + (float)local_9ac * 40.0));
|
|
local_9c0 = GHIDRA_CAST<RNG *>((fVar18 * 40.0 + (float)local_99c));
|
|
listedEntity = GHIDRA_CAST<Entity *>(local_9d4.y);
|
|
do {
|
|
local_a18.x = (float)local_9c0;
|
|
local_a18.y = (float)local_9a0;
|
|
local_9d4.y = (float)(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(local_9bc),GHIDRA_UINT(local_9b8._begin),
|
|
&local_a18,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),
|
|
GHIDRA_UINT(local_9b8._end),GHIDRA_UINT(local_9cc));
|
|
if (pEVar37 == local_9b8._capacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
local_9b8._capacity = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_9f8)) + 0x8)));
|
|
pEVar37 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<Entity *>(local_9f8))) + 0x4)));
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<float *>(pEVar37) = local_9d4.y;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x4))) = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar37)) + 0x4)));
|
|
pEVar37 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar37)) + 0x4))));
|
|
}
|
|
listedEntity = GHIDRA_CAST<Entity *>(listedEntity->_parent);
|
|
} while ((listedEntity != GHIDRA_CAST<Entity *>(0x0)) &&
|
|
(((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager) && (listedEntity->_type == 1)) ||
|
|
(listedEntity->_type - 10U < 0x3de))));
|
|
pvVar31 = (void *)(GHIDRA_INT(pEVar37) - (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) >> 2);
|
|
local_9d4.y = 0.0;
|
|
if (pvVar31 != (void *)0x0) {
|
|
pvVar24 = (void *)0x0;
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) + pvVar24 * 4)) + 0xc))();
|
|
pvVar24 = (void *)(GHIDRA_INT(pvVar24) + 1);
|
|
} while (pvVar24 < pvVar31);
|
|
local_9c0 = (void *)0x0;
|
|
local_9ac = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<ItemPool *>(local_9f8))) + 0x0)));
|
|
pfVar35 = GHIDRA_CAST<float *>(local_9c8.y);
|
|
do {
|
|
fVar18 = *GHIDRA_CAST<float *>(local_9ac);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x16c)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x16c)) | 0x4080;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x168)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(fVar18) + 0x168));
|
|
if (GHIDRA_CAST<Game *>(pfVar35) == local_9a4) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate();
|
|
local_9a4 = GHIDRA_CAST<Game *>(local_a08);
|
|
}
|
|
else {
|
|
*pfVar35 = *GHIDRA_CAST<float *>(local_9ac);
|
|
local_a0c = pfVar35 + 1;
|
|
}
|
|
local_9ac = GHIDRA_CAST<ItemPool *>((GHIDRA_INT(local_9ac) + 4));
|
|
local_9c0 = GHIDRA_CAST<RNG *>((GHIDRA_INT(local_9c0) + 1));
|
|
pfVar35 = local_a0c;
|
|
} while (local_9c0 < pvVar31);
|
|
local_9c8.y = (float)local_a0c;
|
|
}
|
|
pfVar35 = GHIDRA_CAST<float *>(local_9c8.y);
|
|
local_14 = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),9);
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<float *>(local_9f8))) + 0x0))) != GHIDRA_CAST<float *>(0x0)) {
|
|
deallocate((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_9f8)) + 0x0))),GHIDRA_INT(local_9b8._capacity) - (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) >> 2);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x0))) = (void *)0x0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x4))) = (void *)0x0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_9f8)) + 0x8))) = GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
}
|
|
}
|
|
local_9a8 = GHIDRA_CAST<Entity *>((GHIDRA_INT(local_9a8) + 1));
|
|
puVar34 = DAT_00c82674;
|
|
} while (local_9a8 < GHIDRA_UINT((GHIDRA_INT(DAT_00c82678) - GHIDRA_INT(DAT_00c82674) >> 2)));
|
|
}
|
|
uVar19 = 0;
|
|
uVar21 = GHIDRA_INT(pfVar35) - GHIDRA_INT(local_a10) >> 2;
|
|
if (uVar21 != 0) {
|
|
do {
|
|
iVar17 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_a10) + uVar19 * 4));
|
|
uVar19 = uVar19 + 1;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x16c)) = *GHIDRA_CAST<uint32_t *>((iVar17 + 0x16c)) & 0xffffbfff;
|
|
*GHIDRA_CAST<uint32_t *>((iVar17 + 0x168)) = *GHIDRA_CAST<uint32_t *>((iVar17 + 0x168));
|
|
} while (uVar19 < uVar21);
|
|
}
|
|
if (local_a10 != (void *)0x0) {
|
|
deallocate(local_a10,GHIDRA_INT(local_9a4) - GHIDRA_INT(local_a10) >> 2);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
LAB_00805bb8:
|
|
local_99c = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_99c)) + 0x10))));
|
|
local_9a4 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_9a4->_stage) + 1));
|
|
if (GHIDRA_CAST<Game *>(&DAT_00000009) < local_9a4) goto LAB_00805a6e;
|
|
pGVar22 = local_9a0;
|
|
goto LAB_008058a0;
|
|
}
|
|
|
|
// 008068f0
|
|
void Room::TriggerClear(uint8_t playSound)
|
|
{
|
|
uint8_t bVar1;
|
|
ChallengeParam *challengeParams;
|
|
RoomDescriptor *roomDesc;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
int iVar2;
|
|
int unusedArg;
|
|
Game *game;
|
|
undefined3 in_stack_00000005;
|
|
short *clearCount;
|
|
uint32_t curses;
|
|
uint32_t debugCurses;
|
|
int descriptor;
|
|
uint32_t *descriptorFlags;
|
|
Manager *manager;
|
|
uint32_t *scoreSheet;
|
|
|
|
scoreSheet = &g_game->_scoreSheet;
|
|
descriptorFlags = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
*descriptorFlags = *descriptorFlags | 1;
|
|
clearCount = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x4a));
|
|
*clearCount = *clearCount + 1;
|
|
descriptor = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
ScoreSheet::add_cleared_room
|
|
(GHIDRA_CAST<ScoreSheet *>(scoreSheet),this->_roomType,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((descriptor + 0x10)) + 0x48)),
|
|
GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((descriptor + 0x4a))),(uint8_t)(*GHIDRA_CAST<uint32_t *>((descriptor + 0x44)) >> 10) & 1);
|
|
game = g_game;
|
|
if ((((g_game->_challenge == 0x1f) ||
|
|
(challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams(), challengeParams->_pathType == 3)) ||
|
|
(challengeParams->_endStage == 0xd)) &&
|
|
(roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(game->_currentRoomIdx,-1), game = g_game,
|
|
roomDesc->ListIndex == g_game->_lastBossRoomListIdx)) {
|
|
debugCurses = g_game->_debugCurses;
|
|
descriptor = g_game->_stage;
|
|
curses = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
iVar2 = descriptor + 1;
|
|
if ((~preventedCurses & (forcedCurses | debugCurses | curses) & 2) == 0) {
|
|
iVar2 = descriptor;
|
|
}
|
|
if (iVar2 == 6) {
|
|
update_door_targets(this);
|
|
}
|
|
game = g_game;
|
|
}
|
|
if ((game->_difficulty != 2) && (game->_difficulty != 3)) {
|
|
TrySpawnSecretExit(this,1,0);
|
|
}
|
|
TrySpawnDevilRoomDoor(this,1,0);
|
|
manager = g_manager;
|
|
if (playSound == 0) {
|
|
_playSound = 0x24;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&playSound));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_playSound,1.0,2,0,1.0,0.0);
|
|
}
|
|
game = g_game;
|
|
if ((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) {
|
|
TrySpawnBossRushDoor(this,0,0);
|
|
TrySpawnBlueWombDoor(this,1,0,0);
|
|
TrySpawnTheVoidDoor(this,0);
|
|
manager = g_manager;
|
|
game = g_game;
|
|
if (((((*GHIDRA_CAST<char *>(&g_game->_seedEffects) == '\0') &&
|
|
(((bVar1 = (GHIDRA_CAST<Seeds *>((&g_game->_seedEffects)))->Seeds::AchievementUnlocksDisallowed(), bVar1 == 0 &&
|
|
(bVar1 = Manager::IsGameplayInputActive(unusedArg), bVar1 == 0)) &&
|
|
(game->_isRerun == 0)))) || (manager->_netplayManager != *GHIDRA_CAST<int *>((manager + 1)))) &&
|
|
((((manager->_persistentGameData)._eventCounters[0x19] != 0 &&
|
|
((game->_levelStateFlags & 0x10000U) == 0)) &&
|
|
((roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(game->_currentRoomIdx,-1), game = g_game,
|
|
roomDesc->ListIndex == g_game->_lastBossRoomListIdx &&
|
|
((g_game->_stage == 1 && (g_game->_stageType != 4)))))))) &&
|
|
((g_game->_stageType != 5 && (g_game->_frameCount < 0x709)))) {
|
|
g_game->_levelStateFlags = g_game->_levelStateFlags | 0x10000;
|
|
manager = g_manager;
|
|
_playSound = 0x5a;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&playSound));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_playSound,1.0,2,0,1.0,0.0);
|
|
game = g_game;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x72fc)))) = 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 7 & 1) == 0) {
|
|
if (((game->_difficulty != 2) && (game->_difficulty != 3)) || (this->_roomType != 1)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::trigger_room_clear();
|
|
}
|
|
SpawnClearAward(this);
|
|
game = g_game;
|
|
}
|
|
descriptor = game->_difficulty;
|
|
if ((descriptor == 2) || (descriptor == 3)) {
|
|
if (this->_roomType == 1) {
|
|
iVar2 = game->_greedModeWave;
|
|
game->_greedLastBeatenWave = iVar2;
|
|
bVar1 = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::IsCoopPlay();
|
|
if ((bVar1 == 0) || (iVar2 != (descriptor == 3) + 10)) goto LAB_00806c0a;
|
|
}
|
|
else if (((this->_roomType != 5) || (this->_bossId != 0x3e)) ||
|
|
(bVar1 = (GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::IsCoopPlay(), bVar1 == 0))
|
|
goto LAB_00806c0a;
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::revive_player_ghosts();
|
|
}
|
|
LAB_00806c0a:
|
|
Game::save_rewind_state(-1);
|
|
return;
|
|
}
|
|
|
|
// 0080bd20
|
|
void Room::render_player_light(Entity_Player *player, Vector *offset)
|
|
{
|
|
void *pvVar1;
|
|
int iVar2;
|
|
Room *pRVar3;
|
|
code *pcVar4;
|
|
uint8_t bVar5;
|
|
Vector *pVVar6;
|
|
uint32_t uVar7;
|
|
LayerState *layer;
|
|
ANM2 *lightSprite;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
float fVar11;
|
|
double dVar12;
|
|
uint32_t local_88 [8];
|
|
uint32_t local_68;
|
|
uint32_t uStack_64;
|
|
uint32_t local_60;
|
|
ColorMod color;
|
|
RNG rng;
|
|
float renderOffsetX;
|
|
Room *local_1c;
|
|
Vector renderPos;
|
|
float local_10;
|
|
Vector local_c;
|
|
ColorMod *lightColor;
|
|
int minecart;
|
|
|
|
rng._seed = g_game->_frameCount + player->_initSeed;
|
|
minecart = player->_minecart;
|
|
rng._shift3 = 0x19;
|
|
rng._shift1 = 5;
|
|
rng._shift2 = 0x1b;
|
|
renderOffsetX = offset->x;
|
|
fVar8 = offset->y;
|
|
local_1c = this;
|
|
if (minecart == 0) {
|
|
fVar9 = g_vectorZero.x;
|
|
fVar10 = g_vectorZero.y;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((minecart + 0x7c)) == 0) ||
|
|
(pVVar6 = (GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((minecart + 0x78)))))->AnimationState::GetNullFrameById(0),
|
|
pVVar6 == GHIDRA_CAST<Vector *>(0x0))) {
|
|
pVVar6 = &g_vectorZero;
|
|
}
|
|
fVar9 = pVVar6->x;
|
|
fVar10 = pVVar6->y;
|
|
}
|
|
minecart = player->_type;
|
|
renderOffsetX = renderOffsetX + fVar9;
|
|
fVar8 = fVar8 + fVar10;
|
|
if (minecart == 1) {
|
|
local_c.y = g_displayPixelRatio * g_screenPointScale;
|
|
local_10 = ((g_screenWidth - 338.0) * 0.5 + ((player->_pos).x - 60.0) * 0.65) * local_c.y + 0.5;
|
|
dVar12 = floor((double)local_10);
|
|
local_10 = (float)dVar12 / local_c.y;
|
|
renderPos.y = ((g_screenHeight - 182.0) * 0.5 + ((player->_pos).y - 140.0) * 0.65) * local_c.y +
|
|
0.5;
|
|
dVar12 = floor((double)renderPos.y);
|
|
renderPos.x = local_10 + renderOffsetX;
|
|
offset = GHIDRA_CAST<Vector *>((fVar8 + (float)dVar12 / local_c.y));
|
|
renderPos.y = (float)offset;
|
|
local_10 = renderPos.x;
|
|
minecart = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::GetNullEffectNum(0x4a);
|
|
local_c.y = (float)minecart;
|
|
if (4.0 <= local_c.y) {
|
|
local_c.y = 4.0;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<TemporaryEffects *>((&player->_temporaryeffects)))->TemporaryEffects::HasNullEffect(0x4a);
|
|
uVar7 = g_graphicsManager_flags;
|
|
if (bVar5 != 0) {
|
|
lightSprite = &this->_lightSprite;
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
color._tint[0] = 0.4;
|
|
color._colorize[0] = 0.0;
|
|
color._colorize[1] = 0.0;
|
|
color._colorize[2] = 0.0;
|
|
color._colorize[3] = 0.0;
|
|
minecart = 1;
|
|
if ((uVar7 & 4) == 0) {
|
|
minecart = 6;
|
|
}
|
|
layer->_blendMode[1] = minecart;
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[2] = 1;
|
|
color._tint[3] = local_c.y * 0.07 + 0.2;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 1;
|
|
color._tint[1] = 0.6;
|
|
color._tint[2] = 1.0;
|
|
color._offset[0] = 0.0;
|
|
color._offset[1] = 0.0;
|
|
color._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(&color);
|
|
fVar9 = local_c.y * 0.5 + 1.0;
|
|
fVar8 = fVar9 * g_vectorOne.x;
|
|
(local_1c->_lightSprite)._scale.y = fVar9 * g_vectorOne.y;
|
|
(local_1c->_lightSprite)._scale.x = fVar8;
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero);
|
|
uVar7 = g_graphicsManager_flags;
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
minecart = 1;
|
|
offset = GHIDRA_CAST<Vector *>(renderPos.y);
|
|
if ((uVar7 & 4) == 0) {
|
|
minecart = 6;
|
|
}
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = minecart;
|
|
layer->_blendMode[2] = 7;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 7;
|
|
local_10 = renderPos.x;
|
|
this = local_1c;
|
|
}
|
|
uVar7 = g_graphicsManager_flags;
|
|
if (player->_babySkin == 0x42) {
|
|
lightSprite = &this->_lightSprite;
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
color._offset[0] = 0.0;
|
|
color._offset[1] = 0.0;
|
|
minecart = 1;
|
|
color._offset[2] = 0.0;
|
|
if ((uVar7 & 4) == 0) {
|
|
minecart = 6;
|
|
}
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = minecart;
|
|
layer->_blendMode[2] = 1;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 1;
|
|
color._colorize[0] = 0.0;
|
|
color._colorize[1] = 0.0;
|
|
color._colorize[2] = 0.0;
|
|
color._colorize[3] = 0.0;
|
|
color._tint[0] = 1.0;
|
|
color._tint[1] = 1.0;
|
|
color._tint[2] = 0.9;
|
|
color._tint[3] = 1.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(&color);
|
|
fVar8 = g_vectorOne.y * 2.0;
|
|
(local_1c->_lightSprite)._scale.x = g_vectorOne.x * 2.0;
|
|
(local_1c->_lightSprite)._scale.y = fVar8;
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero);
|
|
uVar7 = g_graphicsManager_flags;
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
minecart = 1;
|
|
offset = GHIDRA_CAST<Vector *>(renderPos.y);
|
|
if ((uVar7 & 4) == 0) {
|
|
minecart = 6;
|
|
}
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = minecart;
|
|
layer->_blendMode[2] = 7;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 7;
|
|
local_10 = renderPos.x;
|
|
}
|
|
pvVar1 = (g_manager->_itemConfig)._collectibles._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0x401)
|
|
{
|
|
local_c.y = 0.0;
|
|
}
|
|
else {
|
|
local_c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x400));
|
|
}
|
|
minecart = player->_playerCostumeMap[0]._index;
|
|
if (((minecart < 0) ||
|
|
(*GHIDRA_CAST<float *>((minecart * 0x130 + 0x114 + GHIDRA_INT((player->_costumeSpriteDescs)._begin))) !=
|
|
local_c.y)) &&
|
|
(bVar5 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x101,0), pRVar3 = local_1c, bVar5 == 0)) {
|
|
pvVar1 = (g_manager->_itemConfig)._nullItems._begin;
|
|
if (GHIDRA_INT((GHIDRA_INT((g_manager->_itemConfig)._nullItems._end) - GHIDRA_INT(pvVar1) & 0xfffffffcU)) < 0xe1) {
|
|
minecart = 0;
|
|
}
|
|
else {
|
|
minecart = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0xe0));
|
|
}
|
|
iVar2 = player->_playerCostumeMap[0]._index;
|
|
if ((iVar2 < 0) ||
|
|
(*GHIDRA_CAST<int *>((iVar2 * 0x130 + 0x114 + GHIDRA_INT((player->_costumeSpriteDescs)._begin))) != minecart))
|
|
{
|
|
return;
|
|
}
|
|
color._offset[0] = 0.0;
|
|
color._colorize[0] = 0.0;
|
|
color._colorize[1] = 0.0;
|
|
color._colorize[2] = 0.0;
|
|
color._colorize[3] = 0.0;
|
|
color._tint[0] = 1.0;
|
|
color._tint[1] = 0.8;
|
|
color._tint[2] = 0.7;
|
|
color._tint[3] = 0.7;
|
|
color._offset[1] = 0.0;
|
|
color._offset[2] = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&local_1c->_lightSprite))))->Sprite::SetColor(&color);
|
|
(pRVar3->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(pRVar3->_lightSprite)._scale.y = g_vectorOne.y;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
pVVar6 = RandomVector(&local_c,uVar7);
|
|
fVar9 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::RandomFloat();
|
|
fVar8 = (fVar9 + fVar9) * pVVar6->y;
|
|
renderPos.x = (fVar9 + fVar9) * pVVar6->x;
|
|
}
|
|
else {
|
|
pRVar3 = local_1c;
|
|
local_68 = 0;
|
|
uStack_64 = 0;
|
|
lightColor = &(local_1c->_lightSprite)._color;
|
|
local_60 = 0;
|
|
if (lightColor != GHIDRA_CAST<ColorMod *>(local_88)) {
|
|
(local_1c->_lightSprite)._color._colorize[0] = 0.0;
|
|
(local_1c->_lightSprite)._color._colorize[1] = 0.0;
|
|
(local_1c->_lightSprite)._color._colorize[2] = 0.0;
|
|
(local_1c->_lightSprite)._color._colorize[3] = 0.0;
|
|
(local_1c->_lightSprite)._color._offset[0] = 0.0;
|
|
(local_1c->_lightSprite)._color._offset[1] = 0.0;
|
|
lightColor->_tint[0] = 1.0;
|
|
(local_1c->_lightSprite)._color._tint[1] = 0.6;
|
|
(local_1c->_lightSprite)._color._tint[2] = 0.4;
|
|
(local_1c->_lightSprite)._color._tint[3] = 0.7;
|
|
(local_1c->_lightSprite)._color._offset[2] = 0.0;
|
|
}
|
|
(local_1c->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(local_1c->_lightSprite)._scale.y = g_vectorOne.y;
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
pVVar6 = RandomVector(&local_c,uVar7);
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(rng._seed) >> ((uint8_t)rng._shift1 & 0x1f) ^ rng._seed;
|
|
uVar7 = uVar7 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar7;
|
|
uVar7 = uVar7 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar7;
|
|
renderPos.x = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
renderPos.x = renderPos.x + renderPos.x;
|
|
fVar8 = renderPos.x * pVVar6->y;
|
|
renderPos.x = renderPos.x * pVVar6->x;
|
|
}
|
|
lightSprite = &pRVar3->_lightSprite;
|
|
renderPos.y = fVar8 + (float)offset;
|
|
renderPos.x = renderPos.x + local_10;
|
|
}
|
|
else if (minecart == 9) {
|
|
if ((g_manager->_optionsConfig)._enableBulletVisibility == 0) {
|
|
return;
|
|
}
|
|
fVar9 = sin((float)g_game->_frameCount * 0.8);
|
|
color._offset[0] = 0.0;
|
|
color._offset[1] = 0.0;
|
|
color._colorize[0] = 0.0;
|
|
color._colorize[1] = 0.0;
|
|
color._colorize[2] = 0.0;
|
|
color._colorize[3] = 0.0;
|
|
color._offset[2] = 0.0;
|
|
fVar10 = (fVar9 * 0.5 + 0.5) * 0.20000002 + 0.1;
|
|
color._tint[0] = 1.0;
|
|
color._tint[1] = 1.0;
|
|
color._tint[2] = 1.0;
|
|
color._tint[3] = 0.4;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(&color);
|
|
fVar9 = g_displayPixelRatio;
|
|
fVar11 = fVar10 * g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = fVar10 * g_vectorOne.y;
|
|
(this->_lightSprite)._scale.x = fVar11;
|
|
fVar9 = fVar9 * g_screenPointScale;
|
|
local_c.y = ((((player->_pos).x + (player->_posOffset).x) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * fVar9 + 0.5;
|
|
dVar12 = floor((double)local_c.y);
|
|
renderPos.x = (float)dVar12 / fVar9 + renderOffsetX;
|
|
local_c.y = ((((player->_pos).y + (player->_posOffset).y) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5) * fVar9 + 0.5;
|
|
dVar12 = floor((double)local_c.y);
|
|
local_c.y = (float)dVar12;
|
|
lightSprite = &this->_lightSprite;
|
|
renderPos.y = local_c.y / fVar9 + fVar8;
|
|
}
|
|
else {
|
|
if (minecart != 0x328) {
|
|
return;
|
|
}
|
|
if (player->_visible == 0) {
|
|
return;
|
|
}
|
|
local_1c = GHIDRA_CAST<Room *>((g_displayPixelRatio * g_screenPointScale));
|
|
dVar12 = floor((double)(((((player->_pos).x + 0.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_1c + 0.5));
|
|
fVar9 = (float)dVar12 / (float)local_1c;
|
|
local_c.y = ((((player->_pos).y - 16.0) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)local_1c + 0.5;
|
|
dVar12 = floor((double)local_c.y);
|
|
local_c.y = (float)dVar12;
|
|
fVar9 = fVar9 + renderOffsetX;
|
|
fVar10 = local_c.y / (float)local_1c;
|
|
color._offset[0] = 0.0;
|
|
color._offset[1] = 0.0;
|
|
color._offset[2] = 0.0;
|
|
color._colorize[0] = 0.0;
|
|
color._colorize[1] = 0.0;
|
|
color._colorize[2] = 0.0;
|
|
color._colorize[3] = 0.0;
|
|
color._tint[0] = 0.6;
|
|
color._tint[1] = 0.4;
|
|
color._tint[2] = 0.2;
|
|
color._tint[3] = 0.7;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(&color);
|
|
uVar7 = (GHIDRA_CAST<RNG *>((&rng)))->RNG::Next();
|
|
pVVar6 = RandomVector(&local_c,uVar7);
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar4 = (code *)swi(3);
|
|
(*pcVar4)();
|
|
return;
|
|
}
|
|
uVar7 = GHIDRA_UINT(rng._seed) >> ((uint8_t)rng._shift1 & 0x1f) ^ rng._seed;
|
|
uVar7 = uVar7 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar7;
|
|
lightSprite = &this->_lightSprite;
|
|
uVar7 = uVar7 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar7;
|
|
fVar11 = (float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
renderPos.y = fVar11 * pVVar6->y + fVar8 + fVar10;
|
|
renderPos.x = fVar11 * pVVar6->x + fVar9;
|
|
fVar8 = g_vectorOne.y * 0.5;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(this->_lightSprite)._scale.y = fVar8;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero);
|
|
return;
|
|
}
|
|
|
|
// 0080c810
|
|
void Room::render_grid_entity_light(GridEntity *param_2, float *param_3)
|
|
{
|
|
int *piVar1;
|
|
uint8_t isLastBoss;
|
|
int iVar2;
|
|
ColorMod *color;
|
|
ColorMod *color_00;
|
|
ColorMod *color_01;
|
|
ColorMod *color_02;
|
|
int frame;
|
|
ColorMod *color_03;
|
|
ColorMod *color_04;
|
|
RoomDescriptor *roomDesc;
|
|
ColorMod *color_05;
|
|
ColorMod *color_06;
|
|
ColorMod *color_07;
|
|
ColorMod *tmpColor;
|
|
ColorMod *color_08;
|
|
ColorMod *color_09;
|
|
void *layerFrame;
|
|
ColorMod *color_10;
|
|
uint32_t uVar3;
|
|
Vector *randomDir;
|
|
LayerState *layer;
|
|
ColorMod *color_11;
|
|
Vector *pVVar4;
|
|
uint8_t unused;
|
|
uint8_t unused_00;
|
|
uint8_t unused_01;
|
|
Game *game;
|
|
float b;
|
|
float fVar5;
|
|
double dVar6;
|
|
float fVar7;
|
|
Color local_68;
|
|
RNG local_3c;
|
|
Vector gridPos;
|
|
Vector local_20;
|
|
Vector local_18;
|
|
float *local_10;
|
|
Vector local_c;
|
|
GridEntity *gridEntity;
|
|
ANM2 *lightSprite;
|
|
|
|
gridEntity = param_2;
|
|
game = g_game;
|
|
local_3c._shift1 = 5;
|
|
local_3c._shift2 = 0x1b;
|
|
local_10 = GHIDRA_CAST<float *>(g_game->_frameCount);
|
|
local_3c._seed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x14)))) + GHIDRA_INT(local_10);
|
|
local_3c._shift3 = 0x19;
|
|
local_20.y = (float)this;
|
|
iVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::get_secret_exit_kind();
|
|
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x4))))) {
|
|
case 7:
|
|
iVar2 = this->_backdropType;
|
|
if (iVar2 == 0x20) {
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0) {
|
|
fVar5 = sin((float)GHIDRA_INT(local_10) * 0.1);
|
|
local_20.y = fVar5 * 0.2 + 0.8;
|
|
local_c.y = (local_20.y * 0.1 + 0.9) * this->_lavaIntensity;
|
|
if (1 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0xc))))) {
|
|
local_c.y = local_c.y * 0.5;
|
|
}
|
|
if (local_c.y <= 0.0) {
|
|
return;
|
|
}
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
fVar5 = g_displayPixelRatio * g_screenPointScale;
|
|
local_10 = GHIDRA_CAST<float *>((((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * fVar5 +
|
|
0.5));
|
|
dVar6 = floor((double)(float)local_10);
|
|
local_18.y = (float)dVar6 / fVar5;
|
|
local_10 = GHIDRA_CAST<float *>((((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 +
|
|
0.5));
|
|
dVar6 = floor((double)(float)local_10);
|
|
local_10 = GHIDRA_CAST<float *>((float)dVar6);
|
|
local_18.x = local_18.y + *param_3;
|
|
local_18.y = (float)local_10 / fVar5 + param_3[1];
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,local_20.y * 0.35,0.0,local_c.y);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color);
|
|
pVVar4 = &local_18;
|
|
fVar5 = g_vectorOne.y * 0.8;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.8;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
goto LAB_0080e2d3;
|
|
}
|
|
}
|
|
else if (((iVar2 == 0x3a) || (iVar2 == 0x3b)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0)) goto LAB_0080cac5;
|
|
isLastBoss = (GHIDRA_CAST<Seeds *>((&game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
|
|
if (isLastBoss == 0) {
|
|
return;
|
|
}
|
|
uVar3 = (GHIDRA_CAST<Game *>((game)))->Game::GetStageID(unused);
|
|
if (uVar3 != 6) {
|
|
return;
|
|
}
|
|
if (this->_waterAmount <= 0.5) {
|
|
return;
|
|
}
|
|
game = g_game;
|
|
LAB_0080cac5:
|
|
fVar5 = sin((float)game->_frameCount * 0.1);
|
|
local_c.y = fVar5 * 0.2 + 0.8;
|
|
param_2 = GHIDRA_CAST<GridEntity *>(this->_lavaIntensity);
|
|
isLastBoss = (GHIDRA_CAST<Seeds *>((&game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
|
|
if ((isLastBoss != 0) && (uVar3 = (GHIDRA_CAST<Game *>((game)))->Game::GetStageID(unused_00), uVar3 == 6)) {
|
|
param_2 = GHIDRA_CAST<GridEntity *>(0x3f800000);
|
|
}
|
|
param_2 = GHIDRA_CAST<GridEntity *>(((local_c.y * 0.1 + 0.9) * (float)param_2));
|
|
if (1 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gridEntity)) + 0xc))))) {
|
|
param_2 = GHIDRA_CAST<GridEntity *>(((float)param_2 * 0.5));
|
|
}
|
|
if ((float)param_2 <= 0.0) {
|
|
return;
|
|
}
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((gridEntity)))->GridEntity::Position(&gridPos);
|
|
local_10 = GHIDRA_CAST<float *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)local_10 + 0.5
|
|
;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)local_10;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)local_10 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_20.x = local_18.y + *param_3;
|
|
local_20.y = (float)dVar6 / (float)local_10 + param_3[1];
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
game = g_game;
|
|
layer->_blendMode[0] = DAT_00c35b6c;
|
|
layer->_blendMode[1] = DAT_00c35b70;
|
|
layer->_blendMode[2] = DAT_00c35b74;
|
|
layer->_blendMode[3] = DAT_00c35b78;
|
|
layer->_blendMode[4] = DAT_00c35b7c;
|
|
isLastBoss = (GHIDRA_CAST<Seeds *>((&game->_seedEffects)))->Seeds::HasSeedEffect(0x4f);
|
|
if ((isLastBoss == 0) || (uVar3 = (GHIDRA_CAST<Game *>((game)))->Game::GetStageID(unused_01), uVar3 != 6)) {
|
|
b = 0.0;
|
|
fVar5 = 0.0;
|
|
fVar7 = local_c.y * 0.4 + 0.6;
|
|
}
|
|
else {
|
|
fVar5 = local_c.y * 0.3 + 0.4;
|
|
b = local_c.y * 0.4 + 0.6;
|
|
fVar7 = 0.0;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(fVar7,fVar5,b,(float)param_2);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_00);
|
|
fVar5 = g_vectorOne.y * 0.8;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.8;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::Render(&local_20,&g_vectorZero,&g_vectorZero);
|
|
layer = (GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_blendMode[0] = DAT_00c354ac;
|
|
layer->_blendMode[1] = DAT_00c354b0;
|
|
layer->_blendMode[2] = DAT_00c354b4;
|
|
layer->_blendMode[3] = DAT_00c354b8;
|
|
layer->_blendMode[4] = DAT_00c354bc;
|
|
return;
|
|
default:
|
|
goto switchD_0080c86a_caseD_8;
|
|
case 0x10:
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(param_2[1])) + 0xc)))) == 0x1b) {
|
|
if (iVar2 == 2) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8)))) == 8) {
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.5,0.2,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_01);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2
|
|
+ 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0xc)))) != 4) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.5,0.2,0.5);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_02);
|
|
fVar5 = g_vectorOne.y * 0.5;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2
|
|
+ 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar2 != 3) {
|
|
return;
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8))));
|
|
if (iVar2 == 1) {
|
|
return;
|
|
}
|
|
isLastBoss = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("KeyOpen"));
|
|
if ((isLastBoss != 0) && (frame = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetFrame(), frame < 0x13)) {
|
|
return;
|
|
}
|
|
if (iVar2 != 8) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(0.8,0.1,1.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_03);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2
|
|
+ 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
}
|
|
else if ((game->_currentRoomIdx == -10) && (iVar2 == 4)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8)))) != 8) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.2,0.2,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_04);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
else {
|
|
piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x10));
|
|
if ((piVar1 == GHIDRA_CAST<int *>(0x0)) || (*piVar1 != 0x23)) {
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetRoomByIdx(GHIDRA_INT(param_2[2]._sprite._color._tint[1]),-1);
|
|
if ((roomDesc->Flags & 0x40000U) == 0) {
|
|
if (((GHIDRA_UINT(param_2[2]._sprite._color._colorize[0]) >> 5 & 1) == 0) ||
|
|
(g_game->_currentDimensionIdx != 1)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(param_2[1])) + 0xc)))) != 0xf) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8)))) != 8) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(0.92,0.95,1.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_07);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
else {
|
|
layer = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005);
|
|
if (layer->_visible == 0) {
|
|
return;
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005);
|
|
if ((layer->_color)._tint[3] <= 0.0) {
|
|
return;
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005);
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.95,0.9,(layer->_color)._tint[3]);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_06);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(0.3,0.6,1.0,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_05);
|
|
fVar5 = g_vectorOne.y * 0.7;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.7;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2
|
|
+ 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) *
|
|
(float)param_2 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
}
|
|
else {
|
|
layer = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x3));
|
|
if (layer->_visible == 0) {
|
|
return;
|
|
}
|
|
layer = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x3));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(&layer->_color);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2
|
|
+ 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
}
|
|
break;
|
|
case 0x11:
|
|
if ((this->_roomType != 0x1b) || (iVar2 != 2)) {
|
|
isLastBoss = IsCurrentRoomLastBoss(this);
|
|
if (isLastBoss == 0) {
|
|
return;
|
|
}
|
|
isLastBoss = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsMausoleumHeartStage();
|
|
if (isLastBoss == 0) {
|
|
return;
|
|
}
|
|
lightSprite = &this->_lightSprite;
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_3c._seed = layer->_blendMode[0];
|
|
local_3c._shift1 = layer->_blendMode[1];
|
|
local_3c._shift2 = layer->_blendMode[2];
|
|
local_3c._shift3 = layer->_blendMode[3];
|
|
iVar2 = layer->_blendMode[4];
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_blendMode[0] = DAT_00c35b6c;
|
|
layer->_blendMode[1] = DAT_00c35b70;
|
|
layer->_blendMode[2] = DAT_00c35b74;
|
|
layer->_blendMode[3] = DAT_00c35b78;
|
|
layer->_blendMode[4] = DAT_00c35b7c;
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.5,0.5,2.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(lightSprite))))->Sprite::SetColor(color_11);
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_20.y) + 0x6e40)))->_scale).x = 1.2;
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_20.y) + 0x6e40)))->_scale).y = 0.75;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
fVar5 = g_displayPixelRatio * g_screenPointScale;
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / fVar5;
|
|
local_20.y = ((g_screenHeight - 182.0) * 0.5 + (pVVar4->y - 140.0) * 0.65) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_20.x = local_18.y + *param_3;
|
|
local_20.y = (float)dVar6 / fVar5 + param_3[1];
|
|
(GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::Render(&local_20,&g_vectorZero,&g_vectorZero);
|
|
layer = (GHIDRA_CAST<ANM2 *>((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_blendMode[1] = local_3c._shift1;
|
|
layer->_blendMode[0] = local_3c._seed;
|
|
layer->_blendMode[2] = local_3c._shift2;
|
|
layer->_blendMode[3] = local_3c._shift3;
|
|
layer->_blendMode[4] = iVar2;
|
|
return;
|
|
}
|
|
layerFrame = (GHIDRA_CAST<ANM2 *>((¶m_2->_sprite)))->ANM2::GetLayerFrame(0);
|
|
if (layerFrame == (void *)0x0) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(layerFrame) + 0xc)) == '\0') {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.8,0.2,1.0);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_10);
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(this->_lightSprite)._scale.y = g_vectorOne.y;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
fVar5 = g_displayPixelRatio * g_screenPointScale;
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / fVar5;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_20.y = (float)dVar6 / fVar5;
|
|
fVar5 = *param_3;
|
|
local_10 = GHIDRA_CAST<float *>(param_3[1]);
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&local_3c)))->RNG::Next();
|
|
randomDir = RandomVector(&local_c,uVar3);
|
|
fVar7 = (GHIDRA_CAST<RNG *>((&local_3c)))->RNG::RandomFloat();
|
|
pVVar4 = &local_18;
|
|
local_18.x = local_18.y + fVar5 + 0.0 + fVar7 * randomDir->x * 3.0;
|
|
local_18.y = fVar7 * randomDir->y * 3.0 + ((local_20.y + (float)local_10) - 14.0);
|
|
goto LAB_0080e2d3;
|
|
case 0x14:
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0xc))));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8)))) == 9) {
|
|
if (iVar2 == 0) {
|
|
fVar5 = 1.0;
|
|
}
|
|
else {
|
|
fVar5 = 0.25;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,0.4,0.4,fVar5);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(tmpColor);
|
|
fVar5 = g_vectorOne.y * 0.5;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((param_2)) + 0x8)))) == 3) {
|
|
if (iVar2 == 0) {
|
|
fVar5 = 1.0;
|
|
}
|
|
else {
|
|
fVar5 = 0.25;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,1.0,0.0,fVar5);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_08);
|
|
fVar5 = g_vectorOne.y * 0.5;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
else {
|
|
if (iVar2 != 0) {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&local_68)))->Color::Color(1.0,1.0,1.0,0.2);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(color_09);
|
|
fVar5 = g_vectorOne.y * 0.5;
|
|
(this->_lightSprite)._scale.x = g_vectorOne.x * 0.5;
|
|
(this->_lightSprite)._scale.y = fVar5;
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
param_2 = GHIDRA_CAST<GridEntity *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / (float)param_2;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * (float)param_2 +
|
|
0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
fVar5 = (float)dVar6;
|
|
}
|
|
break;
|
|
case 0x17:
|
|
if ((param_2->_sprite)._animState._animData == (void *)0x0) {
|
|
return;
|
|
}
|
|
local_10 = (GHIDRA_CAST<AnimationState *>((&(param_2->_sprite)._animState)))->AnimationState::GetNullFrameById(0);
|
|
if (local_10 == GHIDRA_CAST<float *>(0x0)) {
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((local_10 + 3)) == '\0') {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_lightSprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>((local_10 + 6)));
|
|
(this->_lightSprite)._scale.x = local_10[4];
|
|
(this->_lightSprite)._scale.y = local_10[5];
|
|
pVVar4 = (GHIDRA_CAST<GridEntity *>((param_2)))->GridEntity::Position(&gridPos);
|
|
fVar5 = g_displayPixelRatio * g_screenPointScale;
|
|
local_20.y = ((g_screenWidth - 338.0) * 0.5 + (pVVar4->x - 60.0) * 0.65) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_18.y = (float)dVar6 / fVar5;
|
|
local_20.y = ((pVVar4->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * fVar5 + 0.5;
|
|
dVar6 = floor((double)local_20.y);
|
|
local_20.x = local_18.y + *param_3 + *local_10;
|
|
local_20.y = (float)dVar6 / fVar5 + param_3[1] + local_10[1];
|
|
goto LAB_0080e2c3;
|
|
}
|
|
local_20.x = local_18.y + *param_3;
|
|
local_20.y = fVar5 / (float)param_2 + param_3[1];
|
|
LAB_0080e2c3:
|
|
pVVar4 = &local_20;
|
|
LAB_0080e2d3:
|
|
(GHIDRA_CAST<ANM2 *>((&this->_lightSprite)))->ANM2::Render(pVVar4,&g_vectorZero,&g_vectorZero);
|
|
switchD_0080c86a_caseD_8:
|
|
return;
|
|
}
|
|
|
|
// 0080e320
|
|
uint8_t Room::pick_special_clear_award(int *outCollectible, uint32_t *outTrinket, RNG *rng)
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
int collectibleId;
|
|
uint32_t trinketChoices [12];
|
|
Game *game;
|
|
int *numAvailableTrinkets;
|
|
void *trinketPool;
|
|
|
|
trinketChoices[0xb] = __security_cookie ^ GHIDRA_UINT((trinketChoices + 0xc));
|
|
*outCollectible = 0;
|
|
*outTrinket = 0;
|
|
if ((this->_roomType != 5) && (this->_secondBossID != 0)) {
|
|
return 0;
|
|
}
|
|
uVar3 = rng->_seed;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
uVar3 = rng->_seed;
|
|
if (uVar3 == 0) {
|
|
pcVar1 = (code *)swi(3);
|
|
bVar2 = (*pcVar1)();
|
|
return bVar2;
|
|
}
|
|
}
|
|
uVar3 = uVar3 >> ((uint8_t)rng->_shift1 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((uint8_t)rng->_shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((uint8_t)rng->_shift3 & 0x1f) ^ uVar3;
|
|
rng->_seed = uVar3;
|
|
if (uVar3 % 100 != 0) goto switchD_0080e3e0_caseD_5;
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 0x10000) != 0) {
|
|
switchD_0080e3e0_caseD_56:
|
|
*outCollectible = 0x27f;
|
|
collectibleId = 0x27f;
|
|
goto LAB_0080e7b8;
|
|
}
|
|
switch(this->_bossId) {
|
|
case 1:
|
|
*outCollectible = 0x56;
|
|
collectibleId = 0x56;
|
|
break;
|
|
case 2:
|
|
case 7:
|
|
case 0x1a:
|
|
case 0x25:
|
|
trinketChoices[0] = 0xc;
|
|
trinketChoices[1] = 0x1a;
|
|
trinketChoices[2] = 9;
|
|
trinketChoices[3] = 0xb;
|
|
trinketChoices[4] = 0x1b;
|
|
trinketChoices[5] = 10;
|
|
trinketChoices[6] = 0x40;
|
|
trinketChoices[7] = 0x41;
|
|
trinketChoices[8] = 0x60;
|
|
trinketChoices[9] = 0x90;
|
|
trinketChoices[10] = 0x42;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((rng)))->RNG::RandomInt(0xb);
|
|
*outTrinket = trinketChoices[uVar3];
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 3:
|
|
*outCollectible = 0x58;
|
|
collectibleId = 0x58;
|
|
break;
|
|
case 4:
|
|
case 0x1c:
|
|
case 0x31:
|
|
case 0x38:
|
|
*outCollectible = 0x180;
|
|
collectibleId = 0x180;
|
|
break;
|
|
case 5:
|
|
*outCollectible = 0xe5;
|
|
collectibleId = 0xe5;
|
|
break;
|
|
default:
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 9:
|
|
*outTrinket = 0x73;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 10:
|
|
*outTrinket = 0x72;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 0xb:
|
|
*outTrinket = 0x71;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 0xc:
|
|
*outTrinket = 0x74;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 0xd:
|
|
*outCollectible = 10;
|
|
collectibleId = 10;
|
|
break;
|
|
case 0xe:
|
|
*outCollectible = 0x242;
|
|
collectibleId = 0x242;
|
|
break;
|
|
case 0xf:
|
|
*outCollectible = 0x57;
|
|
collectibleId = 0x57;
|
|
break;
|
|
case 0x10:
|
|
*outCollectible = 0x219;
|
|
collectibleId = 0x219;
|
|
break;
|
|
case 0x11:
|
|
*outCollectible = 0x13e;
|
|
collectibleId = 0x13e;
|
|
break;
|
|
case 0x12:
|
|
*outCollectible = 0x20d;
|
|
collectibleId = 0x20d;
|
|
break;
|
|
case 0x17:
|
|
*outCollectible = 0x286;
|
|
collectibleId = 0x286;
|
|
break;
|
|
case 0x1b:
|
|
*outCollectible = 0x2ab;
|
|
collectibleId = 0x2ab;
|
|
break;
|
|
case 0x1d:
|
|
*outCollectible = 0x94;
|
|
collectibleId = 0x94;
|
|
break;
|
|
case 0x1e:
|
|
*outCollectible = 0x9b;
|
|
collectibleId = 0x9b;
|
|
break;
|
|
case 0x1f:
|
|
*outCollectible = 0x1b3;
|
|
collectibleId = 0x1b3;
|
|
break;
|
|
case 0x20:
|
|
*outCollectible = 0x264;
|
|
collectibleId = 0x264;
|
|
break;
|
|
case 0x21:
|
|
*outCollectible = 0x285;
|
|
collectibleId = 0x285;
|
|
break;
|
|
case 0x22:
|
|
*outCollectible = 0xd3;
|
|
collectibleId = 0xd3;
|
|
break;
|
|
case 0x23:
|
|
*outCollectible = 0xf2;
|
|
collectibleId = 0xf2;
|
|
break;
|
|
case 0x24:
|
|
*outCollectible = 0x10a;
|
|
collectibleId = 0x10a;
|
|
break;
|
|
case 0x26:
|
|
*outTrinket = 0x75;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 0x29:
|
|
*outCollectible = 0xaa;
|
|
collectibleId = 0xaa;
|
|
break;
|
|
case 0x2a:
|
|
*outCollectible = 0x59;
|
|
collectibleId = 0x59;
|
|
break;
|
|
case 0x2b:
|
|
*outCollectible = 0x115;
|
|
collectibleId = 0x115;
|
|
break;
|
|
case 0x2c:
|
|
*outCollectible = 0x24;
|
|
collectibleId = 0x24;
|
|
break;
|
|
case 0x2d:
|
|
*outCollectible = 0x171;
|
|
collectibleId = 0x171;
|
|
break;
|
|
case 0x2e:
|
|
*outCollectible = 0x177;
|
|
collectibleId = 0x177;
|
|
break;
|
|
case 0x2f:
|
|
*outCollectible = 0x13a;
|
|
collectibleId = 0x13a;
|
|
break;
|
|
case 0x30:
|
|
*outCollectible = 0x262;
|
|
collectibleId = 0x262;
|
|
break;
|
|
case 0x32:
|
|
*outCollectible = 0x103;
|
|
collectibleId = 0x103;
|
|
break;
|
|
case 0x33:
|
|
*outCollectible = 0x23c;
|
|
collectibleId = 0x23c;
|
|
break;
|
|
case 0x34:
|
|
*outCollectible = 0x292;
|
|
collectibleId = 0x292;
|
|
break;
|
|
case 0x35:
|
|
*outCollectible = 0xa7;
|
|
collectibleId = 0xa7;
|
|
break;
|
|
case 0x39:
|
|
*outCollectible = 0x2aa;
|
|
collectibleId = 0x2aa;
|
|
break;
|
|
case 0x3a:
|
|
*outCollectible = 0x240;
|
|
collectibleId = 0x240;
|
|
break;
|
|
case 0x3b:
|
|
*outCollectible = 0x221;
|
|
collectibleId = 0x221;
|
|
break;
|
|
case 0x3c:
|
|
case 0x45:
|
|
*outCollectible = 0x1f7;
|
|
collectibleId = 0x1f7;
|
|
break;
|
|
case 0x3d:
|
|
*outCollectible = 0x120;
|
|
collectibleId = 0x120;
|
|
break;
|
|
case 0x40:
|
|
*outCollectible = 0x2a8;
|
|
collectibleId = 0x2a8;
|
|
break;
|
|
case 0x41:
|
|
*outCollectible = 0x17a;
|
|
collectibleId = 0x17a;
|
|
break;
|
|
case 0x42:
|
|
*outCollectible = 0x225;
|
|
collectibleId = 0x225;
|
|
break;
|
|
case 0x43:
|
|
*outCollectible = 3;
|
|
collectibleId = 3;
|
|
break;
|
|
case 0x44:
|
|
*outCollectible = 0xe1;
|
|
collectibleId = 0xe1;
|
|
break;
|
|
case 0x48:
|
|
*outCollectible = 0x1d9;
|
|
collectibleId = 0x1d9;
|
|
break;
|
|
case 0x49:
|
|
*outCollectible = 0x1c5;
|
|
collectibleId = 0x1c5;
|
|
break;
|
|
case 0x4a:
|
|
*outCollectible = 0x166;
|
|
collectibleId = 0x166;
|
|
break;
|
|
case 0x4b:
|
|
*outCollectible = 0x134;
|
|
collectibleId = 0x134;
|
|
break;
|
|
case 0x4c:
|
|
*outCollectible = 0x10e;
|
|
collectibleId = 0x10e;
|
|
break;
|
|
case 0x4d:
|
|
*outCollectible = 0x1d5;
|
|
collectibleId = 0x1d5;
|
|
break;
|
|
case 0x4e:
|
|
*outCollectible = 0x2a4;
|
|
collectibleId = 0x2a4;
|
|
break;
|
|
case 0x4f:
|
|
*outTrinket = 0x8d;
|
|
goto switchD_0080e3e0_caseD_5;
|
|
case 0x50:
|
|
*outCollectible = 0x297;
|
|
collectibleId = 0x297;
|
|
break;
|
|
case 0x51:
|
|
*outCollectible = 0xd8;
|
|
collectibleId = 0xd8;
|
|
break;
|
|
case 0x52:
|
|
*outCollectible = 0x100;
|
|
collectibleId = 0x100;
|
|
break;
|
|
case 0x53:
|
|
*outCollectible = 0xd2;
|
|
collectibleId = 0xd2;
|
|
break;
|
|
case 0x55:
|
|
*outCollectible = 0x282;
|
|
collectibleId = 0x282;
|
|
break;
|
|
case 0x56:
|
|
*outCollectible = 0x2d9;
|
|
collectibleId = 0x2d9;
|
|
break;
|
|
case 0x57:
|
|
goto switchD_0080e3e0_caseD_56;
|
|
case 0x5b:
|
|
*outCollectible = 0x108;
|
|
collectibleId = 0x108;
|
|
break;
|
|
case 0x5c:
|
|
*outCollectible = 0x123;
|
|
collectibleId = 0x123;
|
|
break;
|
|
case 0x5d:
|
|
*outCollectible = 0x268;
|
|
collectibleId = 0x268;
|
|
break;
|
|
case 0x5f:
|
|
*outCollectible = 0xd1;
|
|
collectibleId = 0xd1;
|
|
break;
|
|
case 0x60:
|
|
*outCollectible = 0x281;
|
|
collectibleId = 0x281;
|
|
break;
|
|
case 0x61:
|
|
*outCollectible = 0x1f8;
|
|
collectibleId = 0x1f8;
|
|
break;
|
|
case 0x65:
|
|
*outTrinket = 0xb7;
|
|
switchD_0080e3e0_caseD_5:
|
|
collectibleId = *outCollectible;
|
|
if (collectibleId == 0) goto LAB_0080e7d5;
|
|
break;
|
|
case 0x66:
|
|
*outCollectible = 0x2a5;
|
|
collectibleId = 0x2a5;
|
|
}
|
|
LAB_0080e7b8:
|
|
bVar2 = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::is_collectible_available(collectibleId,0);
|
|
if (bVar2 == 0) {
|
|
*outCollectible = 0;
|
|
}
|
|
LAB_0080e7d5:
|
|
game = g_game;
|
|
uVar3 = *outTrinket;
|
|
if (uVar3 != 0) {
|
|
if ((((GHIDRA_INT(uVar3) < 1) ||
|
|
(trinketPool = (g_game->_itemPool)._trinketPoolItems._begin,
|
|
GHIDRA_INT((g_game->_itemPool)._trinketPoolItems._end) - GHIDRA_INT(trinketPool) >> 3 <= GHIDRA_INT(uVar3))) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(trinketPool) + uVar3 * 8 + 4)) == '\0')) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(trinketPool) + uVar3 * 8 + 5)) == '\0')) {
|
|
*outTrinket = 0;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(trinketPool) + uVar3 * 8 + 4)) = 0;
|
|
numAvailableTrinkets = &(game->_itemPool)._numAvailableTrinkets;
|
|
*numAvailableTrinkets = *numAvailableTrinkets + -1;
|
|
}
|
|
}
|
|
if ((*outCollectible == 0) && (*outTrinket == 0)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0080ea80
|
|
void Room::render_lighting()
|
|
{
|
|
ColorMod *pCVar1;
|
|
int iVar2;
|
|
uint32_t uVar3;
|
|
Room *beamAnim;
|
|
uint8_t bVar4;
|
|
uint32_t *targetEntry;
|
|
void *quad;
|
|
Vector *centerPos;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
AnimationState *beamAnim;
|
|
uint32_t uVar5;
|
|
void **gridEntitySlot;
|
|
float fVar6;
|
|
double dVar7;
|
|
Vector local_118;
|
|
float local_110;
|
|
Room *room;
|
|
float darkness;
|
|
float local_ec;
|
|
Vector renderOffset;
|
|
KColor ambientColor;
|
|
float baseBlue;
|
|
float baseGreen;
|
|
Vector local_b4;
|
|
uint32_t local_ac [8];
|
|
uint32_t local_8c;
|
|
uint32_t uStack_88;
|
|
uint32_t local_84;
|
|
uint8_t local_80 [124];
|
|
Room *thisRoom;
|
|
|
|
renderOffset.x = 0.0;
|
|
renderOffset.y = 0.0;
|
|
room = this;
|
|
msvc::vector::resize(&renderOffset);
|
|
targetEntry = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((targetEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((targetEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*targetEntry = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797b4,0);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
render_entity_light_masks();
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
local_b4.x = (float)g_game->_stage;
|
|
local_ec = (float)g_game->_stageType;
|
|
if ((g_manager->_optionsConfig)._enableLighting == 0) goto LAB_0080f1ce;
|
|
if (g_game->_darknessModifier <= 0.0) {
|
|
Seeds::GetForcedCurses();
|
|
Seeds::GetPreventedCurses();
|
|
}
|
|
local_118.x = 0.0;
|
|
local_118.y = 0.0;
|
|
msvc::vector::resize(&local_118);
|
|
targetEntry = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((targetEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((targetEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*targetEntry = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797cc,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
ambientColor._red = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b5c))));
|
|
local_118.x = (float)g_currentShader;
|
|
ambientColor._unk = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b6c))));
|
|
baseGreen = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b60))));
|
|
baseBlue = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b64))));
|
|
ambientColor._alpha = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b68))));
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 9 & 1) != 0) {
|
|
ambientColor._red = 0.0;
|
|
ambientColor._alpha = 1.0;
|
|
baseBlue = 0.0;
|
|
baseGreen = 0.0;
|
|
ambientColor._unk = 0;
|
|
}
|
|
local_110 = ambientColor._red;
|
|
ambientColor._green = baseGreen;
|
|
ambientColor._blue = baseBlue;
|
|
quad = render_quad_set_uniform_color(local_80,0.0,0.0,DAT_00c7997c,DAT_00c79980,&ambientColor);
|
|
render_color_shader_pass(quad);
|
|
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] = 1;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 1;
|
|
renderOffset.y = (this->_renderScrollOffset).y + (g_game->_screenShakeOffset).y;
|
|
renderOffset.x = (this->_renderScrollOffset).x + (g_game->_screenShakeOffset).x;
|
|
if (this->_backdropType == 0x39) {
|
|
BeastArena::render_light();
|
|
}
|
|
else if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 9 & 1) == 0) {
|
|
uVar5 = g_game->_debugCurses;
|
|
uVar3 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
this = room;
|
|
if ((~preventedCurses & (forcedCurses | uVar5 | uVar3) & 1) == 0) {
|
|
darkness = g_game->_darknessStrength * g_game->_darknessModifier;
|
|
}
|
|
else {
|
|
darkness = 1.0;
|
|
}
|
|
if ((((room->_roomType == 8) || (room->_roomType == 0x1d)) ||
|
|
((bVar4 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(), bVar4 != 0 &&
|
|
(g_game->_currentDimensionIdx == 1)))) ||
|
|
(bVar4 = is_pre_ascent_mom_room(this), bVar4 != 0)) {
|
|
fVar6 = darkness + 0.6;
|
|
if (1.0 <= darkness + 0.6) {
|
|
fVar6 = 1.0;
|
|
}
|
|
}
|
|
else {
|
|
fVar6 = darkness;
|
|
}
|
|
if (((local_b4.x == 1.82169e-44) && (local_ec == 1.4013e-45)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 2 & 1) == 0)) {
|
|
fVar6 = 1.0;
|
|
}
|
|
fVar6 = fVar6 - g_game->_lightningIntensity;
|
|
ambientColor._alpha = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b7c))));
|
|
if (fVar6 <= 0.0) {
|
|
fVar6 = 0.0;
|
|
}
|
|
ambientColor._unk = 0;
|
|
ambientColor._blue =
|
|
(baseBlue - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b78))))) * fVar6 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b78))));
|
|
ambientColor._green =
|
|
(baseGreen - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b74))))) * fVar6 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b74))));
|
|
ambientColor._red =
|
|
(local_110 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b70))))) * fVar6 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b70))));
|
|
if (((void *)local_118.x != (void *)0x0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_118.x) + 4)) & 1) != 0)) {
|
|
g_currentShader = (void *)local_118.x;
|
|
}
|
|
render_color_quad_list(&this->_fxLayers,&ambientColor);
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>(this->_litGridIndices);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(this->_litGridIndices,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)this->_litGridIndices,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar2 + 4));
|
|
beamAnim = room;
|
|
*GHIDRA_CAST<int *>((iVar2 + 4)) = iVar2;
|
|
*GHIDRA_CAST<int *>(iVar2) = iVar2;
|
|
*GHIDRA_CAST<int *>((iVar2 + 8)) = iVar2;
|
|
uVar5 = 0;
|
|
this->_litGridIndices[4] = 0;
|
|
this->_litGridIndices[5] = 0;
|
|
this->_litGridIndices[6] = 0;
|
|
this->_litGridIndices[7] = 0;
|
|
if ((room->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
(GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>(beamAnim))))->Game::Render(*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((beamAnim->_entityList)._updateEL)) + 0x4)))) + uVar5 * 4)),
|
|
&renderOffset);
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < GHIDRA_UINT((beamAnim->_entityList)._updateEL._size));
|
|
}
|
|
local_110 = (float)(beamAnim->_gridHeight * beamAnim->_gridWidth);
|
|
if (0 < GHIDRA_INT(local_110)) {
|
|
gridEntitySlot = beamAnim->_gridEntities;
|
|
do {
|
|
if (*gridEntitySlot != (void *)0x0) {
|
|
render_grid_entity_light(beamAnim,*gridEntitySlot,&renderOffset);
|
|
}
|
|
gridEntitySlot = gridEntitySlot + 1;
|
|
local_110 = (float)(GHIDRA_INT(local_110) + -1);
|
|
} while (local_110 != 0.0);
|
|
}
|
|
if (((beamAnim->_roomType == 5) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((beamAnim)) + 0x4)))) + 0x10)) + 0x10)) == 0x59)) &&
|
|
(bVar4 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsPreAscent(), bVar4 != 0)) {
|
|
centerPos = GetCenterPos(&local_b4);
|
|
local_110 = g_displayPixelRatio * g_screenPointScale;
|
|
fVar6 = ((g_screenWidth - 338.0) * 0.5 + (centerPos->x - 60.0) * 0.65) * local_110 + 0.5;
|
|
local_118.x = fVar6;
|
|
dVar7 = floor((double)fVar6);
|
|
local_ec = (float)dVar7 / local_110;
|
|
local_118.x = ((centerPos->y - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5) * local_110 + 0.5
|
|
;
|
|
dVar7 = floor((double)local_118.x);
|
|
pCVar1 = &(beamAnim->_lightSprite)._color;
|
|
(beamAnim->_lightSprite)._scale.x = g_vectorOne.x;
|
|
(beamAnim->_lightSprite)._scale.y = g_vectorOne.y;
|
|
local_8c = 0;
|
|
uStack_88 = 0;
|
|
local_84 = 0;
|
|
if (pCVar1 != GHIDRA_CAST<ColorMod *>(local_ac)) {
|
|
pCVar1->_tint[0] = 1.0;
|
|
(beamAnim->_lightSprite)._color._tint[1] = 1.0;
|
|
(beamAnim->_lightSprite)._color._tint[2] = 1.0;
|
|
(beamAnim->_lightSprite)._color._tint[3] = 1.0;
|
|
(beamAnim->_lightSprite)._color._offset[0] = 0.0;
|
|
(beamAnim->_lightSprite)._color._offset[1] = 0.0;
|
|
(beamAnim->_lightSprite)._color._colorize[0] = 0.0;
|
|
(beamAnim->_lightSprite)._color._colorize[1] = 0.0;
|
|
(beamAnim->_lightSprite)._color._colorize[2] = 0.0;
|
|
(beamAnim->_lightSprite)._color._colorize[3] = 0.0;
|
|
(beamAnim->_lightSprite)._color._offset[2] = 0.0;
|
|
}
|
|
local_118.y = renderOffset.y + (float)dVar7 / local_110;
|
|
local_118.x = renderOffset.x + local_ec;
|
|
if ((beamAnim->_lightSprite)._loaded != 0) {
|
|
if ((beamAnim->_lightSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(beamAnim->_lightSprite)._animState,&local_118,&g_vectorZero,&g_vectorZero);
|
|
beamAnim = &(beamAnim->_lightSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(beamAnim->_lightSprite)._overlayAnimState,&local_118,&g_vectorZero,&g_vectorZero
|
|
);
|
|
beamAnim = &(beamAnim->_lightSprite)._animState;
|
|
}
|
|
AnimationState::Render(beamAnim,&local_118,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
this = beamAnim;
|
|
if ((g_manager->_optionsConfig)._enableCaustics != 0) {
|
|
if (g_game->_darknessModifier <= 0.0) {
|
|
uVar5 = g_game->_debugCurses;
|
|
uVar3 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
this = room;
|
|
if ((~preventedCurses & (forcedCurses | uVar5 | uVar3) & 1) == 0) goto LAB_0080f17b;
|
|
}
|
|
render_water(this,1);
|
|
}
|
|
LAB_0080f17b:
|
|
_glfw_context_reset();
|
|
if (g_renderTargetStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("PopRenderTarget: stack is empty!\n"));
|
|
}
|
|
targetEntry = msvc::deque::back();
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)*targetEntry,*GHIDRA_CAST<uint8_t *>((targetEntry + 1)));
|
|
g_renderTargetStackSize = g_renderTargetStackSize - 1;
|
|
if (g_renderTargetStackSize == 0) {
|
|
DAT_00c7978c = 0;
|
|
}
|
|
LAB_0080f1ce:
|
|
render_darkness_overlay(this);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x11f6))) == '\x01') {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x11f6))) = 0;
|
|
render_lava_pit_mask(this);
|
|
}
|
|
render_water(this);
|
|
return;
|
|
}
|
|
|
|
// 0080f200
|
|
void Room::Render()
|
|
{
|
|
Room *rock = this;
|
|
std_set *psVar1;
|
|
code *pcVar2;
|
|
RoomDescriptor *pRVar3;
|
|
uint8_t bVar4;
|
|
char cVar5;
|
|
uint32_t uVar6;
|
|
uint32_t *stageType;
|
|
void *pvVar8;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
LayerState *layer;
|
|
int *extraout_EAX;
|
|
int *extraout_EAX_00;
|
|
ColorMod *color;
|
|
int *piVar9;
|
|
int *extraout_EAX_01;
|
|
ColorMod *color_00;
|
|
int iVar10;
|
|
Game *pGVar11;
|
|
ColorMod *color_01;
|
|
int *extraout_EAX_02;
|
|
int *extraout_EAX_03;
|
|
int *extraout_EAX_04;
|
|
ColorMod *color_02;
|
|
uint8_t *shader;
|
|
ColorMod *color_03;
|
|
KColor *input;
|
|
float *pfVar12;
|
|
AnimationState *this_00;
|
|
int unusedArg;
|
|
KColor *color_04;
|
|
int unused;
|
|
int unusedArg_00;
|
|
int unusedArg_01;
|
|
KColor *color_05;
|
|
int unused_00;
|
|
int unusedArg_02;
|
|
int iVar13;
|
|
int iVar14;
|
|
KColor *color_06;
|
|
int unusedArg_03;
|
|
int unusedArg_04;
|
|
KColor *color_07;
|
|
int unusedArg_05;
|
|
KColor *color_08;
|
|
KColor *color_09;
|
|
int *extraout_ECX;
|
|
int *extraout_ECX_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
int extraout_ECX_01;
|
|
KColor *color_10;
|
|
int unused_03;
|
|
int unused_04;
|
|
int unused_05;
|
|
int extraout_ECX_02;
|
|
KColor *color_11;
|
|
int unused_06;
|
|
int unused_07;
|
|
int extraout_ECX_03;
|
|
KColor *blackChannel;
|
|
void **ppvVar15;
|
|
short *this_01;
|
|
Room *room;
|
|
bool bVar16;
|
|
float fVar17;
|
|
float backdropY;
|
|
Game *pGVar18;
|
|
float backdropX;
|
|
double dVar19;
|
|
Vector *pVVar20;
|
|
void *pvVar21;
|
|
uint8_t auStack_2d2 [2];
|
|
uint8_t screenQuad [112];
|
|
Color nightLightColor;
|
|
Vector renderOffset;
|
|
Vector local_224;
|
|
Vector local_21c;
|
|
Game *local_214;
|
|
Game *local_210;
|
|
Game *local_20c;
|
|
uint8_t isDataminer;
|
|
char isMineshaftDimension;
|
|
char isBeastWaterSurface;
|
|
Game *local_204;
|
|
Game *local_200;
|
|
Vector local_1f8;
|
|
Game *local_1f0;
|
|
char isWaterSurface;
|
|
Game *local_1e4;
|
|
Game *local_1e0;
|
|
char isRenderingToScreen;
|
|
Game *local_1d4;
|
|
std_string stageName;
|
|
uint8_t local_1b8 [28];
|
|
float fStack_19c;
|
|
float fStack_198;
|
|
float fStack_194;
|
|
float local_190;
|
|
Color shaderColor;
|
|
uint8_t *roomTypeNames;
|
|
char *local_15c;
|
|
uint8_t *local_158;
|
|
char *local_154;
|
|
char *local_150;
|
|
uint8_t *local_14c;
|
|
char *local_148;
|
|
char *local_144;
|
|
char *local_140;
|
|
char *local_13c;
|
|
char *local_138;
|
|
char *local_134;
|
|
char *local_130;
|
|
char *local_12c;
|
|
char *local_128;
|
|
char *local_124;
|
|
char *local_120;
|
|
char *local_11c;
|
|
char *local_118;
|
|
char *local_114;
|
|
char *local_110;
|
|
uint8_t *local_10c;
|
|
char *local_108;
|
|
uint8_t *local_104;
|
|
char *local_100;
|
|
char *local_fc;
|
|
char *local_f8;
|
|
char *local_f4;
|
|
uint8_t *local_f0;
|
|
char *local_ec;
|
|
KColor local_e8;
|
|
Game *local_d0;
|
|
Game *pGStack_cc;
|
|
Game *pGStack_c8;
|
|
Vector VStack_c4;
|
|
uint8_t local_bc [16];
|
|
Game *local_ac;
|
|
uint8_t debugText [132];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t curses;
|
|
Manager *manager;
|
|
GridEntity_Rock *rock;
|
|
float stageType;
|
|
|
|
pGVar18 = g_game;
|
|
puStack_20 = debugText + 0xa4;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0154b;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((debugText + 0x98));
|
|
ExceptionList = &local_1c;
|
|
local_210 = GHIDRA_CAST<Game *>(0x4e);
|
|
local_200 = GHIDRA_CAST<Game *>(rock);
|
|
msvc::set<int>::find_node();
|
|
DAT_00c79a4c = 1.0;
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_1f8.y) + 0xd)) != '\0') || (0x4e < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1f8.y) + 0x10)))) ||
|
|
((void *)local_1f8.y == (pGVar18->_seedEffects)._seedEffects)) {
|
|
iVar14 = pGVar18->_pixelationTimer;
|
|
if (iVar14 < 1) {
|
|
DAT_00c79a4c = 0.0;
|
|
}
|
|
else if (pGVar18->_pixelationDuration + -0xf < iVar14) {
|
|
DAT_00c79a4c = (float)(pGVar18->_pixelationDuration - iVar14) / 15.0;
|
|
}
|
|
else if (iVar14 < 0xf) {
|
|
DAT_00c79a4c = (float)iVar14 / 15.0;
|
|
}
|
|
}
|
|
isDataminer = (GHIDRA_CAST<TemporaryEffects *>((&rock->_temporaryEffects)))->TemporaryEffects::HasCollectibleEffect(0x1e1);
|
|
if (isDataminer != 0) {
|
|
DAT_00c7977f = 1;
|
|
}
|
|
if ((rock->_backdropType == 0xb) &&
|
|
((g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) {
|
|
local_20c = GHIDRA_CAST<Game *>(pGVar18->_dizzyIntensity);
|
|
isWaterSurface = '\x01';
|
|
}
|
|
else {
|
|
local_20c = GHIDRA_CAST<Game *>(pGVar18->_dizzyIntensity);
|
|
isWaterSurface = '\0';
|
|
if ((rock->_backdropType == 0x39) &&
|
|
(isWaterSurface = '\0', (g_manager->_optionsConfig)._getsSetToEnableWaterSurface != 0)) {
|
|
isBeastWaterSurface = '\x01';
|
|
isWaterSurface = '\0';
|
|
goto LAB_0080f352;
|
|
}
|
|
}
|
|
isBeastWaterSurface = '\0';
|
|
LAB_0080f352:
|
|
local_210 = local_20c;
|
|
if (((pGVar18->_currentDimensionIdx == 1) &&
|
|
((pGVar18->_stageType == 4 || (pGVar18->_stageType == 5)))) &&
|
|
((pGVar18->_stage == 2 ||
|
|
((pGVar18->_stage == 1 && (uVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(pGVar18))))->Level::GetCurses(), (uVar6 & 2) != 0))))))
|
|
{
|
|
isMineshaftDimension = '\x01';
|
|
local_1f8.x = 0.0;
|
|
local_1f8.y = 0.0;
|
|
msvc::vector::resize(&local_1f8);
|
|
stageType = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((stageType + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((stageType + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*stageType = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c79854,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
else {
|
|
isMineshaftDimension = '\0';
|
|
isRenderingToScreen = '\x01';
|
|
}
|
|
if (0.0 < (float)local_20c) {
|
|
local_1f8.x = 0.0;
|
|
local_1f8.y = 0.0;
|
|
msvc::vector::resize(&local_1f8);
|
|
stageType = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((stageType + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((stageType + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*stageType = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797fc,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
if (((g_manager->_optionsConfig)._enableShockwave != 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70d8)))) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70dc)))) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70f4)))) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70f8)))))))) {
|
|
local_1f8.x = 0.0;
|
|
local_1f8.y = 0.0;
|
|
msvc::vector::resize(&local_1f8);
|
|
stageType = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((stageType + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((stageType + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*stageType = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797d4,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
if (isWaterSurface != '\0') {
|
|
local_1f8.x = 0.0;
|
|
local_1f8.y = 0.0;
|
|
msvc::vector::resize(&local_1f8);
|
|
stageType = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((stageType + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((stageType + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*stageType = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797e4,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
if (isBeastWaterSurface != '\0') {
|
|
local_1f8.x = 0.0;
|
|
local_1f8.y = 0.0;
|
|
msvc::vector::resize(&local_1f8);
|
|
stageType = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((stageType + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((stageType + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*stageType = g_graphicsManager_renderTarget;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c7984c,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
if (rock->_backdropType == 0x39) {
|
|
render_beast_arena_background(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x776c))),0);
|
|
}
|
|
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;
|
|
local_1f8.y = (float)&rock->_fxLayers;
|
|
FXLayers::render_behind_layers();
|
|
stageType = 2.0;
|
|
if (isRenderingToScreen != '\0') {
|
|
if (rock->_backdropType == 0x1c) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18))) = 0.2784314;
|
|
fStack_19c = 0.18039216;
|
|
fStack_198 = 0.101960786;
|
|
fStack_194 = 1.0;
|
|
local_190 = 0.0;
|
|
backdropX = (rock->_renderSurfaceTopLeft).x + (g_game->_screenShakeOffset).x +
|
|
(rock->_renderScrollOffset).x;
|
|
backdropY = (rock->_renderSurfaceTopLeft).y + (g_game->_screenShakeOffset).y +
|
|
(rock->_renderScrollOffset).y;
|
|
fVar17 = (float)rock->_gridWidth - 2.0;
|
|
stageType = (float)rock->_gridHeight - 2.0;
|
|
LAB_0080f949:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) = fVar17 * 26.0;
|
|
local_ac = GHIDRA_CAST<Game *>((stageType * 26.0));
|
|
VStack_c4.y = backdropY + 52.0;
|
|
VStack_c4.x = backdropX + 52.0;
|
|
render_quad_set_rect
|
|
(screenQuad,&VStack_c4,GHIDRA_CAST<Vector *>((local_bc + 0xc)),GHIDRA_CAST<KColor *>((local_1b8 + 0x18)));
|
|
render_color_shader_pass(screenQuad);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<KColor *>((&local_e8)))->KColor::SetFromARGB(0xff000000);
|
|
Color::apply_to_kcolor(GHIDRA_CAST<KColor *>((local_1b8 + 0x18)),&rock->_floorColor,input);
|
|
(GHIDRA_CAST<KColor *>((&local_e8)))->KColor::SetFromARGB(0xff000000);
|
|
pfVar12 = GHIDRA_CAST<float *>((local_1b8 + 0x18));
|
|
uVar6 = 0xc;
|
|
blackChannel = &local_e8;
|
|
do {
|
|
if (*pfVar12 != blackChannel->_red) {
|
|
fVar17 = (float)rock->_gridWidth - stageType;
|
|
backdropX = (g_game->_screenShakeOffset).x + (rock->_renderSurfaceTopLeft).x +
|
|
(rock->_renderScrollOffset).x;
|
|
backdropY = (g_game->_screenShakeOffset).y + (rock->_renderSurfaceTopLeft).y +
|
|
(rock->_renderScrollOffset).y;
|
|
stageType = (float)rock->_gridHeight - stageType;
|
|
goto LAB_0080f949;
|
|
}
|
|
pfVar12 = pfVar12 + 1;
|
|
blackChannel = GHIDRA_CAST<KColor *>(&blackChannel->_green);
|
|
bVar16 = 3 < uVar6;
|
|
uVar6 = uVar6 - 4;
|
|
} while (bVar16);
|
|
}
|
|
}
|
|
if (((g_manager->_optionsConfig)._enableShockwave == 0) &&
|
|
((local_1d4 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70d8)))),
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70d8)))) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70dc)))) ||
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70f4)))) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x70f8)))))))) {
|
|
local_1f0 = GHIDRA_CAST<Game *>(0x2);
|
|
do {
|
|
local_1e4 = *GHIDRA_CAST<Game **>(local_1d4);
|
|
local_204 = *GHIDRA_CAST<Game **>((GHIDRA_CAST<char *>(local_1d4) + 4));
|
|
pGVar18 = local_1d4;
|
|
if ((GHIDRA_INT(local_1e4) < GHIDRA_INT(local_204)) &&
|
|
(((rock->_backdropType == 0x12 || (rock->_backdropType == 0x1c)) &&
|
|
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x4)))) + 0x44)) & 1) == 0)))) {
|
|
pvVar8 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7100)))))))->ANM2::GetAnimationData(s_Idle);
|
|
local_1e4 = GHIDRA_CAST<Game *>(GHIDRA_INT(((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x30)) *
|
|
((float)GHIDRA_INT(local_1e4) / (float)GHIDRA_INT(local_204)))));
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7100)))))))->ANM2::SetAnimation(s_Idle,1);
|
|
if (((bVar4 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7134)))) != 0)) &&
|
|
(AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7130)))),(float)GHIDRA_INT(local_1e4)),
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7134)))) != 0)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7144))) = 0;
|
|
}
|
|
pGVar18 = local_1d4;
|
|
pfVar12 = GHIDRA_CAST<float *>((GHIDRA_INT(local_1d4) + -0x14));
|
|
local_204 = GHIDRA_CAST<Game *>(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_1d4) + -0x10)) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5));
|
|
local_1d4 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_1e4 = GHIDRA_CAST<Game *>((((*pfVar12 - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) *
|
|
(float)local_1d4 + 0.5));
|
|
dVar19 = floor((double)(float)local_1e4);
|
|
local_1e0 = GHIDRA_CAST<Game *>(((float)dVar19 / (float)local_1d4));
|
|
local_1e4 = GHIDRA_CAST<Game *>(((float)local_204 * (float)local_1d4 + 0.5));
|
|
dVar19 = floor((double)(float)local_1e4);
|
|
local_1e4 = GHIDRA_CAST<Game *>((float)dVar19);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) = (float)local_1e0 + (rock->_renderScrollOffset).x;
|
|
local_ac = GHIDRA_CAST<Game *>(((float)local_1e4 / (float)local_1d4 + (rock->_renderScrollOffset).y));
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7209))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7170))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7130)))),GHIDRA_CAST<Vector *>((local_bc + 0xc)),
|
|
&g_vectorZero,&g_vectorZero);
|
|
this_00 = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7150))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7150)))),GHIDRA_CAST<Vector *>((local_bc + 0xc)),
|
|
&g_vectorZero,&g_vectorZero);
|
|
this_00 = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x7130))));
|
|
}
|
|
AnimationState::Render(this_00,GHIDRA_CAST<Vector *>((local_bc + 0xc)),&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(pGVar18) + 0x1c));
|
|
local_1f0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1f0) + -1));
|
|
} while (local_1f0 != GHIDRA_CAST<Game *>(0x0));
|
|
local_1f0 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
local_1e4 = GHIDRA_CAST<Game *>(g_graphicsManager_blendMode[4]);
|
|
local_e8._red = (float)g_graphicsManager_blendMode[0];
|
|
local_e8._green = (float)g_graphicsManager_blendMode[1];
|
|
local_e8._blue = (float)g_graphicsManager_blendMode[2];
|
|
local_e8._alpha = (float)g_graphicsManager_blendMode[3];
|
|
if ((rock->_waterAmount <= 0.0) || ((g_manager->_optionsConfig)._enableWaterSurface == 0)) {
|
|
isRenderingToScreen = '\0';
|
|
}
|
|
else {
|
|
isRenderingToScreen = '\x01';
|
|
}
|
|
pGVar18 = GHIDRA_CAST<Game *>(&rock->_renderScrollOffset);
|
|
renderOffset.y =
|
|
(rock->_renderSurfaceTopLeft).y + (g_game->_screenShakeOffset).y +
|
|
(rock->_renderScrollOffset).y;
|
|
renderOffset.x =
|
|
(g_game->_screenShakeOffset).x + (rock->_renderSurfaceTopLeft).x + (GHIDRA_CAST<Vector *>(pGVar18))->x;
|
|
local_204 = pGVar18;
|
|
if (isRenderingToScreen == '\0') {
|
|
local_1f0 = GHIDRA_CAST<Game *>(&rock->_entityList);
|
|
(rock->_entityList)._renderCursor = 0;
|
|
(rock->_entityList)._renderMode = 1;
|
|
if (rock->_roomType == 0x10) {
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < rock->_gridHeight * rock->_gridWidth) {
|
|
local_1e0 = GHIDRA_CAST<Game *>(rock->_gridEntities);
|
|
do {
|
|
if (*GHIDRA_CAST<int **>(local_1e0) != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(**GHIDRA_CAST<int **>(local_1e0) + 0xc))();
|
|
}
|
|
local_1e0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1e0) + 4));
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
} while (GHIDRA_INT(local_1d4) < rock->_gridHeight * rock->_gridWidth);
|
|
}
|
|
}
|
|
else {
|
|
Backdrop::RenderFloor
|
|
(&renderOffset,(rock->_floorColor)._tint[0],(rock->_floorColor)._tint[1],
|
|
(rock->_floorColor)._tint[2],(rock->_floorColor)._tint[3],
|
|
(rock->_floorColor)._colorize[0],(rock->_floorColor)._colorize[1],
|
|
(rock->_floorColor)._colorize[2],(rock->_floorColor)._colorize[3],
|
|
(rock->_floorColor)._offset[0]);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x1be8))) != '\0') {
|
|
Backdrop::render_floor_surface
|
|
(&renderOffset,(rock->_floorColor)._tint[0],(rock->_floorColor)._tint[1],
|
|
(rock->_floorColor)._tint[2],(rock->_floorColor)._tint[3],
|
|
(rock->_floorColor)._colorize[0],(rock->_floorColor)._colorize[1],
|
|
(rock->_floorColor)._colorize[2],(rock->_floorColor)._colorize[3],
|
|
(rock->_floorColor)._offset[0]);
|
|
}
|
|
FXLayers::render_veins();
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < rock->_gridHeight * rock->_gridWidth) {
|
|
local_1e0 = GHIDRA_CAST<Game *>(rock->_gridEntities);
|
|
do {
|
|
piVar9 = *GHIDRA_CAST<int **>(local_1e0);
|
|
if ((piVar9 != GHIDRA_CAST<int *>(0x0)) && (piVar9[1] == 1)) {
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
}
|
|
local_1e0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1e0) + 4));
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
} while (GHIDRA_INT(local_1d4) < rock->_gridHeight * rock->_gridWidth);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<EntityList *>((&rock->_entityList)))->EntityList::render_up_to(5000,GHIDRA_CAST<Vector *>(pGVar18));
|
|
if (rock->_backdropType == 0x39) {
|
|
render_beast_arena_background(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x776c))),1);
|
|
}
|
|
}
|
|
else {
|
|
render_water_shader(rock,&renderOffset);
|
|
local_1f0 = GHIDRA_CAST<Game *>(&rock->_entityList);
|
|
(rock->_entityList)._renderCursor = 0;
|
|
(rock->_entityList)._renderMode = 3;
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_1f0))))->EntityList::render_up_to(5000,GHIDRA_CAST<Vector *>(pGVar18));
|
|
}
|
|
if (rock->_roomType != 0x10) {
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&rock->_backdrop))))->Backdrop::RenderWalls(&renderOffset,rock->_wallColor);
|
|
if (((g_manager->_optionsConfig)._enableCaustics != 0) && (g_game->_darknessModifier <= 0.0)) {
|
|
uVar6 = g_game->_debugCurses;
|
|
curses = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((~preventedCurses & (forcedCurses | uVar6 | curses) & 1) == 0) {
|
|
set_blend_mode(&DAT_00c798e0,2);
|
|
rock = GHIDRA_CAST<Room *>(local_200);
|
|
render_water(GHIDRA_CAST<Room *>(local_200),0);
|
|
g_graphicsManager_blendMode[0] = GHIDRA_INT(local_e8._red);
|
|
g_graphicsManager_blendMode[1] = GHIDRA_INT(local_e8._green);
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(local_e8._blue);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(local_e8._alpha);
|
|
g_graphicsManager_blendMode[4] = GHIDRA_INT(local_1e4);
|
|
pGVar18 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(rock))->_roomList[0x18].DeliriumDistance);
|
|
}
|
|
else {
|
|
rock = GHIDRA_CAST<Room *>(local_200);
|
|
pGVar18 = local_204;
|
|
}
|
|
}
|
|
if (isRenderingToScreen == '\0') {
|
|
local_1e4 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(rock))->_roomList[0xa1])) + 0x9c))));
|
|
(GHIDRA_CAST<RailManager *>((GHIDRA_CAST<RailManager *>(local_1e4))))->RailManager::Render(GHIDRA_CAST<Vector *>(pGVar18));
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(rock)))) + 0x10)))) * (GHIDRA_CAST<Game *>(rock))->_curses) {
|
|
local_1e0 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(rock))->_roomList[0].Data);
|
|
do {
|
|
piVar9 = *GHIDRA_CAST<int **>(local_1e0);
|
|
if ((piVar9 != GHIDRA_CAST<int *>(0x0)) &&
|
|
((iVar14 = piVar9[1], iVar14 == 7 ||
|
|
((iVar14 != 0x10 &&
|
|
(((iVar14 == 0x11 || (iVar14 == 0x12)) || ((iVar14 == 0xe && (piVar9[3] == 1000))))))
|
|
)))) {
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
}
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
local_1e0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1e0) + 4));
|
|
} while (GHIDRA_INT(local_1d4) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(rock)))) + 0x10)))) * (GHIDRA_CAST<Game *>(rock))->_curses);
|
|
}
|
|
if (((GHIDRA_CAST<Game *>(rock))->_roomList[0x28].Flags == 0x20) &&
|
|
((*GHIDRA_CAST<uint32_t *>(((GHIDRA_CAST<Game *>(rock))->_stageType + 0x44)) >> 5 & 1) != 0)) {
|
|
render_water_overlay(rock,&renderOffset);
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(rock)))) + 0x10)))) * (GHIDRA_CAST<Game *>(rock))->_curses) {
|
|
local_1e0 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(rock))->_roomList[0].Data);
|
|
do {
|
|
pvVar8 = *(void **)local_1e0;
|
|
if ((pvVar8 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 4)) == 7)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar8) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 0;
|
|
(**(code **)(**GHIDRA_CAST<int **>(local_1e0) + 0xc))();
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(*(void **))local_1e0 + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 1;
|
|
}
|
|
local_1e0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1e0) + 4));
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
} while (GHIDRA_INT(local_1d4) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(rock)))) + 0x10)))) * (GHIDRA_CAST<Game *>(rock))->_curses);
|
|
}
|
|
}
|
|
render_pit_rails(GHIDRA_CAST<Room *>(local_1e4));
|
|
}
|
|
}
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x2710);
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>(local_1f0))))->EntityList::render_up_to(10000,GHIDRA_CAST<Vector *>(pGVar18));
|
|
if (isBeastWaterSurface != '\0') {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<BlendMode *>((local_1b8 + 0x18)))->BlendMode::SetMode(1,unusedArg);
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX[4];
|
|
shaderColor._colorize[2] = 0.0;
|
|
shaderColor._tint[2] = 0.0;
|
|
shaderColor._colorize[1] = 0.0;
|
|
shaderColor._tint[3] = 0.0;
|
|
shaderColor._offset[0] = 1.0;
|
|
shaderColor._colorize[0] = 1.0;
|
|
shaderColor._offset[1] = 1.0;
|
|
shaderColor._colorize[3] = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset[2])) + 0x0))) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_04);
|
|
pGVar18 = g_game;
|
|
shader = &DAT_00c79618;
|
|
if ((DAT_00c7961c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_21c.y = (float)((double)DAT_00c7984c[7] +
|
|
__uint_to_double_fixup[-(DAT_00c7984c[7] >> 0x1f)]);
|
|
local_224.y = (float)((double)DAT_00c7984c[6] +
|
|
__uint_to_double_fixup[-(DAT_00c7984c[6] >> 0x1f)]);
|
|
VStack_c4.y = local_224.y / (g_screenPointScale * 1024.0);
|
|
local_ac = GHIDRA_CAST<Game *>((local_21c.y / (g_screenPointScale * 1024.0)));
|
|
local_1d4 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_1e0 = GHIDRA_CAST<Game *>(((g_screenHeight - 182.0) * 0.5));
|
|
local_1e4 = GHIDRA_CAST<Game *>(((((float)local_200->_roomList[0].GridIndex - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_1d4 + 0.5));
|
|
g_currentShader = shader;
|
|
dVar19 = floor((double)(float)local_1e4);
|
|
local_214 = GHIDRA_CAST<Game *>((float)dVar19);
|
|
local_1e4 = GHIDRA_CAST<Game *>(((((float)local_200->_roomList[0].SafeGridIndex - 140.0) * 0.65 +
|
|
(float)local_1e0) * (float)local_1d4 + 0.5));
|
|
iVar14 = GHIDRA_INT(((uint64_t)(double)(float)local_1e4 >> 0x20));
|
|
dVar19 = floor((double)(float)local_1e4);
|
|
local_1e4 = GHIDRA_CAST<Game *>((float)dVar19);
|
|
VStack_c4.x = (((float)local_204->_stage + (pGVar18->_screenShakeOffset).x +
|
|
(float)local_214 / (float)local_1d4) * g_screenPointScale) / local_224.y;
|
|
pGStack_cc = GHIDRA_CAST<Game *>(VStack_c4.y);
|
|
VStack_c4.y = (((pGVar18->_screenShakeOffset).y + (float)local_204->_stageType +
|
|
(float)local_1e4 / (float)local_1d4) * g_screenPointScale) / local_21c.y;
|
|
pGStack_c8 = local_ac;
|
|
local_ac = GHIDRA_CAST<Game *>(((float)(pGVar18->_frameCount % 0x3c) / 60.0));
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Ratio"),0xb,&pGStack_cc,iVar14);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Amount"),8,&local_ac,unused);
|
|
(**(code **)(*DAT_00c7984c + 0x14))(shaderColor._tint + 2);
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x81049f);
|
|
shader_cache_find(unusedArg_00);
|
|
}
|
|
pGVar18 = local_200;
|
|
if (local_200->_roomList[0x28].Flags == 0x39) {
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x8104bb);
|
|
render_beast_arena_background(&local_200->_roomList[0xa6].ListIndex,2);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar14)) + 0x0))) = pGVar18->_bossChallenge;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar14)) + 0x1))) = pGVar18->_devilRoomDisabled;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar14)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar18)) + 0xa))));
|
|
if (iVar14 != 0x10) {
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar18)) + 0x10)))) * pGVar18->_curses) {
|
|
ppvVar15 = &pGVar18->_roomList[0].Data;
|
|
do {
|
|
piVar9 = *ppvVar15;
|
|
if ((piVar9 != GHIDRA_CAST<int *>(0x0)) && (piVar9[1] == 0x10)) {
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x8104fa);
|
|
(**(code **)(*piVar9 + 0xc))();
|
|
}
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
ppvVar15 = ppvVar15 + 1;
|
|
} while (GHIDRA_INT(local_1d4) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar18)) + 0x10)))) * pGVar18->_curses);
|
|
}
|
|
piVar9 = DAT_00c797bc;
|
|
if (DAT_00c797bc != GHIDRA_CAST<int *>(0x0)) {
|
|
(GHIDRA_CAST<BlendMode *>((local_1b8 + 0x18)))->BlendMode::SetMode(1,GHIDRA_INT(local_1d4));
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX_00;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX_00[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX_00[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX_00[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX_00[4];
|
|
pcVar2 = *(code **)(*piVar9 + 0x20);
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
pVVar20 = &renderOffset;
|
|
(*pcVar2)();
|
|
}
|
|
shader_stack_push(0);
|
|
pvVar8 = (void *)0x8105a3;
|
|
(GHIDRA_CAST<Color *>((&shaderColor)))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c797b4);
|
|
apply_sprite_shader_params(color,1,pVVar20,pvVar8);
|
|
local_190 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18))) = 1.0;
|
|
fStack_19c = 1.0;
|
|
fStack_198 = 1.0;
|
|
fStack_194 = 0.24;
|
|
(**(code **)(*DAT_00c797b4 + 0x20))();
|
|
piVar9 = GHIDRA_CAST<int *>(FUN_00684fc0());
|
|
pvVar8 = (void *)*piVar9;
|
|
if ((pvVar8 != (void *)0x0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar8) + 4)) & 1) != 0)) {
|
|
g_currentShader = pvVar8;
|
|
}
|
|
DAT_00c79770 = DAT_00c79770 + -1;
|
|
if (DAT_00c79770 == 0) {
|
|
DAT_00c7976c = 0;
|
|
}
|
|
}
|
|
FXLayers::render_background_layers();
|
|
if (isWaterSurface != '\0') {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<BlendMode *>((local_1b8 + 0x18)))->BlendMode::SetMode(1,unusedArg_01);
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX_01;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX_01[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX_01[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX_01[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX_01[4];
|
|
shaderColor._colorize[2] = 0.0;
|
|
shaderColor._tint[2] = 0.0;
|
|
shaderColor._colorize[1] = 0.0;
|
|
shaderColor._tint[3] = 0.0;
|
|
shaderColor._offset[0] = 1.0;
|
|
shaderColor._colorize[0] = 1.0;
|
|
shaderColor._offset[1] = 1.0;
|
|
shaderColor._colorize[3] = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset[2])) + 0x0))) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_05);
|
|
pGVar18 = g_game;
|
|
shader = &DAT_00c79578;
|
|
if ((DAT_00c7957c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_214 = GHIDRA_CAST<Game *>((float)((double)DAT_00c797e4[7] +
|
|
__uint_to_double_fixup[-(DAT_00c797e4[7] >> 0x1f)]));
|
|
local_224.y = (float)((double)DAT_00c797e4[6] +
|
|
__uint_to_double_fixup[-(DAT_00c797e4[6] >> 0x1f)]);
|
|
local_1e4 = GHIDRA_CAST<Game *>((local_224.y / (g_screenPointScale * 1024.0)));
|
|
local_1e0 = GHIDRA_CAST<Game *>(((float)local_214 / (g_screenPointScale * 1024.0)));
|
|
local_1d4 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
VStack_c4.y = (g_screenHeight - 182.0) * 0.5;
|
|
local_ac = GHIDRA_CAST<Game *>(((((float)local_200->_roomList[0].GridIndex - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_1d4 + 0.5));
|
|
g_currentShader = shader;
|
|
dVar19 = floor((double)(float)local_ac);
|
|
local_21c.y = (float)dVar19;
|
|
local_ac = GHIDRA_CAST<Game *>(((((float)local_200->_roomList[0].SafeGridIndex - 140.0) * 0.65 + VStack_c4.y
|
|
) * (float)local_1d4 + 0.5));
|
|
iVar14 = GHIDRA_INT(((uint64_t)(double)(float)local_ac >> 0x20));
|
|
dVar19 = floor((double)(float)local_ac);
|
|
VStack_c4.x = (((pGVar18->_screenShakeOffset).x + (float)local_204->_stage +
|
|
local_21c.y / (float)local_1d4) * g_screenPointScale) / local_224.y;
|
|
pGStack_cc = local_1e4;
|
|
VStack_c4.y = (((pGVar18->_screenShakeOffset).y + (float)local_204->_stageType +
|
|
(float)dVar19 / (float)local_1d4) * g_screenPointScale) / (float)local_214;
|
|
pGStack_c8 = local_1e0;
|
|
local_ac = GHIDRA_CAST<Game *>(((float)(pGVar18->_frameCount % 0x3c) / 60.0));
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Ratio"),0xb,&pGStack_cc,iVar14);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Amount"),8,&local_ac,unused_00);
|
|
(**(code **)(*DAT_00c797e4 + 0x14))(shaderColor._tint + 2);
|
|
shader_cache_find(unusedArg_02);
|
|
pGVar18 = local_200;
|
|
}
|
|
(GHIDRA_CAST<Color *>((&shaderColor)))->Color::Color();
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((pGVar18->_roomList[0x99]._doors + 6)))))->Sprite::SetColor(color_00);
|
|
iVar14 = *GHIDRA_CAST<int *>(&pGVar18->_roomList[0x9f].ShopItemIdx);
|
|
this_01 = &pGVar18->_roomList[0x9f].ShopItemIdx;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(this_01,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)this_01,
|
|
*(_Tree_node<unsigned_int,void*> **)(iVar14 + 4));
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
*GHIDRA_CAST<int *>((iVar14 + 4)) = iVar14;
|
|
*GHIDRA_CAST<int *>(iVar14) = iVar14;
|
|
*GHIDRA_CAST<int *>((iVar14 + 8)) = iVar14;
|
|
pGVar18->_roomList[0x9f].DeliriumDistance = 0;
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
pRVar3 = local_200->_roomList;
|
|
if (local_200->_roomList[0x19].DecorationSeed != 0) {
|
|
do {
|
|
render_player_light(room,*(Entity_Player **)
|
|
(*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].PoopCount) +
|
|
GHIDRA_INT(local_1d4) * 4),GHIDRA_CAST<Vector *>(&pRVar3[0x18].DeliriumDistance));
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
} while (local_1d4 < GHIDRA_UINT((GHIDRA_CAST<Game *>(room))->_roomList[0x19].DecorationSeed));
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x0))) = (GHIDRA_CAST<Game *>(room))->_bossChallenge;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x1))) = (GHIDRA_CAST<Game *>(room))->_devilRoomDisabled;
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(iVar10)) + 0x2))) = *GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0xa))));
|
|
if (iVar10 != 0x10) {
|
|
iVar10 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0x10))));
|
|
iVar14 = (GHIDRA_CAST<Game *>(room))->_curses;
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < iVar10 * iVar14) {
|
|
local_1e0 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0].Data);
|
|
do {
|
|
local_ac = *GHIDRA_CAST<Game **>(local_1e0);
|
|
if ((((((local_ac != GHIDRA_CAST<Game *>(0x0)) &&
|
|
(stageType = (float)local_ac->_stageType, stageType != 1.4013e-45)) &&
|
|
(stageType != 9.80909e-45)) &&
|
|
((stageType != 2.24208e-44 && (stageType != 2.38221e-44)))) &&
|
|
((stageType != 2.52234e-44 &&
|
|
((stageType != 1.96182e-44 || (local_ac->_curses != 1000)))))) &&
|
|
((isRenderingToScreen == '\0' ||
|
|
((**(code **)(local_ac->_stage + 0x18))(), (GHIDRA_UINT(VStack_c4.x) & 2) == 0)))) {
|
|
(**(code **)(local_ac->_stage + 0xc))();
|
|
}
|
|
iVar10 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0x10))));
|
|
iVar14 = (GHIDRA_CAST<Game *>(room))->_curses;
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
local_1e0 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1e0) + 4));
|
|
} while (GHIDRA_INT(local_1d4) < iVar10 * iVar14);
|
|
}
|
|
local_1e0 = GHIDRA_CAST<Game *>(0x2710);
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (0 < iVar10) {
|
|
VStack_c4.y = 10000.0;
|
|
do {
|
|
if (((iVar14 < 1) || (GHIDRA_INT(local_1d4) < 0)) || (iVar10 <= GHIDRA_INT(local_1d4))) {
|
|
iVar10 = -1;
|
|
}
|
|
else {
|
|
iVar10 = GHIDRA_INT(local_1d4) * iVar14;
|
|
}
|
|
local_ac = GHIDRA_CAST<Game *>((((float)(iVar10 / iVar14) * 40.0 + 120.0 + 20.0) * 100.0 + 10030.0 + 0.5
|
|
));
|
|
dVar19 = floor((double)(float)local_ac);
|
|
local_ac = GHIDRA_CAST<Game *>((float)dVar19);
|
|
local_1e0 = GHIDRA_CAST<Game *>(__ftoui3());
|
|
EntityList::render_up_to
|
|
(GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].Dimension),GHIDRA_UINT(local_1e0),
|
|
GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
iVar14 = (GHIDRA_CAST<Game *>(room))->_curses;
|
|
iVar10 = 0;
|
|
if (0 < iVar14) {
|
|
do {
|
|
if (((((-1 < iVar10) && (iVar10 < iVar14)) &&
|
|
((-1 < GHIDRA_INT(local_1d4) &&
|
|
((GHIDRA_INT(local_1d4) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0x10)))) &&
|
|
(iVar13 = GHIDRA_INT(local_1d4) * iVar14 + iVar10, -1 < iVar13)))))) &&
|
|
(rock = GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<Game *>(room))->_roomMap[iVar13 + -0x5eae]),
|
|
rock != GHIDRA_CAST<GridEntity_Rock *>(0x0))) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x4)))) == 0x18)) {
|
|
GridEntity_Rock::RenderTop
|
|
(rock,GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
iVar14 = (GHIDRA_CAST<Game *>(room))->_curses;
|
|
}
|
|
iVar10 = iVar10 + 1;
|
|
} while (iVar10 < iVar14);
|
|
}
|
|
iVar10 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0x10))));
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 1));
|
|
} while (GHIDRA_INT(local_1d4) < iVar10);
|
|
}
|
|
EntityList::render_up_to
|
|
(GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].Dimension),
|
|
GHIDRA_UINT(&local_1e0->_roomList[0x1b].Dimension),
|
|
GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
}
|
|
if (isRenderingToScreen != '\0') {
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x19].DeliriumDistance = 1;
|
|
}
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0xffffffff);
|
|
EntityList::render_up_to
|
|
(GHIDRA_CAST<EntityList *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].Dimension),0xffffffff,
|
|
GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
pGVar18 = local_1f0;
|
|
uVar6 = 0;
|
|
pGVar11 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].Dimension);
|
|
if (*GHIDRA_CAST<int *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x19].ShopItemIdx) != 0) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<EntityList_EL *>((GHIDRA_INT(pGVar18) + 0x50))))) + 0x4)))) +
|
|
uVar6 * 4)) + 0x1c))();
|
|
uVar6 = uVar6 + 1;
|
|
} while (uVar6 < GHIDRA_UINT(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar18) + 0xa0))));
|
|
pGVar11 = local_1f0;
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
}
|
|
pGVar18 = g_game;
|
|
(GHIDRA_CAST<EntityList *>(pGVar11))->_renderMode = 0;
|
|
local_1d4 = GHIDRA_CAST<Game *>(0x0);
|
|
if (GHIDRA_INT((pGVar18->_playerManager)._extraPlayers._end) -
|
|
GHIDRA_INT((pGVar18->_playerManager)._extraPlayers._begin) >> 2 != 0) {
|
|
do {
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x810d10);
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_INT((pGVar18->_playerManager)._extraPlayers._begin) +
|
|
GHIDRA_INT(local_1d4) * 4)) + 0x14))();
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(&local_1d4->_stage) + 1));
|
|
pGVar18 = g_game;
|
|
} while (local_1d4 <
|
|
(uint8_t *)
|
|
(GHIDRA_INT((g_game->_playerManager)._extraPlayers._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._extraPlayers._begin) >> 2));
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
}
|
|
local_1f0 = GHIDRA_CAST<Game *>(0x0);
|
|
if (GHIDRA_INT((pGVar18->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((pGVar18->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar8 = (pGVar18->_playerManager)._playerList._end;
|
|
stageType = (pGVar18->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(stageType) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (pGVar18->_playerManager)._playerList._end;
|
|
stageType = (pGVar18->_playerManager)._playerList._begin;
|
|
}
|
|
pGVar18 = local_1f0;
|
|
if (local_1f0 < GHIDRA_CAST<Game *>((GHIDRA_INT(pvVar8) - GHIDRA_INT(stageType) >> 2))) {
|
|
stageType = stageType + GHIDRA_INT(local_1f0);
|
|
}
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x1a9);
|
|
bVar4 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*stageType))))->Entity_Player::HasCollectible(0x1a9,0);
|
|
if (bVar4 != 0) {
|
|
local_ac = g_game;
|
|
pvVar8 = (g_game->_playerManager)._playerList._end;
|
|
piVar9 = (g_game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (local_ac->_playerManager)._playerList._end;
|
|
piVar9 = (local_ac->_playerManager)._playerList._begin;
|
|
}
|
|
if (pGVar18 < GHIDRA_CAST<Game *>((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2))) {
|
|
piVar9 = piVar9 + GHIDRA_INT(pGVar18);
|
|
}
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].SavedEntities._capacity =
|
|
(void *)(*GHIDRA_CAST<float *>((*piVar9 + 0x1ae4)) - 90.0);
|
|
(GHIDRA_CAST<Color *>((&nightLightColor)))->Color::Reset();
|
|
psVar1 = &(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].RestrictedGridIndexes;
|
|
nightLightColor._offset[0] = 0.0;
|
|
nightLightColor._offset[1] = 0.0;
|
|
nightLightColor._offset[2] = 0.0;
|
|
if (GHIDRA_CAST<Color *>(psVar1) != &nightLightColor) {
|
|
psVar1->_head = (void *)0x3f800000;
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].RestrictedGridIndexes._size = 0x3f800000;
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].SavedEffects._begin = (void *)0x3f800000;
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].SavedEffects._end = (void *)0x3e4ccccd;
|
|
(GHIDRA_CAST<Game *>(room))->_roomList[0x9b].SavedEffects._capacity =
|
|
(void *)nightLightColor._colorize[0];
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9b])) + 0x94)))) = nightLightColor._colorize[1];
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9b])) + 0x98)))) = nightLightColor._colorize[2];
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9b])) + 0x9c)))) = nightLightColor._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9b])) + 0xa0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9b])) + 0xa8)))) = 0;
|
|
}
|
|
uVar6 = g_graphicsManager_flags;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x9a].SavedEffects._capacity))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
pGVar18 = g_game;
|
|
iVar14 = 1;
|
|
if ((uVar6 & 4) == 0) {
|
|
iVar14 = 6;
|
|
}
|
|
layer->_blendMode[0] = 0;
|
|
layer->_blendMode[1] = iVar14;
|
|
layer->_blendMode[2] = 1;
|
|
layer->_blendMode[3] = 1;
|
|
layer->_blendMode[4] = 1;
|
|
pvVar8 = (pGVar18->_playerManager)._playerList._end;
|
|
piVar9 = (pGVar18->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (pGVar18->_playerManager)._playerList._end;
|
|
piVar9 = (pGVar18->_playerManager)._playerList._begin;
|
|
}
|
|
pGVar18 = local_1f0;
|
|
if (local_1f0 < GHIDRA_CAST<Game *>((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2))) {
|
|
piVar9 = piVar9 + GHIDRA_INT(local_1f0);
|
|
}
|
|
local_1d4 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
VStack_c4.y = (*GHIDRA_CAST<float *>((*piVar9 + 0x340)) - 140.0) * 0.65 + (g_screenHeight - 182.0) * 0.5;
|
|
local_ac = GHIDRA_CAST<Game *>(((float)local_1d4 *
|
|
((*GHIDRA_CAST<float *>((*piVar9 + 0x33c)) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) + 0.5));
|
|
dVar19 = floor((double)(float)local_ac);
|
|
local_21c.y = (float)dVar19 / (float)local_1d4;
|
|
local_ac = GHIDRA_CAST<Game *>(((float)local_1d4 * VStack_c4.y + 0.5));
|
|
dVar19 = floor((double)(float)local_ac);
|
|
local_ac = GHIDRA_CAST<Game *>((float)dVar19);
|
|
pVVar20 = &g_vectorZero;
|
|
local_224.x = local_21c.y + (GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance))->x
|
|
;
|
|
local_224.y = (float)local_ac / (float)local_1d4 +
|
|
(float)(GHIDRA_CAST<Game *>(room))->_roomList[0x18].Group;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x9a].SavedEffects._capacity))))->ANM2::Render(&local_224,
|
|
&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_1f0 = GHIDRA_CAST<Game *>((GHIDRA_INT(&pGVar18->_stage) + 1));
|
|
pGVar18 = g_game;
|
|
} while (local_1f0 <
|
|
(uint8_t *)
|
|
(GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2));
|
|
}
|
|
if ((GHIDRA_UINT(pGVar18->_debugFlags) >> 1 & 1) != 0) {
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x8110b2);
|
|
render_debug_grid_values(room,GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
pGVar18 = g_game;
|
|
}
|
|
if ((GHIDRA_UINT(pGVar18->_debugFlags) >> 10 & 1) != 0) {
|
|
pVVar20 = GHIDRA_CAST<Vector *>(0x8110d3);
|
|
render_debug_grid_indices(room,GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance));
|
|
pGVar18 = g_game;
|
|
}
|
|
shader = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
g_currentShader = shader;
|
|
if ((g_manager->_optionsConfig)._enableLighting != 0) {
|
|
if (pGVar18->_darknessModifier <= 0.0) {
|
|
Seeds::GetForcedCurses();
|
|
Seeds::GetPreventedCurses();
|
|
}
|
|
fVar17 = GetLightingAlpha(room);
|
|
stageType = g_game->_lightningIntensity;
|
|
if (stageType <= 0.0) {
|
|
stageType = 0.0;
|
|
}
|
|
if (1.0 <= stageType) {
|
|
stageType = 1.0;
|
|
}
|
|
local_ac = GHIDRA_CAST<Game *>((fVar17 - stageType * 0.2));
|
|
if (0.0 < (float)local_ac) {
|
|
VStack_c4.y = (float)g_graphicsManager_blendMode[4];
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18))) = g_graphicsManager_blendMode[0];
|
|
fStack_19c = (float)g_graphicsManager_blendMode[1];
|
|
fStack_198 = (float)g_graphicsManager_blendMode[2];
|
|
fStack_194 = (float)g_graphicsManager_blendMode[3];
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 4;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 8;
|
|
pvVar8 = (void *)0x8111a8;
|
|
(GHIDRA_CAST<Color *>((&shaderColor)))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c797cc);
|
|
apply_sprite_shader_params(color_01,1,pVVar20,pvVar8);
|
|
local_e8._unk = 0;
|
|
local_e8._red = 1.0;
|
|
local_e8._green = 1.0;
|
|
pcVar2 = *(code **)(*DAT_00c797cc + 0x1c);
|
|
local_e8._blue = 1.0;
|
|
local_e8._alpha = (float)local_ac;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_bc))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_06);
|
|
(*pcVar2)();
|
|
if (0.0 < g_game->_lightningIntensity) {
|
|
pGVar18 = GHIDRA_CAST<Game *>((g_game->_lightningIntensity * 0.5));
|
|
if ((float)pGVar18 <= 0.0) {
|
|
pGVar18 = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
if (0.5 <= (float)pGVar18) {
|
|
pGVar18 = GHIDRA_CAST<Game *>(0x3f000000);
|
|
}
|
|
(GHIDRA_CAST<BlendMode *>((&local_e8)))->BlendMode::SetMode(2,unusedArg_03);
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX_02;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX_02[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX_02[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX_02[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX_02[4];
|
|
local_e8._red = (float)pGVar18 * 0.85;
|
|
local_e8._green = (float)pGVar18 * 0.9;
|
|
local_e8._unk = 0;
|
|
local_e8._blue = (float)pGVar18;
|
|
local_e8._alpha = (float)pGVar18;
|
|
render_color_quad_list((void *)local_1f8.y,&local_e8);
|
|
}
|
|
g_graphicsManager_blendMode[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18)));
|
|
g_graphicsManager_blendMode[1] = GHIDRA_INT(fStack_19c);
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(fStack_198);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(fStack_194);
|
|
g_graphicsManager_blendMode[4] = GHIDRA_INT(VStack_c4.y);
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
}
|
|
}
|
|
if ((GHIDRA_CAST<Game *>(room))->_roomList[0x28].Flags == 0x39) {
|
|
render_beast_arena_background(&(GHIDRA_CAST<Game *>(room))->_roomList[0xa6].ListIndex,3);
|
|
}
|
|
(GHIDRA_CAST<FXLayers *>((GHIDRA_CAST<FXLayers *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x1e].SavedEntities))))->FXLayers::Render();
|
|
cVar5 = FUN_008242f0();
|
|
if (cVar5 != '\0') {
|
|
local_1f8.y = (float)g_graphicsManager_blendMode[4];
|
|
local_e8._red = (float)g_graphicsManager_blendMode[0];
|
|
local_e8._green = (float)g_graphicsManager_blendMode[1];
|
|
local_e8._blue = (float)g_graphicsManager_blendMode[2];
|
|
local_e8._alpha = (float)g_graphicsManager_blendMode[3];
|
|
(GHIDRA_CAST<BlendMode *>((local_1b8 + 0x18)))->BlendMode::SetMode(2,unusedArg_04);
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX_03;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX_03[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX_03[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX_03[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX_03[4];
|
|
pcVar2 = *(code **)(*DAT_00c79824 + 0x1c);
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_07);
|
|
(*pcVar2)();
|
|
g_graphicsManager_blendMode[0] = GHIDRA_INT(local_e8._red);
|
|
g_graphicsManager_blendMode[1] = GHIDRA_INT(local_e8._green);
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(local_e8._blue);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(local_e8._alpha);
|
|
g_graphicsManager_blendMode[4] = GHIDRA_INT(local_1f8.y);
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
}
|
|
if (((g_manager->_optionsConfig)._enableShockwave != 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9c])) + 0xa4)))) <
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x9c])) + 0xa8)))) ||
|
|
((GHIDRA_CAST<Game *>(room))->_roomList[0x9d].ListIndex < (GHIDRA_CAST<Game *>(room))->_roomList[0x9d].Dimension)))) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
(GHIDRA_CAST<BlendMode *>((local_1b8 + 0x18)))->BlendMode::SetMode(1,unusedArg_05);
|
|
pGVar18 = GHIDRA_CAST<Game *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance);
|
|
g_graphicsManager_blendMode[0] = *extraout_EAX_04;
|
|
g_graphicsManager_blendMode[1] = extraout_EAX_04[1];
|
|
g_graphicsManager_blendMode[2] = extraout_EAX_04[2];
|
|
g_graphicsManager_blendMode[3] = extraout_EAX_04[3];
|
|
g_graphicsManager_blendMode[4] = extraout_EAX_04[4];
|
|
if ((GHIDRA_CAST<Game *>(room))->_roomList[0x28].Flags == 0x1c) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18))) = 0.2784314;
|
|
fStack_19c = 0.18039216;
|
|
fStack_198 = 0.101960786;
|
|
fStack_194 = 1.0;
|
|
local_1f8.x = ((float)(GHIDRA_CAST<Game *>(room))->_curses - 2.0) * 26.0;
|
|
local_190 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) =
|
|
(g_game->_screenShakeOffset).x +
|
|
(GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((GHIDRA_CAST<Game *>(room))->_roomList[0x18])) + 0xa8)))))->x + (GHIDRA_CAST<Vector *>(pGVar18))->x +
|
|
52.0;
|
|
local_ac = GHIDRA_CAST<Game *>(((g_game->_screenShakeOffset).y +
|
|
*GHIDRA_CAST<float *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].ShopItemIdx) +
|
|
(float)(GHIDRA_CAST<Game *>(room))->_roomList[0x18].Group + 52.0));
|
|
local_1f8.y = ((float)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<Game *>(room)))) + 0x10)))) - 2.0) * 26.0;
|
|
render_quad_set_rect
|
|
(screenQuad,GHIDRA_CAST<Vector *>((local_bc + 0xc)),&local_1f8,GHIDRA_CAST<KColor *>((local_1b8 + 0x18)));
|
|
pvVar8 = (void *)0x811600;
|
|
render_color_shader_pass(screenQuad);
|
|
if ((g_manager->_optionsConfig)._enableLighting != 0) {
|
|
if (g_game->_darknessModifier <= 0.0) {
|
|
Seeds::GetForcedCurses();
|
|
Seeds::GetPreventedCurses();
|
|
}
|
|
local_ac = GHIDRA_CAST<Game *>(g_graphicsManager_blendMode[4]);
|
|
local_e8._red = (float)g_graphicsManager_blendMode[0];
|
|
local_e8._green = (float)g_graphicsManager_blendMode[1];
|
|
local_e8._blue = (float)g_graphicsManager_blendMode[2];
|
|
local_e8._alpha = (float)g_graphicsManager_blendMode[3];
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 4;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 8;
|
|
local_1f8.y = GetLightingAlpha(room);
|
|
pvVar21 = (void *)0x81167b;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_1b8))))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c797cc);
|
|
apply_sprite_shader_params(color_02,1,pvVar8,pvVar21);
|
|
VStack_c4.y = 0.0;
|
|
local_d0 = GHIDRA_CAST<Game *>(local_1f8.y);
|
|
pGStack_cc = GHIDRA_CAST<Game *>(local_1f8.y);
|
|
pGStack_c8 = GHIDRA_CAST<Game *>(local_1f8.y);
|
|
VStack_c4.x = local_1f8.y;
|
|
pcVar2 = *(code **)(*DAT_00c797cc + 0x1c);
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_08);
|
|
(*pcVar2)();
|
|
g_graphicsManager_blendMode[1] = GHIDRA_INT(local_e8._green);
|
|
g_graphicsManager_blendMode[0] = GHIDRA_INT(local_e8._red);
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(local_e8._blue);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(local_e8._alpha);
|
|
g_graphicsManager_blendMode[4] = GHIDRA_INT(local_ac);
|
|
pGVar18 = local_204;
|
|
room = GHIDRA_CAST<Room *>(local_200);
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) & 1) == 0) {
|
|
local_1d4 = GHIDRA_CAST<Game *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70d8))));
|
|
local_204 = GHIDRA_CAST<Game *>(0x2);
|
|
do {
|
|
local_1f8.y = *GHIDRA_CAST<float *>(local_1d4);
|
|
local_ac = *GHIDRA_CAST<Game **>((GHIDRA_CAST<char *>(local_1d4) + 4));
|
|
if ((GHIDRA_INT(local_1f8.y) < GHIDRA_INT(local_ac)) &&
|
|
((room->_backdropType == 0x12 || (room->_backdropType == 0x1c)))) {
|
|
pvVar8 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7100)))))))->ANM2::GetAnimationData(s_Idle);
|
|
local_1f8.y = (float)GHIDRA_INT(((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x30)) *
|
|
((float)GHIDRA_INT(local_1f8.y) / (float)GHIDRA_INT(local_ac))));
|
|
bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7100)))))))->ANM2::SetAnimation(s_Idle,1);
|
|
if ((bVar4 != 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7134)))) != 0 &&
|
|
(AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7130)))),(float)GHIDRA_INT(local_1f8.y)),
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7134)))) != 0)))) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7144))) = 0;
|
|
}
|
|
local_ac = GHIDRA_CAST<Game *>(((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_1d4) + -0x10)) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5));
|
|
local_1f0 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_1f8.y = (float)local_1f0 *
|
|
((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_1d4) + -0x14)) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) + 0.5;
|
|
dVar19 = floor((double)local_1f8.y);
|
|
VStack_c4.y = (float)dVar19 / (float)local_1f0;
|
|
local_1f8.y = (float)local_1f0 * (float)local_ac + 0.5;
|
|
dVar19 = floor((double)local_1f8.y);
|
|
local_21c.x = VStack_c4.y + (float)pGVar18->_stage;
|
|
local_21c.y = (float)dVar19 / (float)local_1f0 + (float)pGVar18->_stageType;
|
|
local_1f8.y = (float)(float)dVar19;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7100)))))))->ANM2::Render(&local_21c,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_1d4 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_1d4) + 0x1c));
|
|
local_204 = GHIDRA_CAST<Game *>((GHIDRA_INT(local_204) + -1));
|
|
} while (local_204 != GHIDRA_CAST<Game *>(0x0));
|
|
}
|
|
shaderColor._colorize[2] = 0.0;
|
|
shaderColor._tint[2] = 0.0;
|
|
shaderColor._colorize[1] = 0.0;
|
|
shaderColor._tint[3] = 0.0;
|
|
shaderColor._offset[0] = 1.0;
|
|
shaderColor._colorize[0] = 1.0;
|
|
shaderColor._offset[1] = 1.0;
|
|
shaderColor._colorize[3] = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset[2])) + 0x0))) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
pGVar18 = GHIDRA_CAST<Game *>(0x0);
|
|
pvVar8 = (void *)g_screenHeight;
|
|
render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_09);
|
|
local_204 = GHIDRA_CAST<Game *>(0xc3160000);
|
|
shader = &DAT_00c79488;
|
|
if ((DAT_00c7948c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_1d4 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70cc))));
|
|
local_1f8.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70d8))));
|
|
local_1f0 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70e8))));
|
|
g_currentShader = shader;
|
|
local_200 = local_204;
|
|
local_1e4 = pGVar18;
|
|
local_1e0 = pGVar18;
|
|
stageType = pow((float)GHIDRA_INT(local_1f8.y) / (float)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70dc)))),0.4);
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70f4))));
|
|
local_ac = GHIDRA_CAST<Game *>(((1.0 - stageType) * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70d0))))));
|
|
pvVar21 = (void *)0x811b03;
|
|
stageType = pow((float)iVar14 / (float)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70f8)))),0.4);
|
|
VStack_c4.y = (1.0 - stageType) * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70ec))));
|
|
local_21c.y = 0.66015625 /
|
|
((g_screenPointScale * 520.0) /
|
|
(float)((double)DAT_00c797d4[6] +
|
|
__uint_to_double_fixup[-(DAT_00c797d4[6] >> 0x1f)]));
|
|
local_224.y = 0.35546875 /
|
|
((g_screenPointScale * 280.0) /
|
|
(float)((double)DAT_00c797d4[7] +
|
|
__uint_to_double_fixup[-(DAT_00c797d4[7] >> 0x1f)]));
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7220))) != '\0') {
|
|
local_1d4 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70d4)))) * 0.5 + (float)local_1d4));
|
|
local_1f0 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70f0)))) * 0.5 + (float)local_1f0));
|
|
}
|
|
piVar9 = DAT_00c797d4;
|
|
if (GHIDRA_INT(local_1f8.y) < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70dc))))) {
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c797d4);
|
|
pVVar20 = compute_overlay_texcoords
|
|
(room,&local_1f8,GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70c4)))),pvVar8,pvVar21);
|
|
iVar14 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70f4))));
|
|
local_204 = GHIDRA_CAST<Game *>(pVVar20->x);
|
|
local_1e0 = GHIDRA_CAST<Game *>(pVVar20->y);
|
|
piVar9 = extraout_ECX;
|
|
}
|
|
if (iVar14 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70f8))))) {
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c797d4);
|
|
pVVar20 = compute_overlay_texcoords
|
|
(room,&local_1f8,GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x70e0)))),pvVar8,pvVar21);
|
|
local_200 = GHIDRA_CAST<Game *>(pVVar20->x);
|
|
local_1e4 = GHIDRA_CAST<Game *>(pVVar20->y);
|
|
piVar9 = extraout_ECX_00;
|
|
}
|
|
local_e8._green = (float)local_204;
|
|
local_e8._blue = (float)local_1e0;
|
|
local_e8._unk = GHIDRA_INT(local_ac);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0x4))) = local_200;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0x8))) = local_1e4;
|
|
local_ac = GHIDRA_CAST<Game *>(VStack_c4.y);
|
|
local_e8._alpha = (float)local_1d4;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) = local_1f0;
|
|
local_1f8.x = local_21c.y;
|
|
local_1f8.y = local_224.y;
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Shockwave1"),0xb,&local_e8._green,GHIDRA_INT(piVar9));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Shockwave2"),0xb,local_bc + 4,unused_01);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Ratio"),9,&local_1f8,unused_02);
|
|
(**(code **)(*DAT_00c797d4 + 0x14))(shaderColor._tint + 2);
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
}
|
|
if (isDataminer != 0) {
|
|
DAT_00c7977f = 0;
|
|
}
|
|
FXLayers::render_overlay_layers();
|
|
local_204 = GHIDRA_CAST<Game *>(0x258);
|
|
iVar14 = extraout_ECX_01;
|
|
if (0.0 < (float)local_20c) {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
shaderColor._colorize[2] = 0.0;
|
|
shaderColor._tint[2] = 0.0;
|
|
shaderColor._colorize[1] = 0.0;
|
|
shaderColor._tint[3] = 0.0;
|
|
shaderColor._offset[0] = 1.0;
|
|
shaderColor._colorize[0] = 1.0;
|
|
shaderColor._offset[1] = 1.0;
|
|
shaderColor._colorize[3] = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset[2])) + 0x0))) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(&local_158,0.0,0.0,g_screenWidth,g_screenHeight,color_10);
|
|
local_1e0 = GHIDRA_CAST<Game *>(&DAT_00c795c8);
|
|
if ((DAT_00c795cc & 1) == 0) {
|
|
local_1e0 = g_currentShader;
|
|
}
|
|
local_224.y = (float)((double)DAT_00c797fc[7] +
|
|
__uint_to_double_fixup[-(DAT_00c797fc[7] >> 0x1f)]);
|
|
local_20c = GHIDRA_CAST<Game *>(((float)((double)DAT_00c797fc[5] +
|
|
__uint_to_double_fixup[-(DAT_00c797fc[5] >> 0x1f)]) / local_224.y));
|
|
local_21c.y = (float)((double)DAT_00c797fc[6] +
|
|
__uint_to_double_fixup[-(DAT_00c797fc[6] >> 0x1f)]);
|
|
local_214 = GHIDRA_CAST<Game *>(((float)((double)DAT_00c797fc[4] +
|
|
__uint_to_double_fixup[-(DAT_00c797fc[4] >> 0x1f)]) / local_21c.y));
|
|
local_1d4 = GHIDRA_CAST<Game *>((local_21c.y / (g_screenPointScale * 1024.0)));
|
|
local_1f0 = GHIDRA_CAST<Game *>((local_224.y / (g_screenPointScale * 1024.0)));
|
|
local_ac = GHIDRA_CAST<Game *>(((g_screenHeight - 182.0) * 0.5));
|
|
local_1e4 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_1f8.y = (((float)(GHIDRA_CAST<Game *>(room))->_roomList[0].GridIndex - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_1e4 + 0.5;
|
|
g_currentShader = local_1e0;
|
|
dVar19 = floor((double)local_1f8.y);
|
|
VStack_c4.y = (float)dVar19;
|
|
stageType = (((float)(GHIDRA_CAST<Game *>(room))->_roomList[0].SafeGridIndex - 140.0) * 0.65 +
|
|
(float)local_ac) * (float)local_1e4 + 0.5;
|
|
local_1f8.y = stageType;
|
|
dVar19 = floor((double)stageType);
|
|
local_1f8.y = (float)dVar19;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) = local_214;
|
|
local_e8._alpha =
|
|
(((g_game->_screenShakeOffset).x +
|
|
(GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance))->x +
|
|
VStack_c4.y / (float)local_1e4) * g_screenPointScale) / local_21c.y;
|
|
local_ac = local_20c;
|
|
local_e8._unk =
|
|
GHIDRA_INT(((((float)(GHIDRA_CAST<Game *>(room))->_roomList[0x18].Group + (g_game->_screenShakeOffset).y +
|
|
(float)dVar19 / (float)local_1e4) * g_screenPointScale) / local_224.y));
|
|
local_e8._green = (float)local_1d4;
|
|
local_e8._blue = (float)local_1f0;
|
|
bVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if (bVar4 == 0) {
|
|
uVar6 = g_manager->_framecount + 1U & 0x80000001;
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
uVar6 = (uVar6 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = 0;
|
|
}
|
|
local_1f8.y = (float)((float)GHIDRA_INT((uVar6 + (g_game->_frameCount % GHIDRA_INT(local_204)) * 2)) / 120.0);
|
|
(GHIDRA_CAST<Shader *>((local_1e0)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("TextureSize"),9,local_bc + 0xc,uVar6);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Ratio"),0xb,&local_e8._green,unused_03);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(&DAT_00b6837c,8,&local_1f8.y,unused_04);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Amount"),8,&local_210,unused_05);
|
|
(**(code **)(*DAT_00c797fc + 0x14))(shaderColor._tint + 2);
|
|
iVar14 = extraout_ECX_02;
|
|
}
|
|
if (isMineshaftDimension != '\0') {
|
|
_glfw_context_reset();
|
|
pop_render_target();
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
shaderColor._colorize[2] = 1.0;
|
|
shaderColor._tint[2] = 1.0;
|
|
shaderColor._colorize[1] = 0.0;
|
|
shaderColor._tint[3] = 0.0;
|
|
shaderColor._offset[0] = 0.0;
|
|
shaderColor._colorize[0] = 0.0;
|
|
shaderColor._offset[1] = 1.0;
|
|
shaderColor._colorize[3] = 1.0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset[2])) + 0x0))) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1b8 + 0x18)))))->KColor::SetFromARGB(0xffffffff);
|
|
pvVar8 = (void *)g_screenHeight;
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color_11);
|
|
if ((g_manager->_optionsConfig)._getsSetToEnableWaterSurface == 0) {
|
|
shader = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
pvVar21 = (void *)0x8125f0;
|
|
g_currentShader = shader;
|
|
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_1b8))))->Color::Color();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_2d2 + -10)))->KAGE::SmartPointer::operator_assign(&DAT_00c79854);
|
|
apply_sprite_shader_params(color_03,1,pvVar8,pvVar21);
|
|
}
|
|
else {
|
|
local_1f0 = GHIDRA_CAST<Game *>(&DAT_00c79668);
|
|
if ((DAT_00c7966c & 1) == 0) {
|
|
local_1f0 = g_currentShader;
|
|
}
|
|
local_224.y = (float)((double)DAT_00c79854[7] +
|
|
__uint_to_double_fixup[-(DAT_00c79854[7] >> 0x1f)]);
|
|
local_1e4 = GHIDRA_CAST<Game *>(((float)((double)DAT_00c79854[5] +
|
|
__uint_to_double_fixup[-(DAT_00c79854[5] >> 0x1f)]) / local_224.y))
|
|
;
|
|
local_21c.y = (float)((double)DAT_00c79854[6] +
|
|
__uint_to_double_fixup[-(DAT_00c79854[6] >> 0x1f)]);
|
|
local_214 = GHIDRA_CAST<Game *>(((float)((double)DAT_00c79854[4] +
|
|
__uint_to_double_fixup[-(DAT_00c79854[4] >> 0x1f)]) / local_21c.y))
|
|
;
|
|
local_20c = GHIDRA_CAST<Game *>((local_21c.y / (g_screenPointScale * 1024.0)));
|
|
local_1d4 = GHIDRA_CAST<Game *>((local_224.y / (g_screenPointScale * 1024.0)));
|
|
local_210 = GHIDRA_CAST<Game *>((g_displayPixelRatio * g_screenPointScale));
|
|
local_ac = GHIDRA_CAST<Game *>(((g_screenHeight - 182.0) * 0.5));
|
|
local_1f8.y = (((float)(GHIDRA_CAST<Game *>(room))->_roomList[0].GridIndex - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * (float)local_210 + 0.5;
|
|
g_currentShader = local_1f0;
|
|
dVar19 = floor((double)local_1f8.y);
|
|
VStack_c4.y = (float)dVar19;
|
|
stageType = (((float)(GHIDRA_CAST<Game *>(room))->_roomList[0].SafeGridIndex - 140.0) * 0.65 +
|
|
(float)local_ac) * (float)local_210 + 0.5;
|
|
local_1f8.y = stageType;
|
|
dVar19 = floor((double)stageType);
|
|
local_1f8.y = (float)dVar19;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_bc)) + 0xc))) = local_214;
|
|
local_e8._alpha =
|
|
(((g_game->_screenShakeOffset).x +
|
|
(GHIDRA_CAST<Vector *>(&(GHIDRA_CAST<Game *>(room))->_roomList[0x18].DeliriumDistance))->x +
|
|
VStack_c4.y / (float)local_210) * g_screenPointScale) / local_21c.y;
|
|
local_ac = local_1e4;
|
|
local_e8._unk =
|
|
GHIDRA_INT(((((float)(GHIDRA_CAST<Game *>(room))->_roomList[0x18].Group + (g_game->_screenShakeOffset).y +
|
|
(float)dVar19 / (float)local_210) * g_screenPointScale) / local_224.y));
|
|
local_e8._green = (float)local_20c;
|
|
local_e8._blue = (float)local_1d4;
|
|
bVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if (bVar4 == 0) {
|
|
uVar6 = g_manager->_framecount + 1U & 0x80000001;
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
uVar6 = (uVar6 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
}
|
|
else {
|
|
uVar6 = 0;
|
|
}
|
|
local_1f8.y = (float)((float)GHIDRA_INT((uVar6 + (g_game->_frameCount % 600) * 2)) / 120.0);
|
|
(GHIDRA_CAST<Shader *>((local_1f0)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("TextureSize"),9,local_bc + 0xc,uVar6);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Ratio"),0xb,&local_e8._green,unused_06);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(&DAT_00b6837c,8,&local_1f8.y,unused_07);
|
|
}
|
|
(**(code **)(*DAT_00c79854 + 0x14))(shaderColor._tint + 2);
|
|
iVar14 = extraout_ECX_03;
|
|
}
|
|
DAT_00c79a4c = 0.0;
|
|
shader_cache_find(iVar14);
|
|
if ((GHIDRA_UINT(g_game->_debugFlags) >> 4 & 1) != 0) {
|
|
roomTypeNames = &DAT_00b6c690;
|
|
local_15c = "Default";
|
|
local_158 = &DAT_00b6c688;
|
|
local_154 = "Error";
|
|
local_150 = "Treasure";
|
|
local_14c = &DAT_00b6c734;
|
|
local_148 = "Miniboss";
|
|
local_144 = "Secret";
|
|
local_140 = "SSecret";
|
|
local_13c = "Arcade";
|
|
local_138 = "Curse";
|
|
local_134 = "Ambush";
|
|
local_130 = "Library";
|
|
local_12c = "Sacrifice";
|
|
local_128 = "Devil";
|
|
local_124 = "Angel";
|
|
local_120 = "Dungeon";
|
|
local_11c = "Bossrush";
|
|
local_118 = "Isaac";
|
|
local_114 = "Barren";
|
|
local_110 = "Chest";
|
|
local_10c = &DAT_00b6c74c;
|
|
local_108 = "Market";
|
|
local_104 = &DAT_00b6c75c;
|
|
local_100 = "Planetarium";
|
|
local_fc = "TeleEntrance";
|
|
local_f8 = "TeleExit";
|
|
local_f4 = "SecretExit";
|
|
local_f0 = &DAT_00b634c0;
|
|
local_ec = "USecret";
|
|
RoomConfigStage::GetDisplayName
|
|
((RoomConfig_Stage *)
|
|
(g_game->_ventricleRazorPortals +
|
|
**GHIDRA_CAST<int **>(((GHIDRA_CAST<Game *>(room))->_stageType + 0x10)) * 0xc4 + 0x598),&stageName,0);
|
|
local_14 = 0;
|
|
local_1f8.y = *GHIDRA_CAST<float *>(((GHIDRA_CAST<Game *>(room))->_stageType + 0xb4));
|
|
sprintf_s(debugText,0x80,GHIDRA_CAST<uint8_t *>("%s %s %d %s (group %d)"));
|
|
manager = g_manager;
|
|
uVar6 = (GHIDRA_CAST<Font *>((&g_manager->_font5_terminus8)))->Font::get_string_width_n(debugText,-1);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x10))) = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x14))) = 9.18341e-41;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1b8)) + 0x18))) = 0.0;
|
|
fStack_19c = 1.0;
|
|
fStack_198 = -NAN;
|
|
fStack_194 = 0.0;
|
|
local_190 = 0.0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
(GHIDRA_CAST<Font *>((&manager->_font5_terminus8)))->Font::DrawString(debugText,GHIDRA_CAST<KColor *>(&DAT_00c5d134),local_1b8 + 0x10,
|
|
g_screenWidth * 0.5 - ((float)(uVar6 >> 1) + 0.0),g_screenHeight - 12.0);
|
|
(GHIDRA_CAST<msvc::string *>((stageName._buf)))->msvc::string::_Tidy_deallocate();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 008128f0
|
|
void Room::render_debug_grid_values(Vector *offset)
|
|
{
|
|
KColor color;
|
|
void *glyphs;
|
|
int gridWidth;
|
|
int gridIndex;
|
|
double dVar1;
|
|
float quad [28];
|
|
uint8_t glyphList [16];
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
KColor drawColor;
|
|
float screenY;
|
|
float local_60;
|
|
float drawX;
|
|
uint8_t valueText [64];
|
|
uint32_t local_18;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
puStack_c = &LAB_00b01598;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((valueText + 0x54));
|
|
ExceptionList = &local_10;
|
|
gridIndex = 0;
|
|
gridWidth = this->_gridWidth;
|
|
if (0 < this->_gridHeight * gridWidth) {
|
|
do {
|
|
local_8 = 0xffffffff;
|
|
local_60 = g_displayPixelRatio * g_screenPointScale;
|
|
screenY = (((float)(gridIndex / gridWidth) * 40.0 + 120.0) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5;
|
|
drawX = ((((float)(gridIndex % gridWidth) * 40.0 + 40.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * local_60 + 0.5;
|
|
dVar1 = floor((double)drawX);
|
|
drawX = (float)dVar1 / local_60;
|
|
screenY = screenY * local_60 + 0.5;
|
|
dVar1 = floor((double)screenY);
|
|
screenY = (float)dVar1;
|
|
drawColor._unk = 0;
|
|
local_60 = screenY / local_60 + offset->y;
|
|
drawX = drawX + offset->x;
|
|
drawColor._red = 1.0;
|
|
drawColor._green = 1.0;
|
|
drawColor._blue = 0.0;
|
|
drawColor._alpha = 0.2;
|
|
render_quad_set_uniform_color
|
|
(quad,drawX - 13.0,local_60 - 13.0,drawX + 13.0,local_60 + 13.0,&drawColor);
|
|
render_quad_draw_color_shader(quad,1.0);
|
|
sprintf_s(valueText,0x40,s__d);
|
|
manager = g_manager;
|
|
local_80 = 0;
|
|
local_7c = 0xffff;
|
|
drawColor._red = 0.0;
|
|
drawColor._green = 1.0;
|
|
drawColor._blue = -NAN;
|
|
drawColor._alpha = 0.0;
|
|
drawColor._unk = 0;
|
|
local_8 = 0;
|
|
drawX = drawX - 12.0;
|
|
local_60 = local_60 - 10.0;
|
|
glyphs = Font::measure_string
|
|
(&g_manager->_font6_PFTempestaSevenCondensed,glyphList,valueText,&local_80,
|
|
&g_vectorOne);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
color._alpha = 0.2;
|
|
color._red = 1.0;
|
|
color._green = 1.0;
|
|
color._blue = 0.0;
|
|
color._unk = 0;
|
|
Font::render_glyph_quads
|
|
(&manager->_font6_PFTempestaSevenCondensed,glyphs,drawX,local_60,1.0,1.0,color,
|
|
&local_80);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
gridIndex = gridIndex + 1;
|
|
gridWidth = this->_gridWidth;
|
|
} while (gridIndex < this->_gridHeight * gridWidth);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00812c10
|
|
int Room::GetGridPathFromPos(Vector *position)
|
|
{
|
|
uint32_t gridIndex;
|
|
int gridY;
|
|
int gridX;
|
|
|
|
gridX = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) ||
|
|
(gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5)), gridY < 0)) ||
|
|
((this->_gridHeight <= gridY ||
|
|
(gridIndex = this->_gridWidth * gridY + gridX, 0x1bf < gridIndex)))) {
|
|
return 0;
|
|
}
|
|
return this->_gridPaths[gridIndex];
|
|
}
|
|
|
|
// 00812c90
|
|
int Room::GetGridIndex(Vector *pos)
|
|
{
|
|
int gridY;
|
|
int gridX;
|
|
|
|
gridX = GHIDRA_INT(((pos->x - 40.0) / 40.0 + 0.5));
|
|
if ((((gridX < 0) || (this->_gridWidth <= gridX)) ||
|
|
(gridY = GHIDRA_INT(((pos->y - 120.0) / 40.0 + 0.5)), gridY < 0)) || (this->_gridHeight <= gridY)) {
|
|
return -1;
|
|
}
|
|
return this->_gridWidth * gridY + gridX;
|
|
}
|
|
|
|
// 00812d00
|
|
Vector * Room::GetCenterPos(Vector *outPos)
|
|
{
|
|
int iVar1;
|
|
uint32_t centerGridIndex;
|
|
void *room;
|
|
|
|
room = g_game->_room;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) == 0) ||
|
|
(iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 4)) + 0x10)), iVar1 == 0)) {
|
|
switchD_00812d27_default:
|
|
outPos->x = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x1c)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x14))) * 0.5 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x14));
|
|
outPos->y = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x20)) - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x18))) * 0.5 +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(room) + 0x18));
|
|
return outPos;
|
|
}
|
|
switch(*GHIDRA_CAST<uint32_t *>((iVar1 + 0x48))) {
|
|
case 9:
|
|
centerGridIndex = 0x148;
|
|
break;
|
|
case 10:
|
|
centerGridIndex = 0x13b;
|
|
break;
|
|
case 0xb:
|
|
centerGridIndex = 0x84;
|
|
break;
|
|
case 0xc:
|
|
centerGridIndex = 0x77;
|
|
break;
|
|
default:
|
|
goto switchD_00812d27_default;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(room) + 0xc));
|
|
outPos->x = (float)GHIDRA_INT(((int64_t)(uint64_t)centerGridIndex % (int64_t)iVar1)) * 40.0 + 40.0;
|
|
outPos->y = (float)GHIDRA_INT(((int64_t)(uint64_t)centerGridIndex / (int64_t)iVar1)) * 40.0 + 120.0;
|
|
return outPos;
|
|
}
|
|
|
|
// 00812de0
|
|
int Room::GetClampedGridIndex(Vector *position)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
int column;
|
|
int row;
|
|
|
|
iVar2 = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
column = 0;
|
|
if (0 < iVar2) {
|
|
column = iVar2;
|
|
}
|
|
iVar2 = this->_gridHeight + -1;
|
|
row = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5));
|
|
iVar1 = 0;
|
|
if (0 < row) {
|
|
iVar1 = row;
|
|
}
|
|
if (iVar1 < iVar2) {
|
|
iVar2 = iVar1;
|
|
}
|
|
iVar1 = this->_gridWidth + -1;
|
|
if (column < iVar1) {
|
|
iVar1 = column;
|
|
}
|
|
return iVar2 * this->_gridWidth + iVar1;
|
|
}
|
|
|
|
// 00812e60
|
|
int Room::GetGridIndexByTile(int GridRow, int GridColumn)
|
|
{
|
|
if ((((GridRow < 0) || (this->_gridWidth <= GridRow)) || (GridColumn < 0)) ||
|
|
(this->_gridHeight <= GridColumn)) {
|
|
return -1;
|
|
}
|
|
return this->_gridWidth * GridColumn + GridRow;
|
|
}
|
|
|
|
// 00812f00
|
|
Vector * Room::GetGridPosition(Vector *outPos, int gridIndex)
|
|
{
|
|
int gridWidth;
|
|
|
|
gridWidth = this->_gridWidth;
|
|
outPos->x = (float)(gridIndex % gridWidth) * 40.0 + 40.0;
|
|
outPos->y = (float)(gridIndex / gridWidth) * 40.0 + 120.0;
|
|
return outPos;
|
|
}
|
|
|
|
// 00813360
|
|
uint8_t Room::IsPositionInRoom(Vector *position, float margin)
|
|
{
|
|
Vector clampedPos;
|
|
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U < 4) {
|
|
GetClampedPositionImpl(this,&clampedPos,position,margin,margin,margin,margin);
|
|
if ((clampedPos.x == position->x) && (clampedPos.y == position->y)) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if ((((margin + (this->_topLeftPos).x <= position->x) &&
|
|
(position->x <= (this->_bottomRightPos).x - margin)) &&
|
|
(margin + (this->_topLeftPos).y <= position->y)) &&
|
|
(position->y <= (this->_bottomRightPos).y - margin)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00813b30
|
|
uint8_t Room::DamageGridWithSource(int gridIndex, int damage, EntityRef *source)
|
|
{
|
|
uint8_t isDamaged;
|
|
|
|
if ((GHIDRA_UINT(gridIndex) < 0x1c0) && (this->_gridEntities[gridIndex] != GHIDRA_CAST<int *>(0x0))) {
|
|
isDamaged = (**(code **)(*GHIDRA_CAST<int *>(this->_gridEntities[gridIndex]) + 0x10))(damage,source);
|
|
return isDamaged;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00813b60
|
|
uint8_t Room::DamageGrid(int gridIndex, int damage)
|
|
{
|
|
uint8_t bVar1;
|
|
EntityRef damageSource;
|
|
|
|
damageSource._type = 0;
|
|
damageSource._variant = 0;
|
|
damageSource._spawnerType = 0;
|
|
damageSource._spawnerVariant = 0;
|
|
damageSource._position.x = g_vectorZero.x;
|
|
damageSource._position.y = g_vectorZero.y;
|
|
damageSource._velocity.x = g_vectorZero.x;
|
|
damageSource._velocity.y = g_vectorZero.y;
|
|
damageSource._flags = 0;
|
|
damageSource._entity = (void *)0x0;
|
|
if ((GHIDRA_UINT(gridIndex) < 0x1c0) && (this->_gridEntities[gridIndex] != GHIDRA_CAST<int *>(0x0))) {
|
|
bVar1 = (**(code **)(*GHIDRA_CAST<int *>(this->_gridEntities[gridIndex]) + 0x10))(damage,&damageSource);
|
|
return bVar1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00813c40
|
|
uint8_t Room::DestroyGrid(int gridIdx, uint8_t isImmediate, uint8_t isDefuseBombRock)
|
|
{
|
|
uint8_t bVar1;
|
|
undefined3 in_stack_00000009;
|
|
EntityRef source;
|
|
int *gridEntity;
|
|
|
|
source._type = 0;
|
|
source._variant = 0;
|
|
source._spawnerType = 0;
|
|
source._spawnerVariant = 0;
|
|
source._position.x = g_vectorZero.x;
|
|
source._position.y = g_vectorZero.y;
|
|
source._velocity.x = g_vectorZero.x;
|
|
source._velocity.y = g_vectorZero.y;
|
|
source._flags = 0;
|
|
source._entity = (void *)0x0;
|
|
if ((0x1bf < GHIDRA_UINT(gridIdx)) ||
|
|
(gridEntity = this->_gridEntities[gridIdx], gridEntity == GHIDRA_CAST<int *>(0x0))) {
|
|
return 0;
|
|
}
|
|
if ((isDefuseBombRock != 0) && (gridEntity[1] == 5)) {
|
|
gridEntity[1] = 2;
|
|
}
|
|
bVar1 = (**(code **)(*gridEntity + 0x14))(_isImmediate,&source);
|
|
return bVar1;
|
|
}
|
|
|
|
// 00813ce0
|
|
int Room::GetFrameCount()
|
|
{
|
|
if (*GHIDRA_CAST<char *>(this) == '\0') {
|
|
return -1;
|
|
}
|
|
return g_game->_frameCount - this->_enterFrame;
|
|
}
|
|
|
|
// 00813d00
|
|
int Room::greed_shop_slot_type(uint32_t seed)
|
|
{
|
|
switch(seed % 10) {
|
|
case 0:
|
|
return 3;
|
|
case 1:
|
|
return 1;
|
|
case 2:
|
|
return 0;
|
|
case 3:
|
|
return 4;
|
|
case 4:
|
|
return 8;
|
|
case 5:
|
|
return 10;
|
|
case 6:
|
|
return 5;
|
|
case 7:
|
|
return 2;
|
|
case 8:
|
|
return 6;
|
|
case 9:
|
|
return 0xb;
|
|
default:
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
// 00813d90
|
|
void Room::init_shop_item_slots()
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
uint32_t uVar3;
|
|
uint8_t shift2;
|
|
uint8_t shift3;
|
|
uint16_t uVar4;
|
|
uint32_t allocSize;
|
|
int iVar5;
|
|
int *piVar6;
|
|
int *piVar7;
|
|
int slotOffset;
|
|
uint32_t local_38;
|
|
RNG shopRng;
|
|
int *slotTypes;
|
|
int *slotTypesEnd;
|
|
int *slotTypesCapacity;
|
|
int *local_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int *slotTypesCapacityCopy;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b015f5;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
shopRng._shift1 = 5;
|
|
shopRng._shift2 = 9;
|
|
local_38 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x60));
|
|
*GHIDRA_CAST<uint64_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa4)) = 0;
|
|
iVar5 = this->_roomType;
|
|
local_18 = GHIDRA_CAST<int *>(0x7);
|
|
shopRng._shift3 = 7;
|
|
shopRng._seed = local_38;
|
|
if (((iVar5 == 0xe) || (iVar5 == 0x16)) ||
|
|
(slotOffset = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))), (*GHIDRA_CAST<uint32_t *>((slotOffset + 0x44)) >> 0xb & 1) != 0)) {
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x94)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x96)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x98)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9a)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9c)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9e)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa0)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa2)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
if (local_38 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
shopRng._seed = local_38 >> 5 ^ local_38;
|
|
shopRng._seed = shopRng._seed << 9 ^ shopRng._seed;
|
|
shopRng._seed = GHIDRA_UINT(shopRng._seed) >> 7 ^ shopRng._seed;
|
|
if (shopRng._seed == (GHIDRA_UINT(shopRng._seed) / 3) * 3) {
|
|
LAB_00814851:
|
|
uVar4 = 0xffff;
|
|
uVar3 = shopRng._seed;
|
|
}
|
|
else {
|
|
if (shopRng._seed == 0) {
|
|
shopRng._seed = local_38;
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
shopRng._seed = GHIDRA_UINT(shopRng._seed) >> 5 ^ shopRng._seed;
|
|
shopRng._seed = shopRng._seed << 9 ^ shopRng._seed;
|
|
uVar3 = GHIDRA_UINT(shopRng._seed) >> 7 ^ shopRng._seed;
|
|
uVar4 = (uint16_t)(uVar3 % 6);
|
|
}
|
|
LAB_00814854:
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xae)) = uVar4;
|
|
}
|
|
else {
|
|
if (iVar5 == 0xf) {
|
|
slotTypes = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesEnd = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 0;
|
|
local_18 = GHIDRA_CAST<int *>(0x8);
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&local_18);
|
|
local_18 = GHIDRA_CAST<int *>(0x4);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 4;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x4);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 4;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x3);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 3;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x3);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 3;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x13);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0x13;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x13);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0x13;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x14);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0x14;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
piVar7 = slotTypesEnd;
|
|
piVar6 = slotTypes;
|
|
RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd);
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar7) - GHIDRA_INT(piVar6) >> 2));
|
|
iVar5 = 0;
|
|
local_18 = GHIDRA_CAST<int *>(&DAT_00000008);
|
|
if (GHIDRA_INT(piVar7) < 8) {
|
|
local_18 = piVar7;
|
|
}
|
|
if (0 < GHIDRA_INT(local_18)) {
|
|
slotOffset = 0x94;
|
|
do {
|
|
piVar7 = piVar6 + iVar5;
|
|
iVar5 = iVar5 + 1;
|
|
*GHIDRA_CAST<short *>((slotOffset + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))) = (short)*piVar7;
|
|
slotOffset = slotOffset + 2;
|
|
} while (iVar5 < GHIDRA_INT(local_18));
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x96)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
if (shopRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = GHIDRA_UINT(shopRng._seed) >> ((uint8_t)shopRng._shift1 & 0x1f) ^ shopRng._seed;
|
|
uVar3 = uVar3 << ((uint8_t)shopRng._shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((uint8_t)shopRng._shift3 & 0x1f) ^ uVar3;
|
|
if (uVar3 % 3 == 0) {
|
|
uVar4 = 0xffff;
|
|
}
|
|
else {
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = uVar3 >> ((uint8_t)shopRng._shift1 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << ((uint8_t)shopRng._shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> ((uint8_t)shopRng._shift3 & 0x1f) ^ uVar3;
|
|
uVar4 = (uint16_t)(uVar3 % 6);
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xae)) = uVar4;
|
|
if (slotTypes != GHIDRA_CAST<int *>(0x0)) {
|
|
allocSize = GHIDRA_INT(slotTypesCapacity) - GHIDRA_INT(slotTypes) & 0xfffffffc;
|
|
piVar6 = slotTypes;
|
|
if (0xfff < allocSize) {
|
|
piVar6 = GHIDRA_CAST<int *>(slotTypes[-1]);
|
|
allocSize = allocSize + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(slotTypes) + (-4 - GHIDRA_INT(piVar6))))) goto LAB_00814776;
|
|
}
|
|
operator_delete(piVar6,allocSize);
|
|
}
|
|
goto LAB_0081485e;
|
|
}
|
|
if ((iVar5 == 2) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((slotOffset + 0x10)) + 0x10)) - 100U < 0x14)) {
|
|
slotTypes = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesEnd = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 1;
|
|
local_18 = GHIDRA_CAST<int *>(0xb);
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&local_18);
|
|
local_18 = GHIDRA_CAST<int *>(0x3);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 3;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x1);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 1;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x6);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 6;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x5);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 5;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x2);
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 2;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
slotTypesCapacityCopy = slotTypesCapacity;
|
|
piVar7 = slotTypesEnd;
|
|
RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd);
|
|
piVar6 = slotTypes;
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x94)) = (short)*slotTypes;
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x96)) = (short)slotTypes[1];
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x98)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9a)) = 9;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9c)) = 10;
|
|
*slotTypes = 8;
|
|
slotTypes[1] = 10;
|
|
RNG::Shuffle(&shopRng,slotTypes,piVar7);
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9e)) = (short)*piVar6;
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa0)) = (short)piVar6[1];
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa2)) = 10;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(3);
|
|
if (uVar3 == 0) {
|
|
uVar4 = 0xffff;
|
|
}
|
|
else {
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(8);
|
|
uVar4 = (uint16_t)uVar3;
|
|
}
|
|
uVar3 = GHIDRA_INT(slotTypesCapacityCopy) - GHIDRA_INT(piVar6) & 0xfffffffc;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xae)) = uVar4;
|
|
piVar7 = piVar6;
|
|
if (0xfff < uVar3) {
|
|
piVar7 = GHIDRA_CAST<int *>(piVar6[-1]);
|
|
uVar3 = uVar3 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(piVar6) + (-4 - GHIDRA_INT(piVar7))))) goto LAB_00814776;
|
|
}
|
|
operator_delete(piVar7,uVar3);
|
|
uVar3 = shopRng._seed;
|
|
goto LAB_0081485e;
|
|
}
|
|
if (g_game->_currentRoomIdx == -0xd) {
|
|
slotTypes = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesEnd = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 2;
|
|
local_18 = GHIDRA_CAST<int *>(0x8);
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&local_18);
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(2);
|
|
local_18 = GHIDRA_CAST<int *>((0xd - GHIDRA_UINT((uVar3 != 0))));
|
|
if (slotTypesEnd == slotTypesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = GHIDRA_INT(local_18);
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
piVar7 = slotTypesCapacity;
|
|
piVar6 = slotTypesEnd;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(8);
|
|
local_18 = GHIDRA_CAST<int *>(((-GHIDRA_UINT((uVar3 != 0)) & 0xfffffffb) + 0xe));
|
|
if (piVar6 == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(piVar6,&local_18);
|
|
piVar7 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*piVar6 = GHIDRA_INT(local_18);
|
|
slotTypesEnd = piVar6 + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0xb);
|
|
if (slotTypesEnd == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
piVar7 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0xb;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0xb);
|
|
if (slotTypesEnd == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
piVar7 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0xb;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0xf);
|
|
if (slotTypesEnd == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
piVar7 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0xf;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x6);
|
|
if (slotTypesEnd == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
piVar7 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = 6;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>(0x10);
|
|
if (slotTypesEnd == piVar7) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
}
|
|
else {
|
|
*slotTypesEnd = 0x10;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
piVar7 = slotTypesEnd;
|
|
piVar6 = slotTypes;
|
|
RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd);
|
|
piVar7 = GHIDRA_CAST<int *>((GHIDRA_INT(piVar7) - GHIDRA_INT(piVar6) >> 2));
|
|
iVar5 = 0;
|
|
local_18 = GHIDRA_CAST<int *>(&DAT_00000008);
|
|
if (GHIDRA_INT(piVar7) < 8) {
|
|
local_18 = piVar7;
|
|
}
|
|
if (0 < GHIDRA_INT(local_18)) {
|
|
slotOffset = 0x94;
|
|
do {
|
|
piVar7 = piVar6 + iVar5;
|
|
iVar5 = iVar5 + 1;
|
|
*GHIDRA_CAST<short *>((slotOffset + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))) = (short)*piVar7;
|
|
slotOffset = slotOffset + 2;
|
|
} while (iVar5 < GHIDRA_INT(local_18));
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
if (shopRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
shopRng._seed = GHIDRA_UINT(shopRng._seed) >> ((uint8_t)shopRng._shift1 & 0x1f) ^ shopRng._seed;
|
|
shopRng._seed = shopRng._seed << ((uint8_t)shopRng._shift2 & 0x1f) ^ shopRng._seed;
|
|
shopRng._seed = GHIDRA_UINT(shopRng._seed) >> ((uint8_t)shopRng._shift3 & 0x1f) ^ shopRng._seed;
|
|
if (GHIDRA_UINT(shopRng._seed) % 3 == 0) {
|
|
uVar4 = 0xffff;
|
|
}
|
|
else {
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(8);
|
|
uVar4 = (uint16_t)uVar3;
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xae)) = uVar4;
|
|
uVar3 = shopRng._seed;
|
|
if (slotTypes == GHIDRA_CAST<int *>(0x0)) goto LAB_0081485e;
|
|
allocSize = GHIDRA_INT(slotTypesCapacity) - GHIDRA_INT(slotTypes) & 0xfffffffc;
|
|
piVar6 = slotTypes;
|
|
if (0xfff < allocSize) {
|
|
piVar6 = GHIDRA_CAST<int *>(slotTypes[-1]);
|
|
iVar5 = GHIDRA_INT(slotTypes) - GHIDRA_INT(piVar6);
|
|
joined_r0x00814770:
|
|
allocSize = allocSize + 0x23;
|
|
if (0x1f < iVar5 - 4U) {
|
|
LAB_00814776:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsGreedMode();
|
|
if ((bVar2 != 0) ||
|
|
(((iVar5 == 2 && (uVar3 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((slotOffset + 0x10)) + 0x10)), 99 < uVar3)) &&
|
|
(uVar3 < 0x78)))) {
|
|
*GHIDRA_CAST<uint16_t *>((slotOffset + 0x94)) = 3;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x96)) = 0;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x98)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9a)) = 9;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::Next();
|
|
iVar5 = greed_shop_slot_type(uVar3);
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9c)) = (short)iVar5;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::Next();
|
|
iVar5 = greed_shop_slot_type(uVar3);
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x9e)) = (short)iVar5;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::Next();
|
|
iVar5 = greed_shop_slot_type(uVar3);
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa0)) = (short)iVar5;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::Next();
|
|
iVar5 = greed_shop_slot_type(uVar3);
|
|
*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xa2)) = (short)iVar5;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(3);
|
|
if (uVar3 == 0) goto LAB_00814851;
|
|
uVar3 = (GHIDRA_CAST<RNG *>((&shopRng)))->RNG::RandomInt(8);
|
|
uVar4 = (uint16_t)uVar3;
|
|
uVar3 = shopRng._seed;
|
|
goto LAB_00814854;
|
|
}
|
|
slotTypes = GHIDRA_CAST<int *>(0x0);
|
|
piVar6 = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesEnd = GHIDRA_CAST<int *>(0x0);
|
|
slotTypesCapacity = GHIDRA_CAST<int *>(0x0);
|
|
local_8 = 3;
|
|
local_18 = GHIDRA_CAST<int *>(0x0);
|
|
do {
|
|
if (slotTypesEnd == piVar6) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_18);
|
|
piVar6 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = GHIDRA_INT(local_18);
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
local_18 = GHIDRA_CAST<int *>((GHIDRA_INT(local_18) + 1));
|
|
} while (GHIDRA_INT(local_18) < 8);
|
|
local_18 = piVar6;
|
|
if (3 < this->_shopLevel) {
|
|
local_38 = 8;
|
|
if (slotTypesEnd == piVar6) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(slotTypesEnd,&local_38);
|
|
local_18 = slotTypesCapacity;
|
|
}
|
|
else {
|
|
*slotTypesEnd = 8;
|
|
slotTypesEnd = slotTypesEnd + 1;
|
|
}
|
|
}
|
|
piVar7 = slotTypesEnd;
|
|
piVar6 = slotTypes;
|
|
RNG::Shuffle(&shopRng,slotTypes,slotTypesEnd);
|
|
uVar3 = GHIDRA_INT(piVar7) - GHIDRA_INT(piVar6) >> 2;
|
|
iVar5 = 0;
|
|
local_38 = 8;
|
|
if (GHIDRA_INT(uVar3) < 8) {
|
|
local_38 = uVar3;
|
|
}
|
|
if (0 < GHIDRA_INT(local_38)) {
|
|
slotOffset = 0x94;
|
|
do {
|
|
piVar7 = piVar6 + iVar5;
|
|
iVar5 = iVar5 + 1;
|
|
*GHIDRA_CAST<short *>((slotOffset + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))) = (short)*piVar7;
|
|
slotOffset = slotOffset + 2;
|
|
} while (iVar5 < GHIDRA_INT(local_38));
|
|
}
|
|
if (shopRng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
bVar2 = (uint8_t)shopRng._shift1;
|
|
uVar3 = GHIDRA_UINT(shopRng._seed) >> (bVar2 & 0x1f) ^ shopRng._seed;
|
|
shift2 = (uint8_t)shopRng._shift2;
|
|
uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3;
|
|
shift3 = (uint8_t)shopRng._shift3;
|
|
uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x94 + (uVar3 & 1) * 2)) = 8;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xac)) = 0;
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = uVar3 >> (bVar2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3;
|
|
if (uVar3 % 3 == 0) {
|
|
uVar4 = 0xffff;
|
|
}
|
|
else {
|
|
if (uVar3 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar3 = uVar3 >> (bVar2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 << (shift2 & 0x1f) ^ uVar3;
|
|
uVar3 = uVar3 >> (shift3 & 0x1f) ^ uVar3;
|
|
uVar4 = (uint16_t)(uVar3 % 6);
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0xae)) = uVar4;
|
|
if (slotTypes == GHIDRA_CAST<int *>(0x0)) goto LAB_0081485e;
|
|
allocSize = GHIDRA_INT(local_18) - GHIDRA_INT(slotTypes) & 0xfffffffc;
|
|
piVar6 = slotTypes;
|
|
if (0xfff < allocSize) {
|
|
piVar6 = GHIDRA_CAST<int *>(slotTypes[-1]);
|
|
iVar5 = GHIDRA_INT(slotTypes) - GHIDRA_INT(piVar6);
|
|
goto joined_r0x00814770;
|
|
}
|
|
}
|
|
operator_delete(piVar6,allocSize);
|
|
}
|
|
LAB_0081485e:
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x60)) = uVar3;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00814980
|
|
int Room::shop_ware_roll(uint32_t *param_1, uint32_t *param_2, int *param_3, uint32_t param_4)
|
|
{
|
|
short *psVar1;
|
|
uint16_t *puVar2;
|
|
uint32_t uVar3;
|
|
uint32_t uVar4;
|
|
int shopItemId;
|
|
int iVar5;
|
|
Room *in_ECX;
|
|
|
|
if (*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0xac)) < 0) {
|
|
init_shop_item_slots(in_ECX);
|
|
}
|
|
uVar3 = (in_ECX->_shopItemDeque)._size;
|
|
if (uVar3 == 0) {
|
|
shopItemId = GHIDRA_INT(*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0xac)));
|
|
}
|
|
else {
|
|
uVar4 = (in_ECX->_shopItemDeque)._offset;
|
|
shopItemId = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_INT((in_ECX->_shopItemDeque)._map) +
|
|
(uVar4 >> 1 & (in_ECX->_shopItemDeque)._mapSize - 1) * 4)) + 4 +
|
|
(uVar4 & 1) * 8));
|
|
}
|
|
pickup_roll_random_variant(in_ECX,shopItemId,GHIDRA_CAST<int *>(param_1),param_2,param_4);
|
|
iVar5 = GetShopItemPrice(in_ECX,*param_1,*param_2,shopItemId,GHIDRA_CAST<Entity_Player *>(0x0));
|
|
*param_3 = iVar5;
|
|
iVar5 = _Room::ResolveHeartSubType(shopItemId,iVar5,0);
|
|
*param_3 = iVar5;
|
|
if (uVar3 == 0) {
|
|
psVar1 = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0xac));
|
|
*psVar1 = *psVar1 + 1;
|
|
puVar2 = GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x4)))) + 0xac));
|
|
*puVar2 = *puVar2 & 7;
|
|
}
|
|
return shopItemId;
|
|
}
|
|
|
|
// 008151e0
|
|
int Room::GetShopItemPrice(uint32_t variant, int subType, int shopItemId, Entity_Player *player)
|
|
{
|
|
code *pcVar1;
|
|
uint8_t bVar2;
|
|
uint8_t isNullEffectActive;
|
|
Entity_Player *foundPlayer;
|
|
int iVar3;
|
|
uint32_t coinFlip;
|
|
uint32_t uVar4;
|
|
ItemConfig_Item *collectibleConfig;
|
|
int extraout_ECX;
|
|
char isPoundOfFlesh;
|
|
uint32_t unaff_EBX;
|
|
undefined3 uVar5;
|
|
RNG priceRng;
|
|
uint32_t local_38;
|
|
PlayerManager *playerManager;
|
|
Entity_Player *bargainOwner;
|
|
uint32_t seed;
|
|
Room *room;
|
|
uint32_t local_24;
|
|
Entity_Player *local_20;
|
|
char isKeeperPricing;
|
|
RNG bargainRng;
|
|
uint32_t local_8;
|
|
short shopSlotType;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
local_20 = player;
|
|
priceRng._shift1 = 5;
|
|
priceRng._shift2 = 9;
|
|
priceRng._seed = subType + variant | *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58)) & 0xfffff800;
|
|
local_38 = 7;
|
|
priceRng._shift3 = 7;
|
|
uVar5 = (undefined3)(GHIDRA_UINT(unaff_EBX) >> 8);
|
|
seed = priceRng._seed;
|
|
room = this;
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bargainOwner = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstTrinketOwner(0xab);
|
|
foundPlayer = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x2a0,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
uVar4 = CONCAT31(uVar5,foundPlayer != GHIDRA_CAST<Entity_Player *>(0x0));
|
|
playerManager = &g_game->_playerManager;
|
|
local_24 = uVar4;
|
|
foundPlayer = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::FirstPlayerByType(0xe);
|
|
if (foundPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00815375;
|
|
foundPlayer = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::FirstPlayerByType(0x21);
|
|
if (foundPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_00815375;
|
|
if ((bargainOwner != GHIDRA_CAST<Entity_Player *>(0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Entity_Player *>((bargainOwner)))->Entity_Player::HasTrinket(0xab,0), bVar2 != 0)) {
|
|
iVar3 = (GHIDRA_CAST<Entity_Player *>((bargainOwner)))->Entity_Player::GetTrinketMultiplier(0xab);
|
|
if (iVar3 < 2) {
|
|
bargainRng._seed = seed;
|
|
bargainRng._shift1 = 0xf;
|
|
bargainRng._shift2 = 1;
|
|
bargainRng._shift3 = 0x1d;
|
|
coinFlip = (GHIDRA_CAST<RNG *>((&bargainRng)))->RNG::RandomInt(2);
|
|
if (coinFlip != 0) goto LAB_008152fc;
|
|
}
|
|
goto LAB_00815375;
|
|
}
|
|
LAB_008152fc:
|
|
isKeeperPricing = '\0';
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(0x2a0,0);
|
|
uVar4 = CONCAT31(uVar5,bVar2);
|
|
local_24 = uVar4;
|
|
if ((local_20->_playerType != 0xe) && (local_20->_playerType != 0x21)) {
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((local_20)))->Entity_Player::HasTrinket(0xab,0);
|
|
if (bVar2 == 0) goto LAB_008152fc;
|
|
iVar3 = (GHIDRA_CAST<Entity_Player *>((local_20)))->Entity_Player::GetTrinketMultiplier(0xab);
|
|
if (iVar3 < 2) {
|
|
bargainRng._seed = seed;
|
|
bargainRng._shift1 = 0xf;
|
|
bargainRng._shift2 = 1;
|
|
bargainRng._shift3 = 0x1d;
|
|
coinFlip = (GHIDRA_CAST<RNG *>((&bargainRng)))->RNG::RandomInt(2);
|
|
if (coinFlip != 0) {
|
|
isKeeperPricing = '\0';
|
|
goto LAB_00815377;
|
|
}
|
|
}
|
|
}
|
|
LAB_00815375:
|
|
isKeeperPricing = '\x01';
|
|
}
|
|
LAB_00815377:
|
|
isPoundOfFlesh = (char)uVar4;
|
|
if (g_game->_currentRoomIdx == -0xd) {
|
|
if (300 < variant) {
|
|
if (variant != 0x15e) {
|
|
return 5;
|
|
}
|
|
if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) {
|
|
return 0xf;
|
|
}
|
|
return -5;
|
|
}
|
|
if (variant == 300) {
|
|
if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) {
|
|
return 6;
|
|
}
|
|
return -5;
|
|
}
|
|
if (variant == 10) {
|
|
if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) {
|
|
return -5;
|
|
}
|
|
if (subType == 4) {
|
|
return 0xf;
|
|
}
|
|
if ((subType == 0xb) || (subType == 6)) {
|
|
return 8;
|
|
}
|
|
if (subType == 3) {
|
|
return 6;
|
|
}
|
|
return 5;
|
|
}
|
|
if (variant != 100) {
|
|
return 5;
|
|
}
|
|
if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&priceRng)))->RNG::RandomInt(2);
|
|
return -1 - GHIDRA_UINT((uVar4 != 0));
|
|
}
|
|
iVar3 = 0x1e;
|
|
if ((-1 < shopItemId) && (GHIDRA_UINT(shopItemId) < 8)) {
|
|
shopSlotType = *GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x94 + shopItemId * 2));
|
|
if ((shopSlotType == 0xc) || (shopSlotType == 0xd)) {
|
|
iVar3 = 0x32;
|
|
}
|
|
else if (shopSlotType == 0xe) {
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&priceRng)))->RNG::RandomInt(0x50);
|
|
return uVar4 + 0x14;
|
|
}
|
|
}
|
|
uVar4 = (GHIDRA_CAST<RNG *>((&priceRng)))->RNG::RandomInt(iVar3 - 0xe);
|
|
return uVar4 + 0xf;
|
|
}
|
|
iVar3 = room->_roomType;
|
|
if (((((iVar3 != 0xe) && (iVar3 != 0x16)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x44)) >> 0xb & 1) == 0)) &&
|
|
((iVar3 != 5 ||
|
|
(((g_game->_levelStateFlags & 0x20000U) == 0 &&
|
|
(foundPlayer = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstPlayerByType(0x21),
|
|
foundPlayer == GHIDRA_CAST<Entity_Player *>(0x0))))))) && (shopItemId != -2)) {
|
|
if (variant == 10) {
|
|
if ((subType == 1) || (subType == 2)) {
|
|
if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) {
|
|
return 3;
|
|
}
|
|
return -5;
|
|
}
|
|
}
|
|
else if (variant == 0x28) {
|
|
if (subType == 4) {
|
|
LAB_008155cf:
|
|
if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) {
|
|
return 10;
|
|
}
|
|
return -5;
|
|
}
|
|
}
|
|
else if (variant == 0x1e) {
|
|
if (subType == 2) goto LAB_008155cf;
|
|
}
|
|
else if (variant == 100) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(subType);
|
|
if ((isPoundOfFlesh != '\0') && (isKeeperPricing == '\0')) {
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
return -1;
|
|
}
|
|
return -GHIDRA_INT(collectibleConfig->devilprice);
|
|
}
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Room::GetShopItemPrice: no config for collectible %d.\n"));
|
|
return 0xf;
|
|
}
|
|
iVar3 = GHIDRA_INT(collectibleConfig->shopPrice);
|
|
if (room->_roomType != 0xf) {
|
|
return iVar3;
|
|
}
|
|
if (iVar3 != 0xf) {
|
|
return iVar3;
|
|
}
|
|
if (collectibleConfig->devilprice == 2) {
|
|
return 0x1e;
|
|
}
|
|
return 0xf;
|
|
}
|
|
if ((isPoundOfFlesh == '\0') || (isKeeperPricing != '\0')) {
|
|
return GHIDRA_UINT((variant == 0x45)) * 2 + 5;
|
|
}
|
|
return -5;
|
|
}
|
|
if (local_20 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
bVar2 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0xad);
|
|
}
|
|
else {
|
|
bVar2 = (GHIDRA_CAST<Entity_Player *>((local_20)))->Entity_Player::HasTrinket(0xad,0);
|
|
if (((bVar2 == 0) && (iVar3 = (GHIDRA_CAST<Entity_Player *>((local_20)))->Entity_Player::GetHealthType(), iVar3 != 2)) &&
|
|
(*GHIDRA_CAST<int *>((extraout_ECX + 0x13c0)) != 0x27)) {
|
|
isNullEffectActive =
|
|
(GHIDRA_CAST<TemporaryEffects *>((GHIDRA_CAST<TemporaryEffects *>((extraout_ECX + 0x1508)))))->TemporaryEffects::HasNullEffect(0x70);
|
|
bVar2 = 0;
|
|
if (isNullEffectActive == 0) goto LAB_008156ef;
|
|
}
|
|
bVar2 = 1;
|
|
}
|
|
LAB_008156ef:
|
|
if ((isKeeperPricing != '\0') && (local_24 = uVar4 & 0xff, bVar2 == 0)) {
|
|
local_24 = 1;
|
|
}
|
|
if (variant == 100) {
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(subType);
|
|
if (collectibleConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Room::GetShopItemPrice: no config for collectible %d.\n"));
|
|
if (seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
iVar3 = (*pcVar1)();
|
|
return iVar3;
|
|
}
|
|
uVar4 = seed >> ((uint8_t)priceRng._shift1 & 0x1f) ^ seed;
|
|
uVar4 = uVar4 << ((uint8_t)priceRng._shift2 & 0x1f) ^ uVar4;
|
|
uVar4 = ~(uVar4 >> ((uint8_t)local_38 & 0x1f) ^ uVar4) | 0xfffffffe;
|
|
}
|
|
else {
|
|
uVar4 = (collectibleConfig->devilprice < 2) - 2;
|
|
}
|
|
if ((char)local_24 != '\0') {
|
|
iVar3 = 0xf;
|
|
if (uVar4 == 0xfffffffe) {
|
|
iVar3 = 0x1e;
|
|
}
|
|
return iVar3;
|
|
}
|
|
if ((collectibleConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) &&
|
|
(bVar2 = (GHIDRA_CAST<Item *>((collectibleConfig)))->Item::HasTags(0x200000000), bVar2 != 0)) {
|
|
uVar4 = 0xfffffff6;
|
|
}
|
|
}
|
|
else {
|
|
uVar4 = 0xfffffffb;
|
|
if ((char)local_24 != '\0') {
|
|
return 5;
|
|
}
|
|
}
|
|
return uVar4;
|
|
}
|
|
|
|
// 00815800
|
|
void Room::TriggerRestock(int grid_idx, int shop_idx)
|
|
{
|
|
int iVar1;
|
|
uint32_t uVar2;
|
|
void *pvVar3;
|
|
uint32_t uVar4;
|
|
uint32_t *dequeSize;
|
|
uint32_t mapSize;
|
|
|
|
this->_shopRestockTimer = 0x1e;
|
|
uVar4 = (this->_shopItemDeque)._size;
|
|
uVar2 = (this->_shopItemDeque)._offset;
|
|
if (((uVar2 + uVar4 & 1) == 0) && ((this->_shopItemDeque)._mapSize <= uVar4 + 2 >> 1)) {
|
|
msvc::deque<int>::_Growmap(uVar4);
|
|
uVar2 = (this->_shopItemDeque)._offset;
|
|
uVar4 = (this->_shopItemDeque)._size;
|
|
}
|
|
mapSize = (this->_shopItemDeque)._mapSize;
|
|
uVar2 = mapSize * 2 - 1 & uVar2;
|
|
uVar4 = uVar4 + uVar2;
|
|
(this->_shopItemDeque)._offset = uVar2;
|
|
uVar2 = mapSize - 1 & uVar4 >> 1;
|
|
pvVar3 = (this->_shopItemDeque)._map;
|
|
iVar1 = uVar2 * 4;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 4)) == 0) {
|
|
pvVar3 = operator_new(0x10);
|
|
*(void **)(iVar1 + GHIDRA_INT((this->_shopItemDeque)._map)) = pvVar3;
|
|
pvVar3 = (this->_shopItemDeque)._map;
|
|
}
|
|
iVar1 = *GHIDRA_CAST<int *>((iVar1 + GHIDRA_INT(pvVar3)));
|
|
uVar4 = uVar4 & 1;
|
|
*GHIDRA_CAST<int *>((iVar1 + uVar4 * 8)) = grid_idx;
|
|
*GHIDRA_CAST<int *>((iVar1 + 4 + uVar4 * 8)) = shop_idx;
|
|
dequeSize = &(this->_shopItemDeque)._size;
|
|
*dequeSize = *dequeSize + 1;
|
|
return;
|
|
}
|
|
|
|
// 008158a0
|
|
void Room::ShopRestockPartial()
|
|
{
|
|
code *pcVar1;
|
|
Entity *pEVar2;
|
|
uint32_t uVar3;
|
|
uint32_t blockSlot;
|
|
uint32_t spawnSeed;
|
|
Vector spawnPos;
|
|
uint32_t xorshiftShift;
|
|
int dequeBlock;
|
|
uint32_t *dequeCounter;
|
|
char restockCount;
|
|
int shopItemIdx;
|
|
|
|
if (this->_roomType != 2) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] restock disabled for room type %d.\n"));
|
|
return;
|
|
}
|
|
spawnSeed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x5c));
|
|
xorshiftShift = 7;
|
|
if ((this->_shopItemDeque)._size != 0) {
|
|
while( true ) {
|
|
uVar3 = (this->_shopItemDeque)._offset;
|
|
blockSlot = uVar3 & 1;
|
|
dequeBlock = *GHIDRA_CAST<int *>((GHIDRA_INT((this->_shopItemDeque)._map) +
|
|
(uVar3 >> 1 & (this->_shopItemDeque)._mapSize - 1) * 4));
|
|
shopItemIdx = *GHIDRA_CAST<int *>((dequeBlock + 4 + blockSlot * 8));
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((dequeBlock + blockSlot * 8));
|
|
if (-1 < shopItemIdx) {
|
|
restockCount = *GHIDRA_CAST<char *>((shopItemIdx + 0xa4 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))))));
|
|
if (restockCount != -1) {
|
|
*GHIDRA_CAST<char *>((shopItemIdx + 0xa4 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))))) = restockCount + '\x01';
|
|
}
|
|
}
|
|
spawnPos.x = (float)(GHIDRA_INT(uVar3) % this->_gridWidth) * 40.0 + 40.0;
|
|
spawnPos.y = (float)(GHIDRA_INT(uVar3) / this->_gridWidth) * 40.0 + 120.0;
|
|
if ((uVar3 < 0x1c0) && (this->_gridEntities[uVar3] != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_gridEntities[uVar3]) + 0x14))(1);
|
|
}
|
|
if (spawnSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
spawnSeed = spawnSeed >> 2 ^ spawnSeed;
|
|
spawnSeed = spawnSeed << 7 ^ spawnSeed;
|
|
spawnSeed = spawnSeed >> ((uint8_t)xorshiftShift & 0x1f) ^ spawnSeed;
|
|
pEVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x96,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,spawnSeed);
|
|
pEVar2->_spawnGridIndex = uVar3;
|
|
uVar3 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar3);
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawn shop pickup (restock), Pos(%.2f,%.2f)\n"));
|
|
dequeCounter = &(this->_shopItemDeque)._size;
|
|
*dequeCounter = *dequeCounter - 1;
|
|
if (*dequeCounter == 0) break;
|
|
dequeCounter = &(this->_shopItemDeque)._offset;
|
|
*dequeCounter = *dequeCounter + 1;
|
|
}
|
|
(this->_shopItemDeque)._offset = 0;
|
|
}
|
|
if (spawnSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
spawnSeed = spawnSeed >> 2 ^ spawnSeed;
|
|
spawnSeed = spawnSeed << 7 ^ spawnSeed;
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x5c)) = spawnSeed >> ((uint8_t)xorshiftShift & 0x1f) ^ spawnSeed
|
|
;
|
|
return;
|
|
}
|
|
|
|
// 00815ae0
|
|
void Room::ShopRestockFull()
|
|
{
|
|
code *pcVar1;
|
|
uint32_t uVar2;
|
|
Entity_Player *player;
|
|
int *pickup;
|
|
uint64_t *pickedEntry;
|
|
uint32_t nextSeed;
|
|
Entity *spawned;
|
|
int iVar3;
|
|
short *spawnEntry;
|
|
uint64_t *allocatedBytes;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
float dy;
|
|
float dx;
|
|
EntityList_EL shopPickups;
|
|
EntityList_EL roomPickups;
|
|
Vector freePos;
|
|
uint32_t spawnRngShift3;
|
|
uint32_t gridIndex;
|
|
uint32_t rngShift3;
|
|
uint32_t spawnIndex;
|
|
Room *room;
|
|
uint32_t spawnSeed;
|
|
Vector spawnPos;
|
|
uint32_t uStack_24;
|
|
uint64_t entry;
|
|
uint32_t uStack_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
uint64_t prevAllocatedBytes;
|
|
short spawnX;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01635;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
room = this;
|
|
if ((this->_roomType == 2) || (this->_roomType == 0x16)) {
|
|
this->_shopRestockTimer = -1;
|
|
msvc::deque<ptr>::_Tidy(local_14);
|
|
init_shop_item_slots(this);
|
|
spawnSeed = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x5c));
|
|
rngShift3 = 7;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("SpawnRNG seed: %u\n"));
|
|
EntityList::QuerySublist(&this->_entityList,&shopPickups,5,-1,-1,0,0);
|
|
uVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(shopPickups)) + 0x4)));
|
|
uStack_8 = 0;
|
|
uVar4 = 0;
|
|
if (shopPickups._size != 0) {
|
|
do {
|
|
pickup = GHIDRA_CAST<int *>(__RTDynamicCast(*GHIDRA_CAST<uint32_t *>((uVar2 + uVar4 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor));
|
|
if (pickup[0x14d] != 0) {
|
|
(**(code **)(*pickup + 0x28))();
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT(shopPickups._size));
|
|
this = room;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
spawnIndex = 0;
|
|
if (*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>((iVar3 + 0x10)) + 0x44)) != 0) {
|
|
uStack_24 = 0;
|
|
uVar4 = spawnSeed;
|
|
do {
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> 2 ^ uVar4;
|
|
uVar4 = uVar4 << 7 ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar4;
|
|
spawnEntry = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar3 + 0x10)) + 0x40)) + uStack_24));
|
|
spawnX = *spawnEntry;
|
|
iVar3 = (spawnEntry[1] + 1) * this->_gridWidth;
|
|
uVar5 = spawnX + 1 + iVar3;
|
|
gridIndex = uVar5;
|
|
spawnSeed = uVar4;
|
|
if ((char)spawnEntry[4] != '\0') {
|
|
pickedEntry = (GHIDRA_CAST<Spawn *>((spawnEntry)))->Spawn::PickEntry((float)((double)GHIDRA_INT(uVar4) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10);
|
|
entry = *pickedEntry;
|
|
uStack_18 = *GHIDRA_CAST<uint32_t *>((pickedEntry + 1));
|
|
spawnRngShift3 = 7;
|
|
TransformEntry(this,&entry,uVar5,uVar4);
|
|
if ((GHIDRA_UINT(entry) == 5) && ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(entry)) + 0x4))) == 0x96)) {
|
|
spawnPos.x = (float)(GHIDRA_INT(uVar5) % this->_gridWidth) * 40.0 + 40.0;
|
|
spawnPos.y = (float)(GHIDRA_INT(uVar5) / this->_gridWidth) * 40.0 + 120.0;
|
|
if ((uVar5 < 0x1c0) && (this->_gridEntities[iVar3 + spawnX + 1] != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(this->_gridEntities[iVar3 + spawnX + 1]) + 0x14))(1);
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&roomPickups,5,-1,-1,1,0);
|
|
uVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(roomPickups)) + 0x4)));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x0))) = 1;
|
|
uVar4 = 0;
|
|
if (roomPickups._size != 0) {
|
|
do {
|
|
iVar3 = __RTDynamicCast(*GHIDRA_CAST<uint32_t *>((uVar2 + uVar4 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor);
|
|
if ((iVar3 != 0) &&
|
|
(dx = spawnPos.x - *GHIDRA_CAST<float *>((iVar3 + 0x33c)),
|
|
dy = spawnPos.y - *GHIDRA_CAST<float *>((iVar3 + 0x340)), dy * dy + dx * dx < 900.0)) {
|
|
FindFreePickupSpawnPosition(g_game->_room,&freePos,&spawnPos,10.0,0,0,0);
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x33c)) = freePos.x;
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x340)) = freePos.y;
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x334)) = freePos.x;
|
|
*GHIDRA_CAST<float *>((iVar3 + 0x338)) = freePos.y;
|
|
*GHIDRA_CAST<uint32_t *>((iVar3 + 0x544)) = 0x14;
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT(roomPickups._size));
|
|
uVar5 = gridIndex;
|
|
}
|
|
uStack_8 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_8))) + 0x1))) << 8;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(roomPickups)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (uVar2 != 0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((uVar2 + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar4));
|
|
free((void *)(uVar2 + -4));
|
|
}
|
|
uStack_8 = uStack_8 & 0xffffff00;
|
|
}
|
|
uVar4 = spawnSeed;
|
|
if (spawnSeed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
nextSeed = spawnSeed >> 5 ^ spawnSeed;
|
|
nextSeed = nextSeed << 9 ^ nextSeed;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(GHIDRA_UINT(entry),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entry))) + 0x4))),&spawnPos,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(entry))) + 0x6))),
|
|
nextSeed >> ((uint8_t)spawnRngShift3 & 0x1f) ^ nextSeed);
|
|
spawned->_spawnGridIndex = uVar5;
|
|
uVar5 = Random();
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar5);
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawn Entity with Type(%d), Variant(%d), Pos(%.2f,%.2f)\n"));
|
|
this = room;
|
|
}
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
uStack_24 = uStack_24 + 0x10;
|
|
spawnIndex = spawnIndex + 1;
|
|
} while (spawnIndex < *GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>((iVar3 + 0x10)) + 0x44)));
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(shopPickups)) + 0x0))) == '\0') {
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(shopPickups)) + 0x4))) != 0) {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(shopPickups)) + 0x4))) + -4));
|
|
prevAllocatedBytes = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar4;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocatedBytes) < uVar4));
|
|
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(shopPickups)) + 0x4))) + -4)));
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
Entity_Player::UseActiveItem(player,GHIDRA_CAST<short *>((GHIDRA_INT(&uStack_24) + 2)),0x69,1,-1,0);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00816000
|
|
void Room::ShopReshuffle(uint8_t isKeepCollectibleIdx, uint8_t isReselectSaleItem)
|
|
{
|
|
code *pcVar1;
|
|
int *begin;
|
|
uint32_t uVar2;
|
|
short *shopSlot;
|
|
int *shuffledCursor;
|
|
uint32_t slotCount;
|
|
uint16_t *shopSlotOut;
|
|
int *end;
|
|
int iVar3;
|
|
RNG rng;
|
|
int swappedValue;
|
|
int *shuffledSlot;
|
|
short *local_1c;
|
|
Room *room;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0166d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
rng._shift1 = 5;
|
|
rng._shift2 = 9;
|
|
rng._seed = *GHIDRA_CAST<uint32_t *>((iVar3 + 0x60));
|
|
rng._shift3 = 7;
|
|
local_1c = GHIDRA_CAST<short *>((iVar3 + 0xa4));
|
|
room = this;
|
|
begin = msvc::_Allocate(0x20);
|
|
end = begin;
|
|
for (shopSlot = GHIDRA_CAST<short *>((iVar3 + 0x94)); shopSlot != local_1c; shopSlot = shopSlot + 1) {
|
|
*end = GHIDRA_INT(*shopSlot);
|
|
end = end + 1;
|
|
}
|
|
local_8 = 0;
|
|
RNG::Shuffle(&rng,begin,end);
|
|
if (isKeepCollectibleIdx != 0) {
|
|
local_1c = GHIDRA_CAST<short *>(0x94);
|
|
shuffledSlot = begin;
|
|
do {
|
|
if ((*GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + GHIDRA_INT(local_1c))) == 8) &&
|
|
(swappedValue = *shuffledSlot, swappedValue != 8)) {
|
|
uVar2 = 0;
|
|
slotCount = GHIDRA_INT(end) - GHIDRA_INT(begin) >> 2;
|
|
if (slotCount != 0) {
|
|
shopSlot = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x94));
|
|
do {
|
|
if ((*shopSlot != 8) && (begin[uVar2] == 8)) {
|
|
*shuffledSlot = 8;
|
|
begin[uVar2] = swappedValue;
|
|
break;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
shopSlot = shopSlot + 1;
|
|
} while (uVar2 < slotCount);
|
|
}
|
|
}
|
|
shuffledSlot = shuffledSlot + 1;
|
|
local_1c = local_1c + 1;
|
|
} while (local_1c < GHIDRA_CAST<short *>(0xa4));
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4))));
|
|
shuffledCursor = begin;
|
|
shopSlotOut = GHIDRA_CAST<uint16_t *>((iVar3 + 0x94));
|
|
if (begin != end) {
|
|
do {
|
|
iVar3 = *shuffledCursor;
|
|
shuffledCursor = shuffledCursor + 1;
|
|
*shopSlotOut = (short)iVar3;
|
|
shopSlotOut = shopSlotOut + 1;
|
|
} while (shuffledCursor != end);
|
|
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4))));
|
|
}
|
|
uVar2 = rng._seed;
|
|
if (isReselectSaleItem != 0) {
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar2 = GHIDRA_UINT(rng._seed) >> ((uint8_t)rng._shift1 & 0x1f) ^ rng._seed;
|
|
uVar2 = uVar2 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar2;
|
|
if (uVar2 == (uVar2 / 3) * 3) {
|
|
*GHIDRA_CAST<uint16_t *>((iVar3 + 0xae)) = 0xffff;
|
|
}
|
|
else {
|
|
if (uVar2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar2 = uVar2 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar2;
|
|
uVar2 = uVar2 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar2;
|
|
*GHIDRA_CAST<uint16_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0xae)) = (uint16_t)uVar2 & 7;
|
|
}
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4)))) + 0x60)) = uVar2;
|
|
if (begin != GHIDRA_CAST<int *>(0x0)) {
|
|
operator_delete(begin,0x20);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 008167e0
|
|
void Room::RemoveDoor(int doorSlot)
|
|
{
|
|
uint32_t uVar1;
|
|
int gridIdx;
|
|
GridEntity *wall;
|
|
int gridIdx;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b016b7;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
if ((GHIDRA_UINT(doorSlot) < 8) && (this->_doors[doorSlot] != (void *)0x0)) {
|
|
gridIdx = this->_doorGridPositions[doorSlot];
|
|
if (gridIdx < 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("invalid GridIndex while removing door (slot %d)"));
|
|
}
|
|
if (gridIdx < 1) {
|
|
gridIdx = 0;
|
|
}
|
|
gridIdx = 0x1bf;
|
|
if (gridIdx < 0x1bf) {
|
|
gridIdx = gridIdx;
|
|
}
|
|
gridIdx = __RTDynamicCast(this->_gridEntities[gridIdx],0,
|
|
&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::GridEntity_Door::RTTI_Type_Descriptor,0,uVar1);
|
|
if (gridIdx != 0) {
|
|
if (this->_gridEntities[gridIdx] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[gridIdx]))(1);
|
|
}
|
|
this->_gridEntities[gridIdx] = (void *)0x0;
|
|
}
|
|
this->_doors[doorSlot] = (void *)0x0;
|
|
wall = operator_new(0x154);
|
|
local_8 = 5;
|
|
if (wall == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
wall = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((wall)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(wall) = IsaacRepentancePlus::GridEntity_Wall::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (wall != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((wall)) + 0x4)))) = 0xf;
|
|
wall->_gridIndex = gridIdx;
|
|
this->_gridEntities[gridIdx] = wall;
|
|
uVar1 = Random();
|
|
(GHIDRA_CAST<GridEntity *>((wall)))->GridEntity::Init(uVar1);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00816910
|
|
void Room::SpawnGreedModeWave(uint8_t unusedBool)
|
|
{
|
|
int *piVar1;
|
|
code *pcVar2;
|
|
char cVar3;
|
|
uint32_t uVar4;
|
|
float bossWave;
|
|
Entity *spawned;
|
|
Entity_Pickup *coin;
|
|
uint32_t rngResult;
|
|
uint32_t *playerSlot;
|
|
Vector *freePos;
|
|
uint64_t *pickedEntry;
|
|
EntityConfig_Entity *entityConfig;
|
|
uint8_t rngShiftLeft;
|
|
MusicManager *musicManager;
|
|
uint32_t extraout_ECX;
|
|
int iVar5;
|
|
void *pvVar6;
|
|
uint32_t extraout_ECX_00;
|
|
int iVar7;
|
|
void **doorSlot;
|
|
float bossWave;
|
|
PlayerManager *playerManager;
|
|
int spawnX;
|
|
uint32_t uVar9;
|
|
uint32_t *puVar10;
|
|
uint32_t rngResult;
|
|
Room *pRVar12;
|
|
Room *door;
|
|
bool bVar13;
|
|
uint32_t uVar14;
|
|
TypeDescriptor *pTVar15;
|
|
TypeDescriptor *pTVar16;
|
|
uint32_t uVar17;
|
|
EntityRef destroySource;
|
|
Vector coinPos;
|
|
Vector VStack_a8;
|
|
float local_a0;
|
|
float local_9c;
|
|
void *championCandidates;
|
|
uint32_t *championCandidatesEnd;
|
|
uint32_t *championCandidatesCapacity;
|
|
uint64_t rngShifts;
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
uint32_t rngState;
|
|
Vector VStack_74;
|
|
Room *savedRoom;
|
|
uint32_t local_68;
|
|
uint32_t local_64;
|
|
RoomConfig_Room *local_60;
|
|
uint32_t local_5c;
|
|
uint32_t local_58;
|
|
uint32_t local_54;
|
|
uint64_t spawnEntry;
|
|
uint32_t uStack_48;
|
|
ColorMod particleColor;
|
|
uint32_t stackCookie;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_c;
|
|
int ehState;
|
|
GridEntity_Door *door;
|
|
Game *game;
|
|
Manager *manager;
|
|
RoomConfig_Room *waveRoom;
|
|
|
|
ehState = -1;
|
|
puStack_c = &LAB_00b016f0;
|
|
savedExceptionList = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT(((&particleColor)[1]._colorize + 1));
|
|
ExceptionList = &savedExceptionList;
|
|
iVar7 = 8;
|
|
local_5c = 3;
|
|
iVar5 = g_game->_stage;
|
|
if (g_game->_difficulty == 2) {
|
|
if (iVar5 == 3) {
|
|
iVar7 = 7;
|
|
}
|
|
else if (iVar5 == 4) {
|
|
iVar7 = 6;
|
|
}
|
|
if (((g_manager->_persistentGameData)._achievements[0xf6] == 0) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 ||
|
|
(((g_game->_dailyChallenge)._id == 0 && (g_game->_isDebug == 0)))))) {
|
|
bVar13 = false;
|
|
}
|
|
else {
|
|
bVar13 = true;
|
|
}
|
|
local_58 = iVar7 + -1;
|
|
if (!bVar13) {
|
|
local_58 = iVar7;
|
|
}
|
|
local_68 = 0x19;
|
|
if (!bVar13) {
|
|
local_68 = 0x1c;
|
|
}
|
|
}
|
|
else {
|
|
if (iVar5 == 1) {
|
|
local_58 = 9;
|
|
}
|
|
else if (iVar5 == 2) {
|
|
local_58 = 7;
|
|
}
|
|
else if (iVar5 == 3) {
|
|
local_58 = 5;
|
|
}
|
|
else {
|
|
local_58 = (iVar5 == 4) + 3;
|
|
}
|
|
local_68 = 0xf;
|
|
local_5c = 0;
|
|
}
|
|
doorSlot = this->_doors;
|
|
puVar10 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
*puVar10 = *puVar10 & 0xfffffffe;
|
|
local_64 = 8;
|
|
savedRoom = this;
|
|
stackCookie = uVar4;
|
|
do {
|
|
door = *doorSlot;
|
|
if (door != GHIDRA_CAST<GridEntity_Door *>(0x0)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) != 1) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) = 1;
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::UpdateAnimation();
|
|
iVar7 = door->_currentRoomType;
|
|
if (((((iVar7 == 7) || (iVar5 = door->_targetRoomType, iVar5 == 7)) || (iVar7 == 8)) ||
|
|
((iVar5 == 8 || (iVar7 == 0x1d)))) || (iVar5 == 0x1d)) {
|
|
(GHIDRA_CAST<msvc::string *>(((door->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((*doorSlot))) + 0x8)))) == 8) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((*doorSlot)))->GridEntity_Door::Bar(uVar4);
|
|
}
|
|
}
|
|
game = g_game;
|
|
doorSlot = doorSlot + 1;
|
|
local_64 = local_64 + -1;
|
|
} while (local_64 != 0);
|
|
local_7c = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1);
|
|
iVar7 = game->_greedModeWave;
|
|
VStack_74.y = (float)&game->_roomConfig;
|
|
local_60 = GHIDRA_CAST<RoomConfig_Room *>(0x1);
|
|
bossWave = (float)(iVar7 + 1);
|
|
local_54 = 10;
|
|
uVar4 = -GHIDRA_UINT((bossWave != 0.0)) & GHIDRA_UINT(bossWave);
|
|
if (uVar4 < 0xc) {
|
|
game->_greedModeWave = uVar4;
|
|
if (uVar4 - 1 < 0xc) goto LAB_00816b00;
|
|
rngState = 0;
|
|
}
|
|
else {
|
|
game->_greedModeWave = 0xc;
|
|
uVar4 = 0xc;
|
|
LAB_00816b00:
|
|
rngState = game->_greedWaveSeeds[uVar4 - 1];
|
|
}
|
|
local_64 = 0x1b;
|
|
local_80 = 0x1b;
|
|
rngShifts = 0x1b00000001;
|
|
local_9c = (float)((game->_difficulty == 3) + 9);
|
|
VStack_a8.y = (float)((-GHIDRA_UINT((GHIDRA_UINT(bossWave) < GHIDRA_UINT(local_9c))) & 6) + 5);
|
|
if (game->_difficulty == 2) {
|
|
switch(iVar7) {
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 8:
|
|
goto switchD_00816b56_caseD_0;
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 9:
|
|
goto switchD_00816b56_caseD_3;
|
|
case 6:
|
|
case 7:
|
|
case 10:
|
|
goto switchD_00816b56_caseD_6;
|
|
}
|
|
}
|
|
else {
|
|
switch(iVar7) {
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 9:
|
|
switchD_00816b56_caseD_0:
|
|
local_60 = GHIDRA_CAST<RoomConfig_Room *>(0x1);
|
|
local_54 = 1;
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
case 10:
|
|
switchD_00816b56_caseD_3:
|
|
local_60 = GHIDRA_CAST<RoomConfig_Room *>(0x5);
|
|
local_54 = 5;
|
|
break;
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
case 0xb:
|
|
switchD_00816b56_caseD_6:
|
|
local_60 = GHIDRA_CAST<RoomConfig_Room *>(0xa);
|
|
local_54 = 10;
|
|
}
|
|
}
|
|
if (GHIDRA_UINT(bossWave) < GHIDRA_UINT(local_9c)) {
|
|
savedRoom->_greedWaveTimer = (local_58 + iVar7) * 0x1e;
|
|
local_5c = game->_difficulty;
|
|
local_58 = (local_5c == 2) + 1;
|
|
}
|
|
else {
|
|
savedRoom->_greedWaveTimer = ((iVar7 + -6) * local_5c + local_68) * 0x1e;
|
|
local_5c = game->_difficulty;
|
|
local_58 = (local_5c == 2) + 3;
|
|
}
|
|
if (local_5c == 3) {
|
|
if (bossWave != 1.26117e-44) {
|
|
if (bossWave == 1.54143e-44) {
|
|
local_58 = local_58 + 3;
|
|
}
|
|
goto LAB_00816c08;
|
|
}
|
|
local_58 = local_58 + 1;
|
|
LAB_00816c3e:
|
|
savedRoom->_greedWaveTimer = -1;
|
|
local_5c = game->_difficulty;
|
|
}
|
|
else {
|
|
LAB_00816c08:
|
|
if (((bossWave == (float)((local_5c == 3) + 8)) || (bossWave == (float)((local_5c == 3) + 10))) ||
|
|
((local_5c == 3) + 0xb <= GHIDRA_UINT(bossWave))) goto LAB_00816c3e;
|
|
}
|
|
bossWave = (float)((local_5c == 3) + 0xb);
|
|
local_68 = 0;
|
|
if (bossWave != bossWave) {
|
|
local_68 = local_58;
|
|
}
|
|
local_a0 = bossWave;
|
|
if (GHIDRA_UINT(bossWave) < GHIDRA_UINT(local_9c)) {
|
|
if (local_7c == 0x18) {
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::Crossfade(0x26,0.08);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::EnableLayer(0,0);
|
|
}
|
|
}
|
|
else {
|
|
musicManager = &g_manager->_musicManager;
|
|
if (bossWave == bossWave) {
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::Crossfade(0x17,0.08);
|
|
}
|
|
else if ((game->_stageType == 4) || (game->_stageType == 5)) {
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::Crossfade(0x29,0.08);
|
|
}
|
|
else {
|
|
iVar7 = 9;
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x4)))) + 0x44)) >> 6 & 1) != 0) {
|
|
iVar7 = 0x1a;
|
|
}
|
|
(GHIDRA_CAST<MusicManager *>((musicManager)))->MusicManager::Crossfade(iVar7,0.08);
|
|
}
|
|
}
|
|
game = g_game;
|
|
local_58 = local_68;
|
|
if (local_68 != 0) {
|
|
if ((g_game->_levelStateFlags & 0x800U) != 0) {
|
|
local_58 = local_68 - 1;
|
|
g_game->_levelStateFlags = g_game->_levelStateFlags & 0xfffff7ff;
|
|
}
|
|
}
|
|
iVar7 = game->_greedWavesClearedWithoutRedHeartDamage;
|
|
if ((0 < iVar7) && (iVar7 == (iVar7 / 3) * 3)) {
|
|
local_58 = local_58 + 1;
|
|
}
|
|
piVar1 = &game->_greedWavesClearedWithoutRedHeartDamage;
|
|
*piVar1 = *piVar1 + 1;
|
|
manager = g_manager;
|
|
local_68 = 0x367;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_68));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_68,1.0,3,0,1.0,0.0);
|
|
door = savedRoom;
|
|
local_9c = 0.0;
|
|
local_5c = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((savedRoom)) + 0x4)))) + 0x10)) + 0x48));
|
|
if (rngState == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = rngState >> ((uint8_t)rngShifts & 0x1f) ^ rngState;
|
|
uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
local_60 = RoomConfig::GetRandomRoom
|
|
(GHIDRA_CAST<RoomConfig *>(VStack_74.y),uVar4,0,local_7c,GHIDRA_INT(VStack_a8.y),local_5c,0,-1,
|
|
GHIDRA_INT(local_60),local_54,GHIDRA_CAST<uint32_t *>(&local_9c),0xffffffff,-1);
|
|
if (local_60 == GHIDRA_CAST<RoomConfig_Room *>(0x0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Did not find wave level %d (greed mode).\n"));
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Spawning greed mode wave from room variant %d.\n"));
|
|
if (GHIDRA_UINT(g_game->_greedLastPaidWave) < GHIDRA_UINT(bossWave)) {
|
|
(GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::trigger_room_clear();
|
|
uVar9 = local_64;
|
|
VStack_74.y = (float)g_game->_room;
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<RoomConfig *>(VStack_74.y)))) + 0xc))));
|
|
iVar7 = iVar5 / 2;
|
|
if (((iVar7 < 0) || (iVar5 <= iVar7)) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(((GHIDRA_CAST<RoomConfig *>(VStack_74.y)))) + 0x10)))) < 5))
|
|
{
|
|
iVar7 = -1;
|
|
}
|
|
else {
|
|
iVar7 = iVar7 + iVar5 * 4;
|
|
}
|
|
VStack_a8.x = (float)(iVar7 % iVar5) * 40.0 + 40.0;
|
|
VStack_a8.y = (float)(iVar7 / iVar5) * 40.0 + 120.0;
|
|
if (0 < GHIDRA_INT(local_58)) {
|
|
rngResult = local_58;
|
|
do {
|
|
FindFreePickupSpawnPosition(g_game->_room,&coinPos,&VStack_a8,0.0,0,0,0);
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
uVar17 = 0;
|
|
pTVar16 = &IsaacRepentancePlus::Entity_Pickup::RTTI_Type_Descriptor;
|
|
pTVar15 = &IsaacRepentancePlus::Entity::RTTI_Type_Descriptor;
|
|
uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
uVar14 = 0;
|
|
uVar4 = uVar4 >> ((uint8_t)uVar9 & 0x1f) ^ uVar4;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,0x14,&coinPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),1,uVar4);
|
|
coin = GHIDRA_CAST<Entity_Pickup *>(__RTDynamicCast(spawned,uVar14,pTVar15,pTVar16,uVar17));
|
|
if (coin != GHIDRA_CAST<Entity_Pickup *>(0x0)) {
|
|
(GHIDRA_CAST<Entity_Pickup *>((coin)))->Entity_Pickup::AppearFast();
|
|
}
|
|
particleColor._tint[0] = 1.0;
|
|
particleColor._tint[1] = 1.0;
|
|
particleColor._tint[2] = 1.0;
|
|
particleColor._tint[3] = 1.0;
|
|
particleColor._offset[0] = 0.0;
|
|
particleColor._offset[1] = 0.0;
|
|
particleColor._colorize[0] = 0.0;
|
|
particleColor._colorize[1] = 0.0;
|
|
particleColor._colorize[2] = 0.0;
|
|
particleColor._colorize[3] = 0.0;
|
|
particleColor._offset[2] = 0.0;
|
|
rngResult = Random();
|
|
VStack_74.y = (float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10 *
|
|
3.0 + 2.0;
|
|
rngResult = Random();
|
|
Game::SpawnParticles
|
|
(g_game,&coinPos,0x5f,rngResult % 3 + 5,VStack_74.y,&particleColor,100000.0,0);
|
|
rngResult = rngResult - 1;
|
|
} while (rngResult != 0);
|
|
bossWave = local_a0;
|
|
door = savedRoom;
|
|
}
|
|
game = g_game;
|
|
local_5c = 0;
|
|
g_game->_greedLastPaidWave = GHIDRA_INT(bossWave);
|
|
playerManager = &game->_playerManager;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
|
|
!= 0) {
|
|
do {
|
|
pvVar6 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar6) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar6 = (playerManager->_playerList)._end;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (local_5c < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + local_5c;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::spawn_locusts();
|
|
playerManager = &g_game->_playerManager;
|
|
local_5c = local_5c + 1;
|
|
} while (local_5c <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
}
|
|
waveRoom = local_60;
|
|
*GHIDRA_CAST<uint8_t *>(door) = 0;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
uVar9 = local_64;
|
|
local_58 = uVar4;
|
|
if (door->_gridWidth != local_60->Width + 2) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Greed Mode wave does not match room size\n"));
|
|
uVar9 = extraout_ECX;
|
|
}
|
|
local_68 = 0;
|
|
if (waveRoom->SpawnCount != 0) {
|
|
local_5c = 0;
|
|
pRVar12 = door;
|
|
do {
|
|
door = savedRoom;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
iVar7 = pRVar12->_gridWidth;
|
|
uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
destroySource._type = 0;
|
|
destroySource._variant = 0;
|
|
destroySource._spawnerType = 0;
|
|
destroySource._spawnerVariant = 0;
|
|
destroySource._flags = 0;
|
|
destroySource._entity = (void *)0x0;
|
|
spawnX = GHIDRA_INT(*GHIDRA_CAST<short *>((local_5c + GHIDRA_INT(local_60->Spawns))));
|
|
iVar5 = (*GHIDRA_CAST<short *>((local_5c + 2 + GHIDRA_INT(local_60->Spawns))) + 1) * iVar7;
|
|
local_a0 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
uVar9 = spawnX + iVar5 + 1;
|
|
destroySource._position.x = g_vectorZero.x;
|
|
destroySource._velocity.x = g_vectorZero.x;
|
|
destroySource._position.y = g_vectorZero.y;
|
|
destroySource._velocity.y = g_vectorZero.y;
|
|
VStack_74.x = (float)(GHIDRA_INT(uVar9) % iVar7) * 40.0 + 40.0;
|
|
VStack_74.y = (float)(GHIDRA_INT(uVar9) / iVar7) * 40.0 + 120.0;
|
|
if ((uVar9 < 0x1c0) && (savedRoom->_gridEntities[iVar5 + spawnX + 1] != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*GHIDRA_CAST<int *>(savedRoom->_gridEntities[iVar5 + spawnX + 1]) + 0x14))(1,&destroySource)
|
|
;
|
|
}
|
|
piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x10));
|
|
if (((piVar1 != GHIDRA_CAST<int *>(0x0)) && (piVar1[2] == 0x10)) && (*piVar1 == 0x23)) goto LAB_00817335;
|
|
if (GHIDRA_INT(uVar9) < 0) {
|
|
LAB_008172a7:
|
|
freePos = FindFreePickupSpawnPosition(g_game->_room,&VStack_a8,&VStack_74,0.0,0,0,0);
|
|
VStack_74.x = freePos->x;
|
|
VStack_74.y = freePos->y;
|
|
iVar7 = GHIDRA_INT(((VStack_74.x - 40.0) / 40.0 + 0.5));
|
|
iVar5 = GHIDRA_INT(((VStack_74.y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar7 < 0) || (door->_gridWidth <= iVar7)) || (iVar5 < 0)) ||
|
|
(door->_gridHeight <= iVar5)) {
|
|
uVar9 = 0xffffffff;
|
|
}
|
|
else {
|
|
uVar9 = iVar5 * door->_gridWidth + iVar7;
|
|
}
|
|
}
|
|
else if (door->_gridEntities[iVar5 + spawnX + 1] == (void *)0x0) {
|
|
if ((door->_gridPaths[iVar5 + spawnX + 1] - 3000U < 1000) ||
|
|
(999 < door->_gridPaths[iVar5 + spawnX + 1])) goto LAB_008172a7;
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((GHIDRA_INT(door->_gridEntities[iVar5 + spawnX + 1]) + 0x3c)) != 0)
|
|
goto LAB_008172a7;
|
|
LAB_00817335:
|
|
pvVar6 = (void *)(local_5c + GHIDRA_INT(local_60->Spawns));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar6) + 8)) != '\0') {
|
|
pickedEntry = (GHIDRA_CAST<Spawn *>((pvVar6)))->Spawn::PickEntry(local_a0);
|
|
spawnEntry = *pickedEntry;
|
|
uStack_48 = *GHIDRA_CAST<uint32_t *>((pickedEntry + 1));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
rngState = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
local_7c = rngState >> ((uint8_t)local_64 & 0x1f);
|
|
uVar4 = local_7c ^ rngState;
|
|
TransformEntry(door,&spawnEntry,uVar9,uVar4);
|
|
if (0 < GHIDRA_INT(spawnEntry)) {
|
|
if (GHIDRA_INT(spawnEntry) < 1000) {
|
|
rngShiftLeft = (uint8_t)((uint64_t)rngShifts >> 0x20);
|
|
if (GHIDRA_INT(spawnEntry) == 999) {
|
|
spawnEntry = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spawnEntry)) + 0x4))),1000);
|
|
if (local_7c == rngState) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
spawned = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spawnEntry)) + 0x4))) & 0xffff,&VStack_74,&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(0x0),(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(spawnEntry)) + 0x4))) >> 0x10,uVar4);
|
|
spawned->Update();
|
|
spawned->_spawnGridIndex = uVar9;
|
|
door = savedRoom;
|
|
}
|
|
else {
|
|
if (local_7c == rngState) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
iVar7 = spawn_enemy_spawner_effect
|
|
(GHIDRA_INT(spawnEntry),(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(spawnEntry)) + 0x4))),&VStack_74,local_64,0,
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(spawnEntry)) + 0x6))),uVar4,local_64,uVar9);
|
|
game = g_game;
|
|
*GHIDRA_CAST<uint32_t *>((iVar7 + 0x354)) = 0x3e9;
|
|
if ((((game != GHIDRA_CAST<Game *>(0x0)) && (1 < *GHIDRA_CAST<int *>(&game->_deathmatchManager))) &&
|
|
(GHIDRA_INT(spawnEntry) == 1)) || (GHIDRA_INT(spawnEntry) - 10U < 0x3de)) {
|
|
*GHIDRA_CAST<uint32_t *>((iVar7 + 0x16c)) = *GHIDRA_CAST<uint32_t *>((iVar7 + 0x16c)) | 0x80;
|
|
*GHIDRA_CAST<uint32_t *>((iVar7 + 0x168)) = *GHIDRA_CAST<uint32_t *>((iVar7 + 0x168));
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
SpawnEntry(door,uVar9,&spawnEntry,uVar4,GHIDRA_CAST<Entity **>(0x0),0);
|
|
}
|
|
}
|
|
}
|
|
uVar9 = local_68 + 1;
|
|
local_5c = local_5c + 0x10;
|
|
pRVar12 = door;
|
|
local_68 = uVar9;
|
|
} while (uVar9 < (uint16_t)local_60->SpawnCount);
|
|
local_58 = uVar4;
|
|
}
|
|
if (g_game->_difficulty != 3) goto LAB_008177a4;
|
|
championCandidates = (void *)0x0;
|
|
championCandidatesEnd = GHIDRA_CAST<uint32_t *>(0x0);
|
|
championCandidatesCapacity = GHIDRA_CAST<uint32_t *>(0x0);
|
|
ehState = 0;
|
|
FUN_005cbed0(uVar9);
|
|
uVar9 = extraout_ECX_00 & 0xffffff00;
|
|
puVar10 = championCandidatesEnd;
|
|
local_54 = uVar9;
|
|
if ((door->_entityList)._updateEL._size == 0) {
|
|
LAB_008176d1:
|
|
uVar9 = GHIDRA_INT(puVar10) - GHIDRA_INT(championCandidates) >> 2;
|
|
if (uVar9 != 0) {
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
rngShiftLeft = (uint8_t)((uint64_t)rngShifts >> 0x20);
|
|
uVar4 = uVar4 << (rngShiftLeft & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> ((uint8_t)local_64 & 0x1f) ^ uVar4;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
(*pcVar2)();
|
|
return;
|
|
}
|
|
rngResult = uVar4 >> ((uint8_t)rngShifts & 0x1f) ^ uVar4;
|
|
rngResult = rngResult << (rngShiftLeft & 0x1f) ^ rngResult;
|
|
Entity_NPC::MakeChampion
|
|
(*GHIDRA_CAST<Entity_NPC **>((GHIDRA_CAST<char *>(championCandidates) + (uVar4 % uVar9) * 4)),
|
|
rngResult >> ((uint8_t)local_64 & 0x1f) ^ rngResult,-1,0);
|
|
}
|
|
}
|
|
else {
|
|
uVar4 = 0;
|
|
do {
|
|
piVar1 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((door->_entityList)._updateEL)) + 0x4)))) + uVar4 * 4));
|
|
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) || (piVar1[10] != 1)) {
|
|
iVar7 = piVar1[10];
|
|
if ((0x3dd < iVar7 - 10U) || (((iVar7 == 0x21 || (iVar7 == 0x11)) || (iVar7 == 0x124))))
|
|
goto LAB_008176b6;
|
|
if (iVar7 == 0x375) {
|
|
bVar13 = piVar1[0xb] == 10;
|
|
}
|
|
else {
|
|
if ((iVar7 == 0x3c0) || (iVar7 == 0x3c5)) goto LAB_008176b6;
|
|
bVar13 = iVar7 == 0xf5;
|
|
}
|
|
uVar9 = local_54;
|
|
if (!bVar13) goto LAB_008175f1;
|
|
}
|
|
else {
|
|
LAB_008175f1:
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar1) + 0x173)) == '\0') {
|
|
cVar3 = (**(code **)(*piVar1 + 0x4c))();
|
|
if ((cVar3 == '\0') &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((door->_entityList)._updateEL)) + 0x4)))) + uVar4 * 4)),
|
|
g_game->_frameCount == *GHIDRA_CAST<int *>((iVar7 + 0x328)))) {
|
|
local_5c = __RTDynamicCast(iVar7,0,&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_NPC::RTTI_Type_Descriptor,0);
|
|
entityConfig = EntityConfig::GetEntity
|
|
(&g_manager->_entityConfig,*GHIDRA_CAST<int *>((local_5c + 0x28)),
|
|
*GHIDRA_CAST<int *>((local_5c + 0x2c)),*GHIDRA_CAST<int *>((local_5c + 0x30)));
|
|
if ((entityConfig != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) && (entityConfig->canBeChampion != 0))
|
|
{
|
|
if (puVar10 == championCandidatesCapacity) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(puVar10,&local_5c);
|
|
}
|
|
else {
|
|
*puVar10 = local_5c;
|
|
championCandidatesEnd = puVar10 + 1;
|
|
}
|
|
local_54 = local_54 & 0xff;
|
|
if (*GHIDRA_CAST<char *>((local_5c + 0xc63)) != '\0') {
|
|
local_54 = 1;
|
|
}
|
|
uVar9 = local_54;
|
|
puVar10 = championCandidatesEnd;
|
|
goto LAB_008176b9;
|
|
}
|
|
}
|
|
LAB_008176b6:
|
|
uVar9 = local_54;
|
|
}
|
|
}
|
|
LAB_008176b9:
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < GHIDRA_UINT((door->_entityList)._updateEL._size));
|
|
uVar4 = local_58;
|
|
if ((char)uVar9 == '\0') goto LAB_008176d1;
|
|
}
|
|
if (championCandidates != (void *)0x0) {
|
|
uVar4 = GHIDRA_INT(championCandidatesCapacity) - GHIDRA_INT(championCandidates) & 0xfffffffc;
|
|
pvVar6 = championCandidates;
|
|
if (0xfff < uVar4) {
|
|
pvVar6 = *(void **)(GHIDRA_CAST<char *>(championCandidates) + -4);
|
|
uVar4 = uVar4 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(championCandidates) + (-4 - GHIDRA_INT(pvVar6))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar6,uVar4);
|
|
}
|
|
LAB_008177a4:
|
|
*GHIDRA_CAST<uint8_t *>(door) = 1;
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 00817830
|
|
void Room::render_water(int pass)
|
|
{
|
|
uint32_t stageId;
|
|
Vector *pVVar1;
|
|
uint32_t *quadCursor;
|
|
Vector *pVVar2;
|
|
Vector *pVVar3;
|
|
int *texture;
|
|
Vector *topLeft;
|
|
int iVar4;
|
|
float *srcQuadCursor;
|
|
uint32_t *quadDst;
|
|
double dVar5;
|
|
uint8_t auStackY_8b4 [128];
|
|
uint8_t bVar6;
|
|
DestinationQuad *color;
|
|
void *pvVar7;
|
|
float edgeMargin;
|
|
Vector local_814;
|
|
Vector waveScroll;
|
|
Vector renderOffset;
|
|
Vector waveRotation;
|
|
Vector local_7f4;
|
|
Vector local_7ec;
|
|
Vector local_7e4;
|
|
Vector local_7dc;
|
|
Vector local_7d4;
|
|
Vector local_7cc;
|
|
Vector local_7c4;
|
|
Vector local_7bc;
|
|
Vector local_7b4;
|
|
float topLeftY;
|
|
float topLeftX;
|
|
Vector local_7a4;
|
|
float local_79c;
|
|
float bottomRightY;
|
|
float bottomRightX;
|
|
Vector local_790;
|
|
Vector local_788;
|
|
Vector local_780;
|
|
Vector local_778;
|
|
Vector local_770;
|
|
Vector local_768;
|
|
Vector local_760;
|
|
Vector local_758;
|
|
Vector local_750;
|
|
Vector local_748;
|
|
Vector local_740;
|
|
Vector local_738;
|
|
Vector local_730;
|
|
Vector local_728;
|
|
Vector local_720;
|
|
Vector local_718;
|
|
Vector local_710;
|
|
Vector local_708;
|
|
DestinationQuad tmpQuad;
|
|
uint32_t tmpQuadFlag;
|
|
Vector local_6d0;
|
|
char isFloodRoom;
|
|
Vector local_6c4;
|
|
KColor whiteColorA [2];
|
|
KColor whiteColorC;
|
|
KColor whiteColorB [2];
|
|
uint8_t tileQuad [112];
|
|
uint8_t tileQuad2 [112];
|
|
uint8_t roomAreaDesc [176];
|
|
Color waterColor;
|
|
float srcQuad0TopLeftX;
|
|
float srcQuad0TopLeftY;
|
|
float srcQuad0TopRightX;
|
|
float srcQuad0TopRightY;
|
|
float srcQuad0BottomLeftX;
|
|
float srcQuad0BottomLeftY;
|
|
float srcQuad0BottomRightX;
|
|
float srcQuad0BottomRightY;
|
|
uint32_t srcQuad0Flag;
|
|
float srcQuad1TopLeftX;
|
|
float srcQuad1TopLeftY;
|
|
float srcQuad1TopRightX;
|
|
float srcQuad1TopRightY;
|
|
float srcQuad1BottomLeftX;
|
|
float srcQuad1BottomLeftY;
|
|
float srcQuad1BottomRightX;
|
|
float srcQuad1BottomRightY;
|
|
uint32_t srcQuad1Flag;
|
|
float srcQuad2TopLeftX;
|
|
float srcQuad2TopLeftY;
|
|
float srcQuad2TopRightX;
|
|
float srcQuad2TopRightY;
|
|
float srcQuad2BottomLeftX;
|
|
float srcQuad2BottomLeftY;
|
|
float srcQuad2BottomRightX;
|
|
float srcQuad2BottomRightY;
|
|
uint32_t srcQuad2Flag;
|
|
float srcQuad3TopLeftX;
|
|
float srcQuad3TopLeftY;
|
|
float srcQuad3TopRightX;
|
|
float srcQuad3TopRightY;
|
|
float srcQuad3BottomLeftX;
|
|
float srcQuad3BottomLeftY;
|
|
float srcQuad3BottomRightX;
|
|
float srcQuad3BottomRightY;
|
|
uint32_t srcQuad3Flag;
|
|
float srcQuad4TopLeftX;
|
|
float srcQuad4TopLeftY;
|
|
float srcQuad4TopRightX;
|
|
float srcQuad4TopRightY;
|
|
float srcQuad4BottomLeftX;
|
|
float srcQuad4BottomLeftY;
|
|
float srcQuad4BottomRightX;
|
|
float srcQuad4BottomRightY;
|
|
uint32_t srcQuad4Flag;
|
|
float srcQuad5TopLeftX;
|
|
float srcQuad5TopLeftY;
|
|
float srcQuad5TopRightX;
|
|
float srcQuad5TopRightY;
|
|
float srcQuad5BottomLeftX;
|
|
float srcQuad5BottomLeftY;
|
|
float srcQuad5BottomRightX;
|
|
float srcQuad5BottomRightY;
|
|
uint32_t srcQuad5Flag;
|
|
float srcQuad6TopLeftX;
|
|
float srcQuad6TopLeftY;
|
|
float srcQuad6TopRightX;
|
|
float srcQuad6TopRightY;
|
|
float srcQuad6BottomLeftX;
|
|
float srcQuad6BottomLeftY;
|
|
float srcQuad6BottomRightX;
|
|
float srcQuad6BottomRightY;
|
|
uint32_t srcQuad6Flag;
|
|
float srcQuad7TopLeftX;
|
|
float srcQuad7TopLeftY;
|
|
float srcQuad7TopRightX;
|
|
float srcQuad7TopRightY;
|
|
float srcQuad7BottomLeftX;
|
|
float srcQuad7BottomLeftY;
|
|
float srcQuad7BottomRightX;
|
|
float srcQuad7BottomRightY;
|
|
uint32_t srcQuad7Flag;
|
|
float srcQuad8TopLeftX;
|
|
float srcQuad8TopLeftY;
|
|
float srcQuad8TopRightX;
|
|
float srcQuad8TopRightY;
|
|
float srcQuad8BottomLeftX;
|
|
float srcQuad8BottomLeftY;
|
|
float srcQuad8BottomRightX;
|
|
float srcQuad8BottomRightY;
|
|
uint32_t srcQuad8Flag;
|
|
float srcQuad9TopLeftX;
|
|
float srcQuad9TopLeftY;
|
|
float srcQuad9TopRightX;
|
|
float srcQuad9TopRightY;
|
|
float srcQuad9BottomLeftX;
|
|
float srcQuad9BottomLeftY;
|
|
float srcQuad9BottomRightX;
|
|
float srcQuad9BottomRightY;
|
|
uint32_t srcQuad9Flag;
|
|
float srcQuad10TopLeftX;
|
|
float srcQuad10TopLeftY;
|
|
float srcQuad10TopRightX;
|
|
float srcQuad10TopRightY;
|
|
float srcQuad10BottomLeftX;
|
|
float srcQuad10BottomLeftY;
|
|
float srcQuad10BottomRightX;
|
|
float srcQuad10BottomRightY;
|
|
uint32_t srcQuad10Flag;
|
|
float srcQuad11TopLeftX;
|
|
float srcQuad11TopLeftY;
|
|
float srcQuad11TopRightX;
|
|
float srcQuad11TopRightY;
|
|
float srcQuad11BottomLeftX;
|
|
float srcQuad11BottomLeftY;
|
|
float srcQuad11BottomRightX;
|
|
float srcQuad11BottomRightY;
|
|
uint32_t srcQuad11Flag;
|
|
uint32_t edgeQuad0 [28];
|
|
uint32_t edgeQuad1 [28];
|
|
uint32_t edgeQuad2 [28];
|
|
uint32_t edgeQuad3 [28];
|
|
uint32_t edgeQuad4 [28];
|
|
uint32_t edgeQuad5 [29];
|
|
uint32_t stackCookie;
|
|
float room;
|
|
code *drawFn;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(&edgeMargin);
|
|
local_7dc.x = (float)this;
|
|
stageId = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(0);
|
|
if (this->_gridPaths[this->_backdropType * 0x4f + 0x585] == 0) {
|
|
return;
|
|
}
|
|
if (((((stageId == 4) || (stageId == 5)) || (stageId == 6)) ||
|
|
((stageId == 0x1b || (stageId == 0x1c)))) &&
|
|
((-1 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x54)) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0)))) {
|
|
isFloodRoom = '\x01';
|
|
}
|
|
else {
|
|
isFloodRoom = '\0';
|
|
}
|
|
if ((this->_waterAmount <= 0.0) && (isFloodRoom == '\0')) {
|
|
return;
|
|
}
|
|
bottomRightX = (this->_bottomRightPos).x;
|
|
topLeftX = (this->_topLeftPos).x;
|
|
renderOffset.x = (g_game->_screenShakeOffset).x + (this->_renderScrollOffset).x;
|
|
renderOffset.y = (g_game->_screenShakeOffset).y + (this->_renderScrollOffset).y;
|
|
topLeftY = (this->_topLeftPos).y;
|
|
bottomRightY = (this->_bottomRightPos).y;
|
|
local_708.x = bottomRightY - topLeftY;
|
|
local_79c = bottomRightX - topLeftX;
|
|
local_7ec.x = local_79c + local_79c + local_708.x + local_708.x;
|
|
local_7f4.x = (float)((double)*GHIDRA_CAST<int *>((DAT_00c797c4 + 0x10)) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((DAT_00c797c4 + 0x10)) >> 0x1f)]);
|
|
local_814.x = local_7ec.x / local_7f4.x + 0.5;
|
|
dVar5 = floor((double)local_814.x);
|
|
local_7b4.x = ((float)dVar5 * local_7f4.x) / local_7ec.x;
|
|
local_778.x = local_7b4.x * local_708.x;
|
|
edgeMargin = local_7b4.x * 50.0;
|
|
local_7b4.x = local_7b4.x * local_79c;
|
|
local_7ec.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b70))));
|
|
local_7f4.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b74))));
|
|
local_814.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1b78))));
|
|
(GHIDRA_CAST<Color *>((&waterColor)))->Color::Reset();
|
|
(GHIDRA_CAST<Color *>((&waterColor)))->Color::SetTint(local_7ec.x,local_7f4.x,local_814.x,1.0);
|
|
if (this->_backdropType == 0x2c) {
|
|
waterColor._tint[0] = 1.0;
|
|
waterColor._tint[1] = 0.3;
|
|
waterColor._tint[2] = 0.3;
|
|
}
|
|
if (isFloodRoom == '\0') {
|
|
waterColor._tint[3] = 0.0;
|
|
}
|
|
else {
|
|
waterColor._tint[3] = (float)*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x54)) / 30.0;
|
|
if (waterColor._tint[3] <= 0.0) {
|
|
waterColor._tint[3] = 0.0;
|
|
}
|
|
if (1.0 <= waterColor._tint[3]) {
|
|
waterColor._tint[3] = 1.0;
|
|
}
|
|
}
|
|
if (0.0 < this->_waterAmount) {
|
|
waterColor._tint[3] = waterColor._tint[3] + (1.0 - waterColor._tint[3]) * this->_waterAmount;
|
|
}
|
|
waveRotation.x = (float)g_game->_frameCount * 0.01;
|
|
waveScroll.x = (float)g_game->_frameCount * 0.5;
|
|
local_7a4.x = waveScroll.x * 0.1;
|
|
shader_cache_find(0xb1a5b0);
|
|
if (3 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U) {
|
|
local_7f4.x = local_7a4.x + edgeMargin;
|
|
local_814.x = waveScroll.x + local_778.x;
|
|
FUN_00a110e0();
|
|
local_7ec.x = local_7b4.x + local_778.x;
|
|
FUN_00a110e0();
|
|
local_7e4.x = local_778.x + local_778.x;
|
|
local_7dc.x = local_7e4.x + local_7b4.x;
|
|
FUN_00a110e0();
|
|
local_814.x = local_7b4.x + local_7b4.x + local_7e4.x;
|
|
FUN_00a110e0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(local_778.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(0.0,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7e4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_778.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(0.0,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7e4.x);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6c4,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(local_778.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_710,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7e4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_730,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_740,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_778.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_768,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7e4.x);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6c4,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_710,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7e4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_730,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_740,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_768,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7e4.x);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Vector(local_814.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6c4,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_710,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7ec.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_814.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_730,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_740,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_768,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7ec.x);
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&tmpQuad))))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(topLeftX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
local_7f4.x = topLeftY - edgeMargin;
|
|
local_7ec.x = topLeftX - edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
local_7dc.x = bottomRightY + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(edgeQuad0,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),GHIDRA_CAST<KColor *>(&tmpQuad));
|
|
(GHIDRA_CAST<KColor *>((whiteColorB)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
local_7e4.x = bottomRightX + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(edgeQuad1,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorB);
|
|
(GHIDRA_CAST<KColor *>((&whiteColorC)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7e4.x,local_7dc.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(edgeQuad2,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),&whiteColorC);
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(topLeftX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_728,pVVar1,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7e4.x,local_7dc.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_740,pVVar1,bVar6);
|
|
topLeft = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,&renderOffset);
|
|
pVVar1 = GHIDRA_CAST<Vector *>(local_814.x);
|
|
set_quad_corner_colors(edgeQuad3,topLeft,pVVar3,pVVar2,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
pvVar7 = (void *)0x81de65;
|
|
FUN_00682260();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStackY_8b4 + 0x8c)))->KAGE::SmartPointer::operator_assign(&DAT_00c797c4);
|
|
apply_sprite_shader_params(GHIDRA_CAST<ColorMod *>(&waterColor),1,pVVar1,pvVar7);
|
|
local_7ec.x = (float)&srcQuad0TopLeftX;
|
|
local_7f4.x = 0.0;
|
|
do {
|
|
texture = GHIDRA_CAST<int *>(EntityPtr)::Ref();
|
|
drawFn = *(code **)(*texture + 0x14);
|
|
FUN_00407220();
|
|
(*drawFn)(local_7ec.x);
|
|
local_7ec.x = (float)(GHIDRA_INT(local_7ec.x) + 0x24);
|
|
local_7f4.x = (float)(GHIDRA_INT(local_7f4.x) + 1);
|
|
} while (GHIDRA_INT(local_7f4.x) < 8);
|
|
goto LAB_0081deea;
|
|
}
|
|
GetLRoomAreaDesc(this,roomAreaDesc);
|
|
srcQuadCursor = &srcQuad0TopLeftX;
|
|
local_814.x = 1.68156e-44;
|
|
do {
|
|
local_814.x = (float)(GHIDRA_INT(&(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_814.x) + -8)))->y) + 3);
|
|
FUN_00a10690();
|
|
*GHIDRA_CAST<uint8_t *>((srcQuadCursor + 8)) = 0;
|
|
srcQuadCursor = srcQuadCursor + 9;
|
|
} while (GHIDRA_CAST<Vector *>(local_814.x) != GHIDRA_CAST<Vector *>(0x0));
|
|
quadCursor = edgeQuad0;
|
|
iVar4 = 6;
|
|
do {
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
pVVar1 = GHIDRA_CAST<Vector *>(0x817bbd);
|
|
(GHIDRA_CAST<ColorQuad *>((quadCursor)))->ColorQuad::ColorQuad(whiteColorA);
|
|
room = local_7dc.x;
|
|
quadCursor = quadCursor + 0x1c;
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_7dc.x) + 4)) == 0) ||
|
|
(iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_7dc.x) + 4)) + 0x10)), iVar4 == 0)) {
|
|
LAB_0081a975:
|
|
iVar4 = GetRoomShape(GHIDRA_CAST<Room *>(local_7dc.x));
|
|
if (iVar4 == 0xb) {
|
|
local_790.x = local_778.x * 0.5;
|
|
local_7c4.x = local_7a4.x + edgeMargin;
|
|
local_814.x = local_790.x + waveScroll.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7dc.x = local_790.x + local_7b4.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_814.x = local_778.x * 1.5;
|
|
local_7e4.x = local_814.x + local_7b4.x;
|
|
local_7ec.x = waveScroll.x + local_7b4.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7f4.x = local_7b4.x * 1.5;
|
|
local_788.x = local_7f4.x + local_814.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_778.x = local_778.x + local_778.x;
|
|
local_7ec.x = local_7f4.x + local_778.x;
|
|
local_7f4.x = local_7f4.x + waveScroll.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7b4.x = local_7b4.x + local_7b4.x + local_778.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(local_790.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_758,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(0.0,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_728,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_738,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_790.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_748,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_770,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(0.0,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7cc,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_758,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_790.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_728,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_738,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_748,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_770,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(local_790.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7cc,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(local_7e4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_758,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_728,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_738,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7e4.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_748,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_770,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7cc,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Vector(local_788.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_750,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(local_7e4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_720,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_788.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_740,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_780,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(local_7e4.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_760)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7d4,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7a4)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_750,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(local_788.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_720,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_740,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_780,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(local_788.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_760)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7d4,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(local_7b4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_750,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_720,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7b4.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_740,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_780,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_760)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7d4,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_750,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,&renderOffset);
|
|
local_708.x = local_708.x * 0.5 + topLeftY;
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(topLeftX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_718,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,&renderOffset);
|
|
local_7f4.x = topLeftY - edgeMargin;
|
|
local_7e4.x = topLeftX - edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_730,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_738,&renderOffset);
|
|
local_788.x = local_708.x + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7e4.x,local_788.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_748,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_780,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_750,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_718,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,&renderOffset);
|
|
local_7ec.x = bottomRightX + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_730,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_738,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_748,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_780,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_760,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_7cc,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_7bc,&renderOffset);
|
|
local_7dc.x = bottomRightY + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_7c4)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_790,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7b4,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7a4)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_778,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&waveRotation,&renderOffset);
|
|
set_quad_corner_colors(tileQuad2,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((&whiteColorC)))->KColor::SetFromARGB(0xffffffff);
|
|
local_79c = local_79c * 0.5 + topLeftX;
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(local_79c,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_750,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_718,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,&renderOffset);
|
|
local_7f4.x = local_79c - edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7f4.x,local_7dc.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_730,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_738,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_748,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_780,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),&whiteColorC);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorB)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_750,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_79c,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_718,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7f4.x,local_788.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_730,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_738,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7f4.x,local_7dc.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_748,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_780,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorB);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&tmpQuad))))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(topLeftX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_750,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_718,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_720,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7e4.x,local_788.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_730,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_738,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_7f4.x,local_788.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_748,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_780,&renderOffset);
|
|
color = &tmpQuad;
|
|
}
|
|
else {
|
|
iVar4 = GetRoomShape(GHIDRA_CAST<Room *>(room));
|
|
if (iVar4 != 0xc) goto LAB_0081d167;
|
|
local_7c4.x = local_7a4.x + edgeMargin;
|
|
local_814.x = waveScroll.x + local_778.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7ec.x = local_7b4.x + local_778.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_814.x = local_778.x * 1.5;
|
|
local_7dc.x = local_814.x + local_7b4.x;
|
|
local_788.x = waveScroll.x + local_7b4.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7f4.x = local_7b4.x * 1.5;
|
|
local_7e4.x = local_7f4.x + local_814.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_790.x = local_778.x + local_778.x;
|
|
local_788.x = local_7f4.x + local_790.x;
|
|
local_7f4.x = local_7f4.x + waveScroll.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
local_7b4.x = local_7b4.x + local_7b4.x + local_790.x;
|
|
FUN_00a110e0();
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6d0)))->Vector::Vector(local_778.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_750,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(0.0,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_720,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_778.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_740,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_780,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_770)))->Vector::Vector(0.0,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_760)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_7d4,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_778.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(local_778.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_7ec.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(local_7ec.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7a4)))->Vector::Vector(local_7e4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_7dc.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7e4.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(local_7dc.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_778)))->Vector::Vector(local_788.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_7e4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_788.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(local_7e4.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(local_7b4.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_6d0,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_758,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_788.x,edgeMargin);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_718,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(waveScroll.x,0.0);
|
|
local_7f4.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,pVVar2);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7b4.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::Rotated(&local_738,waveRotation.x);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,pVVar2);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(local_788.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(waveScroll.x,0.0);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_760,pVVar3);
|
|
FUN_00a11130(pVVar2,pVVar1,local_7f4.x);
|
|
FUN_00a112a0();
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&tmpQuad))))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(topLeftX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
local_7f4.x = topLeftY - edgeMargin;
|
|
local_7e4.x = topLeftX - edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
local_788.x = bottomRightY + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7e4.x,local_788.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),GHIDRA_CAST<KColor *>(&tmpQuad))
|
|
;
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorB)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
local_7ec.x = bottomRightX + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7e4.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorB);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&tmpQuad))))->KColor::SetFromARGB(0xffffffff);
|
|
local_708.x = local_708.x * 0.5 + topLeftY;
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_780)))->Vector::Vector(bottomRightX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_768,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_760)))->Vector::Vector(bottomRightX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_7d4,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_7cc,&renderOffset);
|
|
local_7dc.x = local_708.x + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_7c4,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_790,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7b4)))->Vector::Vector(local_7ec.x,local_7f4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_7a4,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_778,&renderOffset);
|
|
set_quad_corner_colors
|
|
(tileQuad2,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),GHIDRA_CAST<KColor *>(&tmpQuad));
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((&whiteColorC)))->KColor::SetFromARGB(0xffffffff);
|
|
local_79c = local_79c * 0.5 + topLeftX;
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(bottomRightX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
local_7f4.x = local_79c + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7f4.x,local_7dc.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7ec.x,local_7dc.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),&whiteColorC);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(local_79c,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7f4.x,local_788.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7f4.x,local_7dc.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_6c4)))->Vector::Vector(topLeftX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_6d0,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_750,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_758)))->Vector::Vector(local_79c,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_710,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_718,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_720)))->Vector::Vector(local_7e4.x,local_788.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_728,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_730,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_738)))->Vector::Vector(local_7f4.x,local_788.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_740,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_748,&renderOffset);
|
|
color = GHIDRA_CAST<DestinationQuad *>(whiteColorA);
|
|
}
|
|
LAB_0081d14b:
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),GHIDRA_CAST<KColor *>(color));
|
|
pVVar1 = GHIDRA_CAST<Vector *>(0x81d167);
|
|
FUN_00a11060();
|
|
}
|
|
else {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x48)) != 9) {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x48)) != 10) goto LAB_0081a975;
|
|
local_7c4.x = local_7a4.x + edgeMargin;
|
|
local_814.x = waveScroll.x + local_778.x;
|
|
FUN_00a10690();
|
|
srcQuad0TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad0TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad0TopRightX = tmpQuad._topRight.x;
|
|
srcQuad0TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad0Flag = tmpQuadFlag;
|
|
srcQuad0BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad0BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad0BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad0BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7ec.x = local_7b4.x * 0.5;
|
|
local_7dc.x = local_7ec.x + local_778.x;
|
|
FUN_00a10690();
|
|
srcQuad1TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad1TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad1TopRightX = tmpQuad._topRight.x;
|
|
srcQuad1TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad1BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad1BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad1BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad1BottomRightY = tmpQuad._bottomRight.y;
|
|
srcQuad1Flag = tmpQuadFlag;
|
|
local_7f4.x = local_778.x * 1.5;
|
|
local_7e4.x = local_7f4.x + local_7ec.x;
|
|
local_7ec.x = local_7ec.x + waveScroll.x;
|
|
FUN_00a10690();
|
|
local_788.x = local_7f4.x + local_7b4.x;
|
|
srcQuad2TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad2TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad2TopRightX = tmpQuad._topRight.x;
|
|
srcQuad2TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad2BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad2BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad2BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad2BottomRightY = tmpQuad._bottomRight.y;
|
|
srcQuad2Flag = tmpQuadFlag;
|
|
FUN_00a10690();
|
|
srcQuad3TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad3TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad3TopRightX = tmpQuad._topRight.x;
|
|
srcQuad3TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad3Flag = tmpQuadFlag;
|
|
srcQuad3BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad3BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad3BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad3BottomRightY = tmpQuad._bottomRight.y;
|
|
local_814.x = local_778.x + local_778.x;
|
|
local_790.x = local_814.x + local_7b4.x;
|
|
FUN_00a10690();
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad4Flag = tmpQuadFlag;
|
|
srcQuad4TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad4TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad4TopRightX = tmpQuad._topRight.x;
|
|
srcQuad4TopRightY = tmpQuad._topRight.y;
|
|
local_7f4.x = local_7b4.x + local_7b4.x + local_814.x;
|
|
srcQuad4BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad4BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad4BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad4BottomRightY = tmpQuad._bottomRight.y;
|
|
FUN_00a10690();
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad5TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad5TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad5TopRightX = tmpQuad._topRight.x;
|
|
srcQuad5TopRightY = tmpQuad._topRight.y;
|
|
srcQuad5Flag = tmpQuadFlag;
|
|
srcQuad5BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad5BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad5BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad5BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_778.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = 0.0;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_778.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
local_814.x = 0.0;
|
|
local_814.y = 0.0;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7a4.y = pVVar1->y + 0.0;
|
|
local_7a4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7a4,&local_7b4,&local_7c4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad6TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad6TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad6TopRightX = tmpQuad._topRight.x;
|
|
srcQuad6TopRightY = tmpQuad._topRight.y;
|
|
srcQuad6Flag = tmpQuadFlag;
|
|
srcQuad6BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad6BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad6BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad6BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7dc.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_778.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7dc.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_778.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7a4.y = pVVar1->y + 0.0;
|
|
local_7a4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7a4,&local_7b4,&local_7c4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad7TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad7TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad7TopRightX = tmpQuad._topRight.x;
|
|
srcQuad7TopRightY = tmpQuad._topRight.y;
|
|
srcQuad7Flag = tmpQuadFlag;
|
|
srcQuad7BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad7BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad7BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad7BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7e4.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_7dc.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7e4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_7dc.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7a4.y = pVVar1->y + 0.0;
|
|
local_7a4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7a4,&local_7b4,&local_7c4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad8TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad8TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad8TopRightX = tmpQuad._topRight.x;
|
|
srcQuad8TopRightY = tmpQuad._topRight.y;
|
|
srcQuad8Flag = tmpQuadFlag;
|
|
srcQuad8BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad8BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad8BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad8BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_788.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_7e4.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7dc.y = pVVar1->y + 0.0;
|
|
local_7dc.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_788.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_7e4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7b4,&local_7c4,&local_7dc,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad9TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad9TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad9TopRightX = tmpQuad._topRight.x;
|
|
srcQuad9TopRightY = tmpQuad._topRight.y;
|
|
srcQuad9Flag = tmpQuadFlag;
|
|
srcQuad9BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad9BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad9BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad9BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_790.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_788.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7dc.y = pVVar1->y + 0.0;
|
|
local_7dc.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_790.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7e4.y = pVVar1->y + 0.0;
|
|
local_7e4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_788.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7c4,&local_7e4,&local_7dc,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad10TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad10TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad10TopRightX = tmpQuad._topRight.x;
|
|
srcQuad10TopRightY = tmpQuad._topRight.y;
|
|
srcQuad10BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad10BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad10BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad10BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7f4.x;
|
|
local_7d4.y = edgeMargin;
|
|
srcQuad10Flag = tmpQuadFlag;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_790.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7dc.y = pVVar1->y + 0.0;
|
|
local_7dc.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7f4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7e4.y = pVVar1->y + 0.0;
|
|
local_7e4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_790.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_788.y = pVVar1->y + 0.0;
|
|
local_788.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_788,&local_7e4,&local_7dc,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad11TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad11TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad11TopRightX = tmpQuad._topRight.x;
|
|
srcQuad11TopRightY = tmpQuad._topRight.y;
|
|
srcQuad11Flag = tmpQuadFlag;
|
|
srcQuad11BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad11BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad11BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad11BottomRightY = tmpQuad._bottomRight.y;
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = topLeftX;
|
|
local_7d4.y = topLeftY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = topLeftX;
|
|
local_7cc.y = bottomRightY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_7dc.x = renderOffset.x + pVVar1->x;
|
|
local_7dc.y = renderOffset.y + pVVar1->y;
|
|
local_7bc.x = topLeftX - edgeMargin;
|
|
local_7ec.x = topLeftY - edgeMargin;
|
|
local_7bc.y = local_7ec.x;
|
|
local_788.x = local_7bc.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_7e4.x = renderOffset.x + pVVar1->x;
|
|
local_7e4.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_788.x;
|
|
local_814.y = bottomRightY + edgeMargin;
|
|
local_7c4.x = local_814.y;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_790,&local_7e4,&local_7dc,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad0;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = local_79c * 0.5 + topLeftX;
|
|
local_7d4.y = topLeftY;
|
|
local_79c = local_7d4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_770,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_768)))->Vector::Vector(topLeftX,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_7cc,&renderOffset);
|
|
local_7dc.x = local_79c + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Vector(local_7dc.x,local_7ec.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_7f4,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_790,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_7b4)))->Vector::Vector(local_788.x,local_7ec.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_7a4,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_778,&renderOffset);
|
|
set_quad_corner_colors(tileQuad2,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
local_708.x = local_708.x * 0.5 + topLeftY;
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&waveRotation)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&waveScroll,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_748,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_740)))->Vector::Vector(local_79c,topLeftY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_738,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_730,&renderOffset);
|
|
local_7e4.x = local_708.x - edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_728)))->Vector::Vector(local_7dc.x,local_7e4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_720,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_718,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_710)))->Vector::Vector(local_7dc.x,local_7ec.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_758,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_750,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(bottomRightX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_758,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(local_79c,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_720,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,&renderOffset);
|
|
local_7ec.x = bottomRightX + edgeMargin;
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7ec.x,local_7e4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_738,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_740,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_7dc.x,local_7e4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_780,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_770,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_758,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(bottomRightX,local_708.x);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_720,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_7ec.x,local_7c4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_738,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_740,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_7ec.x,local_7e4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_780,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_770,&renderOffset);
|
|
set_quad_corner_colors(tileQuad,pVVar3,pVVar2,pVVar1,GHIDRA_CAST<Vector *>(local_814.x),whiteColorA + 1);
|
|
FUN_00a11060();
|
|
(GHIDRA_CAST<KColor *>((whiteColorA + 1)))->KColor::SetFromARGB(0xffffffff);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_750)))->Vector::Vector(topLeftX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_758,pVVar1,bVar6);
|
|
local_814.x = (float)(GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_710,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_718)))->Vector::Vector(bottomRightX,bottomRightY);
|
|
pVVar1 = Isaac::GetRenderPosition(&local_720,pVVar1,bVar6);
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((pVVar1)))->Vector::__add(&local_728,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((&local_730)))->Vector::Vector(local_788.x,local_7c4.x);
|
|
pVVar2 = Isaac::GetRenderPosition(&local_738,pVVar2,bVar6);
|
|
pVVar2 = (GHIDRA_CAST<Vector *>((pVVar2)))->Vector::__add(&local_740,&renderOffset);
|
|
bVar6 = 1;
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((&local_748)))->Vector::Vector(local_7ec.x,local_7c4.x);
|
|
pVVar3 = Isaac::GetRenderPosition(&local_780,pVVar3,bVar6);
|
|
pVVar3 = (GHIDRA_CAST<Vector *>((pVVar3)))->Vector::__add(&local_770,&renderOffset);
|
|
color = GHIDRA_CAST<DestinationQuad *>((whiteColorA + 1));
|
|
goto LAB_0081d14b;
|
|
}
|
|
local_790.x = local_778.x * 0.5;
|
|
local_7c4.x = local_7a4.x + edgeMargin;
|
|
local_814.x = local_790.x + waveScroll.x;
|
|
FUN_00a10690();
|
|
srcQuad0TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad0TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad0TopRightX = tmpQuad._topRight.x;
|
|
srcQuad0TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad0Flag = tmpQuadFlag;
|
|
srcQuad0BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad0BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad0BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad0BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7ec.x = local_7b4.x * 0.5;
|
|
local_788.x = local_7ec.x + local_790.x;
|
|
FUN_00a10690();
|
|
srcQuad1TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad1TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad1TopRightX = tmpQuad._topRight.x;
|
|
srcQuad1TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad1BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad1BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad1BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad1BottomRightY = tmpQuad._bottomRight.y;
|
|
srcQuad1Flag = tmpQuadFlag;
|
|
local_7e4.x = local_7ec.x + local_778.x;
|
|
local_7ec.x = local_7ec.x + waveScroll.x;
|
|
FUN_00a10690();
|
|
local_7dc.x = local_7b4.x + local_778.x;
|
|
srcQuad2TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad2TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad2TopRightX = tmpQuad._topRight.x;
|
|
srcQuad2TopRightY = tmpQuad._topRight.y;
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad2BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad2BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad2BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad2BottomRightY = tmpQuad._bottomRight.y;
|
|
srcQuad2Flag = tmpQuadFlag;
|
|
FUN_00a10690();
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad3TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad3TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad3TopRightX = tmpQuad._topRight.x;
|
|
srcQuad3TopRightY = tmpQuad._topRight.y;
|
|
srcQuad3Flag = tmpQuadFlag;
|
|
srcQuad3BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad3BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad3BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad3BottomRightY = tmpQuad._bottomRight.y;
|
|
local_814.x = local_778.x + local_778.x;
|
|
local_778.x = local_814.x + local_7b4.x;
|
|
FUN_00a10690();
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad4Flag = tmpQuadFlag;
|
|
srcQuad4TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad4TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad4TopRightX = tmpQuad._topRight.x;
|
|
srcQuad4TopRightY = tmpQuad._topRight.y;
|
|
local_7f4.x = local_7b4.x + local_7b4.x + local_814.x;
|
|
srcQuad4BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad4BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad4BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad4BottomRightY = tmpQuad._bottomRight.y;
|
|
FUN_00a10690();
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad5TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad5TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad5TopRightX = tmpQuad._topRight.x;
|
|
srcQuad5TopRightY = tmpQuad._topRight.y;
|
|
srcQuad5Flag = tmpQuadFlag;
|
|
srcQuad5BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad5BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad5BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad5BottomRightY = tmpQuad._bottomRight.y;
|
|
local_814.x = local_790.x;
|
|
local_814.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7a4.y = pVVar1->y + 0.0;
|
|
local_7a4.x = waveScroll.x + pVVar1->x;
|
|
local_7ec.x = 0.0;
|
|
local_7ec.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7ec)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7bc.y = pVVar1->y + 0.0;
|
|
local_7bc.x = waveScroll.x + pVVar1->x;
|
|
local_7c4.y = 0.0;
|
|
local_7c4.x = local_790.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7c4)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7cc.y = pVVar1->y + 0.0;
|
|
local_7cc.x = waveScroll.x + pVVar1->x;
|
|
local_7b4.x = 0.0;
|
|
local_7b4.y = 0.0;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7b4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7d4.y = pVVar1->y + 0.0;
|
|
local_7d4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7d4,&local_7cc,&local_7bc,&local_7a4);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad6TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad6TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad6TopRightX = tmpQuad._topRight.x;
|
|
srcQuad6TopRightY = tmpQuad._topRight.y;
|
|
srcQuad6Flag = tmpQuadFlag;
|
|
srcQuad6BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad6BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad6BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad6BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_788.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_790.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_788.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_790.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7a4.y = pVVar1->y + 0.0;
|
|
local_7a4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7a4,&local_7b4,&local_7c4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad7TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad7TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad7TopRightX = tmpQuad._topRight.x;
|
|
srcQuad7TopRightY = tmpQuad._topRight.y;
|
|
srcQuad7Flag = tmpQuadFlag;
|
|
srcQuad7BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad7BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad7BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad7BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7e4.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_788.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7e4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_790.y = pVVar1->y + 0.0;
|
|
local_790.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_788.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7b4.y = pVVar1->y + 0.0;
|
|
local_7b4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7b4,&local_790,&local_7c4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad8TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad8TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad8TopRightX = tmpQuad._topRight.x;
|
|
srcQuad8TopRightY = tmpQuad._topRight.y;
|
|
srcQuad8Flag = tmpQuadFlag;
|
|
srcQuad8BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad8BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad8BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad8BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7dc.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_7e4.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_788.y = pVVar1->y + 0.0;
|
|
local_788.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7dc.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_7e4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_790.y = pVVar1->y + 0.0;
|
|
local_790.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_790,&local_7c4,&local_788,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad9TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad9TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad9TopRightX = tmpQuad._topRight.x;
|
|
srcQuad9TopRightY = tmpQuad._topRight.y;
|
|
srcQuad9Flag = tmpQuadFlag;
|
|
srcQuad9BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad9BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad9BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad9BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_778.x;
|
|
local_7d4.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_7dc.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7e4.y = pVVar1->y + 0.0;
|
|
local_7e4.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_778.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_788.y = pVVar1->y + 0.0;
|
|
local_788.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_7dc.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_7c4.y = pVVar1->y + 0.0;
|
|
local_7c4.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_7c4,&local_788,&local_7e4,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad10TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad10TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad10TopRightX = tmpQuad._topRight.x;
|
|
srcQuad10TopRightY = tmpQuad._topRight.y;
|
|
srcQuad10BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad10BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad10BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad10BottomRightY = tmpQuad._bottomRight.y;
|
|
local_7d4.x = local_7f4.x;
|
|
local_7d4.y = edgeMargin;
|
|
srcQuad10Flag = tmpQuadFlag;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7d4)))->Vector::Rotated(&local_780,waveRotation.x);
|
|
local_7ec.y = pVVar1->y + 0.0;
|
|
local_7ec.x = waveScroll.x + pVVar1->x;
|
|
local_7cc.x = local_778.x;
|
|
local_7cc.y = edgeMargin;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7cc)))->Vector::Rotated(&local_770,waveRotation.x);
|
|
local_7dc.y = pVVar1->y + 0.0;
|
|
local_7dc.x = waveScroll.x + pVVar1->x;
|
|
local_7bc.y = 0.0;
|
|
local_7bc.x = local_7f4.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_7bc)))->Vector::Rotated(&local_768,waveRotation.x);
|
|
local_7e4.y = pVVar1->y + 0.0;
|
|
local_7e4.x = waveScroll.x + pVVar1->x;
|
|
local_814.y = 0.0;
|
|
local_814.x = local_778.x;
|
|
pVVar1 = (GHIDRA_CAST<Vector *>((&local_814)))->Vector::Rotated(&local_760,waveRotation.x);
|
|
local_788.y = pVVar1->y + 0.0;
|
|
local_788.x = waveScroll.x + pVVar1->x;
|
|
DestinationQuad::DestinationQuad(&tmpQuad,&local_788,&local_7e4,&local_7dc,&local_7ec);
|
|
tmpQuadFlag = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(tmpQuadFlag)) + 0x1))),1);
|
|
srcQuad11TopLeftX = tmpQuad._topLeft.x;
|
|
srcQuad11TopLeftY = tmpQuad._topLeft.y;
|
|
srcQuad11TopRightX = tmpQuad._topRight.x;
|
|
srcQuad11TopRightY = tmpQuad._topRight.y;
|
|
srcQuad11Flag = tmpQuadFlag;
|
|
srcQuad11BottomLeftX = tmpQuad._bottomLeft.x;
|
|
srcQuad11BottomLeftY = tmpQuad._bottomLeft.y;
|
|
srcQuad11BottomRightX = tmpQuad._bottomRight.x;
|
|
srcQuad11BottomRightY = tmpQuad._bottomRight.y;
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = topLeftX;
|
|
local_7d4.y = local_708.x * 0.5 + topLeftY;
|
|
local_708.x = local_7d4.y;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.y = bottomRightY;
|
|
local_7cc.x = topLeftX;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_7dc.x = renderOffset.x + pVVar1->x;
|
|
local_7dc.y = renderOffset.y + pVVar1->y;
|
|
local_7bc.x = topLeftX - edgeMargin;
|
|
local_7ec.x = local_708.x - edgeMargin;
|
|
local_7bc.y = local_7ec.x;
|
|
local_788.x = local_7bc.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_7e4.x = renderOffset.x + pVVar1->x;
|
|
local_7e4.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_788.x;
|
|
local_814.y = bottomRightY + edgeMargin;
|
|
local_7c4.x = local_814.y;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_790,&local_7e4,&local_7dc,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad0;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = local_79c * 0.5 + topLeftX;
|
|
local_7d4.y = local_708.x;
|
|
local_79c = local_7d4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = topLeftX;
|
|
local_7cc.y = local_708.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_7e4.x = renderOffset.x + pVVar1->x;
|
|
local_7e4.y = renderOffset.y + pVVar1->y;
|
|
local_7dc.x = local_79c - edgeMargin;
|
|
local_7bc.y = local_7ec.x;
|
|
local_7bc.x = local_7dc.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_788.x;
|
|
local_814.y = local_7ec.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_7b4.y = renderOffset.y + pVVar1->y;
|
|
local_7b4.x = renderOffset.x + pVVar1->x;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_7b4,&local_790,&local_7e4,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad1;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = local_79c;
|
|
local_7d4.y = topLeftY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = local_79c;
|
|
local_7cc.y = local_708.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_7bc.x = local_7dc.x;
|
|
local_7e4.x = topLeftY - edgeMargin;
|
|
local_7bc.y = local_7e4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_7b4.x = renderOffset.x + pVVar1->x;
|
|
local_7b4.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_7dc.x;
|
|
local_814.y = local_7ec.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_7a4.y = renderOffset.y + pVVar1->y;
|
|
local_7a4.x = renderOffset.x + pVVar1->x;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_7a4,&local_7b4,&local_790,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad2;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = bottomRightX;
|
|
local_7d4.y = topLeftY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = local_79c;
|
|
local_7cc.y = topLeftY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_7ec.x = bottomRightX + edgeMargin;
|
|
local_7bc.y = local_7e4.x;
|
|
local_7bc.x = local_7ec.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_7b4.x = renderOffset.x + pVVar1->x;
|
|
local_7b4.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_7dc.x;
|
|
local_814.y = local_7e4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_708.y = renderOffset.y + pVVar1->y;
|
|
local_708.x = renderOffset.x + pVVar1->x;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_708,&local_7b4,&local_790,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad3;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = bottomRightX;
|
|
local_7d4.y = bottomRightY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = bottomRightX;
|
|
local_7cc.y = topLeftY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_7dc.x = renderOffset.x + pVVar1->x;
|
|
local_7dc.y = renderOffset.y + pVVar1->y;
|
|
local_7bc.x = local_7ec.x;
|
|
local_7bc.y = local_7c4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_7ec.x;
|
|
local_814.y = local_7e4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_7b4.x = renderOffset.x + pVVar1->x;
|
|
local_7b4.y = renderOffset.y + pVVar1->y;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_7b4,&local_790,&local_7dc,&local_7f4,whiteColorA);
|
|
quadDst = edgeQuad4;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
(GHIDRA_CAST<KColor *>((whiteColorA)))->KColor::SetFromARGB(0xffffffff);
|
|
local_7d4.x = topLeftX;
|
|
local_7d4.y = bottomRightY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_780,&local_7d4,1);
|
|
local_7f4.x = renderOffset.x + pVVar1->x;
|
|
local_7f4.y = renderOffset.y + pVVar1->y;
|
|
local_7cc.x = bottomRightX;
|
|
local_7cc.y = bottomRightY;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_770,&local_7cc,1);
|
|
local_7dc.x = renderOffset.x + pVVar1->x;
|
|
local_7dc.y = renderOffset.y + pVVar1->y;
|
|
local_7bc.x = local_788.x;
|
|
local_7bc.y = local_7c4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_768,&local_7bc,1);
|
|
local_7e4.x = renderOffset.x + pVVar1->x;
|
|
local_7e4.y = renderOffset.y + pVVar1->y;
|
|
local_814.x = local_7ec.x;
|
|
local_814.y = local_7c4.x;
|
|
pVVar1 = Isaac::GetRenderPosition(&local_760,&local_814,1);
|
|
local_790.y = renderOffset.y + pVVar1->y;
|
|
local_790.x = renderOffset.x + pVVar1->x;
|
|
pVVar1 = &local_7f4;
|
|
quadCursor = set_quad_corner_colors
|
|
(tileQuad2,&local_790,&local_7e4,&local_7dc,pVVar1,whiteColorA);
|
|
quadDst = edgeQuad5;
|
|
for (iVar4 = 0x1c; iVar4 != 0; iVar4 = iVar4 + -1) {
|
|
*quadDst = *quadCursor;
|
|
quadCursor = quadCursor + 1;
|
|
quadDst = quadDst + 1;
|
|
}
|
|
}
|
|
LAB_0081d167:
|
|
pvVar7 = (void *)0x81d16e;
|
|
FUN_00682260();
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStackY_8b4 + 0x8c)))->KAGE::SmartPointer::operator_assign(&DAT_00c797c4);
|
|
apply_sprite_shader_params(GHIDRA_CAST<ColorMod *>(&waterColor),1,pVVar1,pvVar7);
|
|
local_7f4.x = (float)&srcQuad0TopLeftX;
|
|
local_7ec.x = 0.0;
|
|
do {
|
|
texture = GHIDRA_CAST<int *>(EntityPtr)::Ref();
|
|
drawFn = *(code **)(*texture + 0x14);
|
|
FUN_00407220();
|
|
(*drawFn)(local_7f4.x);
|
|
local_7f4.x = (float)(GHIDRA_INT(local_7f4.x) + 0x24);
|
|
local_7ec.x = (float)(GHIDRA_INT(local_7ec.x) + 1);
|
|
} while (GHIDRA_INT(local_7ec.x) < 0xc);
|
|
LAB_0081deea:
|
|
shader_cache_find(0xb1a5b0);
|
|
return;
|
|
}
|
|
|
|
// 0081e240
|
|
uint32_t Room::IsAmbushActive()
|
|
{
|
|
return CONCAT31((int3)(GHIDRA_UINT(g_game) >> 8),(g_game->_ambush)._isActive);
|
|
}
|
|
|
|
// 0081e250
|
|
float Room::GetLightingAlpha()
|
|
{
|
|
int iVar1;
|
|
uint32_t uVar2;
|
|
uint8_t isAbandonedMineshaft;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
Entity_Player *player;
|
|
uint32_t uVar3;
|
|
float playerDistance;
|
|
float fVar4;
|
|
float alpha;
|
|
Vector local_10;
|
|
Game *game;
|
|
|
|
if (this->_backdropType == 0x39) {
|
|
return g_game->_darknessStrength * g_game->_darknessModifier;
|
|
}
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 9 & 1) != 0) {
|
|
return 1.0;
|
|
}
|
|
iVar1 = g_game->_stage;
|
|
uVar2 = g_game->_debugCurses;
|
|
uVar3 = g_game->_curses;
|
|
local_10.x = (float)g_game->_stageType;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((~preventedCurses & (forcedCurses | uVar2 | uVar3) & 1) == 0) {
|
|
alpha = (this->_fxLayers)._fxParams.shadowAlpha;
|
|
if ((((iVar1 == 1) && (local_10.x != 5.60519e-45)) && (local_10.x != 7.00649e-45)) &&
|
|
(local_10.x != 2.8026e-45)) {
|
|
alpha = alpha * 0.6;
|
|
}
|
|
}
|
|
else {
|
|
alpha = 1.0;
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1a9,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (player != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
alpha = alpha * 0.5;
|
|
}
|
|
player = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x1cc,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((player != GHIDRA_CAST<Entity_Player *>(0x0)) && (alpha = alpha + 0.1, 1.0 <= alpha)) {
|
|
alpha = 1.0;
|
|
}
|
|
alpha = (g_game->_darknessStrength - alpha) * g_game->_darknessModifier + alpha;
|
|
if ((((this->_roomType == 8) || (this->_roomType == 0x1d)) ||
|
|
((isAbandonedMineshaft = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft(),
|
|
isAbandonedMineshaft != 0 && (g_game->_currentDimensionIdx == 1)))) ||
|
|
(g_game->_currentDimensionIdx == 2)) {
|
|
fVar4 = alpha + 0.33;
|
|
alpha = 1.0;
|
|
if (fVar4 <= 1.0) {
|
|
alpha = fVar4;
|
|
}
|
|
}
|
|
game = g_game;
|
|
if (iVar1 == 9) {
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)) == 5) {
|
|
uVar2 = (this->_entityList)._updateEL._size;
|
|
uVar3 = 0;
|
|
if (uVar2 != 0) {
|
|
while ((iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + uVar3 * 4)),
|
|
*GHIDRA_CAST<int *>((iVar1 + 0x28)) != 0x197 || (*GHIDRA_CAST<int *>((iVar1 + 0x2c)) != 0))) {
|
|
uVar3 = uVar3 + 1;
|
|
if (uVar2 <= uVar3) {
|
|
return alpha;
|
|
}
|
|
}
|
|
fVar4 = 1.0 - *GHIDRA_CAST<float *>((iVar1 + 0x380)) / *GHIDRA_CAST<float *>((iVar1 + 900));
|
|
if (fVar4 <= alpha) {
|
|
fVar4 = alpha;
|
|
}
|
|
return fVar4;
|
|
}
|
|
}
|
|
else if (g_game->_currentRoomIdx == -9) {
|
|
GetCenterPos(&local_10);
|
|
player = (GHIDRA_CAST<Game *>((game)))->Game::GetNearestPlayer(&local_10);
|
|
local_10.y = local_10.y - (player->_pos).y;
|
|
fVar4 = local_10.x - (player->_pos).x;
|
|
playerDistance = sqrtf(local_10.y * local_10.y + fVar4 * fVar4);
|
|
fVar4 = 300.0;
|
|
if (playerDistance <= 300.0) {
|
|
fVar4 = playerDistance;
|
|
}
|
|
alpha = 1.0 - fVar4 / 300.0;
|
|
}
|
|
}
|
|
return alpha;
|
|
}
|
|
|
|
// 0081e520
|
|
Vector * Room::FindFreeTilePosition(Vector *outPos, Vector *pos, float distanceThreshold)
|
|
{
|
|
int iVar1;
|
|
uint32_t gridCollision;
|
|
int iVar2;
|
|
int index;
|
|
float fVar3;
|
|
float fVar4;
|
|
float distSq;
|
|
float resultX;
|
|
float resultY;
|
|
float bestX;
|
|
float bestY;
|
|
float bestDistSq;
|
|
|
|
iVar2 = GHIDRA_INT(((pos->x - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar2 < 0) || (this->_gridWidth <= iVar2)) ||
|
|
(iVar1 = GHIDRA_INT(((pos->y - 120.0) / 40.0 + 0.5)), iVar1 < 0)) || (this->_gridHeight <= iVar1)) {
|
|
iVar2 = -1;
|
|
}
|
|
else {
|
|
iVar2 = this->_gridWidth * iVar1 + iVar2;
|
|
}
|
|
gridCollision = GetGridCollision(this,iVar2);
|
|
if (gridCollision == 0) {
|
|
resultY = pos->y;
|
|
outPos->x = pos->x;
|
|
outPos->y = resultY;
|
|
return outPos;
|
|
}
|
|
index = 0;
|
|
iVar1 = this->_gridHeight * this->_gridWidth;
|
|
bestX = (float)(iVar2 % this->_gridWidth) * 40.0 + 40.0;
|
|
bestDistSq = 1e+06;
|
|
bestY = (float)(iVar2 / this->_gridWidth) * 40.0 + 120.0;
|
|
resultY = bestY;
|
|
fVar3 = bestY;
|
|
resultX = bestX;
|
|
fVar4 = bestX;
|
|
if (0 < iVar1) {
|
|
do {
|
|
if ((index != iVar2) &&
|
|
(gridCollision = GetGridCollision(this,index), fVar3 = bestY, fVar4 = bestX,
|
|
gridCollision == 0)) {
|
|
resultY = (float)(index / this->_gridWidth) * 40.0 + 120.0;
|
|
resultX = (float)(index % this->_gridWidth) * 40.0 + 40.0;
|
|
fVar4 = resultY - pos->y;
|
|
fVar3 = resultX - pos->x;
|
|
distSq = fVar4 * fVar4 + fVar3 * fVar3;
|
|
fVar3 = bestY;
|
|
fVar4 = bestX;
|
|
if ((distSq < bestDistSq) &&
|
|
(bestX = resultX, bestY = resultY, bestDistSq = distSq, fVar3 = resultY, fVar4 = resultX,
|
|
distSq < distanceThreshold * distanceThreshold)) break;
|
|
}
|
|
resultX = fVar4;
|
|
resultY = fVar3;
|
|
index = index + 1;
|
|
fVar3 = resultY;
|
|
fVar4 = resultX;
|
|
} while (index < iVar1);
|
|
}
|
|
outPos->x = resultX;
|
|
outPos->y = resultY;
|
|
return outPos;
|
|
}
|
|
|
|
// 0081e6e0
|
|
uint8_t Room::TryMakeBridge(GridEntity *pit, GridEntity *rock)
|
|
{
|
|
uint32_t gridIndex;
|
|
void *gridAbove;
|
|
GridEntity_Pit *pitEntity;
|
|
int iVar1;
|
|
uint32_t uVar2;
|
|
int iVar3;
|
|
void *gridBelow;
|
|
void *gridLeft;
|
|
int gridYAbove;
|
|
float pitY;
|
|
float pitX;
|
|
void *gridRight;
|
|
|
|
if (pit == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pit)) + 0x4)))) != 7) {
|
|
return 0;
|
|
}
|
|
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0xc));
|
|
pitY = (float)(pit->_gridIndex / iVar3) * 40.0 + 120.0;
|
|
pitX = (float)(pit->_gridIndex % iVar3) * 40.0 + 40.0;
|
|
iVar3 = GHIDRA_INT((((pitX + 40.0) - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) ||
|
|
(iVar1 = GHIDRA_INT((((pitY + 0.0) - 120.0) / 40.0 + 0.5)), iVar1 < 0)) ||
|
|
((this->_gridHeight <= iVar1 ||
|
|
(gridIndex = this->_gridWidth * iVar1 + iVar3, 0x1bf < gridIndex)))) {
|
|
gridRight = (void *)0x0;
|
|
}
|
|
else {
|
|
gridRight = this->_gridEntities[gridIndex];
|
|
}
|
|
iVar3 = GHIDRA_INT((((pitX - 40.0) - 40.0) / 40.0 + 0.5));
|
|
if (((iVar3 < 0) || (this->_gridWidth <= iVar3)) ||
|
|
((iVar1 = GHIDRA_INT((((pitY + 0.0) - 120.0) / 40.0 + 0.5)), iVar1 < 0 ||
|
|
((this->_gridHeight <= iVar1 ||
|
|
(gridIndex = this->_gridWidth * iVar1 + iVar3, 0x1bf < gridIndex)))))) {
|
|
gridLeft = (void *)0x0;
|
|
}
|
|
else {
|
|
gridLeft = this->_gridEntities[gridIndex];
|
|
}
|
|
iVar3 = GHIDRA_INT((((pitX + 0.0) - 40.0) / 40.0 + 0.5));
|
|
if ((((iVar3 < 0) || (this->_gridWidth <= iVar3)) ||
|
|
(iVar1 = GHIDRA_INT((((pitY + 40.0) - 120.0) / 40.0 + 0.5)), iVar1 < 0)) ||
|
|
((this->_gridHeight <= iVar1 ||
|
|
(gridIndex = this->_gridWidth * iVar1 + iVar3, 0x1bf < gridIndex)))) {
|
|
gridBelow = (void *)0x0;
|
|
if ((-1 < iVar3) && (iVar1 = this->_gridWidth, iVar3 < iVar1)) goto LAB_0081e871;
|
|
}
|
|
else {
|
|
gridBelow = this->_gridEntities[gridIndex];
|
|
iVar1 = this->_gridWidth;
|
|
LAB_0081e871:
|
|
gridYAbove = GHIDRA_INT((((pitY - 40.0) - 120.0) / 40.0 + 0.5));
|
|
if (((-1 < gridYAbove) && (gridYAbove < this->_gridHeight)) &&
|
|
(gridIndex = iVar1 * gridYAbove + iVar3, gridIndex < 0x1c0)) {
|
|
gridAbove = this->_gridEntities[gridIndex];
|
|
goto LAB_0081e89e;
|
|
}
|
|
}
|
|
gridAbove = (void *)0x0;
|
|
LAB_0081e89e:
|
|
if ((((gridRight != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridRight) + 4)) == 7)) ||
|
|
((gridLeft != (void *)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridLeft) + 4)) == 7)))) &&
|
|
(((gridAbove != (void *)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridAbove) + 4)) == 7)) ||
|
|
((gridBelow != (void *)0x0 && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridBelow) + 4)) == 7)))))) {
|
|
return 0;
|
|
}
|
|
pitEntity = (GridEntity_Pit *)
|
|
__RTDynamicCast(pit,0,&IsaacRepentancePlus::GridEntity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::GridEntity_Pit::RTTI_Type_Descriptor,0);
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pitEntity)) + 0xc)))) == 0) {
|
|
if (((rock == GHIDRA_CAST<GridEntity *>(0x0)) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((rock)) + 0x4)))) != 0x19)) ||
|
|
(uVar2 = 3, *GHIDRA_CAST<int *>(rock[1]._sprite._filename._buf) != 1)) {
|
|
uVar2 = 2;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pitEntity)) + 0xc)))) = uVar2;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((pitEntity)))->GridEntity_Pit::UpdateCollision();
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 0081e930
|
|
void Room::RemoveGridEntity(int gridIndex, int pathTrail, uint8_t isKeepDecoration)
|
|
{
|
|
uint8_t insertResult [12];
|
|
|
|
if (((GHIDRA_UINT(gridIndex) < 0x1c0) && (this->_gridEntities[gridIndex] != (void *)0x0)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_INT(this->_gridEntities[gridIndex]) + 4)) != 1 || (isKeepDecoration == 0)))) {
|
|
this->_gridPaths[gridIndex] = pathTrail;
|
|
msvc::set<int>::insert(insertResult,&gridIndex);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0081e980
|
|
void Room::RemoveGridEntityImmediate(int GridIndex, int PathTrail, uint8_t KeepDecoration)
|
|
{
|
|
uint32_t *gridEntity;
|
|
|
|
if (((GHIDRA_UINT(GridIndex) < 0x1c0) &&
|
|
(gridEntity = this->_gridEntities[GridIndex], gridEntity != GHIDRA_CAST<uint32_t *>(0x0))) &&
|
|
((gridEntity[1] != 1 || (KeepDecoration == 0)))) {
|
|
this->_gridPaths[GridIndex] = PathTrail;
|
|
this->_gridEntities[GridIndex] = (void *)0x0;
|
|
(**(code **)*gridEntity)(1);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0081e9d0
|
|
Vector * Room::GetRandomPosition(Vector *outPosition, float margin)
|
|
{
|
|
double dVar1;
|
|
double dVar2;
|
|
uint32_t randomValue;
|
|
uint32_t randomY;
|
|
float areaASize;
|
|
float areaBWidth;
|
|
float areaAHeight;
|
|
float areaAWidth;
|
|
float areaBHeight;
|
|
float splitY;
|
|
Vector local_30;
|
|
float areaALeft;
|
|
float areaATop;
|
|
float areaARight;
|
|
float areaABottom;
|
|
float areaBLeft;
|
|
float areaBTop;
|
|
float areaBRight;
|
|
float areaBBottom;
|
|
|
|
if (3 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U) {
|
|
randomValue = Random();
|
|
local_30.x = (float)((double)GHIDRA_INT(randomValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)]) * 2.3283064e-10;
|
|
randomValue = Random();
|
|
local_30.x = ((this->_bottomRightPos).x - (this->_topLeftPos).x) * local_30.x +
|
|
(this->_topLeftPos).x;
|
|
local_30.y = ((this->_bottomRightPos).y - (this->_topLeftPos).y) *
|
|
(float)((double)GHIDRA_INT(randomValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)]) * 2.3283064e-10 +
|
|
(this->_topLeftPos).y;
|
|
GetClampedPositionImpl(this,outPosition,&local_30,margin,margin,margin,margin);
|
|
return outPosition;
|
|
}
|
|
GetLRoomAreaDesc(this,&areaALeft);
|
|
local_30.x = areaALeft - margin;
|
|
splitY = areaABottom + margin;
|
|
areaAWidth = (areaARight + margin) - local_30.x;
|
|
areaBWidth = (areaBRight + margin) - (areaBLeft - margin);
|
|
if (areaAWidth < areaBWidth) {
|
|
splitY = areaBTop - margin;
|
|
}
|
|
areaAHeight = splitY - (areaATop - margin);
|
|
areaBHeight = (areaBBottom + margin) - splitY;
|
|
areaASize = ABS(areaAHeight * areaAWidth);
|
|
randomValue = Random();
|
|
if ((float)((double)GHIDRA_INT(randomValue) + __uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)]) *
|
|
2.3283064e-10 < areaASize / (ABS(areaBHeight * areaBWidth) + areaASize)) {
|
|
randomValue = Random();
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)];
|
|
randomY = Random();
|
|
dVar2 = __uint_to_double_fixup[-(GHIDRA_INT(randomY) >> 0x1f)];
|
|
outPosition->x =
|
|
areaAWidth * (float)((double)GHIDRA_INT(randomValue) + dVar1) * 2.3283064e-10 + local_30.x;
|
|
outPosition->y =
|
|
(float)((double)GHIDRA_INT(randomY) + dVar2) * 2.3283064e-10 * areaAHeight + (areaATop - margin);
|
|
return outPosition;
|
|
}
|
|
randomValue = Random();
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)];
|
|
randomY = Random();
|
|
dVar2 = __uint_to_double_fixup[-(GHIDRA_INT(randomY) >> 0x1f)];
|
|
outPosition->x =
|
|
areaBWidth * (float)((double)GHIDRA_INT(randomValue) + dVar1) * 2.3283064e-10 + (areaBLeft - margin)
|
|
;
|
|
outPosition->y = (float)((double)GHIDRA_INT(randomY) + dVar2) * 2.3283064e-10 * areaBHeight + splitY;
|
|
return outPosition;
|
|
}
|
|
|
|
// 0081ecc0
|
|
int Room::GetRandomTileIndex(uint32_t seed)
|
|
{
|
|
uint32_t rngResult;
|
|
int iVar1;
|
|
int maxY;
|
|
int tileDesc;
|
|
uint32_t local_2c;
|
|
uint32_t local_28;
|
|
uint32_t local_24;
|
|
RNG local_20;
|
|
int tileX;
|
|
Room *local_c;
|
|
int maxY;
|
|
int minX;
|
|
|
|
minX = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48));
|
|
maxY = minX * 0x20;
|
|
local_c = this;
|
|
if (minX - 9U < 4) {
|
|
tileDesc = *GHIDRA_CAST<int *>((&DAT_00c35b80 + maxY));
|
|
local_2c = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b84 + maxY));
|
|
local_28 = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b88 + maxY));
|
|
local_24 = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b8c + maxY));
|
|
local_20._seed = *GHIDRA_CAST<int *>((&DAT_00c35b90 + maxY));
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = *GHIDRA_CAST<uint64_t *>((&DAT_00c35b94 + maxY));
|
|
local_20._shift3 = *GHIDRA_CAST<int *>((&DAT_00c35b9c + maxY));
|
|
(GHIDRA_CAST<LRoomTileDesc *>((GHIDRA_CAST<LRoomTileDesc *>(&tileDesc))))->LRoomTileDesc::GetRandomTile(&tileX,seed);
|
|
if (((-1 < tileX) && (tileX < this->_gridWidth)) &&
|
|
((-1 < GHIDRA_INT(local_c) && (GHIDRA_INT(local_c) < this->_gridHeight)))) {
|
|
return this->_gridWidth * GHIDRA_INT(local_c) + tileX;
|
|
}
|
|
}
|
|
else {
|
|
minX = *GHIDRA_CAST<int *>((&DAT_00c35b80 + maxY));
|
|
iVar1 = *GHIDRA_CAST<int *>((&DAT_00c35b84 + maxY));
|
|
maxY = *GHIDRA_CAST<int *>((&DAT_00c35b8c + maxY));
|
|
local_20._seed = seed;
|
|
local_20._shift3 = 0x1d;
|
|
local_20._shift1 = 1;
|
|
local_20._shift2 = 9;
|
|
rngResult = (GHIDRA_CAST<RNG *>((&local_20)))->RNG::RandomInt(*GHIDRA_CAST<int *>((&DAT_00c35b88 + maxY)) - minX);
|
|
minX = rngResult + minX;
|
|
rngResult = (GHIDRA_CAST<RNG *>((&local_20)))->RNG::RandomInt(maxY - iVar1);
|
|
iVar1 = rngResult + iVar1;
|
|
if (-1 < minX) {
|
|
if (((minX < local_c->_gridWidth) && (-1 < iVar1)) && (iVar1 < local_c->_gridHeight)) {
|
|
return iVar1 * local_c->_gridWidth + minX;
|
|
}
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 0081edd0
|
|
uint32_t Room::GetBrokenWatchState()
|
|
{
|
|
uint32_t watchState;
|
|
|
|
watchState = 2;
|
|
if (g_game->_challenge != 0x16) {
|
|
watchState = this->_brokenWatchState;
|
|
}
|
|
return watchState;
|
|
}
|
|
|
|
// 0081edf0
|
|
void Room::SetBrokenWatchState(int state)
|
|
{
|
|
float musicPitch;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
this->_brokenWatchState = state;
|
|
musicPitch = time_scale_update(this);
|
|
(manager->_musicManager)._targetPitch = musicPitch;
|
|
return;
|
|
}
|
|
|
|
// 0081ee20
|
|
void Room::make_walls()
|
|
{
|
|
int iVar1;
|
|
int y;
|
|
int iVar2;
|
|
int iVar3;
|
|
int tileDesc;
|
|
int tileMinY;
|
|
int tileMaxX;
|
|
int tileMaxY;
|
|
int *roomConfig;
|
|
|
|
roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if (((roomConfig == GHIDRA_CAST<int *>(0x0)) || (roomConfig[2] != 0x10)) || (*roomConfig != 0x23)) {
|
|
iVar2 = roomConfig[0x12];
|
|
if (iVar2 == 0xb) {
|
|
iVar2 = 0;
|
|
if (0 < this->_gridWidth) {
|
|
do {
|
|
make_wall(this,iVar2,0);
|
|
if (iVar2 < 0xd) {
|
|
iVar1 = 8;
|
|
}
|
|
else {
|
|
iVar1 = this->_gridHeight + -1;
|
|
}
|
|
make_wall(this,iVar2,iVar1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridWidth);
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < this->_gridHeight + -1) {
|
|
do {
|
|
iVar1 = 0;
|
|
if (7 < iVar2) {
|
|
iVar1 = 0xd;
|
|
}
|
|
make_wall(this,iVar1,iVar2);
|
|
make_wall(this,this->_gridWidth + -1,iVar2);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridHeight + -1);
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar2 == 0xc) {
|
|
iVar2 = 0;
|
|
if (0 < this->_gridWidth) {
|
|
do {
|
|
make_wall(this,iVar2,0);
|
|
if (iVar2 < 0xf) {
|
|
iVar1 = this->_gridHeight + -1;
|
|
}
|
|
else {
|
|
iVar1 = 8;
|
|
}
|
|
make_wall(this,iVar2,iVar1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridWidth);
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < this->_gridHeight + -1) {
|
|
do {
|
|
make_wall(this,0,iVar2);
|
|
if (iVar2 < 8) {
|
|
iVar1 = this->_gridWidth + -1;
|
|
}
|
|
else {
|
|
iVar1 = 0xe;
|
|
}
|
|
make_wall(this,iVar1,iVar2);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridHeight + -1);
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar2 == 9) {
|
|
iVar2 = 0;
|
|
if (0 < this->_gridWidth) {
|
|
do {
|
|
iVar1 = 7;
|
|
if (0xd < iVar2) {
|
|
iVar1 = 0;
|
|
}
|
|
make_wall(this,iVar2,iVar1);
|
|
make_wall(this,iVar2,this->_gridHeight + -1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridWidth);
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < this->_gridHeight + -1) {
|
|
do {
|
|
iVar1 = 0xd;
|
|
if (7 < iVar2) {
|
|
iVar1 = 0;
|
|
}
|
|
make_wall(this,iVar1,iVar2);
|
|
make_wall(this,this->_gridWidth + -1,iVar2);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridHeight + -1);
|
|
return;
|
|
}
|
|
}
|
|
else if (iVar2 == 10) {
|
|
iVar2 = 0;
|
|
if (0 < this->_gridWidth) {
|
|
do {
|
|
iVar1 = 0;
|
|
if (0xe < iVar2) {
|
|
iVar1 = 7;
|
|
}
|
|
make_wall(this,iVar2,iVar1);
|
|
make_wall(this,iVar2,this->_gridHeight + -1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridWidth);
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < this->_gridHeight + -1) {
|
|
do {
|
|
make_wall(this,0,iVar2);
|
|
if (iVar2 < 8) {
|
|
iVar1 = 0xe;
|
|
}
|
|
else {
|
|
iVar1 = this->_gridWidth + -1;
|
|
}
|
|
make_wall(this,iVar1,iVar2);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridHeight + -1);
|
|
return;
|
|
}
|
|
}
|
|
else if (((iVar2 == 2) || (iVar2 == 3)) || ((iVar2 == 7 || (iVar2 == 5)))) {
|
|
GetLRoomTileDesc(this,GHIDRA_CAST<LRoomTileDesc *>(&tileDesc));
|
|
iVar2 = tileDesc + -1;
|
|
iVar1 = tileMaxX + 1;
|
|
if (iVar2 <= iVar1) {
|
|
y = tileMinY + -1;
|
|
iVar3 = iVar2;
|
|
do {
|
|
make_wall(this,iVar3,y);
|
|
make_wall(this,iVar3,tileMaxY + 1);
|
|
iVar3 = iVar3 + 1;
|
|
} while (iVar3 <= iVar1);
|
|
}
|
|
iVar3 = tileMinY + -1;
|
|
if (iVar3 <= tileMaxY + 1) {
|
|
do {
|
|
make_wall(this,iVar2,iVar3);
|
|
make_wall(this,iVar1,iVar3);
|
|
iVar3 = iVar3 + 1;
|
|
} while (iVar3 <= tileMaxY + 1);
|
|
}
|
|
}
|
|
else {
|
|
iVar2 = 0;
|
|
if (0 < this->_gridWidth) {
|
|
do {
|
|
make_wall(this,iVar2,0);
|
|
make_wall(this,iVar2,this->_gridHeight + -1);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridWidth);
|
|
}
|
|
iVar2 = 0;
|
|
if (0 < this->_gridHeight + -1) {
|
|
do {
|
|
make_wall(this,0,iVar2);
|
|
make_wall(this,this->_gridWidth + -1,iVar2);
|
|
iVar2 = iVar2 + 1;
|
|
} while (iVar2 < this->_gridHeight + -1);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0081f130
|
|
void Room::render_debug_grid_indices(Vector *renderOffset)
|
|
{
|
|
KColor color;
|
|
KColor color_00;
|
|
int columnGridIndex;
|
|
void *glyphQuads;
|
|
int gridWidth;
|
|
int iVar1;
|
|
int columnGridIndex;
|
|
double dVar3;
|
|
uint8_t glyphBuffer [16];
|
|
KColor lineColor;
|
|
uint32_t fontSettings;
|
|
uint32_t local_90;
|
|
uint32_t local_8c;
|
|
uint32_t local_88;
|
|
uint32_t local_84;
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
Vector lineEnd;
|
|
Vector local_70;
|
|
float local_68;
|
|
float local_64;
|
|
float local_60;
|
|
float local_5c;
|
|
uint8_t labelText [64];
|
|
uint32_t local_18;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01781;
|
|
local_10 = ExceptionList;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((labelText + 0x54));
|
|
ExceptionList = &local_10;
|
|
iVar1 = 0;
|
|
gridWidth = this->_gridWidth;
|
|
lineColor._unk = 0;
|
|
lineColor._red = 1.0;
|
|
lineColor._green = 1.0;
|
|
lineColor._blue = 0.0;
|
|
lineColor._alpha = 0.2;
|
|
if (0 < gridWidth) {
|
|
do {
|
|
if (((iVar1 < 0) || (gridWidth <= iVar1)) || (columnGridIndex = this->_gridHeight, columnGridIndex < 1)) {
|
|
columnGridIndex = this->_gridHeight;
|
|
columnGridIndex = -1;
|
|
}
|
|
else {
|
|
columnGridIndex = iVar1;
|
|
}
|
|
local_68 = g_displayPixelRatio * g_screenPointScale;
|
|
local_64 = ((((float)(columnGridIndex / gridWidth) * 40.0 + 120.0) - 20.0) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5;
|
|
local_5c = (((((float)(columnGridIndex % gridWidth) * 40.0 + 40.0) - 20.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * local_68 + 0.5;
|
|
dVar3 = floor((double)local_5c);
|
|
local_60 = (float)dVar3 / local_68;
|
|
local_5c = local_64 * local_68 + 0.5;
|
|
dVar3 = floor((double)local_5c);
|
|
local_5c = (float)dVar3;
|
|
lineEnd.x = local_60 + renderOffset->x;
|
|
local_70.y = local_5c / local_68 + renderOffset->y;
|
|
lineEnd.y = renderOffset->y + (float)columnGridIndex * 26.0 + local_5c / local_68;
|
|
local_70.x = lineEnd.x;
|
|
render_color_quad(&local_70,&lineEnd,&lineColor,&lineColor,1.0);
|
|
gridWidth = this->_gridWidth;
|
|
iVar1 = iVar1 + 1;
|
|
} while (iVar1 < gridWidth);
|
|
}
|
|
iVar1 = this->_gridHeight;
|
|
columnGridIndex = 0;
|
|
if (0 < iVar1) {
|
|
do {
|
|
gridWidth = this->_gridWidth;
|
|
if (((gridWidth < 1) || (columnGridIndex < 0)) || (iVar1 <= columnGridIndex)) {
|
|
iVar1 = -1;
|
|
}
|
|
else {
|
|
iVar1 = gridWidth * columnGridIndex;
|
|
}
|
|
local_68 = g_displayPixelRatio * g_screenPointScale;
|
|
local_5c = ((((float)(iVar1 / gridWidth) * 40.0 + 120.0) - 20.0) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5;
|
|
local_60 = (((((float)(iVar1 % gridWidth) * 40.0 + 40.0) - 20.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * local_68 + 0.5;
|
|
dVar3 = floor((double)local_60);
|
|
local_64 = (float)dVar3 / local_68;
|
|
local_60 = local_5c * local_68 + 0.5;
|
|
dVar3 = floor((double)local_60);
|
|
local_60 = (float)dVar3;
|
|
lineEnd.y = local_60 / local_68 + renderOffset->y;
|
|
local_70.x = local_64 + renderOffset->x;
|
|
lineEnd.x = renderOffset->x + (float)gridWidth * 26.0 + local_64;
|
|
local_70.y = lineEnd.y;
|
|
render_color_quad(&local_70,&lineEnd,&lineColor,&lineColor,1.0);
|
|
iVar1 = this->_gridHeight;
|
|
columnGridIndex = columnGridIndex + 1;
|
|
} while (columnGridIndex < iVar1);
|
|
gridWidth = this->_gridWidth;
|
|
}
|
|
local_68 = 0.0;
|
|
if (0 < gridWidth * iVar1) {
|
|
do {
|
|
local_5c = g_displayPixelRatio * g_screenPointScale;
|
|
local_70.y = (((float)(GHIDRA_INT(local_68) / gridWidth) * 40.0 + 120.0) - 140.0) * 0.65 +
|
|
(g_screenHeight - 182.0) * 0.5;
|
|
local_60 = local_5c *
|
|
((((float)(GHIDRA_INT(local_68) % gridWidth) * 40.0 + 40.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) + 0.5;
|
|
dVar3 = floor((double)local_60);
|
|
local_60 = (float)dVar3;
|
|
local_64 = local_60 / local_5c;
|
|
local_70.y = local_5c * local_70.y + 0.5;
|
|
dVar3 = floor((double)local_70.y);
|
|
local_70.y = (float)dVar3;
|
|
local_5c = local_70.y / local_5c;
|
|
sprintf_s(labelText,0x3f,s__d);
|
|
manager = g_manager;
|
|
fontSettings = 0;
|
|
local_90 = 0xffff;
|
|
local_8c = 0;
|
|
local_88 = 0x3f800000;
|
|
local_84 = 0xffffffff;
|
|
local_80 = 0;
|
|
local_7c = 0;
|
|
local_8 = 0;
|
|
local_70.y = (local_5c - 13.0) + renderOffset->y;
|
|
local_64 = local_64 - 13.0;
|
|
local_60 = local_64 + renderOffset->x;
|
|
glyphQuads = Font::measure_string
|
|
(&g_manager->_font2_TeamMeatEx12,&lineColor._green,labelText,
|
|
&fontSettings,&g_vectorOne);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
color._alpha = 0.2;
|
|
color._red = 1.0;
|
|
color._green = 1.0;
|
|
color._blue = 0.0;
|
|
color._unk = 0;
|
|
Font::render_glyph_quads
|
|
(&manager->_font2_TeamMeatEx12,glyphQuads,local_60,local_70.y,1.0,1.0,color,
|
|
&fontSettings);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
sprintf_s(labelText,0x3f,GHIDRA_CAST<uint8_t *>("%d,%d"));
|
|
manager = g_manager;
|
|
fontSettings = 0;
|
|
local_90 = 0xffff;
|
|
local_8c = 0;
|
|
local_88 = 0x3f800000;
|
|
local_84 = 0xffffffff;
|
|
local_80 = 0;
|
|
local_7c = 0;
|
|
local_8 = 2;
|
|
local_5c = local_5c + renderOffset->y;
|
|
local_64 = local_64 + renderOffset->x;
|
|
glyphQuads = Font::measure_string
|
|
(&g_manager->_font2_TeamMeatEx12,glyphBuffer,labelText,&fontSettings,
|
|
&g_vectorOne);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
|
color_00._alpha = 0.2;
|
|
color_00._red = 1.0;
|
|
color_00._green = 1.0;
|
|
color_00._blue = 0.0;
|
|
color_00._unk = 0;
|
|
Font::render_glyph_quads
|
|
(&manager->_font2_TeamMeatEx12,glyphQuads,local_64,local_5c,1.0,1.0,color_00,
|
|
&fontSettings);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
local_8 = 0xffffffff;
|
|
local_68 = (float)(GHIDRA_INT(local_68) + 1);
|
|
gridWidth = this->_gridWidth;
|
|
} while (GHIDRA_INT(local_68) < this->_gridHeight * gridWidth);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0081f890
|
|
uint8_t Room::IsLShapedRoom()
|
|
{
|
|
return *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U < 4;
|
|
}
|
|
|
|
// 0081f8b0
|
|
void * Room::GetLRoomAreaDesc(void *buffer)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
int bottomRightB;
|
|
int bottomRightA;
|
|
int topLeftA;
|
|
int bottomRightARow;
|
|
int gridWidth;
|
|
int bottomRightARow;
|
|
int bottomRightBRow;
|
|
int topLeftARow;
|
|
int topLeftBRow;
|
|
|
|
bottomRightARow = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48));
|
|
if (3 < bottomRightARow - 9U) {
|
|
fVar1 = (this->_topLeftPos).x;
|
|
fVar2 = (this->_topLeftPos).y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 4)) = (this->_topLeftPos).y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0xc)) = (this->_bottomRightPos).y;
|
|
fVar3 = (this->_topLeftPos).x;
|
|
*GHIDRA_CAST<float *>(buffer) = fVar1;
|
|
fVar1 = (this->_bottomRightPos).x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x10)) = fVar3;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x14)) = fVar2;
|
|
fVar2 = (this->_bottomRightPos).y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 8)) = fVar1;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x18)) = fVar1;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x1c)) = fVar2;
|
|
return buffer;
|
|
}
|
|
bottomRightARow = bottomRightARow * 0x20;
|
|
topLeftA = *GHIDRA_CAST<int *>((&DAT_00c35b80 + bottomRightARow));
|
|
bottomRightB = *GHIDRA_CAST<int *>((&DAT_00c35b98 + bottomRightARow));
|
|
topLeftBRow = *GHIDRA_CAST<int *>((&DAT_00c35b94 + bottomRightARow));
|
|
bottomRightBRow = *GHIDRA_CAST<int *>((&DAT_00c35b9c + bottomRightARow));
|
|
topLeftARow = *GHIDRA_CAST<int *>((&DAT_00c35b84 + bottomRightARow));
|
|
bottomRightA = *GHIDRA_CAST<int *>((&DAT_00c35b88 + bottomRightARow));
|
|
bottomRightARow = *GHIDRA_CAST<int *>((&DAT_00c35b8c + bottomRightARow));
|
|
bottomRightARow = *GHIDRA_CAST<int *>((&DAT_00c35b90 + bottomRightARow));
|
|
if ((((bottomRightB < 0) || (gridWidth = this->_gridWidth, gridWidth <= bottomRightB)) ||
|
|
(bottomRightBRow < 0)) || (this->_gridHeight <= bottomRightBRow)) {
|
|
gridWidth = this->_gridWidth;
|
|
bottomRightB = -1;
|
|
}
|
|
else {
|
|
bottomRightB = gridWidth * bottomRightBRow + bottomRightB;
|
|
}
|
|
if (((bottomRightARow < 0) || (gridWidth <= bottomRightARow)) ||
|
|
((topLeftBRow < 0 || (this->_gridHeight <= topLeftBRow)))) {
|
|
bottomRightARow = -1;
|
|
}
|
|
else {
|
|
bottomRightARow = gridWidth * topLeftBRow + bottomRightARow;
|
|
}
|
|
if (((bottomRightA < 0) || (gridWidth <= bottomRightA)) ||
|
|
((bottomRightARow < 0 || (this->_gridHeight <= bottomRightARow)))) {
|
|
bottomRightA = -1;
|
|
}
|
|
else {
|
|
bottomRightA = gridWidth * bottomRightARow + bottomRightA;
|
|
}
|
|
if ((((topLeftA < 0) || (gridWidth <= topLeftA)) || (topLeftARow < 0)) ||
|
|
(this->_gridHeight <= topLeftARow)) {
|
|
topLeftA = -1;
|
|
}
|
|
else {
|
|
topLeftA = gridWidth * topLeftARow + topLeftA;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 8)) = (float)(bottomRightA % gridWidth) * 40.0 + 40.0 + 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0xc)) = (float)(bottomRightA / gridWidth) * 40.0 + 120.0 + 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x10)) = ((float)(bottomRightARow % gridWidth) * 40.0 + 40.0) - 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x14)) = ((float)(bottomRightARow / gridWidth) * 40.0 + 120.0) - 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 4)) = ((float)(topLeftA / gridWidth) * 40.0 + 120.0) - 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x18)) = (float)(bottomRightB % gridWidth) * 40.0 + 40.0 + 20.0;
|
|
*GHIDRA_CAST<float *>(buffer) = ((float)(topLeftA % gridWidth) * 40.0 + 40.0) - 20.0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(buffer) + 0x1c)) = (float)(bottomRightB / gridWidth) * 40.0 + 120.0 + 20.0;
|
|
return buffer;
|
|
}
|
|
|
|
// 0081fb20
|
|
LRoomTileDesc * Room::GetLRoomTileDesc(LRoomTileDesc *buffer)
|
|
{
|
|
int shapeOffset;
|
|
|
|
shapeOffset = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) * 0x20;
|
|
*GHIDRA_CAST<uint32_t *>(buffer) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b80 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(buffer[1])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b84 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(buffer[2])) + 0x2)))) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b88 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>((buffer + 4)) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b8c + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(buffer[5])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b90 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(buffer[6])) + 0x2)))) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b94 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>((buffer + 8)) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b98 + shapeOffset));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(buffer[9])) + 0x1)))) = *GHIDRA_CAST<uint32_t *>((&DAT_00c35b9c + shapeOffset));
|
|
return buffer;
|
|
}
|
|
|
|
// 0081fd60
|
|
void Room::RespawnEnemies()
|
|
{
|
|
Room *door = this;
|
|
uint32_t *puVar1;
|
|
int *piVar2;
|
|
code *pcVar3;
|
|
uint8_t isSpawned;
|
|
char cVar4;
|
|
uint32_t uVar5;
|
|
void *freeBlock;
|
|
short *spawnEntry;
|
|
void **ppvVar6;
|
|
uint32_t *puVar7;
|
|
int iVar8;
|
|
uint8_t auStack_6c [8];
|
|
void *pvStack_64;
|
|
void *pvStack_60;
|
|
uint32_t *puStack_5c;
|
|
uint32_t *puStack_58;
|
|
uint8_t auStack_54 [4];
|
|
uint8_t auStack_50 [4];
|
|
void *pvStack_4c;
|
|
uint8_t auStack_48 [8];
|
|
void *spawnedEntitySet;
|
|
uint32_t uStack_3c;
|
|
void *respawnGridIdxSet;
|
|
int respawnCount;
|
|
int *piStack_30;
|
|
uint32_t rngShift3;
|
|
uint32_t i;
|
|
uint32_t *puStack_24;
|
|
void *pvStack_20;
|
|
int *roomData;
|
|
uint32_t gridIdx;
|
|
Entity *pEStack_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t uStack_8;
|
|
int currentRoomType;
|
|
GridEntity_Door *door;
|
|
int targetRoomType;
|
|
|
|
uStack_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b017cd;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x5c));
|
|
rngShift3 = 7;
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("SpawnRNG seed: %u\n"));
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4))));
|
|
piVar2 = *GHIDRA_CAST<int **>((iVar8 + 0x14));
|
|
roomData = *GHIDRA_CAST<int **>((iVar8 + 0x10));
|
|
if (((piVar2 != GHIDRA_CAST<int *>(0x0)) && (*piVar2 == 0)) && (piVar2[2] == 6)) {
|
|
roomData = piVar2;
|
|
}
|
|
*GHIDRA_CAST<int *>((iVar8 + 0x40)) = *GHIDRA_CAST<int *>((iVar8 + 0x40)) + 1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x1))) = 0;
|
|
respawnGridIdxSet = (void *)0x0;
|
|
respawnCount = 0;
|
|
respawnGridIdxSet = operator_new(0x14);
|
|
*(void **)respawnGridIdxSet = respawnGridIdxSet;
|
|
*(void **)(GHIDRA_CAST<char *>(respawnGridIdxSet) + 4) = respawnGridIdxSet;
|
|
*(void **)(GHIDRA_CAST<char *>(respawnGridIdxSet) + 8) = respawnGridIdxSet;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(respawnGridIdxSet) + 0xc)) = 0x101;
|
|
uStack_8 = 0;
|
|
spawnedEntitySet = (void *)0x0;
|
|
uStack_3c = 0;
|
|
spawnedEntitySet = operator_new(0x14);
|
|
*(void **)spawnedEntitySet = spawnedEntitySet;
|
|
*(void **)(GHIDRA_CAST<char *>(spawnedEntitySet) + 4) = spawnedEntitySet;
|
|
*(void **)(GHIDRA_CAST<char *>(spawnedEntitySet) + 8) = spawnedEntitySet;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(spawnedEntitySet) + 0xc)) = 0x101;
|
|
puVar7 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
pvStack_20 = (void *)0x0;
|
|
pvStack_60 = (void *)0x0;
|
|
puStack_5c = GHIDRA_CAST<uint32_t *>(0x0);
|
|
puStack_24 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
puStack_58 = GHIDRA_CAST<uint32_t *>(0x0);
|
|
uStack_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_8)) + 0x1))),2);
|
|
i = 0;
|
|
if ((short)roomData[0x11] != 0) {
|
|
pvStack_20 = (void *)0x0;
|
|
do {
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar3 = (code *)swi(3);
|
|
(*pcVar3)();
|
|
return;
|
|
}
|
|
uVar5 = uVar5 >> 2 ^ uVar5;
|
|
uVar5 = uVar5 << 7 ^ uVar5;
|
|
uVar5 = uVar5 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar5;
|
|
spawnEntry = GHIDRA_CAST<short *>((roomData[0x10] + GHIDRA_INT(pvStack_20)));
|
|
gridIdx = *spawnEntry + 1 + (spawnEntry[1] + 1) * door->_gridWidth;
|
|
if ((char)spawnEntry[4] != '\0') {
|
|
piStack_30 = (GHIDRA_CAST<Spawn *>((spawnEntry)))->Spawn::PickEntry((float)((double)GHIDRA_INT(uVar5) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) *
|
|
2.3283062e-10);
|
|
pEStack_14 = GHIDRA_CAST<Entity *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x80));
|
|
msvc::set<int>::find_node(auStack_6c,&gridIdx);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvStack_64) + 0xd)) != '\0') ||
|
|
(GHIDRA_INT(gridIdx) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvStack_64) + 0x10)))) ||
|
|
(pvStack_64 == *(void **)pEStack_14)) {
|
|
pEStack_14 = GHIDRA_CAST<Entity *>(0x0);
|
|
isSpawned = SpawnEntry(door,gridIdx,piStack_30,uVar5,&pEStack_14,1);
|
|
if ((isSpawned != 0) && (pEStack_14 != GHIDRA_CAST<Entity *>(0x0))) {
|
|
msvc::set<int>::insert(auStack_48,&gridIdx);
|
|
FUN_008284a0(auStack_50,&pEStack_14);
|
|
if (puVar7 == puStack_24) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(puVar7,&pEStack_14);
|
|
puStack_24 = puStack_58;
|
|
puVar7 = puStack_5c;
|
|
}
|
|
else {
|
|
*puVar7 = pEStack_14;
|
|
puStack_5c = puVar7 + 1;
|
|
puVar7 = puStack_5c;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
pvStack_20 = (void *)(GHIDRA_INT(pvStack_20) + 0x10);
|
|
i = i + 1;
|
|
} while (i < *GHIDRA_CAST<uint16_t *>((roomData + 0x11)));
|
|
pvStack_20 = pvStack_60;
|
|
}
|
|
uVar5 = GHIDRA_INT(puVar7) - GHIDRA_INT(pvStack_20) >> 2;
|
|
i = 0;
|
|
pvStack_60 = pvStack_20;
|
|
if (uVar5 != 0) {
|
|
do {
|
|
piVar2 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvStack_20) + i * 4));
|
|
(**(code **)(*piVar2 + 0xc))();
|
|
cVar4 = (**(code **)(*piVar2 + 0x48))();
|
|
if (cVar4 != '\0') {
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x44));
|
|
*puVar1 = *puVar1 & 0xfffffffe;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x44));
|
|
*puVar1 = *puVar1 & 0xffffff7f;
|
|
}
|
|
i = i + 1;
|
|
} while (i < uVar5);
|
|
}
|
|
if (respawnCount == 0) {
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0x4)))) + 0x44));
|
|
*puVar1 = *puVar1 | 1;
|
|
}
|
|
else {
|
|
uVar5 = 0;
|
|
if ((door->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
piVar2 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((door->_entityList)._updateEL)) + 0x4)))) + uVar5 * 4));
|
|
piStack_30 = piVar2;
|
|
_Find_lower_bound<>(auStack_6c,&piStack_30);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvStack_64) + 0xd)) != '\0') ||
|
|
(piVar2 < *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvStack_64) + 0x10)))) || (pvStack_64 == spawnedEntitySet)) {
|
|
piStack_30 = GHIDRA_CAST<int *>(piVar2[0xcb]);
|
|
msvc::set<int>::find_node(auStack_54,&piStack_30);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvStack_4c) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvStack_4c) + 0x10)) <= piVar2[0xcb])) &&
|
|
(pvStack_4c != respawnGridIdxSet)) {
|
|
(**(code **)(*piVar2 + 0x28))();
|
|
}
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < GHIDRA_UINT((door->_entityList)._updateEL._size));
|
|
}
|
|
ppvVar6 = door->_doors;
|
|
iVar8 = 8;
|
|
do {
|
|
door = *ppvVar6;
|
|
if ((door != GHIDRA_CAST<GridEntity_Door *>(0x0)) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) != 1)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((door)) + 0xc)))) = 1;
|
|
(GHIDRA_CAST<GridEntity_Door *>((door)))->GridEntity_Door::UpdateAnimation();
|
|
currentRoomType = door->_currentRoomType;
|
|
if ((currentRoomType == 7) ||
|
|
((((targetRoomType = door->_targetRoomType, targetRoomType == 7 || (currentRoomType == 8)
|
|
) || (targetRoomType == 8)) || ((currentRoomType == 0x1d || (targetRoomType == 0x1d)))
|
|
))) {
|
|
(GHIDRA_CAST<msvc::string *>(((door->_openAnimation)._buf)))->msvc::string::assign(s_Open,4);
|
|
}
|
|
}
|
|
ppvVar6 = ppvVar6 + 1;
|
|
iVar8 = iVar8 + -1;
|
|
} while (iVar8 != 0);
|
|
}
|
|
if (pvStack_20 != (void *)0x0) {
|
|
uVar5 = GHIDRA_INT(puStack_24) - GHIDRA_INT(pvStack_20) & 0xfffffffc;
|
|
freeBlock = pvStack_20;
|
|
if (0xfff < uVar5) {
|
|
freeBlock = *(void **)(GHIDRA_CAST<char *>(pvStack_20) + -4);
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvStack_20) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,uVar5);
|
|
}
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&spawnedEntitySet,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&spawnedEntitySet,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(spawnedEntitySet) + 4));
|
|
operator_delete(spawnedEntitySet,0x14);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&respawnGridIdxSet,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&respawnGridIdxSet,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(respawnGridIdxSet) + 4));
|
|
operator_delete(respawnGridIdxSet,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00820170
|
|
uint8_t Room::TrySpawnBlueWombDoor(uint8_t isFirstTime, uint8_t isIgnoreTime, uint8_t isForce)
|
|
{
|
|
code *pcVar1;
|
|
uint64_t qVar2;
|
|
uint8_t isHasTrinket;
|
|
RoomDescriptor *currentRoom;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
ChallengeParam *pCVar3;
|
|
int iVar4;
|
|
void *door;
|
|
void **doorSlot;
|
|
uint32_t uVar5;
|
|
int effectiveStage;
|
|
uint32_t uVar6;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t *flagsHigh;
|
|
Game *game;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01801;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((isForce != 0) ||
|
|
((g_game->_challenge != 0x2c &&
|
|
(((g_manager->_persistentGameData)._achievements[0xea] != 0 ||
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))))))) {
|
|
isHasTrinket = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0xaf);
|
|
if (isHasTrinket != 0) {
|
|
isIgnoreTime = 1;
|
|
}
|
|
if ((isForce == 0) &&
|
|
(currentRoom = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1),
|
|
currentRoom->ListIndex != g_game->_lastBossRoomListIdx)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
uVar6 = g_game->_debugCurses;
|
|
iVar4 = g_game->_stage;
|
|
uVar5 = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
game = g_game;
|
|
effectiveStage = iVar4 + 1;
|
|
if ((~preventedCurses & (forcedCurses | uVar6 | uVar5) & 2) == 0) {
|
|
effectiveStage = iVar4;
|
|
}
|
|
pCVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if ((isForce != 0) ||
|
|
((((pCVar3->_isPathTypeSet == 0 || (effectiveStage < pCVar3->_endStage)) &&
|
|
(effectiveStage == 8)) && ((game->_stageType != 4 && (game->_stageType != 5)))))) {
|
|
iVar4 = 0;
|
|
doorSlot = this->_doors;
|
|
do {
|
|
if ((*doorSlot != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_INT(*doorSlot) + 0x394)) == -8)) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
iVar4 = iVar4 + 1;
|
|
doorSlot = doorSlot + 1;
|
|
} while (iVar4 < 8);
|
|
if (((game->_timeCounter <= game->_blueWombParTime) || (isIgnoreTime != 0)) || (isForce != 0))
|
|
{
|
|
uVar6 = game->_enterDoor;
|
|
if (((game->_lastRoomIdx != -8) || (GHIDRA_INT(uVar6) < 0)) || (this->_doors[uVar6] != (void *)0x0)
|
|
) {
|
|
uVar5 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
isHasTrinket = (*pcVar1)();
|
|
return isHasTrinket;
|
|
}
|
|
uVar5 = uVar5 >> 1 ^ uVar5;
|
|
iVar4 = 0;
|
|
uVar5 = uVar5 << 0xb ^ uVar5;
|
|
do {
|
|
uVar6 = iVar4 + ((uVar5 >> 0x10 ^ uVar5) & 7) & 0x80000007;
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
uVar6 = (uVar6 - 1 | 0xfffffff8) + 1;
|
|
}
|
|
} while ((((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x38 + (uVar6 >> 5) * 4))
|
|
& 1 << ((uint8_t)uVar6 & 0x1f)) == 0) || (this->_doors[uVar6] != (void *)0x0)) &&
|
|
(iVar4 = iVar4 + 1, iVar4 < 8));
|
|
if (GHIDRA_INT(uVar6) < 0) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard), g_invalidRoomDescriptorGuard == -1))
|
|
{
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
door = this->_doors[uVar6];
|
|
if (door == (void *)0x0) {
|
|
MakeDoor(this,uVar6);
|
|
door = this->_doors[uVar6];
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(door) + 0x394)) = 0xfffffff8;
|
|
GridEntity_Door::SetRoomTypes
|
|
(this->_doors[uVar6],*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)),1);
|
|
(GHIDRA_CAST<GridEntity_Door *>((this->_doors[uVar6])))->GridEntity_Door::Open();
|
|
if (isFirstTime != 0) {
|
|
(GHIDRA_CAST<GridEntity_Door *>((this->_doors[uVar6])))->GridEntity_Door::SpawnDust();
|
|
}
|
|
game = g_game;
|
|
qVar2 = g_game->_gameStateFlags;
|
|
flagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&g_game->_gameStateFlags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x80;
|
|
*GHIDRA_CAST<int *>(&game->_gameStateFlags) = GHIDRA_INT(qVar2);
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
|
|
// 008204b0
|
|
uint8_t Room::TrySpawnTheVoidDoor(uint8_t isForce)
|
|
{
|
|
Room *game = this;
|
|
uint32_t debugCurses;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
ChallengeParam *challengeParams;
|
|
void *voidDoor;
|
|
int iVar2;
|
|
int endStage;
|
|
int effectiveStage;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t curses;
|
|
uint32_t debugCurses;
|
|
Game *game;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01831;
|
|
local_10 = ExceptionList;
|
|
debugCurses = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
if ((isForce == 0) && (g_game->_challenge == 0x2c)) {
|
|
return 0;
|
|
}
|
|
debugCurses = g_game->_debugCurses;
|
|
iVar2 = g_game->_stage;
|
|
curses = g_game->_curses;
|
|
ExceptionList = &local_10;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
game = g_game;
|
|
effectiveStage = iVar2 + 1;
|
|
if ((~preventedCurses & (forcedCurses | debugCurses | curses) & 2) == 0) {
|
|
effectiveStage = iVar2;
|
|
}
|
|
if (isForce == 0) {
|
|
if (effectiveStage != 9) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x4)))) + 0x10)) + 8)) != 5) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if (g_game->_currentRoomIdx < 0) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) goto LAB_00820601;
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
iVar2 = 0xc;
|
|
if ((challengeParams->_endStage != 0xc) &&
|
|
(((game->_challenge != 0 || ((game->_dailyChallenge)._id != 0)) ||
|
|
(((g_manager->_persistentGameData)._achievements[0x140] == 0 &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 || (game->_isDebug == 0)))))))) {
|
|
iVar2 = 0xb;
|
|
}
|
|
endStage = iVar2;
|
|
if (challengeParams->_isPathTypeSet != 0) {
|
|
endStage = challengeParams->_endStage;
|
|
if (challengeParams->_endStage == 0) {
|
|
endStage = iVar2;
|
|
}
|
|
if (challengeParams->_pathType == 3) goto LAB_00820601;
|
|
}
|
|
if ((endStage < 0xc) || ((game->_levelStateFlags & 0x200000U) != 0)) goto LAB_00820601;
|
|
}
|
|
challengeParams = (GHIDRA_CAST<Game *>((game)))->Game::GetChallengeParams();
|
|
if ((isForce != 0) ||
|
|
((challengeParams->_isPathTypeSet == 0 || (effectiveStage < challengeParams->_endStage)))) {
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(ThreadLocalStoragePointer) + 0xc)) < g_invalidRoomDescriptorGuard) &&
|
|
(_Init_thread_header(&g_invalidRoomDescriptorGuard,debugCurses), g_invalidRoomDescriptorGuard == -1
|
|
)) {
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<RoomDescriptor *>((&g_roomDescriptorDummy)))->RoomDescriptor::constructor();
|
|
_atexit(FUN_00b15b30);
|
|
local_8 = 0xffffffff;
|
|
_Init_thread_footer(&g_invalidRoomDescriptorGuard);
|
|
}
|
|
voidDoor = game->_doors[5];
|
|
if (voidDoor == (void *)0x0) {
|
|
MakeDoor(game,5);
|
|
voidDoor = game->_doors[5];
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(voidDoor) + 0x394)) = 0xfffffff7;
|
|
GridEntity_Door::SetRoomTypes
|
|
(game->_doors[5],*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x4)))) + 0x10)) + 8)),1);
|
|
(GHIDRA_CAST<GridEntity_Door *>((game->_doors[5])))->GridEntity_Door::Open();
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
LAB_00820601:
|
|
game->_levelStateFlags = game->_levelStateFlags | 0x200000;
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
|
|
// 00820720
|
|
uint32_t Room::GetBossVictoryJingle()
|
|
{
|
|
int secretExitKind;
|
|
uint32_t jingleId;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
if ((g_game->_stage != 0xd) || (g_game->_stageType != 1)) {
|
|
secretExitKind = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::get_secret_exit_kind();
|
|
if ((secretExitKind != 4) || (game->_currentRoomIdx != -10)) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) == 6) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(game->_room) + 0x7228)) != '\0')) {
|
|
return 0x5c;
|
|
}
|
|
if ((game->_stageType == 4) || (game->_stageType == 5)) {
|
|
return 0x2a;
|
|
}
|
|
jingleId = 0x53;
|
|
if ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 6 & 1) != 0) {
|
|
jingleId = 0x61;
|
|
}
|
|
return jingleId;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 008208c0
|
|
bool Room::HasWater()
|
|
{
|
|
return 0.0 < this->_waterAmount;
|
|
}
|
|
|
|
// 008208e0
|
|
uint8_t Room::IsCurrentRoomLastBoss()
|
|
{
|
|
RoomDescriptor *roomDesc;
|
|
|
|
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1);
|
|
return roomDesc->ListIndex == g_game->_lastBossRoomListIdx;
|
|
}
|
|
|
|
// 00820910
|
|
void Room::MamaMegaExplosion(Vector *position, Entity_Player *player)
|
|
{
|
|
float fVar1;
|
|
uint32_t seed;
|
|
Entity *explosion;
|
|
Entity_Player *firstPlayer;
|
|
float distance;
|
|
float offsetY;
|
|
float offsetX;
|
|
uint32_t *roomFlags;
|
|
int vtable;
|
|
|
|
roomFlags = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
*roomFlags = *roomFlags | 0x4000;
|
|
seed = Random();
|
|
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
}
|
|
explosion = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x7f,position,&g_vectorZero,GHIDRA_CAST<Entity *>(player),0,seed,0);
|
|
if ((position->x != g_vectorZero.x) || (position->y != g_vectorZero.y)) {
|
|
fVar1 = position->y;
|
|
vtable = *GHIDRA_CAST<int *>(explosion);
|
|
(explosion->_targetPosition).x = position->x;
|
|
(explosion->_targetPosition).y = fVar1;
|
|
(**(code **)(vtable + 0xc))();
|
|
return;
|
|
}
|
|
firstPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
fVar1 = (firstPlayer->_pos).x;
|
|
offsetX = fVar1 - (((this->_bottomRightPos).x - (this->_topLeftPos).x) * 0.5 +
|
|
(this->_topLeftPos).x);
|
|
offsetY = (firstPlayer->_pos).y -
|
|
(((this->_bottomRightPos).y - (this->_topLeftPos).y) * 0.5 + (this->_topLeftPos).y);
|
|
distance = sqrtf(offsetY * offsetY + offsetX * offsetX);
|
|
if (0.0 < distance) {
|
|
offsetX = offsetX * (200.0 / distance);
|
|
offsetY = offsetY * (200.0 / distance);
|
|
}
|
|
vtable = *GHIDRA_CAST<int *>(explosion);
|
|
(explosion->_targetPosition).y = offsetY + (firstPlayer->_pos).y;
|
|
(explosion->_targetPosition).x = fVar1 + offsetX;
|
|
(**(code **)(vtable + 0xc))();
|
|
return;
|
|
}
|
|
|
|
// 00820aa0
|
|
int Room::GetDungeonRockIdx()
|
|
{
|
|
if ((g_game->_levelStateFlags & 0x2000U) == 0) {
|
|
return this->_dungeonRockIdx;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
// 00820ac0
|
|
void Room::TurnGold()
|
|
{
|
|
uint32_t GridIndex;
|
|
void **gridSlot;
|
|
GridEntityDesc goldDesc;
|
|
uint32_t local_b0;
|
|
uint32_t uStack_ac;
|
|
uint32_t local_a8;
|
|
uint32_t local_9c [8];
|
|
uint32_t local_7c;
|
|
uint32_t uStack_78;
|
|
uint32_t local_74;
|
|
uint32_t local_70 [12];
|
|
uint32_t local_40 [15];
|
|
void *gridEntity;
|
|
|
|
local_b0 = 0;
|
|
uStack_ac = 0;
|
|
local_a8 = 0;
|
|
local_7c = 0;
|
|
uStack_78 = 0;
|
|
local_74 = 0;
|
|
if (&this->_floorColor != GHIDRA_CAST<ColorMod *>(local_70)) {
|
|
(this->_floorColor)._offset[0] = 0.0;
|
|
(this->_floorColor)._offset[1] = 0.0;
|
|
(this->_floorColor)._tint[0] = 1.0;
|
|
(this->_floorColor)._tint[1] = 1.0;
|
|
(this->_floorColor)._tint[2] = 1.0;
|
|
(this->_floorColor)._tint[3] = 1.0;
|
|
(this->_floorColor)._offset[2] = 0.0;
|
|
(this->_floorColor)._colorize[0] = 5.0;
|
|
(this->_floorColor)._colorize[1] = 3.0;
|
|
(this->_floorColor)._colorize[2] = 0.0;
|
|
(this->_floorColor)._colorize[3] = 0.8;
|
|
}
|
|
if (&this->_wallColor != GHIDRA_CAST<ColorMod *>(local_40)) {
|
|
(this->_wallColor)._offset[0] = 0.0;
|
|
(this->_wallColor)._offset[1] = 0.0;
|
|
(this->_wallColor)._tint[0] = 1.0;
|
|
(this->_wallColor)._tint[1] = 1.0;
|
|
(this->_wallColor)._tint[2] = 1.0;
|
|
(this->_wallColor)._tint[3] = 1.0;
|
|
(this->_wallColor)._offset[2] = 0.0;
|
|
(this->_wallColor)._colorize[0] = 5.0;
|
|
(this->_wallColor)._colorize[1] = 3.0;
|
|
(this->_wallColor)._colorize[2] = 0.0;
|
|
(this->_wallColor)._colorize[3] = 0.8;
|
|
}
|
|
GridIndex = 0;
|
|
gridSlot = this->_gridEntities;
|
|
do {
|
|
if ((GridIndex < 0x1c0) && (gridEntity = *gridSlot, gridEntity != (void *)0x0)) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 4)) == 0xe) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 8)) != 3) {
|
|
goldDesc._type = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 4));
|
|
goldDesc._state = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0xc));
|
|
goldDesc._spawnCount = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0x10));
|
|
goldDesc._variant = 3;
|
|
goldDesc._spawnSeed = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0x14));
|
|
goldDesc._varData = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0x18));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(goldDesc)) + 0x18))) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x1c));
|
|
goldDesc._variableSeed = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0x20));
|
|
SpawnGridEntityDesc(this,GridIndex,&goldDesc);
|
|
}
|
|
}
|
|
else if (GHIDRA_CAST<uint32_t *>((GHIDRA_INT(gridEntity) + 0xe8)) != local_9c) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x108)) = local_7c;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x10c)) = uStack_78;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xe8)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xec)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xf0)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xf4)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x110)) = local_74;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xf8)) = 0x40400000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xfc)) = 0x3fe66666;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x100)) = 0;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0x104)) = 0x3f4ccccd;
|
|
}
|
|
}
|
|
GridIndex = GridIndex + 1;
|
|
gridSlot = gridSlot + 1;
|
|
} while (GHIDRA_INT(GridIndex) < 0x1c0);
|
|
return;
|
|
}
|
|
|
|
// 00820c00
|
|
Vector * Room::WorldToScreenPosition(Vector *outPosition, float x, float y)
|
|
{
|
|
float pixelScale;
|
|
double dVar1;
|
|
double dVar2;
|
|
float scrollY;
|
|
float shakeY;
|
|
|
|
pixelScale = g_displayPixelRatio * g_screenPointScale;
|
|
dVar1 = floor((double)(((g_screenWidth - 338.0) * 0.5 + (x - 60.0) * 0.65) * pixelScale + 0.5));
|
|
dVar2 = floor((double)(((g_screenHeight - 182.0) * 0.5 + (y - 140.0) * 0.65) * pixelScale + 0.5));
|
|
scrollY = (this->_renderScrollOffset).y;
|
|
shakeY = (g_game->_screenShakeOffset).y;
|
|
outPosition->x =
|
|
(float)dVar1 / pixelScale + (this->_renderScrollOffset).x + (g_game->_screenShakeOffset).x;
|
|
outPosition->y = (float)dVar2 / pixelScale + scrollY + shakeY;
|
|
return outPosition;
|
|
}
|
|
|
|
// 00820d30
|
|
void Room::record_killed_npc(int param_1)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
uint16_t subtype16;
|
|
int iVar3;
|
|
Vector *freePos;
|
|
int *node;
|
|
Room *in_ECX;
|
|
int npcType;
|
|
uint32_t uStack_48;
|
|
Vector local_44;
|
|
uint32_t championColor;
|
|
uint32_t local_38;
|
|
uint32_t local_34;
|
|
Vector local_30;
|
|
float posX;
|
|
uint8_t isFriendly;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t championColorCopy;
|
|
uint32_t listSize;
|
|
uint32_t *prevNode;
|
|
uint16_t variant16;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0185d;
|
|
local_1c = ExceptionList;
|
|
npcType = *GHIDRA_CAST<int *>((param_1 + 0x28));
|
|
if (npcType < 0xd9) {
|
|
if (npcType == 0xd8) {
|
|
return;
|
|
}
|
|
switch(npcType) {
|
|
case 0x13:
|
|
case 0x1c:
|
|
case 0x23:
|
|
case 0x3e:
|
|
case 0x59:
|
|
goto switchD_00820d91_caseD_13;
|
|
}
|
|
switchD_00820d91_caseD_14:
|
|
if (npcType == 0x199) {
|
|
iVar3 = *GHIDRA_CAST<int *>((param_1 + 0x2c));
|
|
goto joined_r0x00820dc1;
|
|
}
|
|
}
|
|
else {
|
|
if (0x38d < npcType) {
|
|
if (npcType == 0x390) {
|
|
return;
|
|
}
|
|
if (npcType == 0x396) {
|
|
return;
|
|
}
|
|
goto switchD_00820d91_caseD_14;
|
|
}
|
|
if (npcType == 0x38d) {
|
|
return;
|
|
}
|
|
if (npcType == 0xef) {
|
|
return;
|
|
}
|
|
if (npcType == 0xf4) {
|
|
if (*GHIDRA_CAST<int *>((param_1 + 0x2c)) == 2) {
|
|
return;
|
|
}
|
|
goto switchD_00820d91_caseD_14;
|
|
}
|
|
if (npcType != 0x194) goto switchD_00820d91_caseD_14;
|
|
iVar3 = *GHIDRA_CAST<int *>((param_1 + 0x2c));
|
|
joined_r0x00820dc1:
|
|
if (iVar3 == 1) {
|
|
return;
|
|
}
|
|
}
|
|
local_34 = *GHIDRA_CAST<uint32_t *>((param_1 + 0x2c));
|
|
local_44.x = *GHIDRA_CAST<float *>((param_1 + 0x33c));
|
|
local_38 = *GHIDRA_CAST<uint32_t *>((param_1 + 0x30));
|
|
championColor = *GHIDRA_CAST<uint32_t *>((param_1 + 0x3ec));
|
|
isFriendly = (*GHIDRA_CAST<uint32_t *>((param_1 + 0x168)) & 0x20000000) != 0;
|
|
local_44.y = *GHIDRA_CAST<float *>((param_1 + 0x340));
|
|
if (npcType == 0x23) {
|
|
npcType = 0xb;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
local_30.y = local_44.y;
|
|
posX = local_44.x;
|
|
iVar3 = GetGridCollisionAtPos(in_ECX,*GHIDRA_CAST<Vector *>((param_1 + 0x33c)));
|
|
if (iVar3 != 0) {
|
|
freePos = FindFreeTilePosition(in_ECX,&local_30,&local_44,40.0);
|
|
posX = freePos->x;
|
|
local_30.y = freePos->y;
|
|
}
|
|
listSize = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304))));
|
|
championColorCopy = championColor;
|
|
fVar1 = local_30.y;
|
|
fVar2 = posX;
|
|
while (championColor = championColorCopy, local_30.y = fVar1, posX = fVar2, 0x1f < listSize) {
|
|
node = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7300)))) + 4));
|
|
iVar3 = *node;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304)))) + -1;
|
|
*GHIDRA_CAST<int *>(node[1]) = iVar3;
|
|
*GHIDRA_CAST<int *>((iVar3 + 4)) = node[1];
|
|
operator_delete(node,0x20);
|
|
championColorCopy = championColor;
|
|
fVar1 = local_30.y;
|
|
fVar2 = posX;
|
|
listSize = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304))));
|
|
}
|
|
variant16 = (uint16_t)local_34;
|
|
subtype16 = (uint16_t)local_38;
|
|
uStack_48 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_48)) + 0x1))),isFriendly);
|
|
iVar3 = **GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7300))));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304)))) == 0x7ffffff) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::_Xlength_error("list too long");
|
|
}
|
|
local_14 = 0;
|
|
local_44.y = 0.0;
|
|
local_44.x = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7300)));
|
|
node = operator_new(0x20);
|
|
node[2] = GHIDRA_INT(fVar2);
|
|
node[3] = GHIDRA_INT(fVar1);
|
|
node[4] = npcType;
|
|
node[5] = CONCAT22(subtype16,variant16);
|
|
*GHIDRA_CAST<uint64_t *>((node + 6)) = CONCAT44(uStack_48,championColorCopy);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((in_ECX)) + 0x7304)))) + 1;
|
|
prevNode = *GHIDRA_CAST<uint32_t **>((iVar3 + 4));
|
|
*node = iVar3;
|
|
node[1] = GHIDRA_INT(prevNode);
|
|
*GHIDRA_CAST<int **>((iVar3 + 4)) = node;
|
|
*prevNode = node;
|
|
switchD_00820d91_caseD_13:
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00820fd0
|
|
void Room::render_water()
|
|
{
|
|
EntityList *this_00;
|
|
void *pvVar1;
|
|
ColorMod color;
|
|
uint32_t uVar2;
|
|
uint32_t uVar3;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
uint32_t uVar6;
|
|
uint32_t uVar7;
|
|
uint32_t uVar8;
|
|
uint32_t uVar9;
|
|
uint32_t uVar10;
|
|
LayerState *layer;
|
|
int iVar11;
|
|
float fVar12;
|
|
Room *pRVar13;
|
|
int *piVar14;
|
|
uint32_t *renderTargetEntry;
|
|
uint32_t hashChar;
|
|
uint8_t lowerChar;
|
|
uint32_t uVar15;
|
|
Room *room;
|
|
float gridCount;
|
|
int iVar16;
|
|
void **gridEntityIt;
|
|
char *shaderNameChar;
|
|
float brightness;
|
|
double dVar17;
|
|
Color aCStackY_16d8 [128];
|
|
Color tintedFloorColor;
|
|
int savedBlendMode0;
|
|
int savedBlendMode1;
|
|
int savedBlendMode2;
|
|
int savedBlendMode3;
|
|
Vector renderOffsetX;
|
|
float savedShakeY;
|
|
float savedShakeX;
|
|
int savedBlendMode4;
|
|
Room *local_20;
|
|
uint8_t local_1c;
|
|
uint32_t local_18;
|
|
float local_14;
|
|
Game *game;
|
|
uint8_t shaderChar;
|
|
|
|
fVar12 = g_vectorZero.y;
|
|
game = g_game;
|
|
if ((0.0 < this->_waterAmount) && ((g_manager->_optionsConfig)._enableWaterSurface != 0)) {
|
|
gridCount = (float)(this->_gridWidth * this->_gridHeight);
|
|
savedShakeX = (g_game->_screenShakeOffset).x;
|
|
savedShakeY = (g_game->_screenShakeOffset).y;
|
|
(g_game->_screenShakeOffset).x = g_vectorZero.x;
|
|
(game->_screenShakeOffset).y = fVar12;
|
|
local_20 = this;
|
|
local_14 = gridCount;
|
|
FUN_00683680();
|
|
savedBlendMode0 = g_graphicsManager_blendMode[0];
|
|
savedBlendMode1 = g_graphicsManager_blendMode[1];
|
|
savedBlendMode2 = g_graphicsManager_blendMode[2];
|
|
savedBlendMode3 = g_graphicsManager_blendMode[3];
|
|
savedBlendMode4 = g_graphicsManager_blendMode[4];
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c797f4,0);
|
|
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd;
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
if ((this->_backdropType == 0x2d) && (fVar12 = this->_waterAmount, 0.0 < fVar12)) {
|
|
(GHIDRA_CAST<Color *>((&tintedFloorColor)))->Color::operator_assign(&this->_floorColor);
|
|
brightness = fVar12 * 0.6 + 1.0;
|
|
tintedFloorColor._tint[0] = tintedFloorColor._tint[0] * brightness;
|
|
tintedFloorColor._tint[1] = tintedFloorColor._tint[1] * brightness;
|
|
tintedFloorColor._tint[2] = tintedFloorColor._tint[2] * brightness;
|
|
tintedFloorColor._offset[0] = fVar12 * 0.08 + tintedFloorColor._offset[0];
|
|
tintedFloorColor._offset[1] = fVar12 * 0.06 + tintedFloorColor._offset[1];
|
|
tintedFloorColor._offset[2] = fVar12 * 0.03 + tintedFloorColor._offset[2];
|
|
(GHIDRA_CAST<Color *>((aCStackY_16d8 + 0x81)))->Color::operator_assign(GHIDRA_CAST<ColorMod *>(&tintedFloorColor));
|
|
}
|
|
Backdrop::RenderFloor(&g_vectorZero);
|
|
if (0 < GHIDRA_INT(gridCount)) {
|
|
gridEntityIt = this->_gridEntities;
|
|
local_18 = GHIDRA_UINT(local_14);
|
|
do {
|
|
piVar14 = *gridEntityIt;
|
|
if ((piVar14 != GHIDRA_CAST<int *>(0x0)) && (piVar14[1] == 1)) {
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(**(code **)(*piVar14 + 0xc))();
|
|
}
|
|
gridEntityIt = gridEntityIt + 1;
|
|
local_18 = local_18 - 1;
|
|
} while (local_18 != 0);
|
|
local_18 = 0;
|
|
gridCount = local_14;
|
|
}
|
|
(this->_entityList)._renderCursor = 0;
|
|
(this->_entityList)._renderMode = 4;
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((&this->_entityList)))->EntityList::render_up_to(5000,&renderOffsetX);
|
|
uVar2 = (this->_floorColor)._tint[0];
|
|
uVar3 = (this->_floorColor)._tint[1];
|
|
uVar4 = (this->_floorColor)._tint[2];
|
|
uVar5 = (this->_floorColor)._tint[3];
|
|
uVar6 = (this->_floorColor)._colorize[0];
|
|
uVar7 = (this->_floorColor)._colorize[1];
|
|
uVar8 = (this->_floorColor)._colorize[2];
|
|
uVar9 = (this->_floorColor)._colorize[3];
|
|
uVar10 = (this->_floorColor)._offset[0];
|
|
color._offset[0] = (float)uVar10;
|
|
color._colorize[3] = (float)uVar9;
|
|
color._colorize[2] = (float)uVar8;
|
|
color._colorize[1] = (float)uVar7;
|
|
color._colorize[0] = (float)uVar6;
|
|
color._tint[3] = (float)uVar5;
|
|
color._tint[2] = (float)uVar4;
|
|
color._tint[1] = (float)uVar3;
|
|
color._tint[0] = (float)uVar2;
|
|
color._offset[1] = (float)GHIDRA_INT(((uint64_t)*GHIDRA_CAST<uint64_t *>((this->_floorColor)._offset) >> 0x20));
|
|
color._offset[2] = (this->_floorColor)._offset[2];
|
|
(GHIDRA_CAST<Backdrop *>((GHIDRA_CAST<Backdrop *>(&this->_backdrop))))->Backdrop::RenderWalls(&g_vectorZero,color);
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<RailManager *>((&this->_railManager)))->RailManager::Render(&renderOffsetX);
|
|
if (0 < GHIDRA_INT(gridCount)) {
|
|
gridEntityIt = this->_gridEntities;
|
|
do {
|
|
if ((*gridEntityIt != GHIDRA_CAST<int *>(0x0)) &&
|
|
((**(code **)(*GHIDRA_CAST<int *>(*gridEntityIt) + 0x18))(), (local_1c & 8) == 0)) {
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*gridEntityIt) + 0xc))();
|
|
}
|
|
gridEntityIt = gridEntityIt + 1;
|
|
local_14 = (float)(GHIDRA_INT(local_14) - 1);
|
|
} while (local_14 != 0.0);
|
|
}
|
|
if ((this->_backdropType == 0x20) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0)) {
|
|
render_water_overlay(this,&g_vectorZero);
|
|
iVar11 = this->_gridWidth;
|
|
iVar16 = this->_gridHeight;
|
|
local_18 = 0;
|
|
if (0 < iVar11 * iVar16) {
|
|
gridEntityIt = this->_gridEntities;
|
|
do {
|
|
pvVar1 = *gridEntityIt;
|
|
if ((pvVar1 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) == 7)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar1) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 0;
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*gridEntityIt) + 0xc))();
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(*gridEntityIt) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 1;
|
|
}
|
|
iVar11 = this->_gridWidth;
|
|
local_18 = local_18 + 1;
|
|
gridEntityIt = gridEntityIt + 1;
|
|
} while (GHIDRA_INT(local_18) < iVar11 * this->_gridHeight);
|
|
iVar16 = this->_gridHeight;
|
|
}
|
|
local_18 = 0;
|
|
if (0 < iVar11 * iVar16) {
|
|
gridEntityIt = this->_gridEntities;
|
|
do {
|
|
pvVar1 = *gridEntityIt;
|
|
if ((pvVar1 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 4)) == 7)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar1) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 0;
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*gridEntityIt) + 0xc))();
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(*gridEntityIt) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
layer->_visible = 1;
|
|
}
|
|
local_18 = local_18 + 1;
|
|
gridEntityIt = gridEntityIt + 1;
|
|
} while (GHIDRA_INT(local_18) < this->_gridWidth * this->_gridHeight);
|
|
}
|
|
}
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
render_pit_rails(GHIDRA_CAST<Room *>(&this->_railManager));
|
|
(GHIDRA_CAST<FXLayers *>((&this->_fxLayers)))->FXLayers::render_underwater_layers();
|
|
iVar11 = this->_gridHeight;
|
|
this_00 = &this->_entityList;
|
|
local_18 = 0;
|
|
fVar12 = (float)10000;
|
|
if (0 < iVar11) {
|
|
do {
|
|
iVar16 = this->_gridWidth;
|
|
if (((iVar16 < 1) || (GHIDRA_INT(local_18) < 0)) || (iVar11 <= GHIDRA_INT(local_18))) {
|
|
iVar11 = -1;
|
|
}
|
|
else {
|
|
iVar11 = iVar16 * local_18;
|
|
}
|
|
local_14 = (((float)(iVar11 / iVar16) * 40.0 + 120.0) - 20.0) * 100.0 + 10030.0 + 0.5;
|
|
dVar17 = floor((double)local_14);
|
|
local_14 = (float)dVar17;
|
|
local_14 = (float)__ftoui3();
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(GHIDRA_UINT(local_14),&renderOffsetX);
|
|
iVar11 = this->_gridHeight;
|
|
local_18 = local_18 + 1;
|
|
} while (GHIDRA_INT(local_18) < iVar11);
|
|
fVar12 = local_14;
|
|
}
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(GHIDRA_INT(fVar12) + 5000,&renderOffsetX);
|
|
renderOffsetX.x = -(this->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(this->_renderSurfaceTopLeft).y;
|
|
room = this;
|
|
if ((this->_entityList)._renderCursor != 0) {
|
|
uVar15 = 0;
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._renderEL)) + 0x4)))) + uVar15 * 4)) +
|
|
0x1c))();
|
|
uVar15 = uVar15 + 1;
|
|
} while (uVar15 < GHIDRA_UINT((this->_entityList)._renderCursor));
|
|
room = local_20;
|
|
}
|
|
(this->_entityList)._renderMode = 0;
|
|
(room->_entityList)._renderCursor = 0;
|
|
(room->_entityList)._renderMode = 2;
|
|
renderOffsetX.x = -(room->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(room->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(5000,&renderOffsetX);
|
|
(room->_entityList)._renderMode = 5;
|
|
iVar11 = room->_gridHeight;
|
|
local_18 = 0;
|
|
pRVar13 = GHIDRA_CAST<Room *>(0x2710);
|
|
if (0 < iVar11) {
|
|
do {
|
|
iVar16 = room->_gridWidth;
|
|
if (((iVar16 < 1) || (GHIDRA_INT(local_18) < 0)) || (iVar11 <= GHIDRA_INT(local_18))) {
|
|
iVar11 = -1;
|
|
}
|
|
else {
|
|
iVar11 = iVar16 * local_18;
|
|
}
|
|
local_20 = GHIDRA_CAST<Room *>(((((float)(iVar11 / iVar16) * 40.0 + 120.0) - 20.0) * 100.0 + 10030.0 +
|
|
0.5));
|
|
dVar17 = floor((double)(float)local_20);
|
|
local_20 = GHIDRA_CAST<Room *>((float)dVar17);
|
|
local_20 = GHIDRA_CAST<Room *>(__ftoui3());
|
|
renderOffsetX.x = -(room->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(room->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(GHIDRA_UINT(local_20),&renderOffsetX);
|
|
iVar11 = room->_gridHeight;
|
|
local_18 = local_18 + 1;
|
|
} while (GHIDRA_INT(local_18) < iVar11);
|
|
pRVar13 = local_20;
|
|
}
|
|
renderOffsetX.x = -(room->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(room->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(GHIDRA_UINT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRVar13)) + 0x1388)))),&renderOffsetX);
|
|
renderOffsetX.x = -(room->_renderSurfaceTopLeft).x;
|
|
renderOffsetX.y = -(room->_renderSurfaceTopLeft).y;
|
|
(GHIDRA_CAST<EntityList *>((this_00)))->EntityList::render_up_to(0xffffffff,&renderOffsetX);
|
|
uVar15 = 0;
|
|
if ((this->_entityList)._renderCursor != 0) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._renderEL)) + 0x4)))) + uVar15 * 4)) +
|
|
0x1c))();
|
|
uVar15 = uVar15 + 1;
|
|
} while (uVar15 < GHIDRA_UINT((this->_entityList)._renderCursor));
|
|
}
|
|
(this->_entityList)._renderMode = 0;
|
|
uVar15 = 0x1505;
|
|
shaderNameChar = "KAGE_ColorTextureShader";
|
|
shaderChar = 0x4b;
|
|
do {
|
|
shaderNameChar = shaderNameChar + 1;
|
|
lowerChar = shaderChar + 0x20;
|
|
if (0x19 < (uint8_t)(shaderChar + 0xbf)) {
|
|
lowerChar = shaderChar;
|
|
}
|
|
hashChar = GHIDRA_UINT(lowerChar);
|
|
if (lowerChar == 0x5c) {
|
|
hashChar = 0x2f;
|
|
}
|
|
uVar15 = uVar15 * 0x21 + hashChar;
|
|
shaderChar = *shaderNameChar;
|
|
} while (shaderChar != 0);
|
|
local_18 = uVar15;
|
|
_Find_lower_bound<>();
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(renderOffsetX.y) + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(renderOffsetX.y) + 0x10)) <= uVar15)) && (renderOffsetX.y != DAT_00c379bc)) {
|
|
piVar14 = GHIDRA_CAST<int *>(std)::map<unsigned_int_4byte>::operator_index();
|
|
pvVar1 = (void *)*piVar14;
|
|
if ((pvVar1 != (void *)0x0) && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar1) + 4)) & 1) != 0)) {
|
|
g_currentShader = pvVar1;
|
|
}
|
|
}
|
|
_glfw_context_reset();
|
|
g_graphicsManager_blendMode[0] = savedBlendMode0;
|
|
g_graphicsManager_blendMode[1] = savedBlendMode1;
|
|
g_graphicsManager_blendMode[2] = savedBlendMode2;
|
|
g_graphicsManager_blendMode[3] = savedBlendMode3;
|
|
g_graphicsManager_blendMode[4] = savedBlendMode4;
|
|
g_graphicsManager_flags = g_graphicsManager_flags | 2;
|
|
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)));
|
|
game = g_game;
|
|
g_renderTargetStackSize = g_renderTargetStackSize - 1;
|
|
if (g_renderTargetStackSize == 0) {
|
|
DAT_00c7978c = 0;
|
|
}
|
|
(g_game->_screenShakeOffset).x = savedShakeX;
|
|
(game->_screenShakeOffset).y = savedShakeY;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00821950
|
|
void Room::render_water_shader(Vector *renderOffset)
|
|
{
|
|
Room *shader = this;
|
|
float *offsetIter;
|
|
Vector *quadSizePtr;
|
|
uint32_t extraout_EAX;
|
|
int iVar1;
|
|
int unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
int unusedArg;
|
|
uint8_t *shader;
|
|
float colorBlue;
|
|
float fVar2;
|
|
float fVar3;
|
|
float colorRed;
|
|
float colorGreen;
|
|
float local_130 [2];
|
|
int quadCount;
|
|
float quadOffsets [4];
|
|
Vector quadSizes;
|
|
uint32_t local_10c;
|
|
uint32_t uStack_108;
|
|
int *local_104;
|
|
KColor quadColor;
|
|
Vector local_dc;
|
|
void *seedNode;
|
|
float shaderParams;
|
|
float fStack_cc;
|
|
float fStack_c8;
|
|
float fStack_c4;
|
|
uint32_t local_c0;
|
|
float uvQuad;
|
|
float local_a0;
|
|
float local_9c;
|
|
float local_98;
|
|
float local_94;
|
|
float local_90;
|
|
float local_8c;
|
|
float local_88;
|
|
uint8_t local_84;
|
|
uint8_t quad [124];
|
|
code *drawFn;
|
|
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
shader = &DAT_00c79708;
|
|
if ((DAT_00c7970c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
if (((uint8_t)g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
iVar1 = 2;
|
|
offsetIter = quadOffsets;
|
|
do {
|
|
offsetIter[1] = 0.0;
|
|
*offsetIter = 0.0;
|
|
iVar1 = iVar1 + -1;
|
|
offsetIter = offsetIter + 2;
|
|
} while (iVar1 != 0);
|
|
iVar1 = 2;
|
|
quadSizePtr = &quadSizes;
|
|
do {
|
|
quadSizePtr->y = 0.0;
|
|
quadSizePtr->x = 0.0;
|
|
iVar1 = iVar1 + -1;
|
|
quadSizePtr = quadSizePtr + 1;
|
|
} while (iVar1 != 0);
|
|
quadCount = 1;
|
|
quadOffsets[0] = 52.0;
|
|
quadOffsets[1] = 52.0;
|
|
quadSizes.x = (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x6ae8)))) - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x6ae0))))) + 0.0;
|
|
quadSizes.y = (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x6aec)))) - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x6ae4))))) + 0.0;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x4)))) == 0) ||
|
|
(iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((shader)) + 0x4)))) + 0x10)), iVar1 == 0)) goto LAB_00821b14;
|
|
switch(*GHIDRA_CAST<uint32_t *>((iVar1 + 0x48))) {
|
|
case 2:
|
|
case 7:
|
|
quadSizes.y = quadSizes.y - 104.0;
|
|
quadOffsets[1] = 104.0;
|
|
goto LAB_00821b14;
|
|
case 3:
|
|
case 5:
|
|
quadSizes.x = quadSizes.x - 208.0;
|
|
quadOffsets[0] = 156.0;
|
|
default:
|
|
goto LAB_00821b14;
|
|
case 9:
|
|
quadOffsets[0] = 390.0;
|
|
quadOffsets[2] = 52.0;
|
|
quadOffsets[3] = 234.0;
|
|
break;
|
|
case 10:
|
|
quadOffsets[2] = 390.0;
|
|
quadOffsets[3] = 234.0;
|
|
break;
|
|
case 0xb:
|
|
quadOffsets[0] = 390.0;
|
|
quadOffsets[2] = 52.0;
|
|
goto LAB_00821ae6;
|
|
case 0xc:
|
|
quadOffsets[2] = 390.0;
|
|
LAB_00821ae6:
|
|
quadOffsets[3] = 52.0;
|
|
}
|
|
quadSizes.x = quadSizes.x - 338.0;
|
|
quadCount = 2;
|
|
uStack_108 = 0x43360000;
|
|
local_10c = 0x43a90000;
|
|
LAB_00821b14:
|
|
shaderParams = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x20))));
|
|
local_c0 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x30))));
|
|
fVar3 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x2c))));
|
|
colorRed = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x34))));
|
|
colorGreen = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x38))));
|
|
colorBlue = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x3c))));
|
|
fStack_cc = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x24))));
|
|
quadColor._unk = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x44))));
|
|
fStack_c8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x28))));
|
|
quadColor._alpha = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((shader->_fxLayers)._fxParams)) + 0x40))));
|
|
local_130[0] = 1.10703e-43;
|
|
g_currentShader = shader;
|
|
fStack_c4 = fVar3;
|
|
msvc::set<int>::find_node(&local_dc,local_130);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)) < 0x50)) &&
|
|
(seedNode != (g_game->_seedEffects)._seedEffects)) {
|
|
fVar3 = 0.5;
|
|
shaderParams = 0.5;
|
|
fStack_cc = 0.7;
|
|
fStack_c8 = 1.0;
|
|
quadColor._alpha = 1.0;
|
|
colorBlue = 1.0;
|
|
colorGreen = 0.7;
|
|
colorRed = 0.5;
|
|
local_c0 = 0;
|
|
quadColor._unk = 0;
|
|
}
|
|
iVar1 = shader->_waterLerpColorDuration;
|
|
if (-1 < iVar1) {
|
|
fVar2 = 1.0;
|
|
if (iVar1 != 0) {
|
|
fVar2 = 1.0 - (float)shader->_waterLerpColorCountdown / (float)iVar1;
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = 0.0;
|
|
}
|
|
if (1.0 <= fVar2) {
|
|
fVar2 = 1.0;
|
|
}
|
|
}
|
|
shaderParams = (shader->_waterColor)._red;
|
|
fVar3 = (shader->_waterColor)._alpha;
|
|
shaderParams = ((shader->_waterLerpTargetColor)._red - shaderParams) * fVar2 + shaderParams;
|
|
fStack_cc = (shader->_waterColor)._green;
|
|
fVar3 = ((shader->_waterLerpTargetColor)._alpha - fVar3) * fVar2 + fVar3;
|
|
fStack_cc = ((shader->_waterLerpTargetColor)._green - fStack_cc) * fVar2 + fStack_cc;
|
|
fStack_c8 = (shader->_waterColor)._blue;
|
|
fStack_c8 = ((shader->_waterLerpTargetColor)._blue - fStack_c8) * fVar2 + fStack_c8;
|
|
colorRed = (shader->_waterColorMultiplier)._red;
|
|
colorRed = ((shader->_waterLerpTargetColorMult)._red - colorRed) * fVar2 + colorRed;
|
|
colorGreen = (shader->_waterColorMultiplier)._green;
|
|
colorGreen = ((shader->_waterLerpTargetColorMult)._green - colorGreen) * fVar2 + colorGreen;
|
|
colorBlue = (shader->_waterColorMultiplier)._blue;
|
|
colorBlue = ((shader->_waterLerpTargetColorMult)._blue - colorBlue) * fVar2 + colorBlue;
|
|
quadColor._alpha = (shader->_waterColorMultiplier)._alpha;
|
|
quadColor._alpha =
|
|
((shader->_waterLerpTargetColorMult)._alpha - quadColor._alpha) * fVar2 + quadColor._alpha;
|
|
}
|
|
fVar2 = shader->_waterAmount;
|
|
fStack_c4 = fVar2 * fVar3;
|
|
quadColor._red = (colorRed - 1.0) * fVar2 + 1.0;
|
|
local_130[0] = (float)g_game->_frameCount + (float)g_game->_frameCount;
|
|
quadColor._green = (colorGreen - 1.0) * fVar2 + 1.0;
|
|
quadColor._blue = (colorBlue - 1.0) * fVar2 + 1.0;
|
|
local_dc.x = (float)((double)DAT_00c797f4[6] + __uint_to_double_fixup[-(DAT_00c797f4[6] >> 0x1f)])
|
|
;
|
|
local_dc.y = (float)((double)DAT_00c797f4[7] + __uint_to_double_fixup[-(DAT_00c797f4[7] >> 0x1f)])
|
|
;
|
|
local_104 = DAT_00c79a4c;
|
|
(GHIDRA_CAST<Shader *>((shader)))->Shader::set_uniform(&DAT_00b6837c,8,local_130,GHIDRA_INT(DAT_00c797f4));
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("ColorMul"),10,&quadColor,unused);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("CurrentDir"),9,&shader->_waterCurrent,unused_00);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("TextureSize"),9,&local_dc,unused_01);
|
|
(GHIDRA_CAST<Shader *>((g_currentShader)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("PixelationAmount"),8,&local_104,unused_02);
|
|
local_130[0] = 0.0;
|
|
do {
|
|
local_104 = DAT_00c797f4;
|
|
quadColor._red = 1.0;
|
|
quadColor._green = 1.0;
|
|
quadColor._blue = 1.0;
|
|
quadColor._alpha = 1.0;
|
|
quadColor._unk = 0;
|
|
drawFn = *(code **)(*DAT_00c797f4 + 0x14);
|
|
local_dc.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(quadOffsets) + GHIDRA_INT(local_130[0]))) + renderOffset->x;
|
|
local_dc.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(quadOffsets) + GHIDRA_INT(local_130[0]) + 4)) + renderOffset->y;
|
|
quadSizePtr = GHIDRA_CAST<Vector *>((GHIDRA_INT(quadOffsets) + GHIDRA_INT(local_130[0]) + 0x10));
|
|
render_quad_set_rect(quad,&local_dc,quadSizePtr,&quadColor);
|
|
fVar3 = local_130[0];
|
|
local_84 = 1;
|
|
local_94 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(quadOffsets) + GHIDRA_INT(local_130[0])));
|
|
local_98 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(quadOffsets) + GHIDRA_INT(local_130[0]) + 4));
|
|
uvQuad = local_94;
|
|
local_9c = local_94 + quadSizePtr->x;
|
|
local_a0 = local_98;
|
|
local_90 = local_98 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(quadOffsets) + GHIDRA_INT(local_130[0]) + 0x14));
|
|
local_8c = local_9c;
|
|
local_88 = local_90;
|
|
(*drawFn)(&uvQuad,extraout_EAX,&shaderParams);
|
|
local_130[0] = (float)(GHIDRA_INT(fVar3) + 8);
|
|
quadCount = quadCount + -1;
|
|
} while (quadCount != 0);
|
|
shader_cache_find(unusedArg);
|
|
return;
|
|
}
|
|
|
|
// 00821fc0
|
|
uint8_t Room::is_obstacle_path_valid(uint32_t startIndex, uint32_t goalIndex, uint32_t flags)
|
|
{
|
|
Room *pathGrid = this;
|
|
int rightCol;
|
|
void *neighborGrid;
|
|
int iVar3;
|
|
int iVar4;
|
|
uint16_t score;
|
|
Room *pRVar5;
|
|
int iVar6;
|
|
uint32_t scanIndex;
|
|
uint8_t isPathFound;
|
|
int *node;
|
|
uint32_t uVar7;
|
|
float fVar8;
|
|
float deltaCol;
|
|
uint8_t local_129c [8];
|
|
uint8_t local_1294 [8];
|
|
uint8_t openFind [8];
|
|
int *openNode;
|
|
uint8_t closedFind [8];
|
|
void *closedNode;
|
|
uint32_t destroySource;
|
|
uint32_t local_1270;
|
|
uint32_t local_126c;
|
|
uint32_t local_1268;
|
|
float local_1264;
|
|
float local_1260;
|
|
float local_125c;
|
|
float local_1258;
|
|
uint32_t local_1254;
|
|
uint32_t local_1250;
|
|
void *closedSetHead;
|
|
uint32_t closedSetSize;
|
|
uint32_t current;
|
|
int *openSetHead;
|
|
int openSetSize;
|
|
int goalRow;
|
|
int goalCol;
|
|
uint8_t local_1230 [4];
|
|
int *local_122c;
|
|
void *local_1228;
|
|
Room *room;
|
|
uint32_t local_1220;
|
|
uint32_t local_121c;
|
|
uint32_t fScore [448];
|
|
uint32_t gScore [448];
|
|
uint32_t neighbors [32];
|
|
uint16_t cameFrom [448];
|
|
uint32_t local_18;
|
|
uint32_t uStack_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int goalColumn;
|
|
void *neighborGrid;
|
|
GridEntity_Pit *pathGrid;
|
|
int rightCol;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0189b;
|
|
local_10 = ExceptionList;
|
|
uStack_14 = 0x821fdb;
|
|
local_18 = __security_cookie ^ GHIDRA_UINT((cameFrom + 0x1ca));
|
|
ExceptionList = &local_10;
|
|
local_1220 = startIndex;
|
|
openSetHead = GHIDRA_CAST<int *>(0x0);
|
|
openSetSize = 0;
|
|
room = pathGrid;
|
|
openSetHead = operator_new(0x14);
|
|
*openSetHead = GHIDRA_INT(openSetHead);
|
|
openSetHead[1] = GHIDRA_INT(openSetHead);
|
|
openSetHead[2] = GHIDRA_INT(openSetHead);
|
|
*GHIDRA_CAST<uint16_t *>((openSetHead + 3)) = 0x101;
|
|
local_8 = 0;
|
|
closedSetHead = (void *)0x0;
|
|
closedSetSize = 0;
|
|
closedSetHead = operator_new(0x14);
|
|
*(void **)closedSetHead = closedSetHead;
|
|
*(void **)(GHIDRA_CAST<char *>(closedSetHead) + 4) = closedSetHead;
|
|
*(void **)(GHIDRA_CAST<char *>(closedSetHead) + 8) = closedSetHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(closedSetHead) + 0xc)) = 0x101;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
msvc::set<int>::insert(local_1230,&local_1220);
|
|
memset(gScore,0xff,0x700);
|
|
memset(fScore,0xff,0x700);
|
|
memset(cameFrom,0xff,0x380);
|
|
uVar7 = local_1220;
|
|
iVar4 = pathGrid->_gridWidth;
|
|
goalRow = GHIDRA_INT(goalIndex) / iVar4;
|
|
goalCol = GHIDRA_INT(goalIndex) % iVar4;
|
|
gScore[local_1220] = 0;
|
|
deltaCol = (float)goalCol - (float)(GHIDRA_INT(local_1220) % iVar4);
|
|
fVar8 = (float)goalRow - (float)(GHIDRA_INT(local_1220) / iVar4);
|
|
fVar8 = sqrtf(fVar8 * fVar8 + deltaCol * deltaCol);
|
|
fScore[uVar7] = GHIDRA_INT((fVar8 * 10.0)) & 0xffff;
|
|
while (openSetSize != 0) {
|
|
local_1220 = 0xffff;
|
|
node = GHIDRA_CAST<int *>(*openSetHead);
|
|
local_122c = node;
|
|
if (node != openSetHead) {
|
|
do {
|
|
score = (uint16_t)fScore[local_122c[4]];
|
|
if (score < (uint16_t)local_1220) {
|
|
node = local_122c;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_122c);
|
|
if ((uint16_t)local_1220 <= score) {
|
|
score = (uint16_t)local_1220;
|
|
}
|
|
local_1220 = GHIDRA_UINT(score);
|
|
} while (local_122c != openSetHead);
|
|
}
|
|
current = node[4];
|
|
local_121c = current;
|
|
if (current == goalIndex) {
|
|
if ((flags & 4) == 0) goto LAB_00822813;
|
|
pRVar5 = room;
|
|
goto LAB_008226e0;
|
|
}
|
|
neighborGrid = (GHIDRA_CAST<msvc::_Tree *>((&openSetHead)))->msvc::_Tree::_Extract(node);
|
|
operator_delete(neighborGrid,0x14);
|
|
msvc::set<int>::insert(local_1294,¤t);
|
|
goalColumn = goalCol;
|
|
rightCol = goalRow;
|
|
iVar4 = room->_gridWidth;
|
|
iVar3 = GHIDRA_INT(current) / iVar4;
|
|
iVar6 = GHIDRA_INT(current) % iVar4;
|
|
if ((((iVar6 + -1 < 0) || (iVar4 <= iVar6 + -1)) || (iVar3 < 0)) || (room->_gridHeight <= iVar3)
|
|
) {
|
|
local_1220 = 0xffffffff;
|
|
}
|
|
else {
|
|
local_1220 = iVar4 * iVar3 + -1 + iVar6;
|
|
}
|
|
local_122c = GHIDRA_CAST<int *>((iVar4 * iVar3));
|
|
neighbors[0] = local_1220;
|
|
rightCol = iVar6 + 1;
|
|
if (((rightCol < 0) || (iVar4 <= rightCol)) || ((iVar3 < 0 || (room->_gridHeight <= iVar3)))) {
|
|
neighbors[1] = 0xffffffff;
|
|
}
|
|
else {
|
|
neighbors[1] = rightCol + GHIDRA_INT(local_122c);
|
|
}
|
|
local_1228 = (void *)(iVar3 + -1);
|
|
if (((iVar6 < 0) || (iVar4 <= iVar6)) ||
|
|
((GHIDRA_INT(local_1228) < 0 || (room->_gridHeight <= GHIDRA_INT(local_1228))))) {
|
|
neighbors[2] = 0xffffffff;
|
|
if ((-1 < iVar6) && (iVar6 < iVar4)) goto LAB_008222fe;
|
|
LAB_00822339:
|
|
neighbors[3] = 0xffffffff;
|
|
}
|
|
else {
|
|
neighbors[2] = GHIDRA_INT(local_1228) * iVar4 + iVar6;
|
|
LAB_008222fe:
|
|
local_121c = iVar3 + 1;
|
|
if ((GHIDRA_INT(local_121c) < 0) || (room->_gridHeight <= GHIDRA_INT(local_121c))) goto LAB_00822339;
|
|
neighbors[3] = local_121c * iVar4 + iVar6;
|
|
}
|
|
uVar7 = 4;
|
|
local_121c = 4;
|
|
if ((flags & 2) != 0) {
|
|
if ((((iVar6 < 0) || (room->_gridWidth <= iVar6)) || (iVar3 < 0)) ||
|
|
(room->_gridHeight <= iVar3)) {
|
|
iVar6 = -1;
|
|
}
|
|
else {
|
|
iVar6 = GHIDRA_INT(local_122c) + iVar6;
|
|
}
|
|
local_1228 = room->_gridEntities[iVar6];
|
|
if (((local_1228 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1228) + 4)) == 0x17)) &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1228) + 0xc)) != 2)) {
|
|
iVar3 = room->_gridHeight * room->_gridWidth;
|
|
scanIndex = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_1228) + 0x24));
|
|
iVar4 = iVar3 + -2;
|
|
if (0 < iVar4) {
|
|
do {
|
|
scanIndex = GHIDRA_INT((scanIndex + 1)) % iVar3;
|
|
if (((scanIndex < 0x1c0) &&
|
|
(neighborGrid = room->_gridEntities[scanIndex], neighborGrid != (void *)0x0)) &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGrid) + 4)) == 0x17 &&
|
|
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGrid) + 8)) == *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1228) + 8)) && (uVar7 < 0x20))))))
|
|
{
|
|
neighbors[uVar7] = scanIndex;
|
|
uVar7 = uVar7 + 1;
|
|
}
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
local_121c = uVar7;
|
|
}
|
|
}
|
|
}
|
|
local_1220 = 0;
|
|
if (0 < GHIDRA_INT(local_121c)) {
|
|
uVar7 = local_121c;
|
|
pRVar5 = room;
|
|
do {
|
|
neighborGrid = (void *)neighbors[local_1220];
|
|
local_1228 = neighborGrid;
|
|
if (-1 < GHIDRA_INT(neighborGrid)) {
|
|
neighborGrid = pRVar5->_gridEntities[GHIDRA_INT(neighborGrid)];
|
|
if (neighborGrid == (void *)0x0) {
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGrid) + 0x3c));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGrid) + 4)) == 8) {
|
|
iVar4 = 3;
|
|
}
|
|
}
|
|
if (999 < room->_gridPaths[GHIDRA_INT(neighborGrid)]) {
|
|
iVar4 = 3;
|
|
}
|
|
if ((flags & 1) != 0) {
|
|
if (iVar4 == 5) {
|
|
iVar4 = 0;
|
|
}
|
|
}
|
|
local_122c = GHIDRA_CAST<int *>(0x1);
|
|
if (((flags & 4) == 0) || (iVar4 != 3)) {
|
|
if (iVar4 == 0) goto LAB_0082250a;
|
|
}
|
|
else if ((neighborGrid != (void *)0x0) &&
|
|
((iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGrid) + 4)), iVar4 == 2 ||
|
|
((iVar4 != 3 &&
|
|
((((iVar4 == 4 || (iVar4 == 5)) || (iVar4 == 6)) ||
|
|
((iVar4 == 0x16 ||
|
|
((iVar4 != 0x18 &&
|
|
(((iVar4 == 0x19 || (iVar4 == 0x1a)) || ((iVar4 == 0x1b || (iVar4 == 7)))))))
|
|
))))))))) {
|
|
local_122c = GHIDRA_CAST<int *>(0x1c0);
|
|
LAB_0082250a:
|
|
msvc::set<int>::find_node(closedFind,&local_1228);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(closedNode) + 0xd)) != '\0') ||
|
|
(GHIDRA_INT(neighborGrid) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(closedNode) + 0x10)))) || (closedNode == closedSetHead))
|
|
{
|
|
local_122c = GHIDRA_CAST<int *>((GHIDRA_INT(local_122c) + gScore[current]));
|
|
msvc::set<int>::find_node(openFind,&local_1228);
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(openNode) + 0xd)) == '\0') && (openNode[4] <= GHIDRA_INT(neighborGrid))) &&
|
|
(openNode != openSetHead)) {
|
|
if (GHIDRA_CAST<int *>(gScore[GHIDRA_INT(neighborGrid)]) <= local_122c) goto LAB_0082262f;
|
|
}
|
|
else {
|
|
msvc::set<int>::insert(local_129c,&local_1228);
|
|
neighborGrid = local_1228;
|
|
}
|
|
gScore[GHIDRA_INT(neighborGrid)] = GHIDRA_UINT(local_122c);
|
|
cameFrom[GHIDRA_INT(neighborGrid)] = (uint16_t)current;
|
|
deltaCol = (float)goalColumn - (float)(GHIDRA_INT(neighborGrid) % room->_gridWidth);
|
|
fVar8 = (float)rightCol - (float)(GHIDRA_INT(neighborGrid) / room->_gridWidth);
|
|
sqrtf(fVar8 * fVar8 + deltaCol * deltaCol);
|
|
iVar4 = __ftoui3();
|
|
fScore[GHIDRA_INT(neighborGrid)] = iVar4 + GHIDRA_INT(local_122c);
|
|
}
|
|
}
|
|
LAB_0082262f:
|
|
uVar7 = local_121c;
|
|
pRVar5 = room;
|
|
}
|
|
local_1220 = local_1220 + 1;
|
|
} while (GHIDRA_INT(local_1220) < GHIDRA_INT(uVar7));
|
|
}
|
|
}
|
|
isPathFound = 0;
|
|
goto LAB_0082265f;
|
|
LAB_008226e0:
|
|
do {
|
|
pathGrid = pRVar5->_gridEntities[local_121c];
|
|
if (pathGrid != GHIDRA_CAST<GridEntity_Pit *>(0x0)) {
|
|
iVar4 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pathGrid)) + 0x4))));
|
|
if (iVar4 == 2) {
|
|
LAB_0082274f:
|
|
if (pRVar5->_enterFrame == g_game->_frameCount) {
|
|
PickupGridEntity(pRVar5,local_121c);
|
|
}
|
|
else {
|
|
destroySource = 0;
|
|
local_1270 = 0;
|
|
local_126c = 0;
|
|
local_1268 = 0;
|
|
local_1264 = g_vectorZero.x;
|
|
local_1260 = g_vectorZero.y;
|
|
local_125c = g_vectorZero.x;
|
|
local_1258 = g_vectorZero.y;
|
|
local_1254 = 0;
|
|
local_1250 = 0;
|
|
pathGrid->Destroy(1,&destroySource);
|
|
}
|
|
}
|
|
else {
|
|
if (iVar4 == 3) goto LAB_008227f9;
|
|
if ((((iVar4 == 4) || (iVar4 == 5)) || (iVar4 == 6)) || (iVar4 == 0x16)) goto LAB_0082274f;
|
|
if (iVar4 == 0x18) goto LAB_008227f9;
|
|
if (((iVar4 == 0x19) || (iVar4 == 0x1a)) || (iVar4 == 0x1b)) goto LAB_0082274f;
|
|
if ((iVar4 != 7) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pathGrid)) + 0xc)))) != 0)) goto LAB_008227f9;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pathGrid)) + 0xc)))) = 2;
|
|
(GHIDRA_CAST<GridEntity_Pit *>((pathGrid)))->GridEntity_Pit::UpdateCollision();
|
|
}
|
|
pRVar5 = room;
|
|
}
|
|
LAB_008227f9:
|
|
local_121c = GHIDRA_UINT(cameFrom[local_121c]);
|
|
} while (local_121c != 0xffff);
|
|
LAB_00822813:
|
|
isPathFound = 1;
|
|
LAB_0082265f:
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&closedSetHead,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&closedSetHead
|
|
,*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(closedSetHead) + 4));
|
|
operator_delete(closedSetHead,0x14);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&openSetHead,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&openSetHead,
|
|
(_Tree_node<unsigned_int,void*> *)openSetHead[1]);
|
|
operator_delete(openSetHead,0x14);
|
|
ExceptionList = local_10;
|
|
return isPathFound;
|
|
}
|
|
|
|
// 00822820
|
|
uint8_t Room::CanSpawnObstacleAtPosition(int GridIndex, uint8_t Force)
|
|
{
|
|
uint8_t isValid;
|
|
char cVar1;
|
|
Entity_Player *player;
|
|
int iVar2;
|
|
int extraout_ECX;
|
|
int iVar3;
|
|
int iVar4;
|
|
int iVar5;
|
|
uint32_t uVar6;
|
|
uint32_t uVar7;
|
|
int iVar8;
|
|
Game *game;
|
|
uint32_t uVar9;
|
|
uint32_t uVar10;
|
|
uint8_t auStack_64 [4];
|
|
int targetColumn;
|
|
uint8_t isPathClear;
|
|
int *local_58;
|
|
int nextNeighbor;
|
|
Vector local_50;
|
|
int targetGridIndex;
|
|
int *local_44;
|
|
Room *local_40;
|
|
uint32_t neighborGridIndices [4];
|
|
int neighborOffsets [10];
|
|
void *neighborGridEntity;
|
|
|
|
game = g_game;
|
|
neighborOffsets[8] = __security_cookie ^ GHIDRA_UINT(auStack_64);
|
|
targetGridIndex = GridIndex;
|
|
if (GHIDRA_UINT(GridIndex) < 0x1c0) {
|
|
iVar5 = g_game->_room->_gridWidth;
|
|
local_50.x = (float)(GridIndex % iVar5) * 40.0 + 40.0;
|
|
local_50.y = (float)(GridIndex / iVar5) * 40.0 + 120.0;
|
|
local_40 = this;
|
|
isValid = IsPositionInRoom(g_game->_room,&local_50,0.0);
|
|
if (((isValid != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 8)) != 0x10)) &&
|
|
((this->_gridEntities[targetGridIndex] == (void *)0x0 ||
|
|
((cVar1 = FUN_0070bf60(), cVar1 != '\0' &&
|
|
(isValid = is_grid_type_floor_special(*GHIDRA_CAST<int *>((extraout_ECX + 4))), isValid == 0)))))) {
|
|
if (Force == 0) {
|
|
uVar9 = 0;
|
|
if (GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((game->_playerManager)._playerList._begin) >> 2 != 0) {
|
|
do {
|
|
player = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(uVar9);
|
|
iVar5 = GHIDRA_INT((((player->_pos).x - 40.0) / 40.0 + 0.5));
|
|
iVar3 = GHIDRA_INT((((player->_pos).y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar5 < 0) || (this->_gridWidth <= iVar5)) || (iVar3 < 0)) ||
|
|
(this->_gridHeight <= iVar3)) {
|
|
iVar5 = -1;
|
|
}
|
|
else {
|
|
iVar5 = this->_gridWidth * iVar3 + iVar5;
|
|
}
|
|
if (((iVar5 == targetGridIndex) &&
|
|
(iVar5 = player->_entityGridCollisionClass, iVar5 != 0)) &&
|
|
((iVar5 != 3 && ((iVar5 != 1 && (iVar5 != 2)))))) {
|
|
return 0;
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
game = g_game;
|
|
} while (uVar9 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
|
|
}
|
|
}
|
|
iVar3 = 0;
|
|
iVar5 = targetGridIndex / this->_gridWidth;
|
|
targetColumn = targetGridIndex % this->_gridWidth;
|
|
local_44 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
local_58 = this->_doorGridPositions;
|
|
local_50.x = 0.0;
|
|
do {
|
|
if (((local_44 != GHIDRA_CAST<int *>(0x0)) &&
|
|
((local_44[(GHIDRA_UINT(local_50.x) >> 5) + 0xe] & 1 << (SUB41(local_50.x,0) & 0x1f)) != 0)) &&
|
|
(uVar9 = *local_58 / this->_gridWidth - iVar5,
|
|
uVar10 = *local_58 % this->_gridWidth - targetColumn, uVar6 = GHIDRA_INT(uVar9) >> 0x1f,
|
|
uVar7 = GHIDRA_INT(uVar10) >> 0x1f,
|
|
GHIDRA_INT((((uVar9 ^ uVar6) - uVar6) + ((uVar10 ^ uVar7) - uVar7))) < 2)) {
|
|
return 0;
|
|
}
|
|
local_50.x = (float)(GHIDRA_INT(local_50.x) + 1);
|
|
local_58 = local_58 + 1;
|
|
} while (GHIDRA_INT(local_50.x) < 8);
|
|
local_50.x = 0.0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
local_44 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4))));
|
|
do {
|
|
iVar4 = *local_44;
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x28)) == 1000) {
|
|
if (*GHIDRA_CAST<int *>((iVar4 + 0x2c)) == 0x9c) goto LAB_00822ab9;
|
|
}
|
|
else if ((*GHIDRA_CAST<int *>((iVar4 + 0x28)) == 5) && (*GHIDRA_CAST<int *>((iVar4 + 0x534)) != 0)) {
|
|
LAB_00822ab9:
|
|
iVar8 = GHIDRA_INT(((*GHIDRA_CAST<float *>((iVar4 + 0x33c)) - 40.0) / 40.0 + 0.5));
|
|
iVar4 = GHIDRA_INT(((*GHIDRA_CAST<float *>((iVar4 + 0x340)) - 120.0) / 40.0 + 0.5));
|
|
if ((((-1 < iVar8) && ((iVar2 = this->_gridWidth, iVar8 < iVar2 && (-1 < iVar4)))) &&
|
|
(iVar4 < this->_gridHeight)) &&
|
|
((iVar8 = iVar2 * iVar4 + iVar8, -1 < iVar8 &&
|
|
(uVar6 = iVar8 % iVar2 - targetColumn, uVar9 = iVar8 / iVar2 - iVar5,
|
|
uVar7 = GHIDRA_INT(uVar6) >> 0x1f, uVar10 = GHIDRA_INT(uVar9) >> 0x1f,
|
|
GHIDRA_INT((((uVar6 ^ uVar7) - uVar7) + ((uVar9 ^ uVar10) - uVar10))) < 2)))) {
|
|
return 0;
|
|
}
|
|
}
|
|
local_50.x = (float)(GHIDRA_INT(local_50.x) + 1);
|
|
local_44 = local_44 + 1;
|
|
} while (GHIDRA_UINT(local_50.x) < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
iVar4 = 0;
|
|
neighborOffsets[0] = -1;
|
|
neighborOffsets[1] = 0;
|
|
neighborOffsets[2] = 1;
|
|
neighborOffsets[3] = 0;
|
|
neighborOffsets[4] = 0;
|
|
neighborOffsets[5] = 0xffffffff;
|
|
neighborOffsets[6] = 0;
|
|
neighborOffsets[7] = 1;
|
|
do {
|
|
iVar8 = neighborOffsets[iVar4 * 2] + targetColumn;
|
|
if (-1 < iVar8) {
|
|
if (iVar8 < this->_gridWidth) {
|
|
iVar2 = neighborOffsets[iVar4 * 2 + 1] + iVar5;
|
|
if ((-1 < iVar2) && (iVar2 < this->_gridHeight)) {
|
|
uVar9 = this->_gridWidth * iVar2 + iVar8;
|
|
if (-1 < GHIDRA_INT(uVar9)) {
|
|
neighborGridEntity = this->_gridEntities[uVar9];
|
|
if (neighborGridEntity == (void *)0x0) {
|
|
if (this->_gridPaths[uVar9] < 1000) goto LAB_00822c10;
|
|
}
|
|
else {
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(neighborGridEntity) + 4));
|
|
if (iVar8 == 0x10) {
|
|
return 0;
|
|
}
|
|
if (((((0x1bf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(neighborGridEntity) + 0x24))) ||
|
|
(this = local_40,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(g_game->_room) +
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(neighborGridEntity) + 0x24)) * 4 + 0x76c)) < 1000)) ||
|
|
(iVar8 == 0xc)) || (iVar8 == 0xe)) &&
|
|
(((iVar8 != 0x11 && (iVar8 != 0x12)) && ((iVar8 != 0x14 && (iVar8 != 0x17))))))
|
|
{
|
|
LAB_00822c10:
|
|
neighborGridIndices[iVar3] = uVar9;
|
|
iVar3 = iVar3 + 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
iVar4 = iVar4 + 1;
|
|
} while (iVar4 < 4);
|
|
isValid = 1;
|
|
isPathClear = 1;
|
|
local_50.x = (float)this->_gridPaths[targetGridIndex];
|
|
this->_gridPaths[targetGridIndex] = 1000;
|
|
if (0 < iVar3 + -1) {
|
|
local_58 = GHIDRA_CAST<int *>(neighborGridIndices);
|
|
nextNeighbor = 1;
|
|
do {
|
|
if (isValid == 0) break;
|
|
iVar5 = nextNeighbor;
|
|
local_40 = GHIDRA_CAST<Room *>(nextNeighbor);
|
|
if (nextNeighbor < iVar3) {
|
|
do {
|
|
isValid = is_obstacle_path_valid(this,*local_58,neighborGridIndices[iVar5],0);
|
|
if (isValid == 0) {
|
|
isPathClear = 0;
|
|
break;
|
|
}
|
|
iVar5 = iVar5 + 1;
|
|
} while (iVar5 < iVar3);
|
|
isValid = isPathClear;
|
|
}
|
|
nextNeighbor = nextNeighbor + 1;
|
|
local_58 = local_58 + 1;
|
|
} while (GHIDRA_INT(local_40) < iVar3 + -1);
|
|
}
|
|
this->_gridPaths[targetGridIndex] = GHIDRA_INT(local_50.x);
|
|
return isValid;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00822cf0
|
|
void Room::add_trigger_output_index(uint32_t group, int gridIndex)
|
|
{
|
|
uint8_t insertResult [12];
|
|
|
|
if (group < 10) {
|
|
msvc::set<int>::insert(insertResult,&gridIndex);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00822d20
|
|
void Room::add_trigger_output_cell(int group, int x, int y)
|
|
{
|
|
int gridIndex;
|
|
|
|
if ((((-1 < x) && (-1 < y)) && (x < this->_gridWidth)) && (y < this->_gridHeight)) {
|
|
gridIndex = GetGridIndexByTile(this,x,y);
|
|
add_trigger_output_index(this,group,gridIndex);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00822d60
|
|
void Room::hold_trigger_output_entities()
|
|
{
|
|
int *piVar1;
|
|
Entity *entity;
|
|
uint64_t *findResult;
|
|
Game *game;
|
|
uint32_t groupIdx;
|
|
uint32_t *puVar2;
|
|
uint8_t *groupSet;
|
|
uint8_t local_20c [12];
|
|
uint64_t insertPos;
|
|
uint32_t *local_1f4;
|
|
uint32_t local_1f0;
|
|
int local_1ec;
|
|
int gridIdxKey;
|
|
uint32_t *heldIndexSet;
|
|
Room *local_1e0;
|
|
int *local_1dc;
|
|
char isAnyOutput;
|
|
char cellGroup [448];
|
|
uint32_t securityCookie;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int descriptor;
|
|
int gridIdx;
|
|
uint32_t setHead;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b018e0;
|
|
local_10 = ExceptionList;
|
|
securityCookie = __security_cookie ^ GHIDRA_UINT((cellGroup + 0x1d0));
|
|
ExceptionList = &local_10;
|
|
local_1e0 = this;
|
|
memset(cellGroup,0xff,0x1c0);
|
|
groupSet = this->_outputGroupGridIndices;
|
|
isAnyOutput = '\0';
|
|
groupIdx = 0;
|
|
do {
|
|
piVar1 = *GHIDRA_CAST<int **>(groupSet);
|
|
local_1dc = GHIDRA_CAST<int *>(*piVar1);
|
|
if (local_1dc != piVar1) {
|
|
isAnyOutput = '\x01';
|
|
do {
|
|
if (cellGroup[local_1dc[4]] < '\0') {
|
|
cellGroup[local_1dc[4]] = (char)groupIdx;
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)&local_1dc);
|
|
} while (local_1dc != piVar1);
|
|
}
|
|
game = g_game;
|
|
groupIdx = groupIdx + 1;
|
|
groupSet = groupSet + 8;
|
|
} while (groupIdx < 10);
|
|
if (isAnyOutput != '\0') {
|
|
local_1dc = GHIDRA_CAST<int *>(0x0);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f5)) = 0;
|
|
if ((local_1e0->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
entity = *(Entity **)
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((local_1e0->_entityList)._updateEL)) + 0x4)))) + GHIDRA_INT(local_1dc) * 4);
|
|
gridIdx = entity->_spawnGridIndex;
|
|
if ((-1 < gridIdx) && (local_1ec = GHIDRA_INT(cellGroup[gridIdx]), -1 < local_1ec)) {
|
|
descriptor = entity->_type;
|
|
gridIdxKey = gridIdx;
|
|
if ((descriptor != 5) || (entity[1]._sprite._championColor._tint[2] != 0.0)) {
|
|
if (((*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) || (descriptor != 1)) &&
|
|
(0x3dd < descriptor - 10U)) {
|
|
if (descriptor != 4) goto LAB_00822f83;
|
|
}
|
|
else {
|
|
descriptor = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_1e0)) + 0x4))));
|
|
puVar2 = GHIDRA_CAST<uint32_t *>((descriptor + 0x80));
|
|
heldIndexSet = puVar2;
|
|
findResult = GHIDRA_CAST<uint64_t *>(std)::set<int>::find_node(local_20c,&gridIdxKey);
|
|
insertPos = *findResult;
|
|
if ((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((findResult + 1)) + 0xd)) != '\0') ||
|
|
(gridIdx < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((findResult + 1)) + 0x10)))) {
|
|
if (*GHIDRA_CAST<int *>((descriptor + 0x84)) == 0xccccccc) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_004170d0();
|
|
}
|
|
setHead = *puVar2;
|
|
local_1f4 = heldIndexSet;
|
|
local_8 = 0;
|
|
local_1f0 = 0;
|
|
puVar2 = operator_new(0x14);
|
|
local_8 = 0xffffffff;
|
|
local_1f0 = 0;
|
|
puVar2[4] = gridIdx;
|
|
*puVar2 = setHead;
|
|
puVar2[1] = setHead;
|
|
puVar2[2] = setHead;
|
|
*GHIDRA_CAST<uint16_t *>((puVar2 + 3)) = 0;
|
|
(GHIDRA_CAST<msvc::_Tree *>((heldIndexSet)))->msvc::_Tree::_Insert_node((void *)insertPos,(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(insertPos)) + 0x4))),puVar2);
|
|
}
|
|
}
|
|
}
|
|
piVar1 = local_1dc;
|
|
hold_entity_in_spawner(local_1e0,entity,local_1ec);
|
|
game = g_game;
|
|
local_1dc = piVar1;
|
|
}
|
|
LAB_00822f83:
|
|
local_1dc = GHIDRA_CAST<int *>((GHIDRA_INT(local_1dc) + 1));
|
|
} while (local_1dc < GHIDRA_UINT((local_1e0->_entityList)._updateEL._size));
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00822fd0
|
|
Entity * Room::hold_entity_in_spawner(Entity *entity, int group)
|
|
{
|
|
char cVar1;
|
|
Entity_Effect *spawner;
|
|
Vector spawnPos;
|
|
|
|
spawnPos.x = (entity->_pos).x;
|
|
spawnPos.y = (entity->_pos).y;
|
|
spawner = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x78,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),entity->_type,
|
|
entity->_initSeed,0);
|
|
*GHIDRA_CAST<int *>(&(spawner->_varData)._l) = entity->_variant;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(spawner->_varData)._l) + 4)) = entity->_subtype;
|
|
spawner->_state = group;
|
|
cVar1 = entity->CanShutDoors();
|
|
if ((cVar1 != '\0') && (entity->_type != 0x362)) {
|
|
this->_aliveEnemyCount = this->_aliveEnemyCount + -1;
|
|
cVar1 = entity->IsBoss();
|
|
if (cVar1 != '\0') {
|
|
this->_aliveBossCount = this->_aliveBossCount + -1;
|
|
}
|
|
}
|
|
entity->Remove();
|
|
return GHIDRA_CAST<Entity *>(spawner);
|
|
}
|
|
|
|
// 00823080
|
|
void Room::TriggerOutput(uint32_t outputGroupdIdx)
|
|
{
|
|
uint32_t i;
|
|
uint32_t *callback;
|
|
int gridIter [2];
|
|
int *entity;
|
|
|
|
gridIter[0] = **GHIDRA_CAST<int **>((this->_outputGroupGridIndices + outputGroupdIdx * 8));
|
|
if (GHIDRA_CAST<int *>(gridIter[0]) != *GHIDRA_CAST<int **>((this->_outputGroupGridIndices + outputGroupdIdx * 8))) {
|
|
do {
|
|
if (this->_gridEntities[*GHIDRA_CAST<int *>((gridIter[0] + 0x10))] != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
GridEntity::trigger_output(this->_gridEntities[*GHIDRA_CAST<int *>((gridIter[0] + 0x10))]);
|
|
}
|
|
msvc::
|
|
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
|
|
*)gridIter);
|
|
} while (gridIter[0] != *GHIDRA_CAST<int *>((this->_outputGroupGridIndices + outputGroupdIdx * 8)));
|
|
}
|
|
i = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
entity = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + i * 4));
|
|
if (((entity[10] == 1000) && (entity[0xb] == 0x78)) && (entity[0x114] == outputGroupdIdx)) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(entity) + 0x173)) = 1;
|
|
(**(code **)(*entity + 0xc))();
|
|
}
|
|
i = i + 1;
|
|
} while (i < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
callback = *GHIDRA_CAST<uint32_t **>((this->_outputGroupCallbacks + outputGroupdIdx * 0xc));
|
|
if (callback != *GHIDRA_CAST<uint32_t **>((this->_outputGroupCallbacks + outputGroupdIdx * 0xc + 4))) {
|
|
do {
|
|
(*(code *)*callback)();
|
|
callback = callback + 1;
|
|
} while (callback != *GHIDRA_CAST<uint32_t **>((this->_outputGroupCallbacks + outputGroupdIdx * 0xc + 4)));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00823370
|
|
float * Room::get_color_modifier(float *outColor)
|
|
{
|
|
uint8_t isHasMineshaft;
|
|
float darkenAmount;
|
|
uint32_t descriptorFlags;
|
|
int roomType;
|
|
|
|
*outColor = *GHIDRA_CAST<float *>(&(this->_fxLayers)._fxParams);
|
|
outColor[1] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0x4))));
|
|
outColor[2] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0x8))));
|
|
outColor[3] = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_fxLayers)._fxParams)) + 0xc))));
|
|
outColor[4] = (this->_fxLayers)._fxParams.brightness;
|
|
outColor[5] = (this->_fxLayers)._fxParams.contrast;
|
|
roomType = this->_roomType;
|
|
if (((roomType != 7) && (roomType != 8)) && (roomType != 0x1d)) {
|
|
isHasMineshaft = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::HasAbandonedMineshaft();
|
|
if ((isHasMineshaft == 0) || (g_game->_currentDimensionIdx != 1)) goto LAB_00823474;
|
|
}
|
|
*outColor = (1.0 - *outColor) * 0.75 + *outColor;
|
|
outColor[4] = (0.0 - outColor[4]) * 0.75 + outColor[4];
|
|
outColor[1] = (1.0 - outColor[1]) * 0.75 + outColor[1];
|
|
outColor[2] = (1.0 - outColor[2]) * 0.75 + outColor[2];
|
|
outColor[5] = (1.0 - outColor[5]) * 0.75 + outColor[5];
|
|
outColor[3] = (0.0 - outColor[3]) * 0.75 + outColor[3];
|
|
LAB_00823474:
|
|
roomType = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
descriptorFlags = *GHIDRA_CAST<uint32_t *>((roomType + 0x44));
|
|
if ((descriptorFlags >> 9 & 1) != 0) {
|
|
outColor[4] = outColor[4] + 0.03;
|
|
}
|
|
if ((this->_backdropType == 0x20) && ((descriptorFlags >> 5 & 1) != 0)) {
|
|
darkenAmount = ((float)*GHIDRA_CAST<int *>((roomType + 0x54)) /
|
|
(float)((this->_gridHeight + -2) * (this->_gridWidth + -2))) *
|
|
this->_lavaIntensity;
|
|
*outColor = *outColor - darkenAmount;
|
|
outColor[2] = darkenAmount * 0.4 + outColor[2];
|
|
outColor[1] = darkenAmount * 0.4 + outColor[1];
|
|
outColor[5] = darkenAmount * 0.2 + outColor[5];
|
|
outColor[3] = outColor[3] - darkenAmount * 0.45;
|
|
}
|
|
return outColor;
|
|
}
|
|
|
|
// 00823590
|
|
KColor * Room::GetFloorColorAt(KColor *outColor, Vector *position, float radius)
|
|
{
|
|
float fVar1;
|
|
float fVar2;
|
|
char cVar3;
|
|
uint32_t uVar4;
|
|
uint32_t uVar5;
|
|
int *medianNode;
|
|
float fVar6;
|
|
void *pvVar7;
|
|
float *sampledColor;
|
|
int medianSteps;
|
|
float fVar8;
|
|
float waterBlend;
|
|
float waterBlend;
|
|
float fVar10;
|
|
double dVar11;
|
|
float sampleLuminance;
|
|
KColor sampleEntryColor;
|
|
KColor sampleColor;
|
|
int *backdrop;
|
|
int *backdropRefCount;
|
|
uint32_t *sampleTreeHead;
|
|
uint32_t sampleTreeSize;
|
|
uint8_t sampleSet [4];
|
|
Room *room;
|
|
void *local_3c;
|
|
float sampleX;
|
|
float sampleY;
|
|
float local_30;
|
|
float sampleRadius;
|
|
float local_28;
|
|
float screenX;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
int *parentNode;
|
|
code *samplePixelFn;
|
|
int *walkNode;
|
|
|
|
puStack_20 = sampleSet + 0x40;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0192d;
|
|
local_1c = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_UINT((sampleSet + 0x34));
|
|
ExceptionList = &local_1c;
|
|
room = this;
|
|
sampleRadius = radius;
|
|
(GHIDRA_CAST<KColor *>((outColor)))->KColor::SetFromARGB(0xffffffff);
|
|
local_28 = g_displayPixelRatio * g_screenPointScale;
|
|
sampleY = (g_screenHeight - 182.0) * 0.5;
|
|
local_30 = ((position->x - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5) * local_28 + 0.5;
|
|
dVar11 = floor((double)local_30);
|
|
local_30 = (float)dVar11;
|
|
screenX = local_30 / local_28;
|
|
sampleY = ((position->y - 140.0) * 0.65 + sampleY) * local_28 + 0.5;
|
|
dVar11 = floor((double)sampleY);
|
|
sampleY = (float)dVar11;
|
|
screenX = screenX - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x11fc));
|
|
local_28 = sampleY / local_28 - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1200));
|
|
if (sampleRadius <= 0.0) {
|
|
(GHIDRA_CAST<shared_ptr *>((&backdrop)))->shared_ptr::assign(&this->_backdrop);
|
|
local_14 = 3;
|
|
samplePixelFn = *(code **)(*backdrop + 0x2c);
|
|
local_30 = (float)__ftoui3(uVar4);
|
|
local_3c = (void *)__ftoui3();
|
|
sampledColor = GHIDRA_CAST<float *>((*samplePixelFn)(&sampleEntryColor,local_3c,local_30));
|
|
fVar6 = sampledColor[1];
|
|
waterBlend = sampledColor[2];
|
|
fVar10 = sampledColor[3];
|
|
outColor->_red = *sampledColor;
|
|
outColor->_green = fVar6;
|
|
outColor->_blue = waterBlend;
|
|
outColor->_alpha = fVar10;
|
|
outColor->_unk = GHIDRA_INT(sampledColor[4]);
|
|
local_14 = 4;
|
|
if (((backdropRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*backdropRefCount + 0xc))(), cVar3 != '\0')) &&
|
|
(g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)();
|
|
}
|
|
local_14 = 0xffffffff;
|
|
pvVar7 = local_3c;
|
|
fVar6 = local_30;
|
|
}
|
|
else {
|
|
sampleTreeHead = GHIDRA_CAST<uint32_t *>(0x0);
|
|
sampleTreeSize = 0;
|
|
sampleTreeHead = operator_new(0x28);
|
|
*sampleTreeHead = sampleTreeHead;
|
|
sampleTreeHead[1] = sampleTreeHead;
|
|
sampleTreeHead[2] = sampleTreeHead;
|
|
*GHIDRA_CAST<uint16_t *>((sampleTreeHead + 3)) = 0x101;
|
|
local_3c = &this->_backdrop;
|
|
local_14 = 0;
|
|
local_30 = 0.0;
|
|
do {
|
|
sampleY = sampleRadius * *GHIDRA_CAST<float *>((GHIDRA_INT(&DAT_00c5d14c) + GHIDRA_INT(local_30))) * 0.65 + local_28;
|
|
sampleX = sampleRadius * *GHIDRA_CAST<float *>((GHIDRA_INT(&DAT_00c5d148) + GHIDRA_INT(local_30))) * 0.65 + screenX;
|
|
(GHIDRA_CAST<shared_ptr *>((&backdrop)))->shared_ptr::assign(local_3c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
samplePixelFn = *(code **)(*backdrop + 0x2c);
|
|
__ftoui3();
|
|
uVar5 = __ftoui3();
|
|
(*samplePixelFn)(&sampleColor,uVar5);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
if (((backdropRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar3 = (**(code **)(*backdropRefCount + 0xc))(), cVar3 != '\0')) &&
|
|
(g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)();
|
|
}
|
|
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
sampleEntryColor._unk = sampleColor._unk;
|
|
sampleEntryColor._red = sampleColor._red;
|
|
sampleEntryColor._green = sampleColor._green;
|
|
sampleEntryColor._blue = sampleColor._blue;
|
|
sampleLuminance =
|
|
sampleColor._green * 0.71516 + sampleColor._red * 0.212671 + sampleColor._blue * 0.072169
|
|
;
|
|
sampleEntryColor._alpha = sampleColor._alpha;
|
|
FUN_00828860(sampleSet,&sampleLuminance);
|
|
local_30 = (float)(GHIDRA_INT(local_30) + 8);
|
|
} while (GHIDRA_UINT(local_30) < 0x28);
|
|
medianSteps = 2;
|
|
medianNode = GHIDRA_CAST<int *>(*sampleTreeHead);
|
|
do {
|
|
walkNode = GHIDRA_CAST<int *>(medianNode[2]);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(walkNode) + 0xd)) == '\0') {
|
|
cVar3 = *GHIDRA_CAST<char *>((*walkNode + 0xd));
|
|
medianNode = walkNode;
|
|
walkNode = GHIDRA_CAST<int *>(*walkNode);
|
|
while (cVar3 == '\0') {
|
|
cVar3 = *GHIDRA_CAST<char *>((*walkNode + 0xd));
|
|
medianNode = walkNode;
|
|
walkNode = GHIDRA_CAST<int *>(*walkNode);
|
|
}
|
|
}
|
|
else {
|
|
cVar3 = *GHIDRA_CAST<char *>((medianNode[1] + 0xd));
|
|
parentNode = GHIDRA_CAST<int *>(medianNode[1]);
|
|
walkNode = medianNode;
|
|
while ((medianNode = parentNode, cVar3 == '\0' && (walkNode == GHIDRA_CAST<int *>(medianNode[2])))) {
|
|
cVar3 = *GHIDRA_CAST<char *>((medianNode[1] + 0xd));
|
|
parentNode = GHIDRA_CAST<int *>(medianNode[1]);
|
|
walkNode = medianNode;
|
|
}
|
|
}
|
|
medianSteps = medianSteps + -1;
|
|
} while (medianSteps != 0);
|
|
fVar6 = (float)medianNode[6];
|
|
waterBlend = (float)medianNode[7];
|
|
fVar10 = (float)medianNode[8];
|
|
outColor->_red = (float)medianNode[5];
|
|
outColor->_green = fVar6;
|
|
outColor->_blue = waterBlend;
|
|
outColor->_alpha = fVar10;
|
|
outColor->_unk = medianNode[9];
|
|
local_14 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&sampleTreeHead,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&sampleTreeHead,
|
|
(_Tree_node<unsigned_int,void*> *)sampleTreeHead[1]);
|
|
operator_delete(sampleTreeHead,0x28);
|
|
fVar6 = (float)__ftoui3();
|
|
pvVar7 = (void *)__ftoui3();
|
|
}
|
|
if ((DAT_00c797bc != 0) && (DAT_00c797ec != GHIDRA_CAST<int *>(0x0))) {
|
|
(**(code **)(*DAT_00c797ec + 0x2c))(&sampleColor,pvVar7,fVar6);
|
|
outColor->_red = (sampleColor._red - outColor->_red) * sampleColor._alpha + outColor->_red;
|
|
outColor->_green =
|
|
(sampleColor._green - outColor->_green) * sampleColor._alpha + outColor->_green;
|
|
outColor->_blue = (sampleColor._blue - outColor->_blue) * sampleColor._alpha + outColor->_blue;
|
|
}
|
|
fVar6 = room->_waterAmount;
|
|
if (fVar6 <= 0.0) {
|
|
fVar6 = outColor->_blue;
|
|
waterBlend = outColor->_red;
|
|
fVar10 = outColor->_green;
|
|
}
|
|
else {
|
|
fVar1 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x28))));
|
|
waterBlend = fVar6 * *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x2c))));
|
|
fVar10 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x38))));
|
|
fVar2 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x24))));
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x3c))));
|
|
waterBlend = ((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x20)))) - outColor->_red) *
|
|
fVar6 * waterBlend + outColor->_red) *
|
|
((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((room->_fxLayers)._fxParams)) + 0x34)))) - 1.0) * fVar6 + 1.0);
|
|
outColor->_red = waterBlend;
|
|
fVar10 = ((fVar2 - outColor->_green) * waterBlend * room->_waterAmount + outColor->_green) *
|
|
((fVar10 - 1.0) * fVar6 + 1.0);
|
|
outColor->_green = fVar10;
|
|
fVar6 = ((fVar1 - outColor->_blue) * waterBlend * room->_waterAmount + outColor->_blue) *
|
|
((fVar8 - 1.0) * fVar6 + 1.0);
|
|
outColor->_blue = fVar6;
|
|
}
|
|
fVar1 = (room->_floorColor)._colorize[3];
|
|
fVar2 = (room->_floorColor)._tint[3];
|
|
waterBlend = waterBlend * (room->_floorColor)._tint[0];
|
|
fVar10 = fVar10 * (room->_floorColor)._tint[1];
|
|
fVar6 = fVar6 * (room->_floorColor)._tint[2];
|
|
if (fVar1 != 0.0) {
|
|
fVar8 = fVar10 * 0.71516 + waterBlend * 0.212671 + fVar6 * 0.072169;
|
|
waterBlend = waterBlend + (fVar8 * (room->_floorColor)._colorize[0] - waterBlend) * fVar1;
|
|
fVar10 = fVar10 + (fVar8 * (room->_floorColor)._colorize[1] - fVar10) * fVar1;
|
|
fVar6 = fVar6 + (fVar8 * (room->_floorColor)._colorize[2] - fVar6) * fVar1;
|
|
}
|
|
fVar1 = (room->_floorColor)._offset[1];
|
|
fVar8 = (room->_floorColor)._offset[2];
|
|
outColor->_red = waterBlend + (room->_floorColor)._offset[0];
|
|
outColor->_green = fVar10 + fVar1;
|
|
outColor->_blue = fVar6 + fVar8;
|
|
outColor->_alpha = fVar2 * outColor->_alpha;
|
|
outColor->_unk = 0;
|
|
ExceptionList = local_1c;
|
|
return outColor;
|
|
}
|
|
|
|
// 00823be0
|
|
uint8_t Room::is_reachable_from_player(float *param_1, Entity_Player *param_2, char param_3)
|
|
{
|
|
uint8_t bVar1;
|
|
Vector *extraout_EAX;
|
|
Vector *pVVar2;
|
|
int iVar3;
|
|
uint32_t uVar4;
|
|
Room *in_ECX;
|
|
Room *extraout_ECX;
|
|
Room *this;
|
|
int iVar5;
|
|
uint32_t goalIndex;
|
|
uint32_t startIndex;
|
|
Vector local_10;
|
|
|
|
this = in_ECX;
|
|
if (param_2 == GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
param_2 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
this = extraout_ECX;
|
|
}
|
|
if (param_3 == '\0') {
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(this))))->Entity_Player::GetEnterPosition(&local_10);
|
|
pVVar2 = extraout_EAX;
|
|
}
|
|
else {
|
|
local_10.y = (param_2->_pos).y;
|
|
pVVar2 = &local_10;
|
|
local_10.x = (param_2->_pos).x;
|
|
}
|
|
iVar5 = GHIDRA_INT(((pVVar2->x - 40.0) / 40.0 + 0.5));
|
|
iVar3 = GHIDRA_INT(((pVVar2->y - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar5 < 0) || (in_ECX->_gridWidth <= iVar5)) || (iVar3 < 0)) ||
|
|
(in_ECX->_gridHeight <= iVar3)) {
|
|
goalIndex = 0xffffffff;
|
|
}
|
|
else {
|
|
goalIndex = in_ECX->_gridWidth * iVar3 + iVar5;
|
|
}
|
|
iVar3 = GHIDRA_INT(((*param_1 - 40.0) / 40.0 + 0.5));
|
|
if (((-1 < iVar3) && (iVar3 < in_ECX->_gridWidth)) &&
|
|
((iVar5 = GHIDRA_INT(((param_1[1] - 120.0) / 40.0 + 0.5)), -1 < iVar5 && (iVar5 < in_ECX->_gridHeight)
|
|
))) {
|
|
startIndex = in_ECX->_gridWidth * iVar5 + iVar3;
|
|
uVar4 = GetGridCollision(in_ECX,startIndex);
|
|
if (((-1 < GHIDRA_INT(startIndex)) && (-1 < GHIDRA_INT(goalIndex))) && ((uVar4 == 0 || (uVar4 == 5)))) {
|
|
bVar1 = is_obstacle_path_valid(in_ECX,startIndex,goalIndex,3);
|
|
return bVar1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00823d10
|
|
Vector * Room::find_reachable_position(Vector *outPosition, Vector *position, int unused)
|
|
{
|
|
char isReachable;
|
|
int gridIndex;
|
|
int iVar1;
|
|
int gridIndex;
|
|
int gridY;
|
|
int gridX;
|
|
float fVar3;
|
|
float tileY;
|
|
int ringLength;
|
|
int stepY;
|
|
int stepX;
|
|
Vector tilePos;
|
|
|
|
isReachable = is_reachable_from_player(position,0,0);
|
|
if (isReachable == '\0') {
|
|
stepX = 0;
|
|
stepY = -1;
|
|
ringLength = 1;
|
|
gridX = GHIDRA_INT(((position->x - 40.0) / 40.0 + 0.5));
|
|
gridY = GHIDRA_INT(((position->y - 120.0) / 40.0 + 0.5));
|
|
do {
|
|
gridIndex = 0;
|
|
if (0 < ringLength) {
|
|
do {
|
|
gridX = gridX + stepX;
|
|
gridY = gridY + stepY;
|
|
if ((((0 < gridX) && (0 < gridY)) && (iVar1 = this->_gridWidth, gridX < iVar1 + -1)) &&
|
|
(gridY < this->_gridHeight + -1)) {
|
|
if ((gridX < iVar1) && (gridY < this->_gridHeight)) {
|
|
gridIndex = iVar1 * gridY + gridX;
|
|
}
|
|
else {
|
|
gridIndex = -1;
|
|
}
|
|
fVar3 = (float)(gridIndex % iVar1) * 40.0 + 40.0;
|
|
tileY = (float)(gridIndex / iVar1) * 40.0 + 120.0;
|
|
tilePos.x = fVar3;
|
|
tilePos.y = tileY;
|
|
isReachable = is_reachable_from_player(&tilePos,0,0);
|
|
if (isReachable != '\0') {
|
|
outPosition->x = fVar3;
|
|
outPosition->y = tileY;
|
|
return outPosition;
|
|
}
|
|
}
|
|
gridIndex = gridIndex + 1;
|
|
} while (gridIndex < ringLength);
|
|
}
|
|
iVar1 = -stepY;
|
|
gridIndex = ringLength + 1;
|
|
if (iVar1 != 0) {
|
|
gridIndex = ringLength;
|
|
}
|
|
ringLength = gridIndex;
|
|
stepY = stepX;
|
|
stepX = iVar1;
|
|
} while (gridIndex < 0x10);
|
|
}
|
|
fVar3 = position->y;
|
|
outPosition->x = position->x;
|
|
outPosition->y = fVar3;
|
|
return outPosition;
|
|
}
|
|
|
|
// 00823f50
|
|
void Room::attach_minecarts()
|
|
{
|
|
int *piVar1;
|
|
Entity_NPC *this;
|
|
void *pvVar2;
|
|
uint8_t railCell;
|
|
uint32_t uVar3;
|
|
int in_ECX;
|
|
int neighborRow;
|
|
int iVar4;
|
|
int iVar5;
|
|
uint8_t *puVar6;
|
|
uint8_t *puVar7;
|
|
float railX;
|
|
float railY;
|
|
uint8_t auStack_54 [3];
|
|
char isMinecartNpc;
|
|
int local_50;
|
|
int gridRow;
|
|
int self;
|
|
Vector railDir;
|
|
Entity_NPC *local_3c;
|
|
uint32_t entityIndex;
|
|
Vector cartPos;
|
|
int neighborOffsets [10];
|
|
Game *game;
|
|
int gridWidth;
|
|
|
|
neighborOffsets[8] = __security_cookie ^ GHIDRA_UINT(auStack_54);
|
|
entityIndex = 0;
|
|
self = in_ECX;
|
|
if (*GHIDRA_CAST<int *>((in_ECX + 0x1264)) != 0) {
|
|
do {
|
|
game = g_game;
|
|
puVar6 = &DAT_bf800000;
|
|
puVar7 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
this = *GHIDRA_CAST<Entity_NPC **>((*GHIDRA_CAST<int *>((in_ECX + 0x125c)) + entityIndex * 4));
|
|
iVar5 = this->_type;
|
|
if ((iVar5 != 0x3c5) || (isMinecartNpc = '\x01', this->_variant != 10)) {
|
|
isMinecartNpc = '\0';
|
|
}
|
|
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (iVar5 == 1)) || (iVar5 - 10U < 0x3de)) {
|
|
local_50 = this->_spawnGridIndex;
|
|
if ((-1 < local_50) &&
|
|
((((iVar5 != 0x3c5 || (this->_variant != 0)) && (this->_minecart == 0)) ||
|
|
(isMinecartNpc != '\0')))) {
|
|
gridRow = local_50 / *GHIDRA_CAST<int *>((in_ECX + 0xc));
|
|
local_50 = local_50 % *GHIDRA_CAST<int *>((in_ECX + 0xc));
|
|
iVar5 = 0;
|
|
neighborOffsets[0] = 0;
|
|
neighborOffsets[1] = 1;
|
|
neighborOffsets[2] = 0;
|
|
neighborOffsets[3] = 0xffffffff;
|
|
neighborOffsets[4] = 0xffffffff;
|
|
neighborOffsets[5] = 0;
|
|
neighborOffsets[6] = 1;
|
|
neighborOffsets[7] = 0;
|
|
do {
|
|
iVar4 = neighborOffsets[iVar5 * 2] + local_50;
|
|
if (0 < iVar4) {
|
|
neighborRow = neighborOffsets[iVar5 * 2 + 1] + gridRow;
|
|
if (0 < neighborRow) {
|
|
gridWidth = *GHIDRA_CAST<int *>((in_ECX + 0xc));
|
|
if (iVar4 < gridWidth + -1) {
|
|
piVar1 = GHIDRA_CAST<int *>((in_ECX + 0x10));
|
|
in_ECX = self;
|
|
if (((neighborRow < *piVar1 + -1) && (iVar4 < gridWidth)) &&
|
|
((neighborRow < *piVar1 &&
|
|
(((iVar4 = gridWidth * neighborRow + iVar4, -1 < iVar4 && (iVar4 < 0x1c0)) &&
|
|
(railCell = *GHIDRA_CAST<uint8_t *>((self + 0x746c + iVar4)), -1 < (char)railCell)))))) {
|
|
if (railCell == 0xff) {
|
|
uVar3 = 0;
|
|
}
|
|
else if ((railCell & 0x40) == 0) {
|
|
if ((railCell & 0x10) == 0) {
|
|
uVar3 = railCell >> 5 & 1;
|
|
}
|
|
else {
|
|
uVar3 = 0xffffffff;
|
|
}
|
|
}
|
|
else {
|
|
uVar3 = 0;
|
|
}
|
|
railCell = *GHIDRA_CAST<uint8_t *>((self + 0x746c + iVar4));
|
|
if ((railCell != 0xff) && ((uVar3 != 0 || (isMinecartNpc != '\0')))) {
|
|
railDir.y = 0.0;
|
|
railDir.x = 0.0;
|
|
if (uVar3 != 0) {
|
|
if ((railCell & 0xf) == 0) {
|
|
railDir.y = (float)puVar7;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
puVar7 = puVar6;
|
|
}
|
|
else {
|
|
puVar7 = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
}
|
|
}
|
|
else {
|
|
if (-1 < GHIDRA_INT(uVar3)) {
|
|
puVar6 = GHIDRA_CAST<uint8_t *>(0x3f800000);
|
|
}
|
|
railDir.y = (float)puVar6;
|
|
}
|
|
railDir.x = (float)puVar7;
|
|
}
|
|
railX = (float)(iVar4 % *GHIDRA_CAST<int *>((self + 0xc))) * 40.0 + 40.0;
|
|
railY = (float)(iVar4 / *GHIDRA_CAST<int *>((self + 0xc))) * 40.0 + 120.0;
|
|
in_ECX = self;
|
|
local_3c = this;
|
|
if (isMinecartNpc == '\0') {
|
|
cartPos.x = railX;
|
|
cartPos.y = railY;
|
|
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::GiveMinecart(&cartPos,&railDir);
|
|
}
|
|
else {
|
|
(this->_velocity).y = railDir.y;
|
|
(this->_pos).x = railX;
|
|
(this->_pos).y = railY;
|
|
(this->_velocity).x = railDir.x;
|
|
(this->_targetPosition).x = railX;
|
|
(this->_targetPosition).y = railY;
|
|
pvVar2 = game->_room;
|
|
iVar5 = GHIDRA_INT((((this->_pos).x - 40.0) / 40.0 + 0.5));
|
|
if (((iVar5 < 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0xc)) <= iVar5)) ||
|
|
(((iVar4 = GHIDRA_INT(((railY - 120.0) / 40.0 + 0.5)), iVar4 < 0 ||
|
|
(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x10)) <= iVar4 ||
|
|
(uVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0xc)) * iVar4 + iVar5, 0x1bf < uVar3))
|
|
|| (railCell = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar2) + uVar3 + 0x746c)),
|
|
railCell == 0xff)))) ||
|
|
(((railCell = railCell & 0xf, railCell != 1 && (railCell != 9)) &&
|
|
(railCell != 10)))))) {
|
|
iVar5 = 0;
|
|
}
|
|
else {
|
|
iVar5 = 4;
|
|
}
|
|
this->_i1 = iVar5;
|
|
this->Entity_NPC::update_move_direction_anim();
|
|
(this->_v2).x = 0.2;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
iVar5 = iVar5 + 1;
|
|
} while (iVar5 < 4);
|
|
}
|
|
}
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < *GHIDRA_CAST<uint32_t *>((in_ECX + 0x1264)));
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 008242d0
|
|
uint8_t Room::HasLava()
|
|
{
|
|
if ((this->_backdropType == 0x20) && ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0))
|
|
{
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00824350
|
|
void Room::init_rain()
|
|
{
|
|
uint32_t uVar1;
|
|
uint8_t unused;
|
|
uint8_t rngShiftB;
|
|
uint32_t baseCount;
|
|
uint32_t roll;
|
|
uint32_t spawnersLeft;
|
|
int updatesLeft;
|
|
float fVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
float fVar5;
|
|
float fVar6;
|
|
float local_4c;
|
|
float local_48;
|
|
float local_44;
|
|
uint64_t rngShiftsAB;
|
|
Vector spawnPos;
|
|
uint32_t attempt;
|
|
code *breakTrap;
|
|
|
|
this->_numRainSpawners = 0;
|
|
this->_rainIntensity = 1.0;
|
|
this->_isRainStopped = 0;
|
|
if ((0.0 < this->_waterAmount) &&
|
|
(((uVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID((uint8_t)this), uVar1 == 0x1b ||
|
|
(uVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(unused), uVar1 == 0x1c)) || (this->_backdropType == 0x2c))))
|
|
{
|
|
rngShiftsAB = 0xb00000001;
|
|
uVar1 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
if (this->_bossId == 0x4d) {
|
|
spawnersLeft = ((uint8_t)~*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) & 1) << 2;
|
|
}
|
|
else {
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> 1 ^ uVar1;
|
|
uVar1 = uVar1 << 0xb ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
roll = uVar1 % 1000;
|
|
baseCount = (roll < 300) + 1;
|
|
if (99 < roll) {
|
|
baseCount = GHIDRA_UINT((roll < 300));
|
|
}
|
|
spawnersLeft = baseCount + 1;
|
|
if (0x27 < roll) {
|
|
spawnersLeft = baseCount;
|
|
}
|
|
if (roll < 10) {
|
|
spawnersLeft = spawnersLeft + 1;
|
|
}
|
|
}
|
|
attempt = 0;
|
|
do {
|
|
if (spawnersLeft == 0) break;
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> ((uint8_t)rngShiftsAB & 0x1f) ^ uVar1;
|
|
rngShiftB = (uint8_t)((uint64_t)rngShiftsAB >> 0x20);
|
|
uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
fVar2 = (this->_topLeftPos).y + 20.0;
|
|
fVar2 = (((this->_bottomRightPos).y - 20.0) - fVar2) *
|
|
(float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283062e-10 + fVar2;
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> ((uint8_t)rngShiftsAB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
fVar3 = (this->_topLeftPos).x + 20.0;
|
|
fVar3 = (((this->_bottomRightPos).x - 20.0) - fVar3) *
|
|
(float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283062e-10 + fVar3;
|
|
spawnPos.x = fVar3;
|
|
spawnPos.y = fVar2;
|
|
FUN_00995f40(&local_4c,&spawnPos);
|
|
if (0.6 <= (local_48 + local_4c + local_44) * 0.333) {
|
|
updatesLeft = this->_numRainSpawners;
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> ((uint8_t)rngShiftsAB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 << ((uint8_t)((uint64_t)rngShiftsAB >> 0x20) & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
fVar4 = (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283062e-10 * 360.0 * 0.017453292;
|
|
fVar5 = cos(fVar4);
|
|
fVar4 = sin(fVar4);
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x7c)) = fVar3;
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x80)) = fVar2;
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> ((uint8_t)rngShiftsAB & 0x1f) ^ uVar1;
|
|
rngShiftB = (uint8_t)((uint64_t)rngShiftsAB >> 0x20);
|
|
uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
fVar2 = (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283062e-10 * 60.0 + 20.0;
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x88)) = fVar2 * fVar4;
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x84)) = fVar2 * fVar5;
|
|
fVar2 = cos(1.5707964);
|
|
fVar3 = sin(1.5707964);
|
|
if (uVar1 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
breakTrap = (code *)swi(3);
|
|
(*breakTrap)();
|
|
return;
|
|
}
|
|
uVar1 = uVar1 >> ((uint8_t)rngShiftsAB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 << (rngShiftB & 0x1f) ^ uVar1;
|
|
uVar1 = uVar1 >> 6 ^ uVar1;
|
|
fVar6 = (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) *
|
|
2.3283062e-10 * 60.0 + 20.0;
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x90)) =
|
|
fVar6 * (fVar3 * fVar5 + fVar2 * fVar4);
|
|
*GHIDRA_CAST<float *>((this->_outputGroupCallbacks + updatesLeft * 0x18 + 0x8c)) =
|
|
fVar6 * (fVar2 * fVar5 - fVar3 * fVar4);
|
|
this->_numRainSpawners = this->_numRainSpawners + 1;
|
|
spawnersLeft = spawnersLeft - 1;
|
|
}
|
|
attempt = attempt + 1;
|
|
} while (attempt < 10);
|
|
updatesLeft = 10;
|
|
do {
|
|
update_ambient_spawns(this);
|
|
updatesLeft = updatesLeft + -1;
|
|
} while (updatesLeft != 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00824800
|
|
void Room::update_ambient_spawns()
|
|
{
|
|
uint32_t rngResult;
|
|
Entity *rainDrop;
|
|
int iVar1;
|
|
float *rainSpawner;
|
|
float radiusRoll;
|
|
float cosOffset;
|
|
float fVar2;
|
|
Vector spawnPos;
|
|
Vector clampedPos;
|
|
|
|
if ((0 < this->_numRainSpawners) && (fVar2 = this->_rainIntensity, 0.0 < fVar2)) {
|
|
if (this->_isRainStopped != 0) {
|
|
fVar2 = fVar2 - 0.02;
|
|
if (fVar2 <= 0.0) {
|
|
fVar2 = 0.0;
|
|
}
|
|
this->_rainIntensity = fVar2;
|
|
}
|
|
if (fVar2 < 0.01) {
|
|
this->_rainIntensity = 0.0;
|
|
return;
|
|
}
|
|
fVar2 = GetTimeScale(this,GHIDRA_CAST<Vector *>(this),GHIDRA_CAST<Entity *>(0x0));
|
|
iVar1 = GHIDRA_INT((1.0 / (fVar2 * this->_rainIntensity)));
|
|
if (((iVar1 == 0) || (g_game->_frameCount % iVar1 < 1)) &&
|
|
(iVar1 = 0, 0 < this->_numRainSpawners)) {
|
|
rainSpawner = GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7408))));
|
|
do {
|
|
rngResult = Random();
|
|
fVar2 = (float)((double)GHIDRA_INT(rngResult) + __uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)])
|
|
* 2.3283064e-10 * 3.14;
|
|
fVar2 = fVar2 + fVar2;
|
|
rngResult = Random();
|
|
radiusRoll = (float)((double)GHIDRA_INT(rngResult) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngResult) >> 0x1f)]) * 2.3283064e-10;
|
|
cosOffset = cos(fVar2);
|
|
cosOffset = cosOffset * radiusRoll;
|
|
fVar2 = sin(fVar2);
|
|
fVar2 = fVar2 * radiusRoll;
|
|
spawnPos.x = cosOffset * rainSpawner[-3] + rainSpawner[-5] + fVar2 * rainSpawner[-1];
|
|
spawnPos.y = cosOffset * rainSpawner[-2] + rainSpawner[-4] + fVar2 * *rainSpawner;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U < 4) {
|
|
GetClampedPositionImpl(this,&clampedPos,&spawnPos,0.0,0.0,0.0,0.0);
|
|
if ((clampedPos.x == spawnPos.x) && (clampedPos.y == spawnPos.y)) {
|
|
LAB_00824a1f:
|
|
rngResult = Random();
|
|
rainDrop = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x87,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
rngResult,0);
|
|
rainDrop->Update();
|
|
}
|
|
}
|
|
else if ((((this->_topLeftPos).x + 0.0 <= spawnPos.x) &&
|
|
(spawnPos.x <= (this->_bottomRightPos).x - 0.0)) &&
|
|
(((this->_topLeftPos).y + 0.0 <= spawnPos.y &&
|
|
(spawnPos.y <= (this->_bottomRightPos).y - 0.0)))) goto LAB_00824a1f;
|
|
iVar1 = iVar1 + 1;
|
|
rainSpawner = rainSpawner + 6;
|
|
} while (iVar1 < this->_numRainSpawners);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00824a70
|
|
uint32_t Room::update_ambient_effects()
|
|
{
|
|
double dVar1;
|
|
uint8_t bVar2;
|
|
uint32_t stageId;
|
|
uint32_t uVar3;
|
|
uint32_t uVar4;
|
|
Entity *particle;
|
|
void *idleAnimData;
|
|
LayerState *layer;
|
|
Game *pGVar5;
|
|
float spawnTop;
|
|
int framesSinceEnter;
|
|
int remainingSpawns;
|
|
Vector spawnPos;
|
|
Vector velocity;
|
|
ColorMod particleColor;
|
|
int backdropType;
|
|
Game *game;
|
|
ANM2 *particleSprite;
|
|
float roomBottom;
|
|
float roomLeft;
|
|
float roomRight;
|
|
|
|
game = g_game;
|
|
if (g_game->_challenge == 0x2c) {
|
|
stageId = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomStageType(g_game->_currentRoomIdx);
|
|
LAB_00824abd:
|
|
pGVar5 = g_game;
|
|
stageId = RoomConfig::GetStageID(game->_stage,stageId,-1);
|
|
if ((stageId != 0x21) && (stageId != 0x1c)) goto LAB_00824ad7;
|
|
}
|
|
else {
|
|
if (g_game->_currentDimensionIdx != 2) {
|
|
stageId = g_game->_stageType;
|
|
goto LAB_00824abd;
|
|
}
|
|
stageId = 0x23;
|
|
pGVar5 = g_game;
|
|
LAB_00824ad7:
|
|
if (((this->_roomType != 5) || (this->_bossId != 0x5b)) && (pGVar5->_currentRoomIdx != -0x10)) {
|
|
bVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(pGVar5))))->Level::HasAbandonedMineshaft();
|
|
pGVar5 = g_game;
|
|
if (((bVar2 == 0) || (g_game->_currentDimensionIdx != 1)) &&
|
|
(g_game->_currentDimensionIdx == 0)) {
|
|
return GHIDRA_UINT(bVar2);
|
|
}
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<char *>(this) == '\0') {
|
|
framesSinceEnter = -1;
|
|
}
|
|
else {
|
|
framesSinceEnter = pGVar5->_frameCount - this->_enterFrame;
|
|
if (framesSinceEnter == 0) goto LAB_00824b4c;
|
|
}
|
|
if (pGVar5->_frameCount % 0xd2 != 0) {
|
|
return pGVar5->_frameCount / 0xd2;
|
|
}
|
|
LAB_00824b4c:
|
|
roomRight = (this->_bottomRightPos).x;
|
|
roomBottom = (this->_bottomRightPos).y;
|
|
spawnTop = (this->_topLeftPos).y - 40.0;
|
|
roomLeft = (this->_topLeftPos).x;
|
|
remainingSpawns = GHIDRA_UINT((framesSinceEnter == 0)) * 4 + 1;
|
|
do {
|
|
uVar3 = Random();
|
|
dVar1 = __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)];
|
|
uVar4 = Random();
|
|
spawnPos.x = ((roomRight + 500.0) - roomLeft) *
|
|
(float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283064e-10 + roomLeft;
|
|
if (framesSinceEnter != 0) {
|
|
spawnPos.x = roomRight + 600.0;
|
|
}
|
|
spawnPos.y = ((roomBottom + 40.0) - spawnTop) *
|
|
(float)((double)GHIDRA_INT(uVar3) + dVar1) * 2.3283064e-10 + spawnTop;
|
|
uVar3 = Random();
|
|
velocity.y = 0.0;
|
|
velocity.x = -0.25 - (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)])
|
|
* 2.3283064e-10 * 0.5;
|
|
uVar3 = Random();
|
|
particle = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x8a,&spawnPos,&velocity,GHIDRA_CAST<Entity *>(0x0),0,uVar3,0);
|
|
particleSprite = &particle->_sprite;
|
|
idleAnimData = (GHIDRA_CAST<ANM2 *>((particleSprite)))->ANM2::GetAnimationData(s_Idle);
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(idleAnimData) + 0x30));
|
|
uVar4 = 0;
|
|
if (uVar3 != 0) {
|
|
uVar4 = Random();
|
|
uVar4 = uVar4 % uVar3;
|
|
}
|
|
bVar2 = (GHIDRA_CAST<ANM2 *>((particleSprite)))->ANM2::SetAnimation(s_Idle,1);
|
|
if (((bVar2 != 0) && ((particle->_sprite)._animState._animData != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((&(particle->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar4)),
|
|
(particle->_sprite)._animState._animData != (void *)0x0)) {
|
|
(particle->_sprite)._animState._isPlaying = 0;
|
|
}
|
|
uVar3 = Random();
|
|
(particle->_sprite)._flipX = (uint8_t)uVar3 & 1;
|
|
uVar3 = Random();
|
|
particleColor._offset[0] = 0.0;
|
|
(particle->_sprite)._flipY = (uint8_t)uVar3 & 1;
|
|
particleColor._offset[1] = 0.0;
|
|
particleColor._offset[2] = 0.0;
|
|
if (stageId == 0x1b) {
|
|
particleColor._tint[0] = 0.87843144;
|
|
particleColor._tint[1] = 0.9607844;
|
|
particleColor._tint[2] = 0.97647065;
|
|
}
|
|
else {
|
|
backdropType = this->_backdropType;
|
|
if ((backdropType == 0x2c) || (backdropType == 0x2b)) {
|
|
particleColor._tint[0] = 0.54901963;
|
|
particleColor._tint[1] = 0.16470589;
|
|
particleColor._tint[2] = 0.16470589;
|
|
}
|
|
else if (backdropType == 0xd) {
|
|
particleColor._tint[0] = 0.83921576;
|
|
particleColor._tint[1] = 0.9176471;
|
|
particleColor._tint[2] = 0.97647065;
|
|
}
|
|
else if (stageId == 0x1c) {
|
|
particleColor._tint[0] = 0.21960786;
|
|
particleColor._tint[1] = 0.27450982;
|
|
particleColor._tint[2] = 0.08627451;
|
|
}
|
|
else if ((stageId == 0x1d) || (stageId == 0x1e)) {
|
|
particleColor._tint[0] = 0.3921569;
|
|
particleColor._tint[1] = 0.3137255;
|
|
particleColor._tint[2] = 0.50980395;
|
|
}
|
|
else if (g_game->_currentDimensionIdx == 2) {
|
|
particleColor._tint[0] = 0.47058827;
|
|
particleColor._tint[1] = 0.47058827;
|
|
particleColor._tint[2] = 0.47058827;
|
|
}
|
|
else {
|
|
particleColor._tint[0] = 0.43921572;
|
|
particleColor._tint[1] = 0.54901963;
|
|
particleColor._tint[2] = 0.1764706;
|
|
}
|
|
}
|
|
uVar3 = Random();
|
|
particleColor._tint[3] =
|
|
(float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) * 2.3283064e-10
|
|
* 0.3 + 0.7;
|
|
layer = (GHIDRA_CAST<ANM2 *>((particleSprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
|
if (&layer->_color != &particleColor) {
|
|
(layer->_color)._tint[0] = particleColor._tint[0];
|
|
(layer->_color)._tint[1] = particleColor._tint[1];
|
|
(layer->_color)._tint[2] = particleColor._tint[2];
|
|
(layer->_color)._tint[3] = particleColor._tint[3];
|
|
(layer->_color)._colorize[0] = 0.0;
|
|
(layer->_color)._colorize[1] = 0.0;
|
|
(layer->_color)._colorize[2] = 0.0;
|
|
(layer->_color)._colorize[3] = 0.0;
|
|
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) =
|
|
CONCAT44(particleColor._offset[1],particleColor._offset[0]);
|
|
(layer->_color)._offset[2] = particleColor._offset[2];
|
|
}
|
|
uVar3 = particle->Update();
|
|
remainingSpawns = remainingSpawns + -1;
|
|
} while (remainingSpawns != 0);
|
|
return uVar3;
|
|
}
|
|
|
|
// 00824ee0
|
|
void Room::update_water_current()
|
|
{
|
|
uint8_t bVar1;
|
|
uint32_t uVar2;
|
|
uint32_t rngValue;
|
|
Entity *splash;
|
|
int iVar3;
|
|
Entity *pEVar4;
|
|
int framesInRoom;
|
|
int iVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
float fVar10;
|
|
float fVar11;
|
|
uint32_t entityIndex;
|
|
int gridIndex;
|
|
void **local_40;
|
|
Vector local_38;
|
|
Vector local_30;
|
|
Vector gridPos;
|
|
Vector clampedPos;
|
|
Vector splashVelocity;
|
|
Vector splashPos;
|
|
Game *game;
|
|
|
|
if (((this->_waterCurrent).x != g_vectorZero.x) || ((this->_waterCurrent).y != g_vectorZero.y)) {
|
|
entityIndex = 0;
|
|
if ((this->_entityList)._updateEL._size != 0) {
|
|
do {
|
|
pEVar4 = *GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_entityList)._updateEL)) + 0x4)))) + entityIndex * 4));
|
|
framesInRoom = pEVar4->_type;
|
|
if (framesInRoom == 5) {
|
|
if (pEVar4->_entityCollisionClass != 0) {
|
|
LAB_00824f78:
|
|
if ((pEVar4->_entityGridCollisionClass == 5) || (pEVar4->_entityGridCollisionClass == 6)
|
|
) {
|
|
fVar9 = (this->_waterCurrent).y;
|
|
(pEVar4->_velocity).x = (this->_waterCurrent).x * 0.4 + (pEVar4->_velocity).x;
|
|
(pEVar4->_velocity).y = fVar9 * 0.4 + (pEVar4->_velocity).y;
|
|
game = g_game;
|
|
if ((((pEVar4->_flags & 0x4000) == 0) &&
|
|
((bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar1 == 0 && (game->_frameCount % 3 == 0)))) &&
|
|
((pEVar4->_type == 1 || (pEVar4->_type - 10U < 0x3de)))) {
|
|
uVar2 = Random();
|
|
for (framesInRoom = uVar2 % 3 + 2; framesInRoom != 0;
|
|
framesInRoom = framesInRoom + -1) {
|
|
fVar9 = (pEVar4->_pos).x;
|
|
fVar11 = (pEVar4->_pos).y;
|
|
uVar2 = Random();
|
|
fVar6 = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]
|
|
) * 2.3283064e-10 * 3.14;
|
|
fVar6 = fVar6 + fVar6;
|
|
fVar10 = pEVar4->_size;
|
|
uVar2 = Random();
|
|
fVar7 = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]
|
|
) * 2.3283064e-10;
|
|
fVar8 = cos(fVar6);
|
|
local_38.x = fVar8 * fVar10 * fVar7 + fVar9;
|
|
fVar9 = sin(fVar6);
|
|
local_38.y = fVar9 * fVar10 * fVar7 + fVar11;
|
|
uVar2 = Random();
|
|
rngValue = Random();
|
|
fVar10 = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10
|
|
* 6.0 + 4.0;
|
|
fVar9 = (this->_waterCurrent).x;
|
|
fVar11 = (this->_waterCurrent).y;
|
|
rngValue = Random();
|
|
fVar6 = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10 *
|
|
3.14;
|
|
fVar6 = fVar6 + fVar6;
|
|
local_30.x = cos(fVar6);
|
|
local_30.x = local_30.x + fVar9 * fVar10;
|
|
local_30.y = sin(fVar6);
|
|
local_30.y = local_30.y + fVar11 * fVar10;
|
|
splash = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,99,&local_38,&local_30,pEVar4,1,uVar2,0);
|
|
splash->Update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (((framesInRoom == 1) || (framesInRoom - 10U < 0x3de)) || (framesInRoom == 4))
|
|
goto LAB_00824f78;
|
|
entityIndex = entityIndex + 1;
|
|
} while (entityIndex < GHIDRA_UINT((this->_entityList)._updateEL._size));
|
|
}
|
|
if ((*GHIDRA_CAST<char *>(this) != '\0') &&
|
|
(framesInRoom = g_game->_frameCount - this->_enterFrame,
|
|
framesInRoom == (framesInRoom / 3) * 3)) {
|
|
framesInRoom = this->_gridWidth * this->_gridHeight;
|
|
fVar9 = (this->_waterCurrent).x * 40.0;
|
|
fVar11 = (this->_waterCurrent).y * 40.0;
|
|
gridIndex = 0;
|
|
if (0 < framesInRoom) {
|
|
local_40 = this->_gridEntities;
|
|
do {
|
|
if ((*local_40 != (void *)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_INT(*local_40) + 4)) == 0xf)) {
|
|
fVar6 = (float)(gridIndex % this->_gridWidth) * 40.0 + 40.0 + fVar9;
|
|
fVar10 = (float)(gridIndex / this->_gridWidth) * 40.0 + 120.0 + fVar11;
|
|
gridPos.x = fVar6;
|
|
gridPos.y = fVar10;
|
|
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x48)) - 9U < 4) {
|
|
GetClampedPositionImpl(this,&clampedPos,&gridPos,0.0,0.0,0.0,0.0);
|
|
if ((clampedPos.x == fVar6) && (clampedPos.y == fVar10)) {
|
|
LAB_0082540c:
|
|
iVar5 = GHIDRA_INT(((fVar6 - 40.0) / 40.0 + 0.5));
|
|
iVar3 = GHIDRA_INT(((fVar10 - 120.0) / 40.0 + 0.5));
|
|
if (((iVar5 < 0) || ((this->_gridWidth <= iVar5 || (iVar3 < 0)))) ||
|
|
(this->_gridHeight <= iVar3)) {
|
|
iVar5 = -1;
|
|
}
|
|
else {
|
|
iVar5 = iVar3 * this->_gridWidth + iVar5;
|
|
}
|
|
uVar2 = GetGridCollision(this,iVar5);
|
|
if (GHIDRA_INT(uVar2) < 2) {
|
|
uVar2 = Random();
|
|
for (iVar3 = uVar2 % 3 + 2; iVar3 != 0; iVar3 = iVar3 + -1) {
|
|
uVar2 = Random();
|
|
rngValue = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10
|
|
* 6.0 + 4.0;
|
|
fVar7 = (this->_waterCurrent).x;
|
|
local_30.x = (this->_waterCurrent).y;
|
|
rngValue = Random();
|
|
local_38.x = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 * 3.14;
|
|
local_38.x = local_38.x + local_38.x;
|
|
splashVelocity.x = cos(local_38.x);
|
|
splashVelocity.x = splashVelocity.x + fVar7 * fVar8;
|
|
splashVelocity.y = sin(local_38.x);
|
|
splashVelocity.y = splashVelocity.y + local_30.x * fVar8;
|
|
rngValue = Random();
|
|
local_30.x = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) *
|
|
2.3283064e-10 - 0.5;
|
|
local_38.x = (this->_waterCurrent).x;
|
|
fVar7 = (this->_waterCurrent).y;
|
|
rngValue = Random();
|
|
fVar8 = (float)((double)GHIDRA_INT(rngValue) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(rngValue) >> 0x1f)]) * 2.3283064e-10
|
|
;
|
|
splashPos.x = local_30.x * fVar11 + (fVar6 - fVar9 * 0.54) +
|
|
local_38.x * 3.0 * fVar8;
|
|
splashPos.y = local_30.x * fVar9 + (fVar10 - fVar11 * 0.54) +
|
|
fVar7 * 3.0 * fVar8;
|
|
pEVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,99,&splashPos,&splashVelocity,GHIDRA_CAST<Entity *>(0x0),1
|
|
,uVar2,0);
|
|
fVar7 = (pEVar4->_sprite)._scale.x;
|
|
fVar8 = (pEVar4->_sprite)._scale.y;
|
|
iVar5 = *GHIDRA_CAST<int *>(pEVar4);
|
|
(pEVar4->_sprite)._scale.x = fVar7 + fVar7;
|
|
(pEVar4->_sprite)._scale.y = fVar8 + fVar8;
|
|
(**(code **)(iVar5 + 0xc))();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (((((this->_topLeftPos).x + 0.0 <= fVar6) &&
|
|
(fVar6 <= (this->_bottomRightPos).x - 0.0)) &&
|
|
((this->_topLeftPos).y + 0.0 <= fVar10)) &&
|
|
(fVar10 <= (this->_bottomRightPos).y - 0.0)) goto LAB_0082540c;
|
|
}
|
|
gridIndex = gridIndex + 1;
|
|
local_40 = local_40 + 1;
|
|
} while (gridIndex < framesInRoom);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00825730
|
|
uint8_t Room::CanPickupGridEntity(int GridIndex)
|
|
{
|
|
void *gridEntity;
|
|
int gridType;
|
|
|
|
if (0x1bf < GHIDRA_UINT(GridIndex)) {
|
|
return 0;
|
|
}
|
|
gridEntity = this->_gridEntities[GridIndex];
|
|
if (gridEntity == (void *)0x0) {
|
|
return 0;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0x3c)) == 0) {
|
|
return 0;
|
|
}
|
|
gridType = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 4));
|
|
if (((((gridType == 2) || (gridType == 4)) || (gridType == 5)) ||
|
|
((gridType == 6 || (gridType == 0x1a)))) || ((gridType == 0x16 || (gridType == 0x1b)))) {
|
|
return 1;
|
|
}
|
|
if (gridType == 0xc) {
|
|
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(gridEntity) + 0xc)) < 4) {
|
|
return 1;
|
|
}
|
|
}
|
|
else if ((gridType == 0xe) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 0xc)) != 1000)) {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 008257a0
|
|
uint8_t Room::spawn_grid_from_desc(uint32_t gridIndex, GridEntityDesc *outDesc, ANM2 *outSprite)
|
|
{
|
|
int iVar1;
|
|
int iVar2;
|
|
uint32_t uVar3;
|
|
ANM2 other;
|
|
Room *pRVar4;
|
|
void **ppvVar5;
|
|
uint8_t isLadderSpawned;
|
|
GridEntity_Poop *gigaPart;
|
|
GridEntity *decoration;
|
|
uint32_t flyGridIndex;
|
|
int listData;
|
|
Room *pRVar6;
|
|
GridEntity_Poop *pGVar7;
|
|
uint32_t uVar8;
|
|
ANM2 aAStackY_8c7c [128];
|
|
uint8_t in_stack_fffffe98 [248];
|
|
float in_stack_ffffff90;
|
|
float in_stack_ffffff94;
|
|
uint32_t in_stack_ffffff98;
|
|
float in_stack_ffffff9c;
|
|
uint32_t in_stack_ffffffa0;
|
|
int in_stack_ffffffa4;
|
|
int in_stack_ffffffa8;
|
|
EntityList_EL flies;
|
|
GridEntity *allocatedGrid;
|
|
uint32_t spawnSeed;
|
|
GridEntity_Poop *local_30;
|
|
int partVariant;
|
|
Room *room;
|
|
char isRock;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
GridEntity_Poop *gigaGridIndex;
|
|
int *eternalFly;
|
|
uint32_t *oldGrid;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b01993;
|
|
local_1c = ExceptionList;
|
|
if (0x1bf < gridIndex) {
|
|
return 0;
|
|
}
|
|
pGVar7 = this->_gridEntities[gridIndex];
|
|
if (pGVar7 == GHIDRA_CAST<GridEntity_Poop *>(0x0)) {
|
|
return 0;
|
|
}
|
|
if (pGVar7->_collisionClass == 0) {
|
|
return 0;
|
|
}
|
|
listData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x4))));
|
|
isRock = '\0';
|
|
local_30 = pGVar7;
|
|
room = this;
|
|
if (((((listData == 2) || (listData == 4)) || (listData == 5)) ||
|
|
((listData == 6 || (listData == 0x16)))) ||
|
|
((listData == 0x19 || ((listData == 0x1a || (listData == 0x1b)))))) {
|
|
ExceptionList = &local_1c;
|
|
(GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<GridEntity_Rock *>(pGVar7))))->GridEntity_Rock::TrySpawnWorms();
|
|
if ((999 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x8))))) && (-1 < GHIDRA_INT((*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x8)))) - 1000)))) {
|
|
(GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<GridEntity_Rock *>(pGVar7))))->GridEntity_Rock::UpdateNeighbors();
|
|
in_stack_ffffffa4 = 0x82588a;
|
|
(GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<GridEntity_Rock *>(pGVar7))))->GridEntity_Rock::SetBigRockFrame();
|
|
}
|
|
in_stack_ffffffa8 = 0x825892;
|
|
grid_mark_neighbors_dirty(pGVar7->_gridIndex);
|
|
isRock = '\x01';
|
|
ppvVar5 = ExceptionList;
|
|
}
|
|
else {
|
|
ppvVar5 = &local_1c;
|
|
if (listData == 0xc) {
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if (3 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0xc))))) {
|
|
return 0;
|
|
}
|
|
}
|
|
else {
|
|
if (listData != 0xe) {
|
|
return 0;
|
|
}
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0xc)))) == 1000) {
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = ppvVar5;
|
|
if (outSprite != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(register0x00000010) + -0x168)))))->ANM2::ANM2(&pGVar7->_sprite);
|
|
other._championColor._offset[1] = in_stack_ffffff90;
|
|
other._filename._buf[0] = in_stack_fffffe98[0];
|
|
other._filename._buf[1] = in_stack_fffffe98[1];
|
|
other._filename._buf[2] = in_stack_fffffe98[2];
|
|
other._filename._buf[3] = in_stack_fffffe98[3];
|
|
other._filename._buf[4] = in_stack_fffffe98[4];
|
|
other._filename._buf[5] = in_stack_fffffe98[5];
|
|
other._filename._buf[6] = in_stack_fffffe98[6];
|
|
other._filename._buf[7] = in_stack_fffffe98[7];
|
|
other._filename._buf[8] = in_stack_fffffe98[8];
|
|
other._filename._buf[9] = in_stack_fffffe98[9];
|
|
other._filename._buf[10] = in_stack_fffffe98[10];
|
|
other._filename._buf[0xb] = in_stack_fffffe98[0xb];
|
|
other._filename._buf[0xc] = in_stack_fffffe98[0xc];
|
|
other._filename._buf[0xd] = in_stack_fffffe98[0xd];
|
|
other._filename._buf[0xe] = in_stack_fffffe98[0xe];
|
|
other._filename._buf[0xf] = in_stack_fffffe98[0xf];
|
|
other._filename._size = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x10)));
|
|
other._filename._capacity = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x14)));
|
|
other._animDefaultName._buf[0] = in_stack_fffffe98[0x18];
|
|
other._animDefaultName._buf[1] = in_stack_fffffe98[0x19];
|
|
other._animDefaultName._buf[2] = in_stack_fffffe98[0x1a];
|
|
other._animDefaultName._buf[3] = in_stack_fffffe98[0x1b];
|
|
other._animDefaultName._buf[4] = in_stack_fffffe98[0x1c];
|
|
other._animDefaultName._buf[5] = in_stack_fffffe98[0x1d];
|
|
other._animDefaultName._buf[6] = in_stack_fffffe98[0x1e];
|
|
other._animDefaultName._buf[7] = in_stack_fffffe98[0x1f];
|
|
other._animDefaultName._buf[8] = in_stack_fffffe98[0x20];
|
|
other._animDefaultName._buf[9] = in_stack_fffffe98[0x21];
|
|
other._animDefaultName._buf[10] = in_stack_fffffe98[0x22];
|
|
other._animDefaultName._buf[0xb] = in_stack_fffffe98[0x23];
|
|
other._animDefaultName._buf[0xc] = in_stack_fffffe98[0x24];
|
|
other._animDefaultName._buf[0xd] = in_stack_fffffe98[0x25];
|
|
other._animDefaultName._buf[0xe] = in_stack_fffffe98[0x26];
|
|
other._animDefaultName._buf[0xf] = in_stack_fffffe98[0x27];
|
|
other._animDefaultName._size = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x28)));
|
|
other._animDefaultName._capacity = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x2c)));
|
|
other._animState._animation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x30)));
|
|
other._animState._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x34)));
|
|
other._animState._layerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x38)));
|
|
other._animState._nullLayerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x3c)));
|
|
other._animState._animFrame = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0x40)));
|
|
other._animState._isPlaying = in_stack_fffffe98[0x44];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other._animState)) + 0x15))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x45)));
|
|
other._animState._currentlyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x48)));
|
|
other._animState._previouslyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x4c)));
|
|
other._overlayAnimState._animation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x50)));
|
|
other._overlayAnimState._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x54)));
|
|
other._overlayAnimState._layerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x58)));
|
|
other._overlayAnimState._nullLayerFrames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x5c)));
|
|
other._overlayAnimState._animFrame = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0x60)));
|
|
other._overlayAnimState._isPlaying = in_stack_fffffe98[100];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other._overlayAnimState)) + 0x15))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x65)));
|
|
other._overlayAnimState._currentlyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x68)));
|
|
other._overlayAnimState._previouslyTriggeredEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x6c)));
|
|
other._overlayRenderFirst = in_stack_fffffe98[0x70];
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other)) + 0x71))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x71)));
|
|
other._animData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x74)));
|
|
other._animCount = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x78)));
|
|
other._layerState = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x7c)));
|
|
other._layerCount = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x80)));
|
|
other._nullLayerNames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x84)));
|
|
other._numNullLayers = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x88)));
|
|
other._eventNames = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)in_stack_fffffe98)) + 0x8c)));
|
|
other._numEvents = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(in_stack_fffffe98)) + 0x90)));
|
|
other._offset.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0x94)));
|
|
other._offset.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0x98)));
|
|
other._scale.x = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0x9c)));
|
|
other._scale.y = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xa0)));
|
|
other._rotation = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xa4)));
|
|
other._color._tint[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xa8)));
|
|
other._color._tint[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xac)));
|
|
other._color._tint[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xb0)));
|
|
other._color._tint[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xb4)));
|
|
other._color._colorize[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xb8)));
|
|
other._color._colorize[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xbc)));
|
|
other._color._colorize[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xc0)));
|
|
other._color._colorize[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xc4)));
|
|
other._color._offset[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xc8)));
|
|
other._color._offset[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xcc)));
|
|
other._color._offset[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xd0)));
|
|
other._championColor._tint[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xd4)));
|
|
other._championColor._tint[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xd8)));
|
|
other._championColor._tint[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xdc)));
|
|
other._championColor._tint[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xe0)));
|
|
other._championColor._colorize[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xe4)));
|
|
other._championColor._colorize[1] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xe8)));
|
|
other._championColor._colorize[2] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xec)));
|
|
other._championColor._colorize[3] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xf0)));
|
|
other._championColor._offset[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((float)in_stack_fffffe98)) + 0xf4)));
|
|
other._championColor._offset[2] = in_stack_ffffff94;
|
|
other._flipX = (uint8_t)in_stack_ffffff98;
|
|
other._flipY = SUB41(in_stack_ffffff98,1);
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(other)) + 0x102))) = SUB42(in_stack_ffffff98,2);
|
|
other._playbackSpeed = in_stack_ffffff9c;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(other)) + 0x108))) = (char)in_stack_ffffffa0;
|
|
other._loaded = SUB41(in_stack_ffffffa0,1);
|
|
(*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(other)) + 0x10a))) = SUB42(in_stack_ffffffa0,2);
|
|
other._shadowLayerIndex = in_stack_ffffffa4;
|
|
other._bitflags = in_stack_ffffffa8;
|
|
(GHIDRA_CAST<ANM2 *>((outSprite)))->ANM2::operator_assign(other);
|
|
}
|
|
if (outDesc != GHIDRA_CAST<GridEntityDesc *>(0x0)) {
|
|
listData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x8))));
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0xc))));
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x10))));
|
|
outDesc->_type = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x4))));
|
|
outDesc->_variant = listData;
|
|
outDesc->_state = iVar1;
|
|
outDesc->_spawnCount = iVar2;
|
|
listData = pGVar7->_varData;
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x1c))));
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x20))));
|
|
outDesc->_spawnSeed = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x14))));
|
|
outDesc->_varData = listData;
|
|
*GHIDRA_CAST<uint32_t *>(&outDesc->_initialized) = uVar3;
|
|
outDesc->_variableSeed = iVar1;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x4)))) == 0xe) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x8)))) - 7U < 4)) {
|
|
if (outDesc != GHIDRA_CAST<GridEntityDesc *>(0x0)) {
|
|
outDesc->_variant = 7;
|
|
}
|
|
partVariant = 7;
|
|
pRVar6 = room;
|
|
do {
|
|
listData = partVariant;
|
|
if (partVariant != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x8))))) {
|
|
gigaPart = (GHIDRA_CAST<GridEntity_Poop *>((pGVar7)))->GridEntity_Poop::get_giga_part(partVariant,0);
|
|
if (gigaPart != GHIDRA_CAST<GridEntity_Poop *>(0x0)) {
|
|
uVar8 = gigaPart->_gridIndex;
|
|
spawnSeed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gigaPart)) + 0x14))));
|
|
if ((uVar8 < 0x1c0) &&
|
|
(oldGrid = room->_gridEntities[uVar8], oldGrid != GHIDRA_CAST<uint32_t *>(0x0))) {
|
|
room->_gridPaths[uVar8] = 0;
|
|
room->_gridEntities[uVar8] = (void *)0x0;
|
|
(**(code **)*oldGrid)();
|
|
}
|
|
if ((GHIDRA_INT(uVar8) < 0) || (0x1bf < GHIDRA_INT(uVar8))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if ((0x1bf < uVar8) || (900 < room->_gridPaths[uVar8])) {
|
|
pRVar6 = room;
|
|
goto LAB_00825a05;
|
|
}
|
|
decoration = operator_new(0x154);
|
|
local_14 = 0;
|
|
allocatedGrid = decoration;
|
|
if (decoration == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
decoration = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(decoration) = IsaacRepentancePlus::GridEntity_Decoration::vftable;
|
|
}
|
|
pRVar6 = room;
|
|
local_14 = 0xffffffff;
|
|
if (decoration != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
decoration->_gridIndex = uVar8;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x4)))) = 1;
|
|
if (room->_gridEntities[uVar8] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(room->_gridEntities[uVar8]))();
|
|
}
|
|
pRVar6->_gridEntities[uVar8] = decoration;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x8)))) = 1000;
|
|
decoration->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::Init(spawnSeed);
|
|
}
|
|
pGVar7 = local_30;
|
|
listData = partVariant;
|
|
}
|
|
pRVar6 = room;
|
|
partVariant = listData;
|
|
}
|
|
LAB_00825a05:
|
|
partVariant = partVariant + 1;
|
|
} while (partVariant < 0xb);
|
|
gigaGridIndex = GHIDRA_CAST<GridEntity_Poop *>(pGVar7->_gridIndex);
|
|
spawnSeed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x14))));
|
|
local_30 = gigaGridIndex;
|
|
if ((gigaGridIndex < GHIDRA_CAST<GridEntity_Poop *>(0x1c0)) &&
|
|
(oldGrid = pRVar6->_gridEntities[GHIDRA_INT(gigaGridIndex)], oldGrid != GHIDRA_CAST<uint32_t *>(0x0))) {
|
|
pRVar6->_gridPaths[GHIDRA_INT(gigaGridIndex)] = 0;
|
|
pRVar6->_gridEntities[GHIDRA_INT(gigaGridIndex)] = (void *)0x0;
|
|
(**(code **)*oldGrid)();
|
|
}
|
|
if ((GHIDRA_INT(gigaGridIndex) < 0) || (0x1bf < GHIDRA_INT(gigaGridIndex))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
pRVar6 = room;
|
|
if ((GHIDRA_CAST<GridEntity_Poop *>(0x1bf) < gigaGridIndex) || (900 < room->_gridPaths[GHIDRA_INT(local_30)]))
|
|
goto LAB_00825b02;
|
|
decoration = operator_new(0x154);
|
|
local_14 = 0x17;
|
|
allocatedGrid = decoration;
|
|
if (decoration == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
decoration = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(decoration) = IsaacRepentancePlus::GridEntity_Decoration::vftable;
|
|
}
|
|
pRVar4 = room;
|
|
pGVar7 = local_30;
|
|
local_14 = 0xffffffff;
|
|
if (decoration == GHIDRA_CAST<GridEntity *>(0x0)) goto LAB_00825b02;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x4)))) = 1;
|
|
decoration->_gridIndex = GHIDRA_INT(local_30);
|
|
if (room->_gridEntities[GHIDRA_INT(local_30)] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(room->_gridEntities[GHIDRA_INT(local_30)]))();
|
|
}
|
|
pRVar4->_gridEntities[GHIDRA_INT(pGVar7)] = decoration;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x8)))) = 1000;
|
|
decoration->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::Init(spawnSeed);
|
|
}
|
|
else if ((isRock == '\0') ||
|
|
(isLadderSpawned = (GHIDRA_CAST<GridEntity_Rock *>((GHIDRA_CAST<GridEntity_Rock *>(pGVar7))))->GridEntity_Rock::TrySpawnLadder(),
|
|
isLadderSpawned == 0)) {
|
|
spawnSeed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar7)) + 0x14))));
|
|
room->_gridPaths[gridIndex] = 0;
|
|
room->_gridEntities[gridIndex] = (void *)0x0;
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(pGVar7))();
|
|
pRVar6 = room;
|
|
if (room->_gridPaths[gridIndex] < 0x385) {
|
|
decoration = operator_new(0x154);
|
|
local_14 = 0x2e;
|
|
allocatedGrid = decoration;
|
|
if (decoration == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
decoration = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(decoration) = IsaacRepentancePlus::GridEntity_Decoration::vftable;
|
|
}
|
|
local_14 = 0xffffffff;
|
|
if (decoration != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x4)))) = 1;
|
|
decoration->_gridIndex = gridIndex;
|
|
if (pRVar6->_gridEntities[gridIndex] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(pRVar6->_gridEntities[gridIndex]))();
|
|
}
|
|
pRVar6->_gridEntities[gridIndex] = decoration;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((decoration)) + 0x8)))) = 1000;
|
|
decoration->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((decoration)))->GridEntity::Init(spawnSeed);
|
|
}
|
|
}
|
|
goto LAB_00825b02;
|
|
}
|
|
pRVar6 = room;
|
|
LAB_00825b02:
|
|
EntityList::QuerySublist(&pRVar6->_entityList,&flies,0x60,-1,-1,0,0);
|
|
uVar8 = 0;
|
|
local_14 = 0x45;
|
|
if (flies._size != 0) {
|
|
listData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flies)) + 0x4)));
|
|
do {
|
|
eternalFly = *GHIDRA_CAST<int **>((listData + uVar8 * 4));
|
|
if (eternalFly[0xef] == 0) {
|
|
flyGridIndex = GetGridIndex(room,GHIDRA_CAST<Vector *>((eternalFly + 0xcd)));
|
|
if (flyGridIndex == gridIndex) {
|
|
eternalFly[0x2d9] = 0x10;
|
|
(**(code **)(*eternalFly + 0xc))();
|
|
}
|
|
listData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(flies)) + 0x4)));
|
|
}
|
|
uVar8 = uVar8 + 1;
|
|
} while (uVar8 < GHIDRA_UINT(flies._size));
|
|
}
|
|
(GHIDRA_CAST<EntityList_Query *>((&flies)))->EntityList_Query::~EntityList_Query();
|
|
ExceptionList = local_1c;
|
|
return 1;
|
|
}
|
|
|
|
// 00825c50
|
|
Entity_Effect * Room::PickupGridEntity(int GridIndex)
|
|
{
|
|
uint8_t isSpawned;
|
|
uint32_t seed;
|
|
Entity_Effect *pickupEffect;
|
|
GridEntityDesc gridDesc;
|
|
ANM2 gridSprite;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(&(&gridSprite)[1]._animDefaultName._size);
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b019c0;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT(((&gridSprite)[1]._animDefaultName._buf + 4));
|
|
ExceptionList = &local_1c;
|
|
gridDesc._type = 0;
|
|
gridDesc._variant = 0;
|
|
gridDesc._state = 0;
|
|
gridDesc._spawnCount = 0;
|
|
gridDesc._spawnSeed = 0x16a9de81;
|
|
gridDesc._varData = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gridDesc)) + 0x18))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gridDesc)) + 0x18))) & 0xffffff00;
|
|
gridDesc._variableSeed = 0x16a9de81;
|
|
(GHIDRA_CAST<ANM2 *>((&gridSprite)))->ANM2::constructor();
|
|
local_14 = 0;
|
|
isSpawned = spawn_grid_from_desc(this,GridIndex,&gridDesc,&gridSprite);
|
|
if (isSpawned == 0) {
|
|
pickupEffect = GHIDRA_CAST<Entity_Effect *>(0x0);
|
|
}
|
|
else {
|
|
seed = Random();
|
|
pickupEffect = (Entity_Effect *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0x88,&g_vectorZero,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed);
|
|
Isaac::SwapANM2(&gridSprite,&pickupEffect->_sprite);
|
|
*GHIDRA_CAST<int *>(&(pickupEffect->_varData)._l) = gridDesc._type;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(pickupEffect->_varData)._l) + 4)) = gridDesc._variant;
|
|
*GHIDRA_CAST<int *>(&(pickupEffect->_varData)._h) = gridDesc._state;
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(pickupEffect->_varData)._h) + 4)) = gridDesc._spawnCount;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickupEffect)) + 0x430)))) = gridDesc._spawnSeed;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickupEffect)) + 0x434)))) = gridDesc._varData;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickupEffect)) + 0x438))) = gridDesc._initialized;
|
|
*GHIDRA_CAST<undefined3 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickupEffect)) + 0x439)))) = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(gridDesc)) + 0x19)));
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pickupEffect)) + 0x43c)))) = gridDesc._variableSeed;
|
|
pickupEffect->_state = this->_backdropType;
|
|
}
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((&gridSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&gridSprite._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&gridSprite._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>((gridSprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&gridSprite))))->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_1c;
|
|
return pickupEffect;
|
|
}
|
|
|
|
// 00825de0
|
|
void Room::render_darkness_overlay()
|
|
{
|
|
code *pcVar1;
|
|
char isOverlayEnabled;
|
|
uint8_t bVar2;
|
|
uint32_t *renderTargetEntry;
|
|
int iVar3;
|
|
uint32_t uVar4;
|
|
uint8_t *shader;
|
|
void *pvVar5;
|
|
uint32_t preventedCurses;
|
|
uint8_t rngShift2;
|
|
uint8_t rngShift3;
|
|
KColor *color;
|
|
int unusedArg;
|
|
int unused;
|
|
int iVar6;
|
|
uint32_t uVar7;
|
|
bool isLightSkipped;
|
|
float fVar8;
|
|
float fVar9;
|
|
uint8_t auVar10 [12];
|
|
float fVar11;
|
|
double dVar12;
|
|
uint8_t auStackY_230 [128];
|
|
void *imageRefCount;
|
|
uint8_t lightQuad [112];
|
|
uint8_t screenQuad [32];
|
|
uint32_t local_108;
|
|
uint32_t uStack_104;
|
|
uint32_t uStack_100;
|
|
float fStack_fc;
|
|
uint32_t local_f8;
|
|
uint32_t local_f4;
|
|
uint32_t uStack_f0;
|
|
uint32_t uStack_ec;
|
|
float fStack_e8;
|
|
uint32_t local_e4;
|
|
uint32_t local_e0;
|
|
uint32_t uStack_dc;
|
|
uint32_t uStack_d8;
|
|
float fStack_d4;
|
|
uint32_t local_d0;
|
|
uint32_t local_cc;
|
|
uint32_t uStack_c8;
|
|
uint32_t uStack_c4;
|
|
float fStack_c0;
|
|
uint32_t local_bc;
|
|
KColor quadColor;
|
|
Vector local_a4;
|
|
Vector local_9c;
|
|
float local_94;
|
|
float fStack_90;
|
|
float fStack_8c;
|
|
float fStack_88;
|
|
float local_84;
|
|
float fStack_80;
|
|
float fStack_7c;
|
|
float fStack_78;
|
|
float local_74;
|
|
Vector local_70;
|
|
KColor local_68;
|
|
float local_54;
|
|
float local_50;
|
|
Room *local_4c;
|
|
float local_48;
|
|
uint32_t *local_44;
|
|
ColorMod local_40;
|
|
float local_14;
|
|
uint32_t curses;
|
|
Game *game;
|
|
Room *room;
|
|
|
|
local_14 = (float)(__security_cookie ^ GHIDRA_UINT(((&local_40)[1]._tint + 1)));
|
|
local_4c = this;
|
|
isOverlayEnabled = FUN_008242f0();
|
|
if (isOverlayEnabled != '\0') {
|
|
(GHIDRA_CAST<KColor *>((&quadColor)))->KColor::SetFromARGB(0xff000000);
|
|
render_quad_set_uniform_color(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,color);
|
|
local_70.x = 0.0;
|
|
local_70.y = 0.0;
|
|
msvc::vector::resize(&local_70);
|
|
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;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c7982c,1);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
render_color_shader_pass(screenQuad);
|
|
game = g_game;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
bVar2 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
if (bVar2 == 0) {
|
|
uVar4 = g_manager->_framecount + 1U & 0x80000001;
|
|
if (GHIDRA_INT(uVar4) < 0) {
|
|
uVar4 = (uVar4 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
local_54 = (float)GHIDRA_INT(uVar4) * 0.5;
|
|
}
|
|
else {
|
|
local_54 = 0.0;
|
|
}
|
|
if (*GHIDRA_CAST<char *>(local_4c) == '\0') {
|
|
iVar3 = -1;
|
|
}
|
|
else {
|
|
iVar3 = game->_frameCount - local_4c->_enterFrame;
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_4c)) + 0x4)))) + 0x58));
|
|
local_50 = 8.40779e-45;
|
|
local_54 = (float)iVar3 + local_54;
|
|
local_68._blue = 1.4013e-45;
|
|
local_68._alpha = 1.54143e-44;
|
|
local_9c.x = (float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c79824) + 0x10)) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c79824) + 0x10)) >> 0x1f)]);
|
|
local_9c.y = (float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c79824) + 0x14)) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c79824) + 0x14)) >> 0x1f)]);
|
|
local_a4.x = -((local_4c->_renderScrollOffset).x + (g_game->_screenShakeOffset).x);
|
|
local_a4.y = -((local_4c->_renderScrollOffset).y + (g_game->_screenShakeOffset).y);
|
|
quad_set_rect(local_40._tint + 2,&local_a4,&local_9c,GHIDRA_INT(DAT_00c79824));
|
|
local_48 = 4.2039e-45;
|
|
fVar9 = 8.40779e-45;
|
|
do {
|
|
fVar11 = local_50;
|
|
local_74 = local_40._offset[2];
|
|
local_44 = GHIDRA_CAST<uint32_t *>(DAT_00c7983c[5]);
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
bVar2 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_68._blue)) + 0x0)));
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
rngShift2 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_68._alpha)) + 0x0)));
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (SUB41(fVar9,0) & 0x1f) ^ uVar4;
|
|
if (local_44 == GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
uVar7 = 0;
|
|
}
|
|
else {
|
|
uVar7 = uVar4 % GHIDRA_UINT(local_44);
|
|
}
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
rngShift3 = SUB41(local_50,0);
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
fVar9 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10;
|
|
local_44 = (uint32_t *)
|
|
(((fVar9 + fVar9) - 1.0) * local_54 +
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]));
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
uVar7 = 0;
|
|
if (DAT_00c7983c[4] != 0) {
|
|
uVar7 = uVar4 % GHIDRA_UINT(DAT_00c7983c[4]);
|
|
}
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
fStack_7c = ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 * 3.0 + 1.0) * local_54 +
|
|
(float)((double)GHIDRA_INT(uVar7) + __uint_to_double_fixup[-(GHIDRA_INT(uVar7) >> 0x1f)]);
|
|
local_94 = fStack_7c + local_40._tint[2];
|
|
fStack_90 = (float)local_44 + local_40._tint[3];
|
|
fStack_8c = fStack_7c + local_40._colorize[0];
|
|
fStack_88 = (float)local_44 + local_40._colorize[1];
|
|
local_84 = fStack_7c + local_40._colorize[2];
|
|
fStack_7c = fStack_7c + local_40._offset[0];
|
|
fStack_80 = (float)local_44 + local_40._colorize[3];
|
|
fStack_78 = (float)local_44 + local_40._offset[1];
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> (bVar2 & 0x1f) ^ uVar4;
|
|
quadColor._red = 1.0;
|
|
uVar4 = uVar4 << (rngShift2 & 0x1f) ^ uVar4;
|
|
quadColor._green = 1.0;
|
|
quadColor._blue = 1.0;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
local_bc = 0;
|
|
local_d0 = 0;
|
|
local_e4 = 0;
|
|
local_f8 = 0;
|
|
fStack_fc = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 * 4.0 + 2.0;
|
|
local_cc = 0x3f800000;
|
|
uStack_c8 = 0x3f800000;
|
|
uStack_c4 = 0x3f800000;
|
|
local_e0 = 0x3f800000;
|
|
uStack_dc = 0x3f800000;
|
|
uStack_d8 = 0x3f800000;
|
|
local_f4 = 0x3f800000;
|
|
uStack_f0 = 0x3f800000;
|
|
uStack_ec = 0x3f800000;
|
|
local_108 = 0x3f800000;
|
|
uStack_104 = 0x3f800000;
|
|
uStack_100 = 0x3f800000;
|
|
fStack_e8 = fStack_fc;
|
|
fStack_d4 = fStack_fc;
|
|
fStack_c0 = fStack_fc;
|
|
quadColor._alpha = fStack_fc;
|
|
(**(code **)(*DAT_00c7983c + 0x14))(&local_94);
|
|
local_48 = (float)(GHIDRA_INT(local_48) + -1);
|
|
fVar9 = fVar11;
|
|
} while (local_48 != 0.0);
|
|
_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;
|
|
}
|
|
local_70.x = 0.0;
|
|
local_70.y = 0.0;
|
|
msvc::vector::resize(&local_70);
|
|
local_44 = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((local_44 + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((local_44 + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*local_44 = g_graphicsManager_renderTarget;
|
|
pvVar5 = DAT_00c79824;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c79824,1);
|
|
imageRefCount = (void *)0x8263df;
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
uVar7 = g_graphicsManager_flags & 0xfffffffd;
|
|
if ((g_manager->_optionsConfig)._enableLighting != 0) {
|
|
shader = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
local_40._tint[0] = 1.0;
|
|
local_40._tint[1] = 1.0;
|
|
local_40._tint[2] = 1.0;
|
|
local_40._tint[3] = 1.0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
local_40._colorize[0] = 0.5;
|
|
local_40._colorize[1] = 0.5;
|
|
local_40._colorize[2] = 0.5;
|
|
local_40._colorize[3] = (float)&DAT_bf800000;
|
|
local_40._offset[0] = -0.8;
|
|
local_40._offset[1] = -0.8;
|
|
local_40._offset[2] = -0.8;
|
|
g_currentShader = shader;
|
|
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStackY_230 + 0x88)))->KAGE::SmartPointer::operator_assign(&DAT_00c797cc);
|
|
apply_sprite_shader_params(&local_40,1,pvVar5,imageRefCount);
|
|
local_cc = 0x3f800000;
|
|
uStack_c8 = 0x3f800000;
|
|
uStack_c4 = 0x3f800000;
|
|
fStack_c0 = 1.0;
|
|
local_bc = 0;
|
|
local_e0 = 0x3f800000;
|
|
uStack_dc = 0x3f800000;
|
|
uStack_d8 = 0x3f800000;
|
|
fStack_d4 = 1.0;
|
|
local_d0 = 0;
|
|
local_f4 = 0x3f800000;
|
|
uStack_f0 = 0x3f800000;
|
|
uStack_ec = 0x3f800000;
|
|
fStack_e8 = 1.0;
|
|
local_e4 = 0;
|
|
local_108 = 0x3f800000;
|
|
uStack_104 = 0x3f800000;
|
|
uStack_100 = 0x3f800000;
|
|
fStack_fc = 1.0;
|
|
local_f8 = 0;
|
|
(**(code **)(*DAT_00c797cc + 0x1c))();
|
|
shader_cache_find(unusedArg);
|
|
uVar7 = g_graphicsManager_flags;
|
|
}
|
|
g_graphicsManager_flags = uVar7;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 1;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 1;
|
|
local_cc = 0x3d4ccccd;
|
|
uStack_c8 = 0x3d4ccccd;
|
|
uStack_c4 = 0x3d4ccccd;
|
|
fStack_c0 = 1.0;
|
|
local_bc = 0;
|
|
local_e0 = 0x3d4ccccd;
|
|
uStack_dc = 0x3d4ccccd;
|
|
uStack_d8 = 0x3d4ccccd;
|
|
fStack_d4 = 1.0;
|
|
local_d0 = 0;
|
|
local_f4 = 0x3d4ccccd;
|
|
uStack_f0 = 0x3d4ccccd;
|
|
uStack_ec = 0x3d4ccccd;
|
|
fStack_e8 = 1.0;
|
|
local_e4 = 0;
|
|
local_108 = 0x3d4ccccd;
|
|
uStack_104 = 0x3d4ccccd;
|
|
uStack_100 = 0x3d4ccccd;
|
|
fStack_fc = 1.0;
|
|
local_f8 = 0;
|
|
shader_push(GHIDRA_CAST<uint8_t *>("KAGE_ColorShader"));
|
|
local_84 = 0.0;
|
|
local_94 = 0.0;
|
|
fStack_88 = 0.0;
|
|
fStack_90 = 0.0;
|
|
fStack_7c = 1.0;
|
|
fStack_8c = 1.0;
|
|
fStack_78 = 1.0;
|
|
fStack_80 = 1.0;
|
|
local_74 = (float)(GHIDRA_UINT(local_74) & 0xffffff00);
|
|
pvVar5 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar5,&local_94,screenQuad,1,unused);
|
|
FUN_00a14200();
|
|
if ((((g_manager->_optionsConfig)._enableLighting != 0) &&
|
|
((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_4c)) + 0x4)))) + 0x44)) >> 9 & 1) == 0)) &&
|
|
(DAT_00c79834 != GHIDRA_CAST<int *>(0x0))) {
|
|
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] = 1;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 1;
|
|
local_a4.y = (float)((double)DAT_00c79834[4] +
|
|
__uint_to_double_fixup[-(DAT_00c79834[4] >> 0x1f)]);
|
|
local_9c.y = (float)((double)DAT_00c79834[5] +
|
|
__uint_to_double_fixup[-(DAT_00c79834[5] >> 0x1f)]);
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = uVar4 >> ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_68._blue)) + 0x0))) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 << ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_68._alpha)) + 0x0))) & 0x1f) ^ uVar4;
|
|
uVar4 = uVar4 >> (rngShift3 & 0x1f) ^ uVar4;
|
|
uVar7 = g_game->_debugCurses;
|
|
curses = g_game->_curses;
|
|
fVar9 = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) *
|
|
2.3283062e-10 * 9.0 + 0.1;
|
|
uVar4 = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
room = local_4c;
|
|
if ((~preventedCurses & (uVar4 | uVar7 | curses) & 1) == 0) {
|
|
fVar11 = g_game->_darknessStrength * g_game->_darknessModifier;
|
|
}
|
|
else {
|
|
fVar11 = 1.0;
|
|
}
|
|
local_68._unk = 0;
|
|
local_68._red = 1.0;
|
|
local_68._green = 0.9 - fVar11 * 0.19999999;
|
|
auVar10 = ZEXT812(0x3d4ccccd);
|
|
fVar8 = fVar9 * (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0)));
|
|
if (fVar8 <= (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0)))) {
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x4))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x4)));
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0))) = fVar8;
|
|
}
|
|
local_68._alpha = ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(auVar10)) + 0x0))) - fVar9) * fVar11 + fVar9;
|
|
local_68._blue = 0.8 - fVar11 * 0.15000004;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_4c)) + 0x4)))) == 0) ||
|
|
(iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_4c)) + 0x4)))) + 0x10)), iVar3 == 0)) {
|
|
local_4c = GHIDRA_CAST<Room *>(0x1);
|
|
}
|
|
else {
|
|
local_4c = *GHIDRA_CAST<Room **>((iVar3 + 0x48));
|
|
}
|
|
uVar4 = 0;
|
|
do {
|
|
iVar3 = (&DAT_00b6c9b0)[uVar4 * 2];
|
|
if (((-1 < iVar3) && (iVar6 = (&DAT_00b6c9b4)[uVar4 * 2], -1 < iVar6)) &&
|
|
((local_48 = (float)room->_gridWidth, iVar3 < GHIDRA_INT(local_48) &&
|
|
(iVar6 < room->_gridHeight)))) {
|
|
if (uVar4 == 0) {
|
|
isLightSkipped = local_4c == GHIDRA_CAST<Room *>(&DAT_00000009);
|
|
LAB_0082681a:
|
|
if (isLightSkipped) goto LAB_008269ef;
|
|
}
|
|
else if (uVar4 == 1) {
|
|
isLightSkipped = local_4c == GHIDRA_CAST<Room *>(0xa);
|
|
goto LAB_0082681a;
|
|
}
|
|
iVar3 = iVar6 * GHIDRA_INT(local_48) + iVar3;
|
|
iVar6 = iVar3 % GHIDRA_INT(local_48);
|
|
local_54 = (float)(iVar3 / GHIDRA_INT(local_48)) * 40.0 + 120.0;
|
|
local_48 = g_displayPixelRatio * g_screenPointScale;
|
|
local_44 = (uint32_t *)
|
|
(((g_screenWidth - 338.0) * 0.5 + (((float)iVar6 * 40.0 + 40.0) - 60.0) * 0.65)
|
|
* local_48 + 0.5);
|
|
dVar12 = floor((double)(float)local_44);
|
|
local_50 = (float)dVar12 / local_48;
|
|
local_44 = (uint32_t *)
|
|
(((g_screenHeight - 182.0) * 0.5 + (local_54 - 140.0) * 0.65) * local_48 + 0.5)
|
|
;
|
|
dVar12 = floor((double)(float)local_44);
|
|
local_44 = GHIDRA_CAST<uint32_t *>((float)dVar12);
|
|
local_70.y = (float)local_44 / local_48 + (room->_renderScrollOffset).y +
|
|
(g_game->_screenShakeOffset).y;
|
|
local_70.x = local_50 + (room->_renderScrollOffset).x + (g_game->_screenShakeOffset).x;
|
|
render_quad_set_uniform_color
|
|
(lightQuad,local_70.x - local_a4.y * 0.5,local_70.y - local_9c.y * 0.6,
|
|
local_a4.y * 0.5 + local_70.x,local_9c.y * 0.4 + local_70.y,&local_68);
|
|
(GHIDRA_CAST<Quad *>((lightQuad)))->Quad::rotate(&local_70,-0.7853982);
|
|
(**(code **)(*DAT_00c79834 + 0x1c))();
|
|
}
|
|
LAB_008269ef:
|
|
uVar4 = uVar4 + 1;
|
|
} while (uVar4 < 2);
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 4;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 4;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
local_cc = 0x3f800000;
|
|
uStack_c8 = 0x3f800000;
|
|
uStack_c4 = 0x3f800000;
|
|
fStack_c0 = 1.0;
|
|
local_bc = 0;
|
|
local_e0 = 0x3f800000;
|
|
uStack_dc = 0x3f800000;
|
|
uStack_d8 = 0x3f800000;
|
|
fStack_d4 = 1.0;
|
|
local_d0 = 0;
|
|
local_f4 = 0x3f800000;
|
|
uStack_f0 = 0x3f800000;
|
|
uStack_ec = 0x3f800000;
|
|
fStack_e8 = 1.0;
|
|
local_e4 = 0;
|
|
local_108 = 0x3f800000;
|
|
uStack_104 = 0x3f800000;
|
|
uStack_100 = 0x3f800000;
|
|
fStack_fc = 1.0;
|
|
local_f8 = 0;
|
|
(**(code **)(*DAT_00c7982c + 0x1c))();
|
|
g_graphicsManager_flags = g_graphicsManager_flags | 2;
|
|
_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;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00826ae0
|
|
void Room::render_lava_pit_mask()
|
|
{
|
|
char cVar1;
|
|
uint32_t *targetStackEntry;
|
|
uint8_t *shader;
|
|
int iVar2;
|
|
uint32_t extraout_EAX;
|
|
int gridIndex;
|
|
int extraout_ECX;
|
|
int extraout_ECX_00;
|
|
int extraout_ECX_01;
|
|
int row;
|
|
int column;
|
|
uint8_t auStackY_19c [128];
|
|
int *piVar3;
|
|
uint8_t quad [112];
|
|
int savedBlendMode0;
|
|
int savedBlendMode1;
|
|
int savedBlendMode2;
|
|
int savedBlendMode3;
|
|
KColor white;
|
|
int savedBlendMode4;
|
|
void *gridEntity;
|
|
float local_58;
|
|
float local_54;
|
|
float local_50;
|
|
float local_4c;
|
|
float local_48;
|
|
float local_44;
|
|
float local_40;
|
|
float local_3c;
|
|
uint8_t local_38;
|
|
float local_34;
|
|
float local_30;
|
|
float local_2c;
|
|
float local_28;
|
|
uint32_t local_24;
|
|
Vector targetSize;
|
|
uint32_t local_18;
|
|
float targetHeight;
|
|
float targetWidth;
|
|
int local_c;
|
|
Room *room;
|
|
code *shaderDrawFn;
|
|
|
|
if ((this->_backdropType == 0x20) && ((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 5 & 1) != 0))
|
|
{
|
|
targetSize.x = 0.0;
|
|
targetSize.y = 0.0;
|
|
room = this;
|
|
msvc::vector::resize(&targetSize);
|
|
targetStackEntry = msvc::deque::back();
|
|
if (GHIDRA_CAST<uint8_t *>((targetStackEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((targetStackEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
|
|
}
|
|
*targetStackEntry = g_graphicsManager_renderTarget;
|
|
savedBlendMode0 = g_graphicsManager_blendMode[0];
|
|
savedBlendMode1 = g_graphicsManager_blendMode[1];
|
|
savedBlendMode2 = g_graphicsManager_blendMode[2];
|
|
savedBlendMode3 = g_graphicsManager_blendMode[3];
|
|
savedBlendMode4 = g_graphicsManager_blendMode[4];
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c7981c,0);
|
|
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd;
|
|
(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;
|
|
DAT_00c33910 = 0;
|
|
targetWidth = (float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c7981c) + 0x10)) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c7981c) + 0x10)) >> 0x1f)]);
|
|
shader = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
shader = g_currentShader;
|
|
}
|
|
local_c = 0;
|
|
targetHeight = (float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c7981c) + 0x14)) +
|
|
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(DAT_00c7981c) + 0x14)) >> 0x1f)]);
|
|
targetSize.y = targetHeight;
|
|
targetSize.x = targetWidth;
|
|
g_currentShader = shader;
|
|
if (0 < this->_gridHeight) {
|
|
do {
|
|
iVar2 = this->_gridWidth;
|
|
column = 0;
|
|
row = local_c;
|
|
if (0 < iVar2) {
|
|
do {
|
|
if ((((-1 < column) && (column < iVar2)) && (-1 < row)) &&
|
|
((row < this->_gridHeight && (gridIndex = iVar2 * row + column, -1 < gridIndex)))) {
|
|
gridEntity = this->_gridEntities[gridIndex];
|
|
if ((gridEntity == (void *)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(gridEntity) + 4)) != 7)) {
|
|
this = room;
|
|
}
|
|
else {
|
|
piVar3 = GHIDRA_CAST<int *>(0x0);
|
|
local_18 = DAT_00c79804;
|
|
if (DAT_00c79808 != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar1 = (**(code **)(*DAT_00c79808 + 4))();
|
|
iVar2 = extraout_ECX;
|
|
if ((cVar1 != '\0') && (iVar2 = 0, piVar3 != GHIDRA_CAST<int *>(0x0))) {
|
|
cVar1 = (**(code **)(*piVar3 + 0xc))();
|
|
iVar2 = extraout_ECX_00;
|
|
if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(auStackY_19c + 0x90);
|
|
iVar2 = extraout_ECX_01;
|
|
}
|
|
}
|
|
}
|
|
FUN_007135d0(iVar2);
|
|
iVar2 = room->_gridWidth;
|
|
row = local_c;
|
|
this = room;
|
|
}
|
|
}
|
|
column = column + 1;
|
|
} while (column < iVar2);
|
|
}
|
|
local_c = row + 1;
|
|
} while (local_c < this->_gridHeight);
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 0;
|
|
g_graphicsManager_blendMode[4] = 1;
|
|
local_30 = this->_lavaIntensity;
|
|
DAT_00c33910 = 1;
|
|
shaderDrawFn = *(code **)(*DAT_00c7980c + 0x14);
|
|
local_24 = 0;
|
|
local_34 = local_30 * 0.5 + 0.5;
|
|
local_28 = 1.0;
|
|
white._unk = 0;
|
|
white._red = 1.0;
|
|
white._green = 1.0;
|
|
white._blue = 1.0;
|
|
white._alpha = 1.0;
|
|
local_2c = local_30;
|
|
render_quad_set_rect(quad,&g_vectorZero,&targetSize,&white);
|
|
local_50 = targetWidth + g_vectorZero.x;
|
|
local_48 = g_vectorZero.x;
|
|
local_58 = g_vectorZero.x;
|
|
local_44 = targetHeight + g_vectorZero.y;
|
|
local_4c = g_vectorZero.y;
|
|
local_54 = g_vectorZero.y;
|
|
local_38 = 1;
|
|
local_40 = local_50;
|
|
local_3c = local_44;
|
|
(*shaderDrawFn)(&local_58);
|
|
if (0.0 < this->_waterAmount) {
|
|
local_24 = 0;
|
|
local_34 = 1.0;
|
|
local_28 = 1.0 - this->_lavaIntensity * this->_lavaIntensity;
|
|
local_30 = 1.0;
|
|
shaderDrawFn = *(code **)(*DAT_00c79814 + 0x14);
|
|
local_2c = 1.0;
|
|
white._unk = 0;
|
|
white._red = 1.0;
|
|
white._green = 1.0;
|
|
white._blue = 1.0;
|
|
white._alpha = 1.0;
|
|
render_quad_set_rect(quad,&g_vectorZero,&targetSize,&white);
|
|
local_50 = targetWidth + g_vectorZero.x;
|
|
local_48 = g_vectorZero.x;
|
|
local_58 = g_vectorZero.x;
|
|
local_44 = targetHeight + g_vectorZero.y;
|
|
local_4c = g_vectorZero.y;
|
|
local_54 = g_vectorZero.y;
|
|
local_38 = 1;
|
|
local_40 = local_50;
|
|
local_3c = local_44;
|
|
(*shaderDrawFn)(&local_58,extraout_EAX,&local_34);
|
|
}
|
|
_glfw_context_reset(1);
|
|
g_graphicsManager_blendMode[0] = savedBlendMode0;
|
|
g_graphicsManager_blendMode[1] = savedBlendMode1;
|
|
g_graphicsManager_blendMode[2] = savedBlendMode2;
|
|
g_graphicsManager_blendMode[3] = savedBlendMode3;
|
|
g_graphicsManager_blendMode[4] = savedBlendMode4;
|
|
g_graphicsManager_flags = g_graphicsManager_flags | 2;
|
|
if (g_renderTargetStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("PopRenderTarget: stack is empty!\n"));
|
|
}
|
|
targetStackEntry = msvc::deque::back();
|
|
KAGE_Graphics::SetRenderTarget
|
|
(&DAT_00c798e0,(void *)*targetStackEntry,*GHIDRA_CAST<uint8_t *>((targetStackEntry + 1)));
|
|
g_renderTargetStackSize = g_renderTargetStackSize - 1;
|
|
if (g_renderTargetStackSize == 0) {
|
|
DAT_00c7978c = 0;
|
|
}
|
|
shader_cache_find(0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00826f80
|
|
void Room::render_water_overlay(Vector *offset)
|
|
{
|
|
uint8_t *puVar1;
|
|
KColor *color;
|
|
int unusedArg;
|
|
float overlayOffset;
|
|
uint8_t auStackY_178 [128];
|
|
void *in_stack_ffffff10;
|
|
void *in_stack_ffffff14;
|
|
Vector roomSize;
|
|
Vector drawPos;
|
|
KColor local_d0;
|
|
KColor local_bc;
|
|
uint8_t local_a8 [112];
|
|
ColorMod local_38;
|
|
uint32_t local_c;
|
|
code *renderFn;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&roomSize);
|
|
roomSize.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6ae8)))) - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6ae0))));
|
|
roomSize.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6aec)))) - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x6ae4))));
|
|
puVar1 = &g_shaders;
|
|
if ((DAT_00c7911c & 1) == 0) {
|
|
puVar1 = g_currentShader;
|
|
}
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if (((uint8_t)g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
local_38._tint[0] = 1.0;
|
|
local_38._tint[1] = 1.0;
|
|
local_38._tint[2] = 1.0;
|
|
local_38._tint[3] = 1.0;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
local_38._colorize[0] = 0.0;
|
|
local_38._colorize[1] = 0.0;
|
|
local_38._colorize[2] = 0.0;
|
|
local_38._colorize[3] = 0.0;
|
|
local_38._offset[0] = 0.0;
|
|
local_38._offset[1] = 0.0;
|
|
local_38._offset[2] = 0.0;
|
|
g_currentShader = puVar1;
|
|
(GHIDRA_CAST<KAGE::SmartPointer *>((auStackY_178 + 0x88)))->KAGE::SmartPointer::operator_assign(&DAT_00c7981c);
|
|
apply_sprite_shader_params(&local_38,1,in_stack_ffffff10,in_stack_ffffff14);
|
|
renderFn = *(code **)(*DAT_00c7981c + 0x14);
|
|
(GHIDRA_CAST<KColor *>((&local_bc)))->KColor::SetFromARGB(0xffffffff);
|
|
(GHIDRA_CAST<KColor *>((&local_d0)))->KColor::SetFromARGB(0xffffffff);
|
|
overlayOffset = 52.0;
|
|
drawPos.x = offset->x + 52.0;
|
|
drawPos.y = offset->y + 52.0;
|
|
render_quad_set_rect(local_a8,&drawPos,&roomSize,color);
|
|
local_38._tint[2] = roomSize.x + overlayOffset;
|
|
local_38._colorize[1] = roomSize.y + overlayOffset;
|
|
local_38._colorize[0] = 52.0;
|
|
local_38._tint[3] = 52.0;
|
|
local_38._tint[0] = 52.0;
|
|
local_38._tint[1] = 52.0;
|
|
local_38._offset[0] = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38._offset[0])) + 0x1))),1);
|
|
local_38._colorize[2] = local_38._tint[2];
|
|
local_38._colorize[3] = local_38._colorize[1];
|
|
(*renderFn)(&local_38);
|
|
shader_cache_find(unusedArg);
|
|
return;
|
|
}
|
|
|
|
// 008271e0
|
|
void Room::UpdateRedKey()
|
|
{
|
|
uint8_t isCanSpawnOutline;
|
|
uint32_t uVar1;
|
|
Entity_Player *redKeyOwner;
|
|
uint32_t uVar2;
|
|
Room *pRVar3;
|
|
uint32_t pocketSlot;
|
|
Entity *outlineSlot;
|
|
int *doorOutlineSlot;
|
|
Game *game;
|
|
int iVar4;
|
|
float fVar5;
|
|
Entity *local_34;
|
|
Room *room;
|
|
int *local_2c;
|
|
float angleRad;
|
|
Vector spawnPos;
|
|
float doorAngles [4];
|
|
uint32_t local_c;
|
|
bool isHasRedKey;
|
|
void *playerListEnd;
|
|
int pocketCardId;
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&local_34);
|
|
local_34 = GHIDRA_CAST<Entity *>(0x0);
|
|
isHasRedKey = false;
|
|
game = g_game;
|
|
room = this;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 == 0) {
|
|
LAB_0082731a:
|
|
pRVar3 = room;
|
|
redKeyOwner = PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x244,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if ((redKeyOwner == GHIDRA_CAST<Entity_Player *>(0x0)) && (!isHasRedKey)) {
|
|
outlineSlot = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRVar3)) + 0x7744))));
|
|
iVar4 = 8;
|
|
do {
|
|
if ((*GHIDRA_CAST<int **>(outlineSlot) != GHIDRA_CAST<int *>(0x0)) &&
|
|
((**(code **)(**GHIDRA_CAST<int **>(outlineSlot) + 0x28))(), *GHIDRA_CAST<int *>(outlineSlot) != 0)) {
|
|
local_34 = outlineSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_34);
|
|
*GHIDRA_CAST<int *>(outlineSlot) = 0;
|
|
}
|
|
outlineSlot = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((outlineSlot)) + 0x4))));
|
|
iVar4 = iVar4 + -1;
|
|
} while (iVar4 != 0);
|
|
return;
|
|
}
|
|
doorAngles[0] = -90.0;
|
|
doorAngles[1] = 0.0;
|
|
doorAngles[2] = 90.0;
|
|
doorAngles[3] = 180.0;
|
|
doorOutlineSlot = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x4))));
|
|
if (((*GHIDRA_CAST<int *>((doorOutlineSlot[4] + 8)) != 5) ||
|
|
(doorOutlineSlot[2] != g_game->_lastBossRoomListIdx)) && (-1 < *doorOutlineSlot)) {
|
|
uVar1 = 0;
|
|
doorOutlineSlot = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((room)) + 0x7744))));
|
|
uVar2 = 1;
|
|
pRVar3 = room;
|
|
do {
|
|
if (*doorOutlineSlot == 0) {
|
|
if ((((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRVar3)) + 0x4)))) + 0x10)) + 0x38 + (uVar1 >> 5) * 4)) &
|
|
uVar2) != 0) && (doorOutlineSlot[-0x1c08] == 0)) &&
|
|
(isCanSpawnOutline =
|
|
Level::CanSpawnDoorOutline
|
|
(GHIDRA_CAST<Level *>(g_game),*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRVar3)) + 0x4)))) + 4)),uVar1),
|
|
isCanSpawnOutline != 0)) {
|
|
local_34 = GHIDRA_CAST<Entity *>(Random());
|
|
spawnPos.x = (float)(doorOutlineSlot[-0x1c00] % room->_gridWidth) * 40.0 + 40.0;
|
|
spawnPos.y = (float)(doorOutlineSlot[-0x1c00] / room->_gridWidth) * 40.0 + 120.0;
|
|
local_34 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,0x9a,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
GHIDRA_UINT(local_34),0);
|
|
fVar5 = doorAngles[uVar1 & 3];
|
|
(local_34->_sprite)._rotation = fVar5;
|
|
angleRad = (fVar5 + 90.0) * 0.017453292;
|
|
fVar5 = cos(angleRad);
|
|
local_2c = GHIDRA_CAST<int *>((fVar5 * 15.0));
|
|
fVar5 = sin(angleRad);
|
|
(local_34->_sprite)._offset.x = (float)local_2c;
|
|
(local_34->_sprite)._offset.y = fVar5 * 15.0;
|
|
if (GHIDRA_CAST<Entity *>(*doorOutlineSlot) != local_34) {
|
|
if (GHIDRA_CAST<Entity *>(*doorOutlineSlot) != GHIDRA_CAST<Entity *>(0x0)) {
|
|
local_2c = doorOutlineSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_2c);
|
|
}
|
|
*doorOutlineSlot = GHIDRA_INT(local_34);
|
|
msvc::multiset<unsigned_int>::insert(doorOutlineSlot);
|
|
}
|
|
}
|
|
pRVar3 = room;
|
|
}
|
|
uVar1 = uVar1 + 1;
|
|
uVar2 = uVar2 << 1 | GHIDRA_UINT((GHIDRA_INT(uVar2) < 0));
|
|
doorOutlineSlot = doorOutlineSlot + 1;
|
|
} while (uVar1 < 8);
|
|
}
|
|
return;
|
|
}
|
|
LAB_00827222:
|
|
playerListEnd = (game->_playerManager)._playerList._end;
|
|
doorOutlineSlot = (game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT(doorOutlineSlot) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
playerListEnd = (game->_playerManager)._playerList._end;
|
|
doorOutlineSlot = (game->_playerManager)._playerList._begin;
|
|
game = g_game;
|
|
}
|
|
if (local_34 < GHIDRA_CAST<Entity *>((GHIDRA_INT(playerListEnd) - GHIDRA_INT(doorOutlineSlot) >> 2))) {
|
|
doorOutlineSlot = doorOutlineSlot + GHIDRA_INT(local_34);
|
|
}
|
|
iVar4 = *doorOutlineSlot;
|
|
uVar2 = 0;
|
|
do {
|
|
if (isHasRedKey) break;
|
|
uVar1 = uVar2;
|
|
if (GHIDRA_INT(uVar2) < 1) {
|
|
uVar1 = 0;
|
|
}
|
|
pocketSlot = 3;
|
|
if (GHIDRA_INT(uVar1) < 3) {
|
|
pocketSlot = uVar1;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0x17a4 + pocketSlot * 8)) == 1) &&
|
|
((pocketCardId = *GHIDRA_CAST<int *>((iVar4 + 0x17a0 + pocketSlot * 8)), pocketCardId == 0x4e ||
|
|
(pocketCardId == 0x53)))) {
|
|
isHasRedKey = true;
|
|
break;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
} while (uVar2 < 4);
|
|
uVar2 = 0;
|
|
doorOutlineSlot = GHIDRA_CAST<int *>((iVar4 + 0x1580));
|
|
do {
|
|
if (*doorOutlineSlot == 0x1dd) {
|
|
if (-1 < GHIDRA_INT(uVar2)) {
|
|
uVar2 = 0;
|
|
doorOutlineSlot = *GHIDRA_CAST<int **>((iVar4 + 0x1754));
|
|
uVar1 = *GHIDRA_CAST<int *>((iVar4 + 0x1758)) - GHIDRA_INT(doorOutlineSlot) >> 2;
|
|
if (uVar1 != 0) goto LAB_008272e2;
|
|
}
|
|
break;
|
|
}
|
|
uVar2 = uVar2 + 1;
|
|
doorOutlineSlot = doorOutlineSlot + 8;
|
|
} while (uVar2 < 4);
|
|
goto LAB_008272f6;
|
|
while( true ) {
|
|
uVar2 = uVar2 + 1;
|
|
doorOutlineSlot = doorOutlineSlot + 1;
|
|
if (uVar1 <= uVar2) break;
|
|
LAB_008272e2:
|
|
if (*doorOutlineSlot == 0x244) {
|
|
isHasRedKey = true;
|
|
break;
|
|
}
|
|
}
|
|
LAB_008272f6:
|
|
local_34 = GHIDRA_CAST<Entity *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_34)) + 0x1))));
|
|
if ((uint8_t *)
|
|
(GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT((game->_playerManager)._playerList._begin)
|
|
>> 2) <= local_34) goto LAB_0082731a;
|
|
goto LAB_00827222;
|
|
}
|
|
|
|
// 00827550
|
|
void Room::open_red_room_doors(int doorSlot, RoomDescriptor *targetRoom)
|
|
{
|
|
float *pfVar1;
|
|
GridEntity_Door *this_00;
|
|
char extraout_AL;
|
|
int iVar2;
|
|
void **refSlot;
|
|
uint32_t slot;
|
|
void **local_c [2];
|
|
Manager *manager;
|
|
|
|
local_c[0] = this->_doors;
|
|
slot = 0;
|
|
do {
|
|
refSlot = local_c[0];
|
|
if (((*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x18 + (slot >> 5) * 4)) & 1 << ((uint8_t)slot & 0x1f))
|
|
!= 0) && (*local_c[0] == (void *)0x0)) {
|
|
MakeDoor(this,slot);
|
|
if (extraout_AL != '\0') {
|
|
this_00 = *refSlot;
|
|
if (targetRoom == GHIDRA_CAST<RoomDescriptor *>(0x0)) {
|
|
this_00->_targetRoomIdx = -2;
|
|
iVar2 = 1;
|
|
}
|
|
else {
|
|
this_00->_targetRoomIdx = targetRoom->SafeGridIndex;
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(targetRoom->Data) + 8));
|
|
}
|
|
GridEntity_Door::SetRoomTypes
|
|
(this_00,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8)),iVar2);
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8))));
|
|
this_00->_slot = slot;
|
|
if (((iVar2 == 1) || (iVar2 == 2)) || (iVar2 == 3)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) = 8;
|
|
(GHIDRA_CAST<ANM2 *>((&this_00->_extraSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::LoadSprite();
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8))));
|
|
}
|
|
if (iVar2 == 7) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x8)))) = 8;
|
|
}
|
|
(GHIDRA_CAST<GridEntity_Door *>((this_00)))->GridEntity_Door::UpdateAnimation();
|
|
refSlot = local_c[0];
|
|
}
|
|
}
|
|
slot = slot + 1;
|
|
local_c[0] = refSlot + 1;
|
|
} while (slot < 8);
|
|
pfVar1 = GHIDRA_CAST<float *>((GHIDRA_INT((&this->_railManager + 1)) + (doorSlot + 1) * 4));
|
|
if ((GHIDRA_CAST<int *>(*pfVar1) != GHIDRA_CAST<int *>(0x0)) && ((**(code **)(*GHIDRA_CAST<int *>(*pfVar1) + 0x28))(), *pfVar1 != 0.0)) {
|
|
local_c[0] = (void **)pfVar1;
|
|
msvc::multiset<unsigned_int>::erase(local_c);
|
|
*pfVar1 = 0.0;
|
|
}
|
|
manager = g_manager;
|
|
local_c[0] = (void **)0x9c;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c[0]),1.0,2,0,1.0,0.0);
|
|
return;
|
|
}
|
|
|
|
// 008276e0
|
|
Entity_Pickup * Room::spawn_options_alternative(Entity_Pickup *pickup)
|
|
{
|
|
uint32_t *puVar1;
|
|
code *pcVar2;
|
|
uint64_t qVar3;
|
|
uint8_t isObstacleSpawnable;
|
|
Entity_Pickup *spawnedPickup;
|
|
int gridY;
|
|
uint32_t angleRoll;
|
|
int iVar4;
|
|
uint32_t variant;
|
|
uint32_t uVar5;
|
|
RNG rng;
|
|
uint8_t local_20 [8];
|
|
float local_18;
|
|
float local_14;
|
|
float offsetX;
|
|
Room *room;
|
|
float originY;
|
|
float originX;
|
|
|
|
variant = 0;
|
|
rng._seed = pickup->_initSeed;
|
|
uVar5 = 0;
|
|
rng._shift1 = 3;
|
|
rng._shift2 = 5;
|
|
rng._shift3 = 0x19;
|
|
room = this;
|
|
do {
|
|
if ((variant != 0) && (variant != pickup->_variant)) goto LAB_00827735;
|
|
variant = RoomClear_PickVariant(&rng,1);
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 10);
|
|
if (variant == 0) {
|
|
return GHIDRA_CAST<Entity_Pickup *>(0x0);
|
|
}
|
|
LAB_00827735:
|
|
originX = (pickup->_pos).x;
|
|
originY = (pickup->_pos).y;
|
|
if (rng._seed == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
spawnedPickup = GHIDRA_CAST<Entity_Pickup *>((*pcVar2)());
|
|
return spawnedPickup;
|
|
}
|
|
uVar5 = GHIDRA_UINT(rng._seed) >> ((uint8_t)rng._shift1 & 0x1f) ^ rng._seed;
|
|
local_20 = (uint8_t [8])0x100000003;
|
|
uVar5 = uVar5 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar5;
|
|
local_14 = 1.96182e-44;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
spawnedPickup = GHIDRA_CAST<Entity_Pickup *>((*pcVar2)());
|
|
return spawnedPickup;
|
|
}
|
|
angleRoll = uVar5 >> 3 ^ uVar5;
|
|
angleRoll = angleRoll << 1 ^ angleRoll;
|
|
angleRoll = angleRoll >> 0xe ^ angleRoll;
|
|
local_14 = (float)((double)GHIDRA_INT(angleRoll) + __uint_to_double_fixup[-(GHIDRA_INT(angleRoll) >> 0x1f)]) *
|
|
2.3283062e-10 * 3.14;
|
|
local_14 = local_14 + local_14;
|
|
offsetX = cos(local_14);
|
|
offsetX = offsetX * 15.0;
|
|
local_14 = sin(local_14);
|
|
local_14 = local_14 * 15.0;
|
|
if (uVar5 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
spawnedPickup = GHIDRA_CAST<Entity_Pickup *>((*pcVar2)());
|
|
return spawnedPickup;
|
|
}
|
|
uVar5 = uVar5 >> ((uint8_t)rng._shift1 & 0x1f) ^ uVar5;
|
|
uVar5 = uVar5 << ((uint8_t)rng._shift2 & 0x1f) ^ uVar5;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = originX + offsetX;
|
|
local_18 = originY + local_14;
|
|
spawnedPickup =
|
|
(Entity_Pickup *)
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(5,variant,GHIDRA_CAST<Vector *>((local_20 + 4)),&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,
|
|
uVar5 >> ((uint8_t)rng._shift3 & 0x1f) ^ uVar5);
|
|
if ((spawnedPickup->_type == 5) &&
|
|
(((iVar4 = spawnedPickup->_variant, iVar4 == 0x34 || (iVar4 == 0x36)) || (iVar4 == 0x39)))) {
|
|
iVar4 = GHIDRA_INT(((originX - 40.0) / 40.0 + 0.5));
|
|
gridY = GHIDRA_INT(((originY - 120.0) / 40.0 + 0.5));
|
|
if ((((iVar4 < 0) || (room->_gridWidth <= iVar4)) || (gridY < 0)) ||
|
|
(room->_gridHeight <= gridY)) {
|
|
iVar4 = -1;
|
|
}
|
|
else {
|
|
iVar4 = room->_gridWidth * gridY + iVar4;
|
|
}
|
|
isObstacleSpawnable = CanSpawnObstacleAtPosition(room,iVar4,0);
|
|
if (isObstacleSpawnable == 0) {
|
|
Entity_Pickup::Morph(spawnedPickup,5,0x32,1,0,0,0);
|
|
}
|
|
}
|
|
if ((pickup->_flags & 0x10000000000) != 0) {
|
|
qVar3 = spawnedPickup->_flags;
|
|
puVar1 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&spawnedPickup->_flags) + 4));
|
|
*puVar1 = *puVar1 | 0x100;
|
|
*GHIDRA_CAST<int *>(&spawnedPickup->_flags) = GHIDRA_INT(qVar3);
|
|
}
|
|
iVar4 = (GHIDRA_CAST<Entity_Pickup *>((pickup)))->Entity_Pickup::AssignOptionsIndex();
|
|
spawnedPickup->_optionsPickupIndex = iVar4;
|
|
(pickup->_pos).x = originX - offsetX;
|
|
(pickup->_pos).y = originY - local_14;
|
|
return pickup;
|
|
}
|
|
|
|
// 008279a0
|
|
uint8_t Room::IsBeastDungeon()
|
|
{
|
|
int *roomConfig;
|
|
|
|
roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if (((roomConfig == GHIDRA_CAST<int *>(0x0)) || (roomConfig[2] != 0x10)) || (*roomConfig != 0x23)) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 008279c0
|
|
void Room::get_lava_line_y()
|
|
{
|
|
return;
|
|
}
|
|
|
|
// 008279d0
|
|
uint8_t Room::TrySpawnSpecialQuestDoor()
|
|
{
|
|
int iVar1;
|
|
uint32_t forcedCurses;
|
|
uint32_t preventedCurses;
|
|
uint32_t curses;
|
|
uint32_t curses;
|
|
bool isDownpourTwo;
|
|
bool isMinesTwo;
|
|
|
|
iVar1 = g_game->_stage;
|
|
if ((g_game->_stageType != 4) && (g_game->_stageType != 5)) {
|
|
return 0;
|
|
}
|
|
if (iVar1 == 2) {
|
|
LAB_00827a28:
|
|
isDownpourTwo = true;
|
|
}
|
|
else {
|
|
if (iVar1 == 1) {
|
|
curses = g_game->_debugCurses;
|
|
curses = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((~preventedCurses & (forcedCurses | curses | curses) & 2) != 0) goto LAB_00827a28;
|
|
}
|
|
isDownpourTwo = false;
|
|
}
|
|
if (iVar1 == 4) {
|
|
LAB_00827a59:
|
|
isMinesTwo = true;
|
|
}
|
|
else {
|
|
if (iVar1 == 3) {
|
|
curses = g_game->_debugCurses;
|
|
curses = g_game->_curses;
|
|
forcedCurses = Seeds::GetForcedCurses();
|
|
preventedCurses = Seeds::GetPreventedCurses();
|
|
if ((~preventedCurses & (forcedCurses | curses | curses) & 2) != 0) goto LAB_00827a59;
|
|
}
|
|
isMinesTwo = false;
|
|
}
|
|
if (isDownpourTwo) {
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10));
|
|
if ((*GHIDRA_CAST<int *>((iVar1 + 8)) == 1) && (*GHIDRA_CAST<int *>((iVar1 + 0x10)) == 0x22)) {
|
|
curses = 0;
|
|
do {
|
|
if ((*GHIDRA_CAST<uint32_t *>((iVar1 + 0x3c + (curses >> 5) * 4)) & 1 << ((uint8_t)curses & 0x1f)) != 0) {
|
|
if (curses == 0xffffffff) {
|
|
return 0;
|
|
}
|
|
if (this->_doors[curses] != (void *)0x0) {
|
|
return 0;
|
|
}
|
|
MakeDoor(this,curses);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_doors[curses]) + 0x394)) = 0xffffff9c;
|
|
goto LAB_00827ace;
|
|
}
|
|
curses = curses + 1;
|
|
} while (GHIDRA_INT(curses) < 8);
|
|
}
|
|
}
|
|
else if (((isMinesTwo) &&
|
|
(iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)), *GHIDRA_CAST<int *>((iVar1 + 8)) == 1)) &&
|
|
((*GHIDRA_CAST<int *>((iVar1 + 0x10)) == 10 || (*GHIDRA_CAST<int *>((iVar1 + 0x10)) == 0xb)))) {
|
|
curses = 0;
|
|
while ((*GHIDRA_CAST<uint32_t *>((iVar1 + 0x3c + (curses >> 5) * 4)) & 1 << ((uint8_t)curses & 0x1f)) == 0) {
|
|
curses = curses + 1;
|
|
if (7 < GHIDRA_INT(curses)) {
|
|
return 0;
|
|
}
|
|
}
|
|
if ((curses != 0xffffffff) && (this->_doors[curses] == (void *)0x0)) {
|
|
MakeDoor(this,curses);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this->_doors[curses]) + 0x394)) = 0xffffff9b;
|
|
LAB_00827ace:
|
|
iVar1 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 8));
|
|
(GHIDRA_CAST<GridEntity_Door *>((this->_doors[curses])))->GridEntity_Door::SetRoomTypes(iVar1,iVar1);
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00827b70
|
|
uint8_t Room::IsMirrorWorld()
|
|
{
|
|
uint32_t curses;
|
|
|
|
if ((g_game->_currentDimensionIdx == 1) &&
|
|
((g_game->_stageType == 4 || (g_game->_stageType == 5)))) {
|
|
if (g_game->_stage == 2) {
|
|
return 1;
|
|
}
|
|
if ((g_game->_stage == 1) && (curses = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses(), (curses & 2) != 0)) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00827bb0
|
|
uint8_t Room::HasCurseMist()
|
|
{
|
|
return (uint8_t)(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) >> 0xd) & 1;
|
|
}
|
|
|
|
// 00827bc0
|
|
uint8_t Room::is_pre_ascent_mom_room()
|
|
{
|
|
uint8_t local_AL_24;
|
|
|
|
if ((this->_roomType == 5) && (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x10)) + 0x10)) == 0x59)
|
|
) {
|
|
local_AL_24 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::IsPreAscent();
|
|
if (local_AL_24 != 0) {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
// 00827bf0
|
|
uint8_t Room::spawn_sanguine_bond_spikes(uint8_t isRoomInit)
|
|
{
|
|
int iVar1;
|
|
GridEntity_Spikes *this_00;
|
|
code *pcVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
Entity_Player *bondOwner;
|
|
int rowStart;
|
|
GridEntity *newSpikes;
|
|
Entity *poof;
|
|
int cellIdx;
|
|
int iVar5;
|
|
uint32_t *existingGrid;
|
|
void **gridSlot;
|
|
int gridY;
|
|
uint32_t spikeIdx;
|
|
Vector local_28;
|
|
int rowsLeft;
|
|
int dx;
|
|
uint32_t spikeGridIdx;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int *neighborGrid;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b01a07;
|
|
local_10 = ExceptionList;
|
|
uVar4 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
if ((this->_roomType != 0xe) ||
|
|
(bondOwner = PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x2b4,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1),
|
|
bondOwner == GHIDRA_CAST<Entity_Player *>(0x0))) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
iVar1 = this->_gridWidth;
|
|
if ((iVar1 < 8) || (this->_gridHeight < 5)) {
|
|
spikeIdx = 0xffffffff;
|
|
spikeGridIdx = 0xffffffff;
|
|
}
|
|
else {
|
|
spikeIdx = iVar1 * 4 + 7;
|
|
spikeGridIdx = spikeIdx;
|
|
if ((spikeIdx < 0x1c0) &&
|
|
(existingGrid = this->_gridEntities[iVar1 * 4 + 7], existingGrid != GHIDRA_CAST<uint32_t *>(0x0))) {
|
|
local_28.y = (float)(existingGrid + 1);
|
|
if (*GHIDRA_CAST<int *>(local_28.y) == 8) {
|
|
if (existingGrid[2] == 100) {
|
|
ExceptionList = local_10;
|
|
return 0;
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(local_28.y) == 7) {
|
|
dx = -1;
|
|
do {
|
|
gridY = 3;
|
|
iVar1 = dx + 7;
|
|
rowsLeft = 3;
|
|
iVar5 = dx;
|
|
do {
|
|
if ((((-1 < iVar1) && (iVar1 < this->_gridWidth)) && (-1 < gridY)) &&
|
|
(gridY < this->_gridHeight)) {
|
|
rowStart = this->_gridWidth * gridY;
|
|
cellIdx = iVar5 + 7 + rowStart;
|
|
if (((-1 < cellIdx) && (cellIdx < 0x1c0)) &&
|
|
((neighborGrid = this->_gridEntities[rowStart + iVar5 + 7],
|
|
neighborGrid != GHIDRA_CAST<int *>(0x0) && (neighborGrid[1] == 7)))) {
|
|
(**(code **)(*neighborGrid + 4))(uVar4);
|
|
}
|
|
iVar5 = dx;
|
|
}
|
|
spikeIdx = spikeGridIdx;
|
|
gridY = gridY + 1;
|
|
rowsLeft = rowsLeft + -1;
|
|
} while (rowsLeft != 0);
|
|
dx = iVar5 + 1;
|
|
} while (dx < 2);
|
|
existingGrid = GHIDRA_CAST<uint32_t *>(0x0);
|
|
if (this->_gridEntities[spikeGridIdx] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[spikeGridIdx]))(1);
|
|
existingGrid = GHIDRA_CAST<uint32_t *>(0x0);
|
|
this->_gridEntities[spikeIdx] = (void *)0x0;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<int *>(local_28.y) == 8) || (*GHIDRA_CAST<int *>(local_28.y) == 9)) &&
|
|
((existingGrid != GHIDRA_CAST<uint32_t *>(0x0) && (existingGrid[1] != 1)))) {
|
|
this->_gridPaths[spikeIdx] = 900;
|
|
this->_gridEntities[spikeIdx] = (void *)0x0;
|
|
(**(code **)*existingGrid)(1);
|
|
}
|
|
}
|
|
}
|
|
if (isRoomInit == 0) {
|
|
uVar4 = 0;
|
|
if (0 < this->_gridWidth * this->_gridHeight) {
|
|
gridSlot = this->_gridEntities;
|
|
do {
|
|
if ((((uVar4 != spikeGridIdx) && (uVar4 < 0x1c0)) &&
|
|
(this_00 = *gridSlot, this_00 != GHIDRA_CAST<GridEntity_Spikes *>(0x0))) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x4)))) == 8 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x4)))) == 9)))) {
|
|
(GHIDRA_CAST<GridEntity_Spikes *>((this_00)))->GridEntity_Spikes::unsummon(0);
|
|
}
|
|
uVar4 = uVar4 + 1;
|
|
gridSlot = gridSlot + 1;
|
|
} while (GHIDRA_INT(uVar4) < this->_gridWidth * this->_gridHeight);
|
|
}
|
|
spikeIdx = spikeGridIdx;
|
|
}
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x58));
|
|
local_28.y = 1.68156e-44;
|
|
if (uVar4 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar2 = (code *)swi(3);
|
|
bVar3 = (*pcVar2)();
|
|
return bVar3;
|
|
}
|
|
uVar4 = uVar4 >> 0xb ^ uVar4;
|
|
uVar4 = uVar4 << 7 ^ uVar4;
|
|
if ((GHIDRA_INT(spikeIdx) < 0) || (0x1bf < GHIDRA_INT(spikeIdx))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("SpawnGridEntity: Grid index invalid\n"));
|
|
}
|
|
if ((spikeIdx < 0x1c0) && (this->_gridPaths[spikeIdx] < 0x385)) {
|
|
newSpikes = operator_new(0x158);
|
|
local_8 = 0xd;
|
|
local_28.y = (float)newSpikes;
|
|
if (newSpikes == GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
newSpikes = GHIDRA_CAST<GridEntity *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GridEntity *>((newSpikes)))->GridEntity::GridEntity();
|
|
*GHIDRA_CAST<uint8_t ***>(newSpikes) = IsaacRepentancePlus::GridEntity_Spikes::vftable;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (newSpikes != GHIDRA_CAST<GridEntity *>(0x0)) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((newSpikes)) + 0x4)))) = 8;
|
|
newSpikes->_gridIndex = spikeGridIdx;
|
|
if (this->_gridEntities[spikeGridIdx] != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(this->_gridEntities[spikeGridIdx]))(1);
|
|
}
|
|
this->_gridEntities[spikeGridIdx] = newSpikes;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((newSpikes)) + 0x8)))) = 100;
|
|
newSpikes->_varData = 0;
|
|
(GHIDRA_CAST<GridEntity *>((newSpikes)))->GridEntity::Init(uVar4 >> 0xc ^ uVar4);
|
|
}
|
|
spikeIdx = spikeGridIdx;
|
|
}
|
|
if (isRoomInit == 0) {
|
|
uVar4 = Random();
|
|
local_28.x = (float)(GHIDRA_INT(spikeIdx) % this->_gridWidth) * 40.0 + 40.0;
|
|
local_28.y = (float)(GHIDRA_INT(spikeIdx) / this->_gridWidth) * 40.0 + 120.0;
|
|
poof = (GHIDRA_CAST<Game *>((g_game)))->Game::Spawn(1000,0xf,&local_28,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,uVar4);
|
|
poof->Update();
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|
|
|
|
// 0082eb80
|
|
int Room::GetSecondBossID()
|
|
{
|
|
return this->_secondBossID;
|
|
}
|
|
|
|
// 008332c0
|
|
void Room::SetAmbushDone(uint8_t isDone)
|
|
{
|
|
uint32_t newRoomFlags;
|
|
uint32_t roomFlags;
|
|
|
|
roomFlags = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44));
|
|
newRoomFlags = roomFlags | 8;
|
|
if (isDone == 0) {
|
|
newRoomFlags = roomFlags & 0xfffffff7;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x44)) = newRoomFlags;
|
|
return;
|
|
}
|
|
|
|
// 0085e0f0
|
|
void Room::KeepDoorsClosed()
|
|
{
|
|
this->_roomClearDelay = 10;
|
|
return;
|
|
}
|
|
|
|
// 0085e100
|
|
uint32_t Room::GetAwardSeed()
|
|
{
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == 0) {
|
|
return 0;
|
|
}
|
|
return *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + 0x60));
|
|
}
|
|
|
|
// 0085e110
|
|
int Room::GetShopLevel()
|
|
{
|
|
return this->_shopLevel;
|
|
}
|
|
|
|
// 0085e120
|
|
int Room::GetRenderMode()
|
|
{
|
|
return (this->_entityList)._renderMode;
|
|
}
|
|
|
|
// 0085e130
|
|
float Room::GetEnemyDamageInflicted()
|
|
{
|
|
return *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x12d4))));
|
|
}
|
|
|
|
// 00872020
|
|
void Room::Spawns(uint32_t *param_1, int param_2)
|
|
{
|
|
*param_1 = GHIDRA_UINT(*GHIDRA_CAST<uint16_t *>((param_2 + 0x44)));
|
|
param_1[1] = *GHIDRA_CAST<uint32_t *>((param_2 + 0x40));
|
|
return;
|
|
}
|
|
|
|
// 00872040
|
|
uint32_t Room::Doors(int param_1)
|
|
{
|
|
return *GHIDRA_CAST<uint32_t *>((param_1 + 0x38));
|
|
}
|
|
|
|
// 009e31b0
|
|
void Room::render_pit_rails(float *param_2)
|
|
{
|
|
uint8_t bVar1;
|
|
int cellCount;
|
|
AnimationState *secondLayer;
|
|
uint32_t gridIndex;
|
|
int cellCount;
|
|
float pixelScale;
|
|
double dVar3;
|
|
double dVar4;
|
|
int gridSlotOffset;
|
|
Vector renderPos;
|
|
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this->_gridEntities + 0x68)))))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("pitrail"),1);
|
|
if (((bVar1 != 0) && (this->_gridEntities[0x75] != (void *)0x0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x74)))))->AnimationState::SetFrameFloat(0.0),
|
|
this->_gridEntities[0x75] != (void *)0x0)) {
|
|
*GHIDRA_CAST<uint8_t *>((this->_gridEntities + 0x79)) = 0;
|
|
}
|
|
gridIndex = 0;
|
|
cellCount = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this) + 0x10)) * *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this) + 0xc));
|
|
if (0 < cellCount) {
|
|
gridSlotOffset = 0x24;
|
|
do {
|
|
bVar1 = *GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_gridEntities) + (gridIndex - 0x20)));
|
|
if ((-1 < (char)bVar1) && (gridIndex < 0x1c0)) {
|
|
cellCount = *GHIDRA_CAST<int *>(this);
|
|
if ((*GHIDRA_CAST<int *>((gridSlotOffset + cellCount)) != 0) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((gridSlotOffset + cellCount)) + 4)) == 7)) {
|
|
if (this->_gridEntities[0x75] != (void *)0x0) {
|
|
AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x74)),(float)(bVar1 & 0xf));
|
|
cellCount = *GHIDRA_CAST<int *>(this);
|
|
}
|
|
cellCount = *GHIDRA_CAST<int *>((cellCount + 0xc));
|
|
pixelScale = g_displayPixelRatio * g_screenPointScale;
|
|
dVar3 = floor((double)(((((float)(GHIDRA_INT(gridIndex) % cellCount) * 40.0 + 40.0) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * pixelScale + 0.5));
|
|
dVar4 = floor((double)(((((float)(GHIDRA_INT(gridIndex) / cellCount) * 40.0 + 120.0) - 140.0) * 0.65
|
|
+ (g_screenHeight - 182.0) * 0.5) * pixelScale + 0.5));
|
|
renderPos.x = (float)dVar3 / pixelScale + *param_2;
|
|
renderPos.y = (float)dVar4 / pixelScale + param_2[1];
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this->_gridEntities) + 0x2a9)) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((this->_gridEntities + 0x84)) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x74)),&renderPos,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondLayer = GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x7c));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x7c)),&renderPos,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondLayer = GHIDRA_CAST<AnimationState *>((this->_gridEntities + 0x74));
|
|
}
|
|
AnimationState::Render(secondLayer,&renderPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
gridSlotOffset = gridSlotOffset + 4;
|
|
gridIndex = gridIndex + 1;
|
|
} while (GHIDRA_INT(gridIndex) < cellCount);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009e7dc0
|
|
int Room::GetBossThematicItem(int param_2)
|
|
{
|
|
char *putPos;
|
|
int iVar1;
|
|
int putResult;
|
|
size_t written;
|
|
char ch;
|
|
size_t _Count;
|
|
char *srcNext;
|
|
char *convEnd;
|
|
char srcChar;
|
|
char convBuf [32];
|
|
uint32_t local_8;
|
|
void *bufferBegin;
|
|
void *bufferEnd;
|
|
uint32_t putPtr;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((convBuf + 0x24));
|
|
if (param_2 == -1) {
|
|
return 0;
|
|
}
|
|
putPtr = *GHIDRA_CAST<uint32_t *>((this->_bottomRightPos).y);
|
|
ch = (char)param_2;
|
|
if ((putPtr != 0) && (putPtr < *GHIDRA_CAST<int *>(this->_gridEntities[3]) + putPtr)) {
|
|
putPos = msvc::basic_streambuf<char,msvc::char_traits<char>_>::_Pninc
|
|
((basic_streambuf<char,msvc::char_traits<char>_> *)this);
|
|
*putPos = ch;
|
|
return param_2;
|
|
}
|
|
if (this->_gridEntities[10] != (void *)0x0) {
|
|
if ((void **)*GHIDRA_CAST<uint8_t **>(this->_gridWidth) == this->_gridEntities + 6) {
|
|
bufferEnd = this->_gridEntities[0xc];
|
|
bufferBegin = this->_gridEntities[0xb];
|
|
*(void **)this->_gridWidth = bufferBegin;
|
|
*(void **)(this->_bottomRightPos).x = bufferBegin;
|
|
*GHIDRA_CAST<int *>(this->_gridEntities[2]) = GHIDRA_INT(bufferEnd) - GHIDRA_INT(bufferBegin);
|
|
}
|
|
if (this->_gridEntities[5] == (codecvt<char,char,_Mbstatet> *)0x0) {
|
|
LAB_009e7e8d:
|
|
putResult = fputc(GHIDRA_INT(ch),this->_gridEntities[10]);
|
|
iVar1 = -1;
|
|
if (putResult != -1) {
|
|
iVar1 = param_2;
|
|
}
|
|
return iVar1;
|
|
}
|
|
srcChar = ch;
|
|
iVar1 = msvc::codecvt<char,char,_Mbstatet>::out
|
|
(this->_gridEntities[5],GHIDRA_CAST<_Mbstatet *>((this->_gridEntities + 7)),&srcChar,
|
|
convBuf,&srcNext,convBuf,GHIDRA_CAST<char *>(&local_8),&convEnd);
|
|
if ((iVar1 == 0) || (iVar1 == 1)) {
|
|
_Count = GHIDRA_INT(convEnd) - GHIDRA_INT(convBuf);
|
|
if (((_Count == 0) ||
|
|
(written = fwrite(convBuf,1,_Count,this->_gridEntities[10]), _Count == written)) &&
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_gridEntities) + 0x19)) = 1, srcNext != &srcChar)) {
|
|
return param_2;
|
|
}
|
|
}
|
|
else if (iVar1 == 3) {
|
|
ch = srcChar;
|
|
goto LAB_009e7e8d;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|