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

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

66 lines
2.0 KiB
C++

#include "classes.h"
// 00a12430
void KAGE::Graphics::ImageBase::set_palette(uint32_t param_1, uint32_t param_2)
{
char cVar1;
void *pvVar2;
int *in_ECX;
int *extraout_ECX;
int *piVar3;
uint8_t **stream;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00b10b9d;
local_10 = ExceptionList;
ExceptionList = &local_10;
cVar1 = (**(code **)(*in_ECX + 8))(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
if (cVar1 == '\0') {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Attempting to set palette on an image that isn\'t indexed\n"));
}
if (0x100 < param_2) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Specified palette is larger than 256 texels in size\n"));
}
sprintf(&DAT_00c943d8,GHIDRA_CAST<uint8_t *>("%s - Palette"));
if (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
in_ECX[0xb] = 0;
}
pvVar2 = operator_new(0x60);
if (pvVar2 == (void *)0x0) {
piVar3 = GHIDRA_CAST<int *>(0x0);
}
else {
FUN_00a69950();
*extraout_ECX = GHIDRA_INT(ImagePalette)::vftable;
extraout_ECX[2] = extraout_ECX[2] | 4;
extraout_ECX[3] = extraout_ECX[3];
piVar3 = extraout_ECX;
}
in_ECX[0xb] = GHIDRA_INT(piVar3);
stream = Filesys::BufferedStream::vftable;
local_8 = 0;
cVar1 = (**(code **)(*piVar3 + 0x38))(&stream,&DAT_00c943d8);
if ((cVar1 == '\0') && (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0))) {
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
in_ECX[0xb] = 0;
}
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
if ((piVar3[0xc] != 0) || (piVar3[0xd] != 0)) {
(**(code **)(*piVar3 + 0x44))(0,0);
piVar3[0xc] = 0;
piVar3[0xd] = 0;
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
}
if ((piVar3[0xe] != 1) || (piVar3[0xf] != 1)) {
(**(code **)(*piVar3 + 0x48))(1,1);
piVar3[0xe] = 1;
piVar3[0xf] = 1;
}
ExceptionList = local_10;
return;
}