--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
484 lines
19 KiB
C++
484 lines
19 KiB
C++
#include "classes.h"
|
|
|
|
// 009abd80
|
|
ItemOverlay::~ItemOverlay()
|
|
{
|
|
int *local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t *playerRef;
|
|
|
|
puStack_c = &LAB_00afa3c0;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_megaMushPlayerSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_megaMushPlayerSprite)._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_megaMushPlayerSprite)._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_megaMushPlayerSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_megaMushPlayerSprite))))->msvc::string::_Tidy_deallocate();
|
|
playerRef = &this->_player;
|
|
if (*playerRef != 0) {
|
|
local_14 = playerRef;
|
|
msvc::multiset<unsigned_int>::erase(&local_14);
|
|
*playerRef = 0;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
_eh_vector_destructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x11c))),0x58,0x30,FUN_009abd50);
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_sprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_sprite))))->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009aca90
|
|
void ItemOverlay::Update(uint8_t unk)
|
|
{
|
|
uint8_t bVar1;
|
|
int iVar2;
|
|
uint32_t *playerSlot;
|
|
int healthType;
|
|
void *playerListEnd;
|
|
Entity_Player *player;
|
|
Entity_Player *heartPlayer;
|
|
int extraout_EDX;
|
|
uint32_t uVar3;
|
|
uint8_t isFastForward;
|
|
uint32_t playerIndex;
|
|
PlayerManager *playerManager;
|
|
undefined3 in_stack_00000005;
|
|
float Pitch;
|
|
int soundId;
|
|
AnimationState *local_8;
|
|
Game *game;
|
|
Manager *manager;
|
|
int *roomDesc;
|
|
AnimationState *spriteAnimState;
|
|
|
|
isFastForward = unk;
|
|
if (this->_state == 1) {
|
|
this->_delay = this->_delay + -1;
|
|
if (this->_delay < 1) {
|
|
this->_state = 2;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (this->_state == 0) {
|
|
return;
|
|
}
|
|
if ((this->_megaMushPlayerSprite)._loaded != 0) {
|
|
if (unk == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_megaMushPlayerSprite)))->ANM2::Update();
|
|
}
|
|
else if ((this->_megaMushPlayerSprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::AdvancePosition
|
|
(&(this->_megaMushPlayerSprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_megaMushPlayerSprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
if (((this->_player != 0) &&
|
|
(bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_megaMushPlayerSprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("Transform")), bVar1 != 0)) &&
|
|
(isFastForward == 0)) {
|
|
iVar2 = (GHIDRA_CAST<ANM2 *>((&this->_megaMushPlayerSprite)))->ANM2::GetFrame();
|
|
manager = g_manager;
|
|
if (iVar2 == 1) {
|
|
local_8 = GHIDRA_CAST<AnimationState *>(0x9d);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
|
|
Pitch = 1.0;
|
|
iVar2 = 2;
|
|
}
|
|
else {
|
|
if (iVar2 == 6) {
|
|
local_8 = GHIDRA_CAST<AnimationState *>(0x10c);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
|
|
Pitch = 0.8;
|
|
}
|
|
else if (iVar2 == 0xb) {
|
|
local_8 = GHIDRA_CAST<AnimationState *>(0x10c);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
|
|
Pitch = 1.0;
|
|
}
|
|
else {
|
|
if (iVar2 != 0x10) goto LAB_009acc1b;
|
|
local_8 = GHIDRA_CAST<AnimationState *>(0x10c);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
|
|
Pitch = 1.2;
|
|
}
|
|
iVar2 = 1;
|
|
}
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_8),1.0,iVar2,0,Pitch,0.0);
|
|
}
|
|
}
|
|
LAB_009acc1b:
|
|
if ((this->_sprite)._loaded == 0) {
|
|
if (this->_state != 2) {
|
|
return;
|
|
}
|
|
if (((this->_megaMushPlayerSprite)._animState._animData != (void *)0x0) &&
|
|
((this->_megaMushPlayerSprite)._animState._isPlaying != 0)) {
|
|
return;
|
|
}
|
|
if (this->_player != 0) {
|
|
*GHIDRA_CAST<uint8_t *>((this->_player + 0x171)) = 1;
|
|
}
|
|
this->_state = 0;
|
|
return;
|
|
}
|
|
if ((this->_state == 2) &&
|
|
(((this->_sprite)._animState._animData == (void *)0x0 ||
|
|
((this->_sprite)._animState._isPlaying == 0)))) {
|
|
this->_state = 0;
|
|
}
|
|
if (isFastForward == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Update();
|
|
}
|
|
else {
|
|
if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_009accdf;
|
|
AnimationState::AdvancePosition
|
|
(&(this->_sprite)._animState,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1);
|
|
}
|
|
if ((((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
(bVar1 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Sound")),
|
|
manager = g_manager, bVar1 != 0)) && (this->_overlayID == 0x27)) {
|
|
local_8 = GHIDRA_CAST<AnimationState *>(0x51);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_8),1.0,2,0,1.0,0.0);
|
|
}
|
|
LAB_009accdf:
|
|
local_8 = &(this->_sprite)._animState;
|
|
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
(bVar1 = (GHIDRA_CAST<AnimationState *>((local_8)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("SleepFillHP")), bVar1 != 0)) {
|
|
playerIndex = 0;
|
|
playerManager = &g_game->_playerManager;
|
|
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;
|
|
}
|
|
playerSlot = (playerManager->_playerList)._begin;
|
|
if (playerIndex < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(playerSlot) >> 2))) {
|
|
playerSlot = playerSlot + playerIndex;
|
|
}
|
|
if ((GHIDRA_CAST<Entity_Player *>(*playerSlot))->_playerType != 0x28) {
|
|
iVar2 = (GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerSlot))))->Entity_Player::GetHealthType();
|
|
if ((iVar2 == 1) || (iVar2 == 2)) {
|
|
iVar2 = player->_maxHearts;
|
|
}
|
|
else {
|
|
iVar2 = player->_maxHearts + player->_boneHearts * 2;
|
|
}
|
|
if (iVar2 < 1) {
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::AddSoulHearts(6,0);
|
|
}
|
|
else {
|
|
healthType = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetHealthType();
|
|
iVar2 = extraout_EDX;
|
|
if ((healthType != 1) && (healthType != 2)) {
|
|
iVar2 = extraout_EDX + heartPlayer->_boneHearts * 2;
|
|
}
|
|
if (iVar2 <= heartPlayer->_redHearts) goto LAB_009ace00;
|
|
(GHIDRA_CAST<Entity_Player *>((heartPlayer)))->Entity_Player::SetFullHearts();
|
|
}
|
|
manager = g_manager;
|
|
if (unk == 0) {
|
|
soundId = 0x80;
|
|
seed_fart_sound_override(&soundId);
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0);
|
|
}
|
|
}
|
|
LAB_009ace00:
|
|
playerIndex = playerIndex + 1;
|
|
playerManager = &g_game->_playerManager;
|
|
} while (playerIndex <
|
|
GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&g_manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0xca,1);
|
|
isFastForward = (uint8_t)_unk;
|
|
}
|
|
spriteAnimState = local_8;
|
|
if ((this->_overlayID == 0x2c) && ((this->_sprite)._animState._animData != (void *)0x0)) {
|
|
bVar1 = (GHIDRA_CAST<AnimationState *>((local_8)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Transition"));
|
|
manager = g_manager;
|
|
game = g_game;
|
|
if (bVar1 == 0) {
|
|
if ((((this->_sprite)._animState._animData != (void *)0x0) &&
|
|
(bVar1 = (GHIDRA_CAST<AnimationState *>((spriteAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("Static")),
|
|
manager = g_manager, bVar1 != 0)) && (isFastForward == 0)) {
|
|
_unk = 0x51;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&unk));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(_unk,1.0,2,0,1.0,0.0);
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::PlayMusic();
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::EnableLayer(0,1);
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
if (isFastForward == 0) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x21c10))) = 0;
|
|
if ((game->_difficulty == 2) || (game->_difficulty == 3)) {
|
|
uVar3 = 0x12;
|
|
}
|
|
else {
|
|
uVar3 = 0x1b;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x21c10))) = 1;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x3a0)))) = uVar3;
|
|
*GHIDRA_CAST<uint16_t *>(&manager->_isNightmarePending) = 0x101;
|
|
}
|
|
roomDesc = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 4)) + 0x10));
|
|
if (((roomDesc != GHIDRA_CAST<int *>(0x0)) && (game->_stage == 0xd)) &&
|
|
((game->_stageType == 0 && ((*roomDesc == 0x23 && (roomDesc[4] == 2)))))) {
|
|
(GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::SetStage(0xd,1);
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::reload_backdrop();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009acfe0
|
|
void ItemOverlay::Render()
|
|
{
|
|
void *quad;
|
|
ItemOverlay *extraout_ECX;
|
|
ANM2 *sprite;
|
|
ItemOverlay *extraout_ECX_00;
|
|
ItemOverlay *unusedArg;
|
|
double dVar1;
|
|
Vector scratchVec;
|
|
float pixelScale;
|
|
KColor tintColor;
|
|
uint8_t renderQuad [172];
|
|
int player;
|
|
|
|
if (this->_state == 0) {
|
|
return;
|
|
}
|
|
if (this->_state == 1) {
|
|
return;
|
|
}
|
|
if ((this->_sprite)._loaded == 0) {
|
|
unusedArg = this;
|
|
if (this->_overlayID != 0x2d) goto LAB_009ad1ff;
|
|
set_blend_mode(&DAT_00c798e0,1);
|
|
tintColor._red = 0.0;
|
|
tintColor._green = 0.0;
|
|
tintColor._blue = 0.0;
|
|
tintColor._alpha = 0.4;
|
|
tintColor._unk = 0;
|
|
scratchVec.x = g_screenWidth;
|
|
scratchVec.y = g_screenHeight;
|
|
render_quad_set_rect(renderQuad,&g_vectorZero,&scratchVec,&tintColor);
|
|
render_color_shader_pass(quad);
|
|
FUN_00682260();
|
|
unusedArg = extraout_ECX;
|
|
if (((this->_megaMushPlayerSprite)._loaded == 0) || (player = this->_player, player == 0))
|
|
goto LAB_009ad1ff;
|
|
pixelScale = g_displayPixelRatio * g_screenPointScale;
|
|
dVar1 = floor((double)(((g_screenWidth - 338.0) * 0.5 +
|
|
(*GHIDRA_CAST<float *>((player + 0x33c)) - 60.0) * 0.65) * pixelScale + 0.5));
|
|
scratchVec.x = (float)dVar1 / pixelScale;
|
|
dVar1 = floor((double)(((g_screenHeight - 182.0) * 0.5 +
|
|
(*GHIDRA_CAST<float *>((player + 0x340)) - 140.0) * 0.65) * pixelScale + 0.5));
|
|
sprite = &this->_megaMushPlayerSprite;
|
|
scratchVec.y = (float)dVar1 / pixelScale + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1208));
|
|
scratchVec.x = scratchVec.x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1204));
|
|
}
|
|
else {
|
|
sprite = &this->_sprite;
|
|
scratchVec.y = g_screenHeight * 0.5;
|
|
scratchVec.x = g_screenWidth * 0.5;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Render(&scratchVec,&g_vectorZero,&g_vectorZero);
|
|
unusedArg = extraout_ECX_00;
|
|
LAB_009ad1ff:
|
|
shader_cache_find(GHIDRA_INT(unusedArg));
|
|
return;
|
|
}
|
|
|
|
// 009ad210
|
|
void ItemOverlay::Show(int eOverlayID, int delay, Entity_Player *player)
|
|
{
|
|
int iVar1;
|
|
float fVar2;
|
|
float fVar3;
|
|
float fVar4;
|
|
uint8_t bVar5;
|
|
LayerState *layer;
|
|
uint8_t *pbVar6;
|
|
uint32_t cmpResult;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
int iVar7;
|
|
uint8_t *pbVar8;
|
|
int layerColors;
|
|
uint8_t *pbVar9;
|
|
uint8_t *pbVar10;
|
|
bool isLess;
|
|
uint32_t layerColorIndex;
|
|
uint8_t *layerName;
|
|
void *layerData;
|
|
Entity_Player *newPlayer;
|
|
uint32_t *playerRef;
|
|
ANM2 *sprite;
|
|
|
|
if (0x2f < GHIDRA_UINT(eOverlayID)) {
|
|
return;
|
|
}
|
|
sprite = &this->_sprite;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x14)) == 0) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Reset();
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 4)),0);
|
|
bVar5 = extraout_CL;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x44)) != 0) {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(sprite),0,
|
|
GHIDRA_CAST<std_string *>((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x34)));
|
|
bVar5 = extraout_CL_00;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::LoadGraphics(bVar5);
|
|
}
|
|
newPlayer = player;
|
|
this->_overlayID = eOverlayID;
|
|
playerRef = &this->_player;
|
|
if (GHIDRA_CAST<Entity_Player *>(*playerRef) != player) {
|
|
if (GHIDRA_CAST<Entity_Player *>(*playerRef) != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
player = GHIDRA_CAST<Entity_Player *>(playerRef);
|
|
msvc::multiset<unsigned_int>::erase(&player);
|
|
}
|
|
*playerRef = newPlayer;
|
|
if (newPlayer != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
msvc::multiset<unsigned_int>::insert(playerRef);
|
|
}
|
|
}
|
|
if ((this->_sprite)._loaded != 0) {
|
|
layerColorIndex = 0;
|
|
layerColors = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x4c));
|
|
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x50)) - layerColors;
|
|
iVar1 = iVar7 >> 0x1f;
|
|
if (iVar7 / 0x44 + iVar1 != iVar1) {
|
|
player = GHIDRA_CAST<Entity_Player *>(0x0);
|
|
do {
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT((&(player->_sprite)._filename + -3)) + layerColors));
|
|
layerName = pbVar10;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(((player->_sprite)._filename._buf + layerColors + -0x34))) {
|
|
layerName = *GHIDRA_CAST<uint8_t **>(pbVar10);
|
|
}
|
|
pbVar9 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
if ((this->_sprite)._layerCount != 0) {
|
|
do {
|
|
layer = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::GetLayer(pbVar9);
|
|
layerData = layer->_layerData;
|
|
if (layerData == (void *)0x0) {
|
|
pbVar8 = &s_empty;
|
|
}
|
|
else {
|
|
pbVar8 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(layerData) + 8));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(layerData) + 0x1c))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar8);
|
|
}
|
|
}
|
|
pbVar6 = layerName;
|
|
do {
|
|
bVar5 = *pbVar8;
|
|
isLess = bVar5 < *pbVar6;
|
|
if (bVar5 != *pbVar6) {
|
|
LAB_009ad360:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ad365;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar8[1];
|
|
isLess = bVar5 < pbVar6[1];
|
|
if (bVar5 != pbVar6[1]) goto LAB_009ad360;
|
|
pbVar8 = pbVar8 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar5 != 0);
|
|
cmpResult = 0;
|
|
LAB_009ad365:
|
|
if ((cmpResult == 0) && (&layer->_color != GHIDRA_CAST<ColorMod *>((pbVar10 + 0x18)))) {
|
|
fVar2 = *GHIDRA_CAST<float *>((pbVar10 + 0x1c));
|
|
fVar3 = *GHIDRA_CAST<float *>((pbVar10 + 0x20));
|
|
fVar4 = *GHIDRA_CAST<float *>((pbVar10 + 0x24));
|
|
(layer->_color)._tint[0] = *GHIDRA_CAST<float *>((pbVar10 + 0x18));
|
|
(layer->_color)._tint[1] = fVar2;
|
|
(layer->_color)._tint[2] = fVar3;
|
|
(layer->_color)._tint[3] = fVar4;
|
|
fVar2 = *GHIDRA_CAST<float *>((pbVar10 + 0x2c));
|
|
fVar3 = *GHIDRA_CAST<float *>((pbVar10 + 0x30));
|
|
fVar4 = *GHIDRA_CAST<float *>((pbVar10 + 0x34));
|
|
(layer->_color)._colorize[0] = *GHIDRA_CAST<float *>((pbVar10 + 0x28));
|
|
(layer->_color)._colorize[1] = fVar2;
|
|
(layer->_color)._colorize[2] = fVar3;
|
|
(layer->_color)._colorize[3] = fVar4;
|
|
fVar2 = *GHIDRA_CAST<float *>((pbVar10 + 0x3c));
|
|
(layer->_color)._offset[0] = *GHIDRA_CAST<float *>((pbVar10 + 0x38));
|
|
(layer->_color)._offset[1] = fVar2;
|
|
(layer->_color)._offset[2] = *GHIDRA_CAST<float *>((pbVar10 + 0x40));
|
|
}
|
|
pbVar9 = pbVar9 + 1;
|
|
} while (pbVar9 < GHIDRA_CAST<uint8_t *>((this->_sprite)._layerCount));
|
|
}
|
|
player = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x44))));
|
|
layerColorIndex = layerColorIndex + 1;
|
|
layerColors = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x4c));
|
|
} while (layerColorIndex <
|
|
GHIDRA_UINT(((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x50)) - layerColors)
|
|
/ 0x44)));
|
|
}
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x1c));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x30))) {
|
|
pbVar10 = *GHIDRA_CAST<uint8_t **>(pbVar10);
|
|
}
|
|
pbVar9 = (this->_sprite)._animState._animData;
|
|
if (pbVar9 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar8 = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar9 + 0x14))) {
|
|
pbVar8 = *GHIDRA_CAST<uint8_t **>(pbVar9);
|
|
}
|
|
pbVar6 = pbVar10;
|
|
do {
|
|
bVar5 = *pbVar8;
|
|
isLess = bVar5 < *pbVar6;
|
|
if (bVar5 != *pbVar6) {
|
|
LAB_009ad424:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ad429;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar8[1];
|
|
isLess = bVar5 < pbVar6[1];
|
|
if (bVar5 != pbVar6[1]) goto LAB_009ad424;
|
|
pbVar8 = pbVar8 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar5 != 0);
|
|
cmpResult = 0;
|
|
LAB_009ad429:
|
|
if ((cmpResult == 0) && ((pbVar9[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
|
goto LAB_009ad452;
|
|
}
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(pbVar10,1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
|
(this->_sprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_009ad452:
|
|
this->_state = 2 - GHIDRA_UINT((delay != 0));
|
|
this->_delay = delay;
|
|
return;
|
|
}
|