Six agents took over PopupButtons/PopupQueue/AchievementOverlay, Seeds with the global Random (now seeded from the clock as in the original), Game (g_game exists from Manager::Init on), KeyConfigs, an offline NetplayManager, Console's output and printing, TextureCache, the color-mod and sprite shader passes, mod shaders and reload_resource_paths. An integration pass moved callers to the new APIs (0 errors, 0 warnings with -Wall -Wextra). build/isaac loads the 34 installed mods and stops at ScoreSheet::ScoreSheet in Game's constructor; with the remaining stubs skipped under gdb the intro cutscene plays through and the main menu's frame loop runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
192 lines
7.4 KiB
C++
192 lines
7.4 KiB
C++
#include "classes.h"
|
|
|
|
// 005ccd80
|
|
void Entity_Text::Update()
|
|
{
|
|
int iVar1;
|
|
uint32_t timer;
|
|
uint32_t uVar2;
|
|
float fVar3;
|
|
float velY;
|
|
Game *game;
|
|
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c));
|
|
if (iVar1 == 0) {
|
|
fVar3 = 1.0 - (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) / (float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414));
|
|
fVar3 = fVar3 * fVar3;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x524)) = fVar3;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x34c)) = 0;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x350)) = (1.0 - fVar3) * -50.0;
|
|
}
|
|
else if (iVar1 == 1) {
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410));
|
|
if (iVar1 == 0) {
|
|
sprintf_s(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(this) + 0x418)),0x100,&DAT_00b62fe0);
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410));
|
|
}
|
|
game = g_game;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) - iVar1;
|
|
if (10 < iVar1) {
|
|
iVar1 = 10;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x524)) = (float)iVar1 / 10.0;
|
|
fVar3 = sin((float)(game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x328))) * 0.2);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 0x20)) & 1) == 0) {
|
|
fVar3 = fVar3 * 15.0;
|
|
}
|
|
else {
|
|
fVar3 = fVar3 * -15.0;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = fVar3;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0;
|
|
}
|
|
else if (iVar1 == 2) {
|
|
timer = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x410));
|
|
if (timer == 0) {
|
|
sprintf_s(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(this) + 0x418)),0x100,s__d);
|
|
timer = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x410));
|
|
}
|
|
uVar2 = 0x3f800000;
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) + -0xf <= GHIDRA_INT(timer)) && ((timer & 1) != 0)) {
|
|
uVar2 = 0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x518)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x51c)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x520)) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x524)) = uVar2;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x528)) = 0;
|
|
}
|
|
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360));
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410)) + 1;
|
|
velY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x36c)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x36c)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x368));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x360)) = fVar3;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x364)) = velY;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c)) = fVar3 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x33c));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340)) = velY + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x340));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x414)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x410))) {
|
|
this->Remove();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 005ccfc0
|
|
void Entity_Text::Render(Vector *offset)
|
|
{
|
|
void *font = this;
|
|
uint8_t *str;
|
|
Vector pos;
|
|
Vector scale;
|
|
uint8_t isPaused;
|
|
uint32_t flickerPhase;
|
|
Font *font;
|
|
float fVar1;
|
|
double dVar2;
|
|
uint32_t fontSettings;
|
|
uint32_t local_3c;
|
|
uint32_t local_38;
|
|
uint32_t local_34;
|
|
uint32_t local_30;
|
|
uint32_t local_2c;
|
|
uint32_t local_28;
|
|
float screenY;
|
|
float worldY;
|
|
int textWidth;
|
|
float pixelScale;
|
|
float screenX;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af5fe5;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(font) + 0x172)) != '\0') {
|
|
str = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(font) + 0x418));
|
|
font = &g_manager->_font6_PFTempestaSevenCondensed;
|
|
textWidth = Font::get_string_width_n(font,str,-1);
|
|
worldY = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x340)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x350));
|
|
screenY = (g_screenHeight - 182.0) * 0.5;
|
|
pixelScale = g_displayPixelRatio * g_screenPointScale;
|
|
screenX = (((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x34c)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x33c))) - 60.0) * 0.65 +
|
|
(g_screenWidth - 338.0) * 0.5) * pixelScale + 0.5;
|
|
dVar2 = floor((double)screenX);
|
|
screenX = (float)dVar2 / pixelScale;
|
|
screenY = ((worldY - 140.0) * 0.65 + screenY) * pixelScale + 0.5;
|
|
dVar2 = floor((double)screenY);
|
|
screenY = (float)dVar2;
|
|
screenX = screenX + offset->x;
|
|
fVar1 = offset->y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a4)) = screenX;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)) = screenY / pixelScale + fVar1;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(font) + 0x2c)) == 2) {
|
|
isPaused = Game::IsPaused(g_game);
|
|
if (isPaused == 0) {
|
|
flickerPhase = g_manager->_framecount + 1U & 0x80000001;
|
|
if (GHIDRA_INT(flickerPhase) < 0) {
|
|
flickerPhase = (flickerPhase - 1 | 0xfffffffe) + 1;
|
|
}
|
|
}
|
|
else {
|
|
flickerPhase = 0;
|
|
}
|
|
fontSettings = 0;
|
|
local_3c = 0xffff;
|
|
local_38 = 0;
|
|
local_34 = 0x3f800000;
|
|
local_30 = 0xffffffff;
|
|
local_2c = 0;
|
|
local_28 = 0;
|
|
fVar1 = ((float)GHIDRA_INT((flickerPhase + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(font) + 0x410)) * 2)) * 0.5 - 0.0) * 0.25;
|
|
if (fVar1 <= 0.0) {
|
|
fVar1 = 0.0;
|
|
}
|
|
if (1.0 <= fVar1) {
|
|
fVar1 = 1.0;
|
|
}
|
|
fVar1 = 4.0 - fVar1 * 2.5;
|
|
local_8 = 0;
|
|
pos.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)) - fVar1 * 4.0;
|
|
pos.x = screenX - (float)textWidth * 0.5 * fVar1;
|
|
scale.y = fVar1;
|
|
scale.x = fVar1;
|
|
Font::DrawString(font,str,pos,scale,GHIDRA_CAST<KColor *>((GHIDRA_INT(font) + 0x518)),
|
|
GHIDRA_CAST<FontSettings *>(&fontSettings));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
fontSettings = 0;
|
|
local_3c = 0xffff;
|
|
local_38 = 0;
|
|
local_34 = 0x3f800000;
|
|
local_30 = 0xffffffff;
|
|
local_2c = 0;
|
|
local_28 = 0;
|
|
local_8 = 1;
|
|
Font::DrawString(font,str,GHIDRA_CAST<KColor *>((GHIDRA_INT(font) + 0x518)),&fontSettings,
|
|
screenX - (float)textWidth * 0.5,*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(font) + 0x1a8)));
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 005cd2e0
|
|
void Entity_Text::Interpolate()
|
|
{
|
|
float wobble;
|
|
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x2c)) == 1) {
|
|
wobble = sin(((float)(g_game->_frameCount - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x328))) + 0.5) * 0.2);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x350)) = 0;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + 0x20)) & 1) == 0) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = wobble * 15.0;
|
|
this->Entity::Interpolate();
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x34c)) = wobble * -15.0;
|
|
}
|
|
this->Entity::Interpolate();
|
|
return;
|
|
}
|