Curation round 24 (code only): pickups and slots, level generation with the Ascent and the Death Certificate return, rooms and grid entities, Game and Entity core with Polty, Clutch, Matriarch, Chimera, Bumbino and other bosses, the player's remaining branches, familiars and weapons, HUD and engine stubs, 004b6a90 renamed push_back, shared constants folded (66 duplicates, 38 main gaps)
This commit is contained in:
1 parent
11c71fe041
commit
534339a496
232 files changed
+14610
-3185
No files matched your search
@@ -104,79 +104,6 @@ LAB_00499c40:
|
||||
goto LAB_00499ba3;
|
||||
}
|
||||
|
||||
// 0049f870
|
||||
void NpcHelper::chimera_charge_begin(Entity_NPC *npc, Vector *target, float speed)
|
||||
{
|
||||
uint8_t bVar1;
|
||||
uint8_t *currentName;
|
||||
uint32_t compareResult;
|
||||
char *chargeBeginName;
|
||||
bool isLess;
|
||||
float length;
|
||||
float dirX;
|
||||
float local_c;
|
||||
float local_8;
|
||||
uint8_t *animData;
|
||||
Manager *manager;
|
||||
|
||||
animData = (npc->_sprite)._animState._animData;
|
||||
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
||||
currentName = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
||||
currentName = *GHIDRA_CAST<uint8_t **>(animData);
|
||||
}
|
||||
chargeBeginName = "ChargeBegin";
|
||||
do {
|
||||
bVar1 = *currentName;
|
||||
isLess = bVar1 < (uint8_t)*chargeBeginName;
|
||||
if (bVar1 != *chargeBeginName) {
|
||||
LAB_0049f8b6:
|
||||
compareResult = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_0049f8bb;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = currentName[1];
|
||||
isLess = bVar1 < (uint8_t)chargeBeginName[1];
|
||||
if (bVar1 != chargeBeginName[1]) goto LAB_0049f8b6;
|
||||
currentName = currentName + 2;
|
||||
chargeBeginName = chargeBeginName + 2;
|
||||
} while (bVar1 != 0);
|
||||
compareResult = 0;
|
||||
LAB_0049f8bb:
|
||||
if ((compareResult == 0) &&
|
||||
((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0049f8ee;
|
||||
}
|
||||
bVar1 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST<uint8_t *>("ChargeBegin"),1);
|
||||
if (bVar1 != 0) {
|
||||
AnimationState::Rewind(&(npc->_sprite)._animState);
|
||||
(npc->_sprite)._animState._isPlaying = 1;
|
||||
}
|
||||
LAB_0049f8ee:
|
||||
npc->_state = 10;
|
||||
manager = g_manager;
|
||||
local_8 = 1.0;
|
||||
if (npc->_championColorIdx == 0x12) {
|
||||
local_8 = 1.5;
|
||||
}
|
||||
else if (npc->_championColorIdx == 0x13) {
|
||||
local_8 = 0.5;
|
||||
}
|
||||
local_c = 4.21791e-43;
|
||||
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_c));
|
||||
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c),1.0,2,0,local_8,0.0);
|
||||
dirX = target->x - (npc->_pos).x;
|
||||
local_c = target->y - (npc->_pos).y;
|
||||
length = sqrtf(dirX * dirX + local_c * local_c);
|
||||
if (0.0 < length) {
|
||||
dirX = dirX * (1.0 / length);
|
||||
local_c = local_c * (1.0 / length);
|
||||
}
|
||||
*GHIDRA_CAST<uint8_t *>(&npc->_i1) = 0;
|
||||
(npc->_targetPosition).x = dirX * speed;
|
||||
(npc->_targetPosition).y = local_c * speed;
|
||||
return;
|
||||
}
|
||||
|
||||
// 0055d070
|
||||
uint8_t NpcHelper::polty_target_set(int gridIndex)
|
||||
{
|
||||
@@ -282,483 +209,6 @@ void NpcHelper::mother_set_collision_class(Entity_NPC *npc, int collisionClass)
|
||||
return;
|
||||
}
|
||||
|
||||
// 00572a70
|
||||
Entity * NpcHelper::clutch_find_farthest_orbital(Entity_NPC *clutch, int unused)
|
||||
{
|
||||
uint64_t qVar1;
|
||||
uint8_t isClutchFriendly;
|
||||
int enemiesData;
|
||||
uint64_t *heapAllocatedBytes;
|
||||
uint8_t extraout_DL;
|
||||
Entity *tmpEntity;
|
||||
uint32_t uVar2;
|
||||
float fVar3;
|
||||
float deltaX;
|
||||
EntityList_EL local_38;
|
||||
uint32_t local_24;
|
||||
float maxDistance;
|
||||
Entity *local_18;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t uStack_8;
|
||||
|
||||
uStack_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af1840;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
local_18 = GHIDRA_CAST<Entity *>(0x0);
|
||||
maxDistance = 0.0;
|
||||
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&local_38,0x379,-1,-1,0,0);
|
||||
uVar2 = 0;
|
||||
tmpEntity = GHIDRA_CAST<Entity *>(0x0);
|
||||
if (local_38._size != 0) {
|
||||
enemiesData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
||||
do {
|
||||
tmpEntity = *GHIDRA_CAST<Entity **>((enemiesData + uVar2 * 4));
|
||||
if (tmpEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
||||
if (((1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) && (tmpEntity->_type == 1)) ||
|
||||
(tmpEntity->_type - 10U < 0x3de)) {
|
||||
local_24 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&tmpEntity->_flags) + 4));
|
||||
isClutchFriendly = Entity::IsFriendly(GHIDRA_CAST<Entity *>(clutch));
|
||||
if (((extraout_DL == isClutchFriendly) && (GHIDRA_CAST<Entity_NPC *>(tmpEntity->_parent) == clutch)) &&
|
||||
((tmpEntity != GHIDRA_CAST<Entity *>(clutch->_child) &&
|
||||
((tmpEntity[2]._updateTime != 1.38729e-43 &&
|
||||
(fVar3 = (clutch->_pos).y - (tmpEntity->_pos).y,
|
||||
deltaX = (clutch->_pos).x - (tmpEntity->_pos).x,
|
||||
fVar3 = sqrtf(fVar3 * fVar3 + deltaX * deltaX), (tmpEntity->_flags & 0x10) == 0))))))
|
||||
{
|
||||
enemiesData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
||||
if (maxDistance < fVar3) {
|
||||
maxDistance = fVar3;
|
||||
local_18 = tmpEntity;
|
||||
}
|
||||
goto LAB_00572bab;
|
||||
}
|
||||
}
|
||||
enemiesData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4)));
|
||||
}
|
||||
LAB_00572bab:
|
||||
uVar2 = uVar2 + 1;
|
||||
tmpEntity = local_18;
|
||||
} while (uVar2 < GHIDRA_UINT(local_38._size));
|
||||
}
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x0))) == '\0') {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
heapAllocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
heapAllocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) != 0) {
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) + -4));
|
||||
qVar1 = *heapAllocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(heapAllocatedBytes) = GHIDRA_UINT(*heapAllocatedBytes) - uVar2;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapAllocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapAllocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
|
||||
free(GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x4))) + -4)));
|
||||
}
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return tmpEntity;
|
||||
}
|
||||
|
||||
// 00572cc0
|
||||
void NpcHelper::clutch_spawn_fire(Entity_NPC *npc, Entity *target)
|
||||
{
|
||||
uint32_t uVar1;
|
||||
float fVar2;
|
||||
float fVar3;
|
||||
uint8_t bVar4;
|
||||
uint32_t uVar5;
|
||||
Entity *fire;
|
||||
uint8_t *pbVar6;
|
||||
LayerState *layer;
|
||||
uint32_t angleRoll;
|
||||
char *pcVar7;
|
||||
uint8_t *size;
|
||||
bool bVar8;
|
||||
float fVar9;
|
||||
Vector spawnPos;
|
||||
Vector local_64;
|
||||
ANM2 *local_5c;
|
||||
Entity *local_58;
|
||||
Entity_NPC *local_54;
|
||||
Entity *local_50;
|
||||
uint8_t local_4c [32];
|
||||
int animPathSize;
|
||||
uint8_t *animPathCapacity;
|
||||
uint32_t local_24;
|
||||
uint8_t *puStack_20;
|
||||
void *local_1c;
|
||||
uint8_t *puStack_18;
|
||||
uint32_t local_14;
|
||||
code *addFlagsFn;
|
||||
ANM2 *fireSprite;
|
||||
uint32_t *parentSlot;
|
||||
|
||||
puStack_20 = local_4c + 0x48;
|
||||
local_14 = 0xffffffff;
|
||||
puStack_18 = &LAB_00af506d;
|
||||
local_1c = ExceptionList;
|
||||
uVar5 = __security_cookie ^ GHIDRA_UINT((local_4c + 0x3c));
|
||||
ExceptionList = &local_1c;
|
||||
local_58 = target;
|
||||
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&target->_flags) + 4));
|
||||
*GHIDRA_CAST<uint32_t *>(&target->_flags) = GHIDRA_UINT(target->_flags) | 0x10;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&target->_flags) + 4)) = uVar1;
|
||||
addFlagsFn = *(code **)(*GHIDRA_CAST<int *>(target) + 0x24);
|
||||
local_54 = npc;
|
||||
local_24 = uVar5;
|
||||
EntityRef::constructor(GHIDRA_CAST<EntityRef *>(local_4c),GHIDRA_CAST<Entity *>(npc));
|
||||
(*addFlagsFn)(local_4c,uVar5);
|
||||
uVar5 = Random();
|
||||
local_64.x = (local_58->_pos).x;
|
||||
local_64.y = (local_58->_pos).y;
|
||||
fire = Game::Spawn(g_game,0x21,0xd,&local_64,&g_vectorZero,GHIDRA_CAST<Entity *>(npc),0,uVar5);
|
||||
animPathSize = 0;
|
||||
fireSprite = &fire->_sprite;
|
||||
animPathCapacity = &DAT_0000000f;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c)) + 0x10))) = 0.0;
|
||||
local_5c = fireSprite;
|
||||
local_50 = fire;
|
||||
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c)) + 0x10))) = msvc::_Allocate(0x30);
|
||||
animPathSize = 0x20;
|
||||
animPathCapacity = &DAT_0000002f;
|
||||
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_4c))) + 0x10))),"gfx/009.002_Fire Projectile.anm2",0x21);
|
||||
local_14 = 0;
|
||||
ANM2::Load(fireSprite,GHIDRA_CAST<std_string *>((local_4c + 0x10)),1);
|
||||
local_14 = 0xffffffff;
|
||||
if (&DAT_0000000f < animPathCapacity) {
|
||||
size = animPathCapacity + 1;
|
||||
pcVar7 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_4c))) + 0x10)));
|
||||
if (GHIDRA_CAST<uint8_t *>(0xfff) < size) {
|
||||
pcVar7 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c)) + 0x10))) + -4));
|
||||
size = animPathCapacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_4c)) + 0x10))) + (-4 - GHIDRA_INT(pcVar7))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar7,GHIDRA_UINT(size));
|
||||
}
|
||||
pbVar6 = (fire->_sprite)._animState._animData;
|
||||
if (pbVar6 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
||||
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
|
||||
pbVar6 = *GHIDRA_CAST<uint8_t **>(pbVar6);
|
||||
}
|
||||
pcVar7 = "Flickering";
|
||||
do {
|
||||
bVar4 = *pbVar6;
|
||||
bVar8 = bVar4 < (uint8_t)*pcVar7;
|
||||
if (bVar4 != *pcVar7) {
|
||||
LAB_00572e46:
|
||||
uVar5 = -GHIDRA_UINT(bVar8) | 1;
|
||||
goto LAB_00572e4b;
|
||||
}
|
||||
if (bVar4 == 0) break;
|
||||
bVar4 = pbVar6[1];
|
||||
bVar8 = bVar4 < (uint8_t)pcVar7[1];
|
||||
if (bVar4 != pcVar7[1]) goto LAB_00572e46;
|
||||
pbVar6 = pbVar6 + 2;
|
||||
pcVar7 = pcVar7 + 2;
|
||||
} while (bVar4 != 0);
|
||||
uVar5 = 0;
|
||||
LAB_00572e4b:
|
||||
if ((uVar5 == 0) &&
|
||||
((*GHIDRA_CAST<char *>((GHIDRA_INT((fire->_sprite)._animState._animData) + 0x34)) == '\0' ||
|
||||
((fire->_sprite)._animState._isPlaying != 0)))) goto LAB_00572e7c;
|
||||
}
|
||||
bVar4 = ANM2::SetAnimation(fireSprite,GHIDRA_CAST<uint8_t *>("Flickering"),1);
|
||||
if (bVar4 != 0) {
|
||||
AnimationState::Rewind(&(fire->_sprite)._animState);
|
||||
(fire->_sprite)._animState._isPlaying = 1;
|
||||
}
|
||||
LAB_00572e7c:
|
||||
fireSprite = local_5c;
|
||||
pbVar6 = GHIDRA_CAST<uint8_t *>(0x0);
|
||||
if ((local_50->_sprite)._layerCount != 0) {
|
||||
do {
|
||||
layer = ANM2::GetLayer(fireSprite,pbVar6);
|
||||
fVar3 = fRam00c34e34;
|
||||
fVar2 = fRam00c34e30;
|
||||
fVar9 = fRam00c34e2c;
|
||||
if (&layer->_color != GHIDRA_CAST<ColorMod *>(&DAT_00c34e28)) {
|
||||
(layer->_color)._tint[0] = _DAT_00c34e28;
|
||||
(layer->_color)._tint[1] = fVar9;
|
||||
(layer->_color)._tint[2] = fVar2;
|
||||
(layer->_color)._tint[3] = fVar3;
|
||||
fVar3 = fRam00c34e44;
|
||||
fVar2 = fRam00c34e40;
|
||||
fVar9 = fRam00c34e3c;
|
||||
(layer->_color)._colorize[0] = _DAT_00c34e38;
|
||||
(layer->_color)._colorize[1] = fVar9;
|
||||
(layer->_color)._colorize[2] = fVar2;
|
||||
(layer->_color)._colorize[3] = fVar3;
|
||||
*GHIDRA_CAST<uint64_t *>((layer->_color)._offset) = DAT_00c34e48;
|
||||
(layer->_color)._offset[2] = DAT_00c34e50;
|
||||
}
|
||||
pbVar6 = pbVar6 + 1;
|
||||
} while (pbVar6 < GHIDRA_CAST<uint8_t *>((local_50->_sprite)._layerCount));
|
||||
npc = local_54;
|
||||
}
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_50) + 0xc))();
|
||||
local_50 = GHIDRA_CAST<Entity *>(0x2);
|
||||
do {
|
||||
uVar5 = Random();
|
||||
local_54 = GHIDRA_CAST<Entity_NPC *>((local_58->_pos).x);
|
||||
local_64.y = (local_58->_pos).y;
|
||||
angleRoll = Random();
|
||||
fVar9 = (float)((double)GHIDRA_INT(angleRoll) + __uint_to_double_fixup[-(GHIDRA_INT(angleRoll) >> 0x1f)]) *
|
||||
2.3283064e-10 * 3.14;
|
||||
local_5c = GHIDRA_CAST<ANM2 *>((fVar9 + fVar9));
|
||||
fVar9 = cos((float)local_5c);
|
||||
spawnPos.x = fVar9 * 10.0 + (float)local_54;
|
||||
fVar9 = sin((float)local_5c);
|
||||
spawnPos.y = fVar9 * 10.0 + local_64.y;
|
||||
local_54 = (Entity_NPC *)
|
||||
Game::Spawn(g_game,0x399,1,&spawnPos,&g_vectorZero,GHIDRA_CAST<Entity *>(npc),0,uVar5);
|
||||
parentSlot = &local_54->_parent;
|
||||
if (local_54->_parent != 0) {
|
||||
local_64.y = (float)parentSlot;
|
||||
msvc::multiset<unsigned_int>::erase(&local_64.y);
|
||||
}
|
||||
*parentSlot = npc;
|
||||
if (npc != GHIDRA_CAST<Entity_NPC *>(0x0)) {
|
||||
msvc::multiset<unsigned_int>::insert(parentSlot);
|
||||
}
|
||||
uVar5 = Random();
|
||||
local_50 = GHIDRA_CAST<Entity *>((GHIDRA_INT(local_50) + -1));
|
||||
(local_54->_v1).x =
|
||||
(float)((double)GHIDRA_INT(uVar5) + __uint_to_double_fixup[-(GHIDRA_INT(uVar5) >> 0x1f)]) * 2.3283064e-10
|
||||
* 360.0;
|
||||
} while (local_50 != GHIDRA_CAST<Entity *>(0x0));
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00575a10
|
||||
void NpcHelper::clutch_render(Entity_NPC *npc, Vector *offset)
|
||||
{
|
||||
LayerState *pLVar1;
|
||||
float *pfVar2;
|
||||
int iVar3;
|
||||
int iVar4;
|
||||
int iVar5;
|
||||
void *layerFrames;
|
||||
int pointSlotOffset;
|
||||
int iVar6;
|
||||
void *animData;
|
||||
int pointIndex;
|
||||
uint32_t pointBlock;
|
||||
uint32_t nextPointBlock;
|
||||
float *nextPoint;
|
||||
float flipSign;
|
||||
float deltaX;
|
||||
float fVar7;
|
||||
double dVar8;
|
||||
double dVar9;
|
||||
int layerOffset;
|
||||
uint32_t nextPointIndex;
|
||||
uint8_t *layerId;
|
||||
float segmentStretch;
|
||||
Vector segmentPos [8];
|
||||
ANM2 *animation;
|
||||
int *pointDeque;
|
||||
|
||||
if (npc->_variant == 0) {
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x1));
|
||||
if ((0.0 < (pLVar1->_color)._tint[3]) && ((npc->_vectorDeque1)._size != 0)) {
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x1));
|
||||
pLVar1->_visible = 1;
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x2));
|
||||
layerId = GHIDRA_CAST<uint8_t *>(0x1);
|
||||
layerOffset = 0x3c;
|
||||
pLVar1->_visible = 1;
|
||||
pointBlock = (npc->_vectorDeque1)._offset;
|
||||
do {
|
||||
pointDeque = (npc->_vectorDeque1)._proxy;
|
||||
nextPointIndex = pointBlock + 3;
|
||||
pointIndex = pointBlock;
|
||||
while( true ) {
|
||||
pointBlock = (npc->_vectorDeque1)._offset;
|
||||
if (((npc->_vectorDeque1)._size - 3) + pointBlock <= GHIDRA_UINT(pointIndex)) break;
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar3 = 0;
|
||||
}
|
||||
else {
|
||||
iVar3 = *pointDeque;
|
||||
}
|
||||
pointBlock = GHIDRA_UINT(pointIndex) >> 1;
|
||||
pointSlotOffset = (pointIndex & 1U) * 8;
|
||||
pfVar2 = GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar3 + 4)) +
|
||||
(*GHIDRA_CAST<int *>((iVar3 + 8)) - 1U & pointBlock) * 4)) + pointSlotOffset))
|
||||
;
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar3 = 0;
|
||||
}
|
||||
else {
|
||||
iVar3 = *pointDeque;
|
||||
}
|
||||
nextPointBlock = nextPointIndex >> 1;
|
||||
fVar7 = g_displayPixelRatio * g_screenPointScale;
|
||||
iVar6 = (nextPointIndex & 1) * 8;
|
||||
nextPoint = GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar3 + 4)) +
|
||||
(*GHIDRA_CAST<int *>((iVar3 + 8)) - 1U & nextPointBlock) * 4)) + iVar6));
|
||||
dVar8 = floor((double)((((*pfVar2 + *nextPoint) * 0.5 - 60.0) * 0.65 +
|
||||
(g_screenWidth - 338.0) * 0.5) * fVar7 + 0.5));
|
||||
dVar9 = floor((double)((((pfVar2[1] + nextPoint[1]) * 0.5 - 140.0) * 0.65 +
|
||||
(g_screenHeight - 182.0) * 0.5) * fVar7 + 0.5));
|
||||
segmentPos[0].x = (float)dVar8 / fVar7 + offset->x;
|
||||
segmentPos[0].y = (float)dVar9 / fVar7 + offset->y;
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar3 = 0;
|
||||
}
|
||||
else {
|
||||
iVar3 = *pointDeque;
|
||||
}
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar5 = 0;
|
||||
}
|
||||
else {
|
||||
iVar5 = *pointDeque;
|
||||
}
|
||||
iVar3 = GHIDRA_INT((8.0 - (*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 4)) +
|
||||
(nextPointIndex + 2 >> 1 &
|
||||
*GHIDRA_CAST<int *>((iVar5 + 8)) - 1U) * 4)) +
|
||||
(nextPointIndex + 2 & 1) * 8)) +
|
||||
*GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar3 + 4)) +
|
||||
(nextPointIndex - 1 >> 1 & *GHIDRA_CAST<int *>((iVar3 + 8)) - 1U
|
||||
) * 4)) + (nextPointIndex + 1 & 1) * 8))) * 0.5 * 8.0
|
||||
));
|
||||
if (iVar3 == 7) {
|
||||
segmentStretch = 1.0;
|
||||
LAB_00575d73:
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId);
|
||||
(pLVar1->_size).x = segmentStretch;
|
||||
(pLVar1->_size).y = 1.0;
|
||||
if ((npc->_sprite)._flipX == 0) {
|
||||
flipSign = 1.0;
|
||||
}
|
||||
else {
|
||||
flipSign = (float)&DAT_bf800000;
|
||||
}
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar5 = 0;
|
||||
}
|
||||
else {
|
||||
iVar5 = *pointDeque;
|
||||
}
|
||||
pfVar2 = GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 4)) +
|
||||
(*GHIDRA_CAST<int *>((iVar5 + 8)) - 1U & nextPointBlock) * 4)) + iVar6));
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar6 = 0;
|
||||
}
|
||||
else {
|
||||
iVar6 = *pointDeque;
|
||||
}
|
||||
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar6 + 4)) + (*GHIDRA_CAST<int *>((iVar6 + 8)) - 1U & pointBlock) * 4));
|
||||
fVar7 = atan2f(pfVar2[1] - *GHIDRA_CAST<float *>((iVar6 + 4 + pointSlotOffset)),
|
||||
*pfVar2 - *GHIDRA_CAST<float *>((iVar6 + pointSlotOffset)));
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId);
|
||||
pLVar1->_rotation = fVar7 * 57.295776 * flipSign;
|
||||
if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) {
|
||||
AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar3);
|
||||
}
|
||||
if ((npc->_sprite)._loaded != 0) {
|
||||
if ((npc->_sprite)._overlayRenderFirst == 0) {
|
||||
animData = (npc->_sprite)._animState._animData;
|
||||
if (((animData != (void *)0x0) &&
|
||||
(animation = (npc->_sprite)._animState._animation,
|
||||
GHIDRA_INT(layerId) < animation->_layerCount)) &&
|
||||
(iVar3 = *GHIDRA_CAST<int *>((layerOffset + GHIDRA_INT(animData))), -1 < iVar3)) {
|
||||
AnimationLayer::RenderFrame
|
||||
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),
|
||||
segmentPos,
|
||||
*GHIDRA_CAST<int *>((GHIDRA_INT((npc->_sprite)._animState._layerFrames) + iVar3 * 4)),
|
||||
&g_vectorZero,&g_vectorZero,animation);
|
||||
}
|
||||
animData = (npc->_sprite)._overlayAnimState._animData;
|
||||
if (((animData != (void *)0x0) &&
|
||||
(animation = (npc->_sprite)._overlayAnimState._animation,
|
||||
GHIDRA_INT(layerId) < animation->_layerCount)) &&
|
||||
(iVar3 = *GHIDRA_CAST<int *>((layerOffset + GHIDRA_INT(animData))), -1 < iVar3)) {
|
||||
layerFrames = (npc->_sprite)._overlayAnimState._layerFrames;
|
||||
goto LAB_00575ed0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
animData = (npc->_sprite)._overlayAnimState._animData;
|
||||
if (((animData != (void *)0x0) &&
|
||||
(animation = (npc->_sprite)._overlayAnimState._animation,
|
||||
GHIDRA_INT(layerId) < animation->_layerCount)) &&
|
||||
(iVar3 = *GHIDRA_CAST<int *>((layerOffset + GHIDRA_INT(animData))), -1 < iVar3)) {
|
||||
AnimationLayer::RenderFrame
|
||||
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),
|
||||
segmentPos,
|
||||
*GHIDRA_CAST<int *>((GHIDRA_INT((npc->_sprite)._overlayAnimState._layerFrames) + iVar3 * 4
|
||||
)),&g_vectorZero,&g_vectorZero,animation);
|
||||
}
|
||||
animData = (npc->_sprite)._animState._animData;
|
||||
if (((animData != (void *)0x0) &&
|
||||
(animation = (npc->_sprite)._animState._animation,
|
||||
GHIDRA_INT(layerId) < animation->_layerCount)) &&
|
||||
(iVar3 = *GHIDRA_CAST<int *>((layerOffset + GHIDRA_INT(animData))), -1 < iVar3)) {
|
||||
layerFrames = (npc->_sprite)._animState._layerFrames;
|
||||
LAB_00575ed0:
|
||||
AnimationLayer::RenderFrame
|
||||
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),
|
||||
segmentPos,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(layerFrames) + iVar3 * 4)),&g_vectorZero,
|
||||
&g_vectorZero,animation);
|
||||
}
|
||||
}
|
||||
}
|
||||
pointIndex = pointIndex + 3;
|
||||
nextPointIndex = nextPointIndex + 3;
|
||||
}
|
||||
else {
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar5 = 0;
|
||||
}
|
||||
else {
|
||||
iVar5 = *pointDeque;
|
||||
}
|
||||
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 4)) + (*GHIDRA_CAST<int *>((iVar5 + 8)) - 1U & pointBlock) * 4));
|
||||
if (pointDeque == GHIDRA_CAST<int *>(0x0)) {
|
||||
iVar4 = 0;
|
||||
}
|
||||
else {
|
||||
iVar4 = *pointDeque;
|
||||
}
|
||||
pfVar2 = GHIDRA_CAST<float *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar4 + 4)) +
|
||||
(*GHIDRA_CAST<int *>((iVar4 + 8)) - 1U & nextPointBlock) * 4)) + iVar6));
|
||||
fVar7 = pfVar2[1] - *GHIDRA_CAST<float *>((iVar5 + 4 + pointSlotOffset));
|
||||
deltaX = *pfVar2 - *GHIDRA_CAST<float *>((iVar5 + pointSlotOffset));
|
||||
fVar7 = sqrtf(fVar7 * fVar7 + deltaX * deltaX);
|
||||
segmentStretch = (fVar7 * 0.5) / (float)(8 - iVar3);
|
||||
if (segmentStretch <= 1.0) {
|
||||
segmentStretch = 1.0;
|
||||
}
|
||||
if (3.0 <= segmentStretch) {
|
||||
segmentStretch = 3.0;
|
||||
}
|
||||
if (iVar3 < 8) goto LAB_00575d73;
|
||||
pointIndex = pointIndex + 3;
|
||||
nextPointIndex = nextPointIndex + 3;
|
||||
}
|
||||
}
|
||||
layerId = layerId + 1;
|
||||
layerOffset = layerOffset + 4;
|
||||
} while (layerOffset < 0x41);
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x1));
|
||||
pLVar1->_visible = 0;
|
||||
pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST<uint8_t *>(0x2));
|
||||
pLVar1->_visible = 0;
|
||||
}
|
||||
}
|
||||
Entity::Render(GHIDRA_CAST<Entity *>(npc),offset);
|
||||
return;
|
||||
}
|
||||
|
||||
// 00582f60
|
||||
void NpcHelper::scourge_whip(Entity_NPC *npc)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user