- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired. - font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact against its assembly. - options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include Save's exact bytes. - platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first built-in shader (FUN_00a13fa0). - source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every address in a (a, b, c to d) list on a comment counts as taken over. - log.h: reconstruction_missing() for a taken-over class's methods that are not written yet. 206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager still use the old APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
608 lines
26 KiB
C++
608 lines
26 KiB
C++
#include "classes.h"
|
|
|
|
// 0041e480
|
|
void BeamRenderer::Begin(ANM2 *anm2, uint32_t layer, uint8_t isUseOverlay, uint8_t isUnk)
|
|
{
|
|
DAT_00c78ef0 = anm2;
|
|
DAT_00c78ef4 = layer;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(DAT_00c78ef8)) + 0x0))) = isUseOverlay;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(DAT_00c78ef8)) + 0x1))) = isUnk;
|
|
g_beamRendererPointsEnd = g_beamRendererPoints;
|
|
return;
|
|
}
|
|
|
|
// 0041e720
|
|
void BeamRenderer::Add(Vector *point, ColorMod *color, float spritesheetCoordinate, float width)
|
|
{
|
|
int iVar1;
|
|
float fVar2;
|
|
float dirX;
|
|
float dirY;
|
|
uint64_t local_70;
|
|
float local_68;
|
|
float fStack_64;
|
|
float fStack_60;
|
|
float fStack_5c;
|
|
Vector newPointPos;
|
|
float normalX;
|
|
float normalY;
|
|
float newPointCoord;
|
|
float newPointWidth;
|
|
float local_40;
|
|
float fStack_3c;
|
|
float fStack_38;
|
|
float fStack_34;
|
|
float local_30;
|
|
float fStack_2c;
|
|
float fStack_28;
|
|
float fStack_24;
|
|
uint64_t local_20;
|
|
float local_18;
|
|
uint32_t local_c;
|
|
void *pointsEnd;
|
|
|
|
pointsEnd = g_beamRendererPointsEnd;
|
|
local_c = __security_cookie ^ GHIDRA_UINT(&dirX);
|
|
newPointPos.x = point->x;
|
|
newPointPos.y = point->y;
|
|
local_68 = color->_tint[0];
|
|
fStack_64 = color->_tint[1];
|
|
fStack_60 = color->_tint[2];
|
|
fStack_5c = color->_tint[3];
|
|
local_18 = color->_offset[2];
|
|
local_30 = color->_colorize[0];
|
|
fStack_2c = color->_colorize[1];
|
|
fStack_28 = color->_colorize[2];
|
|
fStack_24 = color->_colorize[3];
|
|
local_70 = *GHIDRA_CAST<uint64_t *>(color->_offset);
|
|
iVar1 = GHIDRA_INT(g_beamRendererPointsEnd) - GHIDRA_INT(g_beamRendererPoints) >> 0x1f;
|
|
normalX = g_vectorZero.x;
|
|
normalY = g_vectorZero.y;
|
|
newPointCoord = spritesheetCoordinate;
|
|
newPointWidth = width;
|
|
local_40 = local_68;
|
|
fStack_3c = fStack_64;
|
|
fStack_38 = fStack_60;
|
|
fStack_34 = fStack_5c;
|
|
local_20 = local_70;
|
|
if ((GHIDRA_INT(g_beamRendererPointsEnd) - GHIDRA_INT(g_beamRendererPoints)) / 0x44 + iVar1 != iVar1) {
|
|
dirY = newPointPos.y - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_beamRendererPointsEnd) + -0x40));
|
|
dirX = newPointPos.x - *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_beamRendererPointsEnd) + -0x44));
|
|
fVar2 = sqrtf(dirY * dirY + dirX * dirX);
|
|
if (0.0 < fVar2) {
|
|
dirX = dirX * (1.0 / fVar2);
|
|
dirY = dirY * (1.0 / fVar2);
|
|
}
|
|
fVar2 = cos(1.5707964);
|
|
local_70 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))),fVar2);
|
|
fVar2 = sin(1.5707964);
|
|
normalX = (float)local_70 * dirX - fVar2 * dirY;
|
|
normalY = fVar2 * dirX + (float)local_70 * dirY;
|
|
(GHIDRA_CAST<Point *>((GHIDRA_CAST<Point *>((GHIDRA_INT(pointsEnd) + -0x44)))))->Point::UpdateNormal(&newPointPos);
|
|
}
|
|
pointsEnd = g_beamRendererPointsEnd;
|
|
if (g_beamRendererPointsEnd == DAT_00c78f04) {
|
|
FUN_0041fcb0(g_beamRendererPointsEnd,&newPointPos);
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<float *>(g_beamRendererPointsEnd) = newPointPos.x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 4)) = newPointPos.y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 8)) = normalX;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0xc)) = normalY;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x10)) = newPointCoord;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x14)) = newPointWidth;
|
|
*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(pointsEnd) + 0x38)) = local_20;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x18)) = local_40;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x1c)) = fStack_3c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x20)) = fStack_38;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x24)) = fStack_34;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x40)) = local_18;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x28)) = local_30;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x2c)) = fStack_2c;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x30)) = fStack_28;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pointsEnd) + 0x34)) = fStack_24;
|
|
g_beamRendererPointsEnd = (void *)(GHIDRA_INT(g_beamRendererPointsEnd) + 0x44);
|
|
return;
|
|
}
|
|
|
|
// 0041e960
|
|
void BeamRenderer::End()
|
|
{
|
|
char cVar1;
|
|
LayerState *layer;
|
|
float *pfVar2;
|
|
void *pvVar3;
|
|
int iVar4;
|
|
AnimationState *animState;
|
|
KColor *color;
|
|
uint8_t *unusedArg;
|
|
float *pfVar5;
|
|
uint32_t bytesLeft;
|
|
bool isBytesLeft;
|
|
int *piVar6;
|
|
float nextUvY;
|
|
float fVar7;
|
|
float fVar8;
|
|
float fVar9;
|
|
float nextEdgeOffsetY;
|
|
int *imageRefCount;
|
|
uint8_t auStack_202 [2];
|
|
Vector startCornerA;
|
|
Vector startCornerB;
|
|
Vector endCornerA;
|
|
uint8_t local_1dc [20];
|
|
float fStack_1c8;
|
|
float fStack_1c4;
|
|
float fStack_1c0;
|
|
uint8_t local_1bc;
|
|
float local_1b8 [14];
|
|
uint32_t local_180;
|
|
float local_17c [4];
|
|
uint32_t local_16c;
|
|
Vector local_168;
|
|
uint64_t local_160;
|
|
Vector local_158;
|
|
Vector local_150;
|
|
Vector local_148;
|
|
Vector local_140;
|
|
Vector local_138;
|
|
int *texture;
|
|
int *textureRefCount;
|
|
Vector local_128;
|
|
Color pointColor;
|
|
Color nextPointColor;
|
|
Vector local_c0;
|
|
float *layerFrame;
|
|
float local_b4;
|
|
uint8_t *local_b0;
|
|
float local_ac;
|
|
float local_a8;
|
|
uint8_t spriteFlipX;
|
|
uint8_t layerFlipX;
|
|
float *local_a0;
|
|
char isPerVertexColor;
|
|
uint8_t coloredQuad [24];
|
|
ColorMod shaderColor;
|
|
float endTint;
|
|
float fStack_50;
|
|
float fStack_4c;
|
|
float fStack_48;
|
|
float endColorize;
|
|
float fStack_40;
|
|
float fStack_3c;
|
|
float fStack_38;
|
|
uint64_t endOffsetXY;
|
|
float endOffsetZ;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
float *nextPointColorize;
|
|
float uvLeft;
|
|
|
|
puStack_20 = coloredQuad + 0x94;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af1720;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((coloredQuad + 0x88));
|
|
ExceptionList = &local_1c;
|
|
layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4);
|
|
LayerState::GetTexture(layer,&texture);
|
|
local_14 = 0;
|
|
if ((texture != GHIDRA_CAST<int *>(0x0)) &&
|
|
(1 < GHIDRA_UINT(((GHIDRA_INT(g_beamRendererPointsEnd) - GHIDRA_INT(g_beamRendererPoints)) / 0x44)))) {
|
|
if ((char)DAT_00c78ef8 == '\0') {
|
|
animState = &DAT_00c78ef0->_animState;
|
|
}
|
|
else {
|
|
animState = &DAT_00c78ef0->_overlayAnimState;
|
|
}
|
|
pfVar2 = AnimationState::GetLayerFrame(animState,GHIDRA_INT(DAT_00c78ef4));
|
|
layerFrame = pfVar2;
|
|
if (pfVar2 != GHIDRA_CAST<float *>(0x0)) {
|
|
iVar4 = *GHIDRA_CAST<int *>(ThreadLocalStoragePointer);
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < DAT_00c7f6d0) && (_Init_thread_header(), DAT_00c7f6d0 == -1)) {
|
|
_atexit(GHIDRA_CAST<_func_4879 *>(&LAB_00b15320));
|
|
_Init_thread_footer();
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((iVar4 + 0xc)) < DAT_00c7f6e0) && (_Init_thread_header(), DAT_00c7f6e0 == -1)) {
|
|
_atexit(GHIDRA_CAST<_func_4879 *>(&LAB_00b15310));
|
|
_Init_thread_footer();
|
|
}
|
|
DAT_00c7f6d8 = DAT_00c7f6d4;
|
|
DAT_00c7f6e8 = DAT_00c7f6e4;
|
|
layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4);
|
|
isPerVertexColor = '\0';
|
|
layerFlipX = layer->_flipX;
|
|
spriteFlipX = DAT_00c78ef0->_flipX;
|
|
pfVar5 = g_beamRendererPoints;
|
|
if (g_beamRendererPoints != (void *)(GHIDRA_INT(g_beamRendererPointsEnd) + -0x44)) {
|
|
LAB_0041eac0:
|
|
local_a0 = pfVar5 + 0x11;
|
|
fVar7 = pfVar2[2];
|
|
local_b4 = fVar7 * pfVar5[4] * pfVar5[2] * 0.5;
|
|
local_b0 = GHIDRA_CAST<uint8_t *>((fVar7 * pfVar5[4] * pfVar5[3] * 0.5));
|
|
fVar9 = fVar7 * pfVar5[0x15] * pfVar5[0x13] * 0.5;
|
|
nextEdgeOffsetY = fVar7 * pfVar5[0x15] * pfVar5[0x14] * 0.5;
|
|
fVar8 = pfVar5[5];
|
|
cVar1 = (char)(GHIDRA_UINT(DAT_00c78ef8) >> 8);
|
|
if (cVar1 != '\0') {
|
|
fVar8 = fVar8 * pfVar2[3];
|
|
}
|
|
nextUvY = pfVar5[0x16];
|
|
if (cVar1 != '\0') {
|
|
nextUvY = nextUvY * pfVar2[3];
|
|
}
|
|
uvLeft = *pfVar2;
|
|
nextUvY = pfVar2[1] + nextUvY;
|
|
fVar7 = fVar7 + uvLeft;
|
|
piVar6 = GHIDRA_CAST<int *>((pfVar2[1] + fVar8));
|
|
local_ac = fVar9;
|
|
local_a8 = nextEdgeOffsetY;
|
|
if (layerFlipX == spriteFlipX) {
|
|
local_158.x = fVar7;
|
|
local_158.y = nextUvY;
|
|
local_150.x = uvLeft;
|
|
local_150.y = nextUvY;
|
|
local_148.x = fVar7;
|
|
local_148.y = (float)piVar6;
|
|
local_140.x = uvLeft;
|
|
local_140.y = (float)piVar6;
|
|
DestinationQuad::DestinationQuad
|
|
(GHIDRA_CAST<DestinationQuad *>(local_1dc),&local_140,&local_148,&local_150,&local_158);
|
|
local_1bc = 1;
|
|
if (DAT_00c7f6d8 == DAT_00c7f6dc) goto LAB_0041eca3;
|
|
(GHIDRA_CAST<SourceQuad *>((DAT_00c7f6d8)))->SourceQuad::SourceQuad(local_1dc);
|
|
DAT_00c7f6d8 = DAT_00c7f6d8 + 1;
|
|
}
|
|
else {
|
|
local_168.x = uvLeft;
|
|
local_168.y = nextUvY;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_160)) + 0x0))) = fVar7;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_160)) + 0x4))) = nextUvY;
|
|
local_128.x = fVar7;
|
|
local_128.y = (float)piVar6;
|
|
local_c0.x = uvLeft;
|
|
local_c0.y = (float)piVar6;
|
|
DestinationQuad::DestinationQuad
|
|
(GHIDRA_CAST<DestinationQuad *>(local_1dc),&local_128,&local_c0,GHIDRA_CAST<Vector *>(&local_160),
|
|
&local_168);
|
|
local_1bc = 1;
|
|
if (DAT_00c7f6d8 == DAT_00c7f6dc) {
|
|
LAB_0041eca3:
|
|
local_1bc = 1;
|
|
msvc::vector<ColoredQuad>::_Emplace_reallocate();
|
|
fVar9 = local_ac;
|
|
nextEdgeOffsetY = local_a8;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<SourceQuad *>((DAT_00c7f6d8)))->SourceQuad::SourceQuad(local_1dc);
|
|
DAT_00c7f6d8 = DAT_00c7f6d8 + 1;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((local_1dc + 0x10)))))->KColor::SetFromARGB(0xffffffff);
|
|
local_138.x = *local_a0 - fVar9;
|
|
endCornerA.x = fVar9 + *local_a0;
|
|
local_138.y = local_a0[1] - nextEdgeOffsetY;
|
|
endCornerA.y = nextEdgeOffsetY + local_a0[1];
|
|
startCornerB.x = *pfVar5 - local_b4;
|
|
startCornerA.x = *pfVar5 + local_b4;
|
|
startCornerB.y = pfVar5[1] - (float)local_b0;
|
|
startCornerA.y = (float)local_b0 + pfVar5[1];
|
|
pvVar3 = set_quad_corner_colors
|
|
(coloredQuad,&startCornerA,&startCornerB,&endCornerA,&local_138,color);
|
|
if (DAT_00c7f6e8 == DAT_00c7f6ec) {
|
|
FUN_0041fa30();
|
|
}
|
|
else {
|
|
render_quad_copy(DAT_00c7f6e8,pvVar3);
|
|
DAT_00c7f6e8 = (void *)(GHIDRA_INT(DAT_00c7f6e8) + 0x70);
|
|
}
|
|
if (isPerVertexColor == '\0') {
|
|
pointColor._tint[0] = pfVar5[6];
|
|
pointColor._tint[1] = pfVar5[7];
|
|
pointColor._tint[2] = pfVar5[8];
|
|
pointColor._tint[3] = pfVar5[9];
|
|
pointColor._offset[2] = pfVar5[0x10];
|
|
pointColor._colorize[0] = pfVar5[10];
|
|
pointColor._colorize[1] = pfVar5[0xb];
|
|
pointColor._colorize[2] = pfVar5[0xc];
|
|
pointColor._colorize[3] = pfVar5[0xd];
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(pointColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((pfVar5 + 0xe));
|
|
(GHIDRA_CAST<Color *>((&pointColor)))->Color::__mul(GHIDRA_CAST<ColorMod *>((pfVar2 + 0xc)));
|
|
nextPointColor._tint[0] = local_a0[6];
|
|
nextPointColor._tint[1] = local_a0[7];
|
|
nextPointColor._tint[2] = local_a0[8];
|
|
nextPointColor._tint[3] = local_a0[9];
|
|
nextPointColor._colorize[0] = local_a0[10];
|
|
nextPointColor._colorize[1] = local_a0[0xb];
|
|
nextPointColor._colorize[2] = local_a0[0xc];
|
|
nextPointColor._colorize[3] = local_a0[0xd];
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(nextPointColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((local_a0 + 0xe));
|
|
nextPointColor._offset[2] = local_a0[0x10];
|
|
(GHIDRA_CAST<Color *>((&nextPointColor)))->Color::__mul(GHIDRA_CAST<ColorMod *>((pfVar2 + 0xc)));
|
|
local_16c = 0;
|
|
pfVar2 = local_17c;
|
|
local_180 = 0;
|
|
pfVar5 = local_1b8 + 10;
|
|
local_17c[0] = pointColor._colorize[0];
|
|
local_17c[1] = pointColor._colorize[1];
|
|
local_17c[2] = pointColor._colorize[2];
|
|
local_17c[3] = pointColor._colorize[3];
|
|
bytesLeft = 0xc;
|
|
local_1b8[10] = nextPointColor._colorize[0];
|
|
local_1b8[0xb] = nextPointColor._colorize[1];
|
|
local_1b8[0xc] = nextPointColor._colorize[2];
|
|
local_1b8[0xd] = nextPointColor._colorize[3];
|
|
do {
|
|
if (*pfVar2 != *pfVar5) goto LAB_0041ef3a;
|
|
pfVar2 = pfVar2 + 1;
|
|
pfVar5 = pfVar5 + 1;
|
|
isBytesLeft = 3 < bytesLeft;
|
|
bytesLeft = bytesLeft - 4;
|
|
} while (isBytesLeft);
|
|
pfVar2 = local_1b8 + 5;
|
|
local_1b8[5] = pointColor._offset[0];
|
|
pfVar5 = local_1b8;
|
|
bytesLeft = 0xc;
|
|
local_1b8[6] = pointColor._offset[1];
|
|
local_1b8[7] = pointColor._offset[2];
|
|
local_1b8[0] = nextPointColor._offset[0];
|
|
local_1b8[1] = nextPointColor._offset[1];
|
|
local_1b8[9] = 0.0;
|
|
local_1b8[8] = 1.0;
|
|
local_1b8[4] = 0.0;
|
|
local_1b8[2] = nextPointColor._offset[2];
|
|
local_1b8[3] = 1.0;
|
|
do {
|
|
if (*pfVar2 != *pfVar5) goto LAB_0041ef3a;
|
|
pfVar2 = pfVar2 + 1;
|
|
pfVar5 = pfVar5 + 1;
|
|
isBytesLeft = 3 < bytesLeft;
|
|
bytesLeft = bytesLeft - 4;
|
|
} while (isBytesLeft);
|
|
isPerVertexColor = '\0';
|
|
goto LAB_0041ef41;
|
|
}
|
|
goto LAB_0041ef47;
|
|
}
|
|
LAB_0041ef71:
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1dc)) + 0x10))) = g_graphicsManager_blendMode[0];
|
|
fStack_1c8 = (float)g_graphicsManager_blendMode[1];
|
|
fStack_1c4 = (float)g_graphicsManager_blendMode[2];
|
|
fStack_1c0 = (float)g_graphicsManager_blendMode[3];
|
|
iVar4 = (GHIDRA_INT(DAT_00c7f6d8) - GHIDRA_INT(DAT_00c7f6d4)) / 0x24;
|
|
local_168.y = (float)g_graphicsManager_blendMode[4];
|
|
local_b4 = (float)iVar4;
|
|
layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4);
|
|
g_graphicsManager_blendMode[0] = layer->_blendMode[0];
|
|
g_graphicsManager_blendMode[1] = layer->_blendMode[1];
|
|
g_graphicsManager_blendMode[2] = layer->_blendMode[2];
|
|
g_graphicsManager_blendMode[3] = layer->_blendMode[3];
|
|
g_graphicsManager_blendMode[4] = layer->_blendMode[4];
|
|
local_a0 = GHIDRA_CAST<float *>(GHIDRA_UINT((isPerVertexColor != '\0')));
|
|
layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4);
|
|
if (((DAT_00c78ef0->_bitflags | layer->_bitflags) & 0x20U) != 0) {
|
|
if (isPerVertexColor != '\0') {
|
|
KAGE_LogMessage(8,(uint8_t *)
|
|
"Beam renderer needs per-vertex colors for Dogma but his shader doesn\'t support it!\n"
|
|
);
|
|
}
|
|
local_a0 = GHIDRA_CAST<float *>(0x2);
|
|
}
|
|
unusedArg = &g_shaders + GHIDRA_INT(local_a0) * 0x50;
|
|
if ((unusedArg != GHIDRA_CAST<uint8_t *>(0x0)) && (((&DAT_00c7911c)[GHIDRA_INT(local_a0) * 0x50] & 1) != 0)) {
|
|
g_currentShader = unusedArg;
|
|
}
|
|
if (iVar4 != 0) {
|
|
local_ac = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_160)) + 0x4))) = (float)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_160)) + 0x5))),local_a0 != GHIDRA_CAST<float *>(0x1));
|
|
local_a8 = 0.0;
|
|
local_b0 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
do {
|
|
fVar7 = pfVar2[0x10];
|
|
fVar8 = pfVar2[0x11];
|
|
fVar9 = pfVar2[0x12];
|
|
pfVar5 = GHIDRA_CAST<float *>((local_b0 + 0x28 + GHIDRA_INT(g_beamRendererPoints)));
|
|
pointColor._colorize[0] = *pfVar5;
|
|
pointColor._colorize[1] = pfVar5[1];
|
|
pointColor._colorize[2] = pfVar5[2];
|
|
pointColor._colorize[3] = pfVar5[3];
|
|
pfVar5 = GHIDRA_CAST<float *>((local_b0 + 0x18 + GHIDRA_INT(g_beamRendererPoints)));
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(pointColor._offset)) + 0x0))) = *GHIDRA_CAST<uint64_t *>((local_b0 + 0x38 + GHIDRA_INT(g_beamRendererPoints)));
|
|
local_138.y = pfVar2[0xc];
|
|
pointColor._tint[0] = local_138.y * *pfVar5;
|
|
local_140.y = pfVar2[0xd];
|
|
pointColor._tint[1] = local_140.y * pfVar5[1];
|
|
local_148.y = pfVar2[0xe];
|
|
pointColor._tint[2] = local_148.y * pfVar5[2];
|
|
local_150.y = pfVar2[0xf];
|
|
pointColor._tint[3] = local_150.y * pfVar5[3];
|
|
local_158.y = fVar7 + fVar8 + fVar9;
|
|
if (local_158.y != 0.0) {
|
|
if (pointColor._colorize[0] + pointColor._colorize[1] + pointColor._colorize[2] == 0.0)
|
|
{
|
|
pointColor._colorize[0] = fVar7;
|
|
pointColor._colorize[1] = fVar8;
|
|
pointColor._colorize[2] = fVar9;
|
|
pointColor._colorize[3] = pfVar2[0x13];
|
|
}
|
|
else {
|
|
pointColor._colorize[0] = (fVar7 + pointColor._colorize[0]) * 0.5;
|
|
pointColor._colorize[1] = (fVar8 + pointColor._colorize[1]) * 0.5;
|
|
pointColor._colorize[2] = (fVar9 + pointColor._colorize[2]) * 0.5;
|
|
pointColor._colorize[3] = (pointColor._colorize[3] + pfVar2[0x13]) * 0.5;
|
|
}
|
|
}
|
|
pointColor._offset[2] =
|
|
pfVar2[0x16] + *GHIDRA_CAST<float *>((local_b0 + 0x40 + GHIDRA_INT(g_beamRendererPoints)));
|
|
pfVar5 = GHIDRA_CAST<float *>((local_b0 + 0x5c + GHIDRA_INT(g_beamRendererPoints)));
|
|
shaderColor._offset[1] = pfVar2[0x15] + pointColor._offset[1];
|
|
shaderColor._offset[0] = pfVar2[0x14] + pointColor._offset[0];
|
|
shaderColor._colorize[0] = pointColor._colorize[0];
|
|
shaderColor._colorize[1] = pointColor._colorize[1];
|
|
shaderColor._colorize[2] = pointColor._colorize[2];
|
|
shaderColor._colorize[3] = pointColor._colorize[3];
|
|
nextPointColorize = GHIDRA_CAST<float *>((local_b0 + 0x6c + GHIDRA_INT(g_beamRendererPoints)));
|
|
nextPointColor._colorize[0] = *nextPointColorize;
|
|
nextPointColor._colorize[1] = nextPointColorize[1];
|
|
nextPointColor._colorize[2] = nextPointColorize[2];
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(nextPointColor._offset)) + 0x0))) =
|
|
*GHIDRA_CAST<uint64_t *>((local_b0 + 0x7c + GHIDRA_INT(g_beamRendererPoints)));
|
|
nextPointColor._tint[0] = local_138.y * *pfVar5;
|
|
nextPointColor._tint[1] = local_140.y * pfVar5[1];
|
|
nextPointColor._tint[2] = local_148.y * pfVar5[2];
|
|
nextPointColor._tint[3] = local_150.y * pfVar5[3];
|
|
nextPointColor._colorize[3] = nextPointColorize[3];
|
|
if (local_158.y != 0.0) {
|
|
nextPointColor._colorize[3] = pfVar2[0x13];
|
|
if (nextPointColor._colorize[0] + nextPointColor._colorize[1] +
|
|
nextPointColor._colorize[2] != 0.0) {
|
|
fVar7 = (fVar7 + nextPointColor._colorize[0]) * 0.5;
|
|
fVar8 = (fVar8 + nextPointColor._colorize[1]) * 0.5;
|
|
nextPointColor._colorize[3] =
|
|
(nextPointColorize[3] + nextPointColor._colorize[3]) * 0.5;
|
|
fVar9 = (fVar9 + nextPointColor._colorize[2]) * 0.5;
|
|
}
|
|
nextPointColor._colorize[0] = fVar7;
|
|
nextPointColor._colorize[1] = fVar8;
|
|
nextPointColor._colorize[2] = fVar9;
|
|
}
|
|
nextPointColor._offset[2] =
|
|
pfVar2[0x16] + *GHIDRA_CAST<float *>((local_b0 + 0x84 + GHIDRA_INT(g_beamRendererPoints)));
|
|
piVar6 = GHIDRA_CAST<int *>(0x0);
|
|
imageRefCount = GHIDRA_CAST<int *>(0x0);
|
|
endOffsetXY = CONCAT44(pfVar2[0x15] + nextPointColor._offset[1],
|
|
pfVar2[0x14] + nextPointColor._offset[0]);
|
|
local_c0.y = (float)textureRefCount;
|
|
local_128.y = (float)texture;
|
|
endColorize = nextPointColor._colorize[0];
|
|
fStack_40 = nextPointColor._colorize[1];
|
|
fStack_3c = nextPointColor._colorize[2];
|
|
fStack_38 = nextPointColor._colorize[3];
|
|
shaderColor._tint[0] = pointColor._tint[0];
|
|
shaderColor._tint[1] = pointColor._tint[1];
|
|
shaderColor._tint[2] = pointColor._tint[2];
|
|
shaderColor._tint[3] = pointColor._tint[3];
|
|
shaderColor._offset[2] = pointColor._offset[2];
|
|
endTint = nextPointColor._tint[0];
|
|
fStack_50 = nextPointColor._tint[1];
|
|
fStack_4c = nextPointColor._tint[2];
|
|
fStack_48 = nextPointColor._tint[3];
|
|
endOffsetZ = nextPointColor._offset[2];
|
|
if (textureRefCount != GHIDRA_CAST<int *>(0x0)) {
|
|
cVar1 = (**(code **)(*textureRefCount + 4))();
|
|
if (cVar1 != '\0') {
|
|
if (((imageRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*imageRefCount + 0xc))(), cVar1 != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(auStack_202 + -10);
|
|
}
|
|
piVar6 = GHIDRA_CAST<int *>(local_128.y);
|
|
imageRefCount = GHIDRA_CAST<int *>(local_c0.y);
|
|
}
|
|
}
|
|
apply_sprite_shader_params(&shaderColor,SUB41((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_160)) + 0x4))),0),piVar6,imageRefCount);
|
|
pvVar3 = DAT_00c7f6e4;
|
|
local_17c[3] = fStack_48;
|
|
local_1b8[0xd] = fStack_48;
|
|
local_17c[0] = endTint;
|
|
local_17c[1] = fStack_50;
|
|
local_17c[2] = fStack_4c;
|
|
local_1b8[10] = endTint;
|
|
local_1b8[0xb] = fStack_50;
|
|
local_1b8[0xc] = fStack_4c;
|
|
local_1b8[8] = shaderColor._tint[3];
|
|
local_1b8[3] = shaderColor._tint[3];
|
|
local_1b8[0] = shaderColor._tint[0];
|
|
local_1b8[1] = shaderColor._tint[1];
|
|
local_1b8[2] = shaderColor._tint[2];
|
|
local_1b8[5] = shaderColor._tint[0];
|
|
pfVar2 = GHIDRA_CAST<float *>((GHIDRA_INT(local_a8) + 0x20 + GHIDRA_INT(DAT_00c7f6e4)));
|
|
*pfVar2 = shaderColor._tint[0];
|
|
pfVar2[1] = shaderColor._tint[1];
|
|
pfVar2[2] = shaderColor._tint[2];
|
|
pfVar2[3] = shaderColor._tint[3];
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_a8) + 0x30 + GHIDRA_INT(pvVar3))) = 0;
|
|
local_1b8[6] = shaderColor._tint[1];
|
|
local_1b8[7] = shaderColor._tint[2];
|
|
pfVar2 = GHIDRA_CAST<float *>((GHIDRA_INT(local_a8) + 0x34 + GHIDRA_INT(pvVar3)));
|
|
*pfVar2 = shaderColor._tint[0];
|
|
pfVar2[1] = shaderColor._tint[1];
|
|
pfVar2[2] = shaderColor._tint[2];
|
|
pfVar2[3] = shaderColor._tint[3];
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_a8) + 0x44 + GHIDRA_INT(pvVar3))) = 0;
|
|
pfVar2 = GHIDRA_CAST<float *>((GHIDRA_INT(local_a8) + 0x48 + GHIDRA_INT(pvVar3)));
|
|
*pfVar2 = endTint;
|
|
pfVar2[1] = fStack_50;
|
|
pfVar2[2] = fStack_4c;
|
|
pfVar2[3] = fStack_48;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_a8) + 0x58 + GHIDRA_INT(pvVar3))) = 0;
|
|
pfVar2 = GHIDRA_CAST<float *>((GHIDRA_INT(local_a8) + 0x5c + GHIDRA_INT(pvVar3)));
|
|
*pfVar2 = endTint;
|
|
pfVar2[1] = fStack_50;
|
|
pfVar2[2] = fStack_4c;
|
|
pfVar2[3] = fStack_48;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_a8) + 0x6c + GHIDRA_INT(pvVar3))) = 0;
|
|
iVar4 = (**(code **)(*texture + 0x14))(GHIDRA_INT(&(DAT_00c7f6d4->_topLeft).x) + GHIDRA_INT(local_ac));
|
|
if ((iVar4 != 0) && (local_a0 == GHIDRA_CAST<float *>(0x1))) {
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x24)) = shaderColor._colorize[0];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x28)) = shaderColor._colorize[1];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x2c)) = shaderColor._colorize[2];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x30)) = shaderColor._colorize[3];
|
|
*GHIDRA_CAST<uint64_t *>((iVar4 + 0x34)) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset)) + 0x0)));
|
|
*GHIDRA_CAST<float *>((iVar4 + 100)) = shaderColor._colorize[0];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x68)) = shaderColor._colorize[1];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x6c)) = shaderColor._colorize[2];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x70)) = shaderColor._colorize[3];
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x3c)) = shaderColor._offset[2];
|
|
*GHIDRA_CAST<uint64_t *>((iVar4 + 0x74)) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(shaderColor._offset)) + 0x0)));
|
|
*GHIDRA_CAST<float *>((iVar4 + 0x7c)) = shaderColor._offset[2];
|
|
*GHIDRA_CAST<uint64_t *>((iVar4 + 0xb4)) = endOffsetXY;
|
|
*GHIDRA_CAST<uint64_t *>((iVar4 + 0xf4)) = endOffsetXY;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xa4)) = endColorize;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xa8)) = fStack_40;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xac)) = fStack_3c;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xb0)) = fStack_38;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xbc)) = endOffsetZ;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xe4)) = endColorize;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xe8)) = fStack_40;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xec)) = fStack_3c;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xf0)) = fStack_38;
|
|
*GHIDRA_CAST<float *>((iVar4 + 0xfc)) = endOffsetZ;
|
|
}
|
|
local_a8 = (float)(GHIDRA_INT(local_a8) + 0x70);
|
|
unusedArg = local_b0 + 0x44;
|
|
local_ac = (float)(GHIDRA_INT(local_ac) + 0x24);
|
|
local_b4 = (float)(GHIDRA_INT(local_b4) + -1);
|
|
pfVar2 = layerFrame;
|
|
local_b0 = unusedArg;
|
|
} while (local_b4 != 0.0);
|
|
}
|
|
g_graphicsManager_blendMode[0] = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_1dc)) + 0x10)));
|
|
g_graphicsManager_blendMode[1] = GHIDRA_INT(fStack_1c8);
|
|
g_graphicsManager_blendMode[2] = GHIDRA_INT(fStack_1c4);
|
|
g_graphicsManager_blendMode[3] = GHIDRA_INT(fStack_1c0);
|
|
g_graphicsManager_blendMode[4] = GHIDRA_INT(local_168.y);
|
|
shader_cache_find(GHIDRA_INT(unusedArg));
|
|
}
|
|
}
|
|
local_14 = 1;
|
|
if (((textureRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*textureRefCount + 0xc))(), cVar1 != '\0')) &&
|
|
(g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
LAB_0041ef3a:
|
|
isPerVertexColor = '\x01';
|
|
LAB_0041ef41:
|
|
pfVar2 = layerFrame;
|
|
LAB_0041ef47:
|
|
pfVar5 = local_a0;
|
|
if (local_a0 == GHIDRA_CAST<float *>((GHIDRA_INT(g_beamRendererPointsEnd) + -0x44))) goto LAB_0041ef71;
|
|
goto LAB_0041eac0;
|
|
}
|