--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>
66 lines
2.1 KiB
C++
66 lines
2.1 KiB
C++
#include "classes.h"
|
|
|
|
// 00417510
|
|
void EntityList_EL::constructor(EntityList_EL *source)
|
|
{
|
|
*GHIDRA_CAST<uint8_t *>(this) = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((source)) + 0x4))));
|
|
this->_capacity = source->_capacity;
|
|
this->_size = source->_size;
|
|
return;
|
|
}
|
|
|
|
// 00417630
|
|
void EntityList_EL::push_back(Entity *entity)
|
|
{
|
|
int count;
|
|
|
|
count = this->_size;
|
|
if (GHIDRA_UINT(this->_capacity) < count + 1U) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
count = this->_size;
|
|
}
|
|
*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + count * 4)) = entity;
|
|
this->_size = this->_size + 1;
|
|
return;
|
|
}
|
|
|
|
// 00417670
|
|
void EntityList_EL::remove(Entity *entity)
|
|
{
|
|
uint32_t shiftIndex;
|
|
uint32_t size;
|
|
uint32_t uVar1;
|
|
uint32_t *slotPtr;
|
|
|
|
uVar1 = 0;
|
|
size = this->_size;
|
|
if (size != 0) {
|
|
do {
|
|
if (*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + uVar1 * 4)) == entity) {
|
|
while ((uVar1 < size && (*GHIDRA_CAST<Entity **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + uVar1 * 4)) == entity))) {
|
|
if (size <= uVar1) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: invalid index for remove\n"));
|
|
size = this->_size;
|
|
}
|
|
shiftIndex = uVar1;
|
|
if (uVar1 < size - 1) {
|
|
do {
|
|
slotPtr = GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4)))) + shiftIndex * 4));
|
|
shiftIndex = shiftIndex + 1;
|
|
*slotPtr = slotPtr[1];
|
|
size = this->_size;
|
|
} while (shiftIndex < size - 1);
|
|
}
|
|
size = size - 1;
|
|
this->_size = size;
|
|
}
|
|
}
|
|
else {
|
|
uVar1 = uVar1 + 1;
|
|
}
|
|
} while (uVar1 < size);
|
|
}
|
|
return;
|
|
}
|