Curation round 2, wave A: anm2 (Anm2Ed JSON), text, config as idiomatic classes; SDL3 platform opens a window
- 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>
This commit is contained in:
1 parent
d6e1ca7c6c
commit
780767f5e1
161 files changed
+8646
-21919
No files matched your search
@@ -393,555 +393,6 @@ LAB_00a18638:
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a18750
|
||||
void KAGE_Graphics::update_depth_renderbuffer(uint8_t isForced)
|
||||
{
|
||||
uint32_t uVar1;
|
||||
uint32_t height;
|
||||
uint32_t widthBits;
|
||||
uint8_t shift;
|
||||
uint32_t uVar2;
|
||||
undefined3 in_stack_00000005;
|
||||
uint32_t prevFramebuffer;
|
||||
int currentHeight;
|
||||
int pow2Width;
|
||||
uint32_t *renderbufferId;
|
||||
|
||||
uVar1 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xb4));
|
||||
if (GHIDRA_INT(uVar1) < 1) {
|
||||
uVar1 = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x5c))();
|
||||
}
|
||||
height = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xb8));
|
||||
if (GHIDRA_INT(height) < 1) {
|
||||
height = (**(code **)(*GHIDRA_CAST<int *>(this) + 0x60))();
|
||||
}
|
||||
if ((isForced == 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xb0)) != 0)) {
|
||||
(*(code *)epoxy_glBindRenderbuffer)(0x8d41,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xb0)));
|
||||
(*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d42,&isForced);
|
||||
(*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d43,¤tHeight);
|
||||
if ((GHIDRA_INT(uVar1) <= _isForced) && (GHIDRA_INT(height) <= currentHeight)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xb0)) != 0) {
|
||||
(*(code *)epoxy_glDeleteRenderbuffers)(1,GHIDRA_INT(this) + 0xb0);
|
||||
}
|
||||
if (GHIDRA_INT(uVar1) < 9) {
|
||||
uVar1 = 8;
|
||||
uVar2 = 7;
|
||||
widthBits = 4;
|
||||
LAB_00a18808:
|
||||
shift = 1;
|
||||
do {
|
||||
uVar2 = uVar2 | widthBits;
|
||||
shift = shift + 1;
|
||||
widthBits = uVar1 >> (shift & 0x1f);
|
||||
} while (widthBits != 0);
|
||||
}
|
||||
else {
|
||||
uVar2 = uVar1 - 1;
|
||||
widthBits = uVar1 >> 1;
|
||||
if (widthBits != 0) goto LAB_00a18808;
|
||||
}
|
||||
_isForced = uVar2 + 1;
|
||||
if (GHIDRA_INT(height) < 9) {
|
||||
height = 8;
|
||||
uVar1 = 7;
|
||||
uVar2 = 4;
|
||||
}
|
||||
else {
|
||||
uVar1 = height - 1;
|
||||
uVar2 = height >> 1;
|
||||
if (uVar2 == 0) goto LAB_00a18850;
|
||||
}
|
||||
shift = 1;
|
||||
do {
|
||||
uVar1 = uVar1 | uVar2;
|
||||
shift = shift + 1;
|
||||
uVar2 = height >> (shift & 0x1f);
|
||||
} while (uVar2 != 0);
|
||||
LAB_00a18850:
|
||||
(*(code *)epoxy_glGetIntegerv)(0x8ca6,&prevFramebuffer);
|
||||
(*(code *)epoxy_glBindFramebuffer)(0x8d40,*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xac)));
|
||||
renderbufferId = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this) + 0xb0));
|
||||
(*(code *)epoxy_glGenRenderbuffers)(1,renderbufferId);
|
||||
pow2Width = _isForced;
|
||||
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Renderbuffer ID: %d size %dx%d\n"));
|
||||
(*(code *)epoxy_glBindRenderbuffer)(0x8d41,*renderbufferId);
|
||||
(*(code *)epoxy_glRenderbufferStorage)(0x8d41,0x81a6,pow2Width,uVar1 + 1);
|
||||
(*(code *)epoxy_glFramebufferRenderbuffer)(0x8d40,0x8d00,0x8d41,*renderbufferId);
|
||||
(*(code *)epoxy_glBindFramebuffer)(0x8d40,prevFramebuffer);
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a19450
|
||||
void KAGE_Graphics::set_window_size(int *param_1)
|
||||
{
|
||||
int iVar1;
|
||||
int iVar2;
|
||||
int iVar3;
|
||||
int in_ECX;
|
||||
|
||||
if ((*GHIDRA_CAST<int *>((in_ECX + 0xc0)) != *param_1) || (*GHIDRA_CAST<int *>((in_ECX + 0xc4)) != param_1[1])) {
|
||||
*GHIDRA_CAST<int *>((in_ECX + 0xc0)) = *param_1;
|
||||
*GHIDRA_CAST<int *>((in_ECX + 0xc4)) = param_1[1];
|
||||
if ((*GHIDRA_CAST<uint32_t *>((in_ECX + 4)) & 0x100) == 0) {
|
||||
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 0xbc));
|
||||
if (iVar1 != 0) {
|
||||
iVar2 = *param_1;
|
||||
iVar3 = param_1[1];
|
||||
if (iVar2 < 0) {
|
||||
_wassert(L"width >= 0",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x26f);
|
||||
}
|
||||
if (iVar3 < 0) {
|
||||
_wassert(L"height >= 0",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x270);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
return;
|
||||
}
|
||||
*GHIDRA_CAST<int *>((iVar1 + 0x28)) = iVar2;
|
||||
*GHIDRA_CAST<int *>((iVar1 + 0x2c)) = iVar3;
|
||||
(*DAT_00c73724)(iVar1,iVar2,iVar3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("Setting size of window while in fullscreen, is this intended?\n"));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a196b0
|
||||
void KAGE_Graphics::set_fullscreen(uint8_t isFullscreen, uint8_t isExclusive)
|
||||
{
|
||||
void *pvVar1;
|
||||
int iVar2;
|
||||
HWND hWnd;
|
||||
Vector *viewportOffset;
|
||||
code *assertFn;
|
||||
int *piVar3;
|
||||
int cx;
|
||||
bool isResizable;
|
||||
HWND hWndInsertAfter;
|
||||
int X;
|
||||
int Y;
|
||||
UINT uFlags;
|
||||
uint32_t framebufferWidth;
|
||||
uint32_t framebufferHeight;
|
||||
void *local_8;
|
||||
uint32_t currentModeAddr;
|
||||
|
||||
if (((uint8_t)(g_graphicsManager_flags >> 8) & 1) == isFullscreen) {
|
||||
return;
|
||||
}
|
||||
if (isFullscreen == 0) {
|
||||
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffeff;
|
||||
FUN_00a6b0a0(DAT_00c799b0,DAT_00c799b4,DAT_00c799a8,DAT_00c799ac,0);
|
||||
pvVar1 = g_glfwWindow;
|
||||
assertFn = _wassert_exref;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x3a3);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 8)) = 1;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x40)) == 0) {
|
||||
(*DAT_00c7377c)(pvVar1,1);
|
||||
}
|
||||
}
|
||||
pvVar1 = g_glfwWindow;
|
||||
isResizable = DAT_00c79a3d != '\0';
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x3a3);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 4)) = GHIDRA_UINT(isResizable);
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x40)) == 0) {
|
||||
(*DAT_00c73778)(pvVar1,GHIDRA_UINT(isResizable));
|
||||
}
|
||||
}
|
||||
uFlags = 3;
|
||||
iVar2 = 0;
|
||||
cx = 0;
|
||||
Y = 0;
|
||||
X = 0;
|
||||
hWndInsertAfter = (HWND)0xfffffffe;
|
||||
hWnd = (HWND)FUN_00a5f090();
|
||||
}
|
||||
else {
|
||||
g_graphicsManager_flags = g_graphicsManager_flags | 0x100;
|
||||
local_8 = window_get_current_monitor(&DAT_00c798e0);
|
||||
assertFn = _wassert_exref;
|
||||
if (local_8 == (void *)0x0) {
|
||||
_wassert(L"monitor != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c"
|
||||
,0x1c1);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
piVar3 = GHIDRA_CAST<int *>(0x0);
|
||||
}
|
||||
else {
|
||||
currentModeAddr = GHIDRA_INT(local_8) + 0x98;
|
||||
iVar2 = (*DAT_00c736fc)(local_8,currentModeAddr);
|
||||
piVar3 = GHIDRA_CAST<int *>((-GHIDRA_UINT((iVar2 != 0)) & currentModeAddr));
|
||||
}
|
||||
if (isExclusive != 0) {
|
||||
FUN_00a6b0a0(0,0,*piVar3,piVar3[1],piVar3[5]);
|
||||
goto LAB_00a1993f;
|
||||
}
|
||||
FUN_00a6b0a0(0,0,*piVar3 + 1,piVar3[1],0);
|
||||
pvVar1 = g_glfwWindow;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x3a3);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 8)) = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x40)) == 0) {
|
||||
(*DAT_00c7377c)(pvVar1,0);
|
||||
}
|
||||
}
|
||||
pvVar1 = g_glfwWindow;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x3a3);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 4)) = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x40)) == 0) {
|
||||
(*DAT_00c73778)(pvVar1,0);
|
||||
}
|
||||
}
|
||||
iVar2 = piVar3[1];
|
||||
cx = *piVar3 + 1;
|
||||
hWnd = (HWND)FUN_00a5f090();
|
||||
uFlags = 0x10;
|
||||
Y = 0;
|
||||
X = -1;
|
||||
hWndInsertAfter = (HWND)0xffffffff;
|
||||
}
|
||||
SetWindowPos(hWnd,hWndInsertAfter,X,Y,cx,iVar2,uFlags);
|
||||
LAB_00a1993f:
|
||||
pvVar1 = g_glfwWindow;
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
(*assertFn)(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x333);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x40)) == 0) &&
|
||||
((*DAT_00c73748)(pvVar1), *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x14)) != 0)) {
|
||||
(*DAT_00c73754)(pvVar1);
|
||||
}
|
||||
pvVar1 = g_glfwWindow;
|
||||
if (isFullscreen == 0) {
|
||||
g_graphicsManager_flags = g_graphicsManager_flags & 0xfffff7ff;
|
||||
}
|
||||
else {
|
||||
g_graphicsManager_flags = g_graphicsManager_flags | 0x800;
|
||||
}
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
(*assertFn)(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x260);
|
||||
}
|
||||
framebufferWidth = 0;
|
||||
framebufferHeight = 0;
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
(*DAT_00c73720)(pvVar1,&framebufferWidth,&framebufferHeight);
|
||||
}
|
||||
piVar3 = GHIDRA_CAST<int *>(*DAT_00c799b8);
|
||||
if (piVar3 != DAT_00c799b8) {
|
||||
do {
|
||||
(*(code *)piVar3[2])(framebufferWidth,framebufferHeight,piVar3[3]);
|
||||
piVar3 = GHIDRA_CAST<int *>(*piVar3);
|
||||
} while (piVar3 != DAT_00c799b8);
|
||||
}
|
||||
viewportOffset = GHIDRA_CAST<Vector *>(&DAT_00c79984);
|
||||
if ((g_graphicsManager_flags & 0x40) == 0) {
|
||||
viewportOffset = &g_vectorZero;
|
||||
}
|
||||
(*(code *)epoxy_glViewport)
|
||||
(GHIDRA_INT(viewportOffset->x),GHIDRA_INT(viewportOffset->y),DAT_00c799a8,DAT_00c799ac);
|
||||
update_projection(&DAT_00c798e0);
|
||||
update_depth_renderbuffer(&DAT_00c798e0,0);
|
||||
pvVar1 = g_glfwWindow;
|
||||
if (isFullscreen == 0) {
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
(*assertFn)(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
||||
,0x24c);
|
||||
}
|
||||
if (_glfw != 0) {
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x70)) == 0x34001) {
|
||||
return;
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x70)) = 0x34001;
|
||||
(*DAT_00c736a0)(pvVar1,GHIDRA_INT(pvVar1) + 0x1e0,GHIDRA_INT(pvVar1) + 0x1e8);
|
||||
(*DAT_00c736a8)(pvVar1,0x34001);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (g_glfwWindow == (void *)0x0) {
|
||||
(*assertFn)(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
||||
,0x24c);
|
||||
}
|
||||
if (_glfw != 0) {
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x70)) == 0x34002) {
|
||||
return;
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x70)) = 0x34002;
|
||||
(*DAT_00c736a0)(pvVar1,GHIDRA_INT(pvVar1) + 0x1e0,GHIDRA_INT(pvVar1) + 0x1e8);
|
||||
(*DAT_00c736a8)(pvVar1,0x34002);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_glfwInputError(0x10001,0);
|
||||
return;
|
||||
}
|
||||
|
||||
// 00a19df0
|
||||
uint32_t KAGE_Graphics::create_window()
|
||||
{
|
||||
HMODULE hInstance;
|
||||
HICON dwNewLong;
|
||||
uint32_t windowStyle;
|
||||
LPVOID currentContext;
|
||||
int *piVar1;
|
||||
int *in_ECX;
|
||||
uint32_t extraout_ECX;
|
||||
uint32_t extraout_ECX_00;
|
||||
uint32_t extraout_ECX_01;
|
||||
uint32_t extraout_ECX_02;
|
||||
uint32_t extraout_ECX_03;
|
||||
uint32_t extraout_ECX_04;
|
||||
uint32_t extraout_ECX_05;
|
||||
uint32_t extraout_ECX_06;
|
||||
uint32_t uVar2;
|
||||
HWND hwnd;
|
||||
uint32_t extraout_ECX_07;
|
||||
int *piVar3;
|
||||
LPCSTR lpIconName;
|
||||
int iVar4;
|
||||
int local_10;
|
||||
|
||||
glfwWindowHint();
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_00;
|
||||
}
|
||||
else {
|
||||
_DAT_00c73830 = 0;
|
||||
uVar2 = extraout_ECX;
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_01;
|
||||
}
|
||||
else {
|
||||
_DAT_00c7383c = 0;
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_02;
|
||||
}
|
||||
else {
|
||||
_DAT_00c73c6c = 2;
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_03;
|
||||
}
|
||||
else {
|
||||
_DAT_00c73c70 = 0;
|
||||
}
|
||||
local_10 = glfwCreateWindow(DAT_00c79a30,uVar2,in_ECX[0x2f]);
|
||||
if (local_10 == 0) {
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_05;
|
||||
}
|
||||
else {
|
||||
_DAT_00c73c6c = 1;
|
||||
uVar2 = extraout_ECX_04;
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
uVar2 = extraout_ECX_06;
|
||||
}
|
||||
else {
|
||||
_DAT_00c73c70 = 0;
|
||||
}
|
||||
local_10 = glfwCreateWindow(DAT_00c79a30,uVar2,in_ECX[0x2f]);
|
||||
if (local_10 == 0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Failed to create OpenGL window / context\n"));
|
||||
}
|
||||
}
|
||||
if (in_ECX[0x2f] != 0) {
|
||||
FUN_00a6af90();
|
||||
}
|
||||
lpIconName = (LPCSTR)GHIDRA_UINT(DAT_00c79a40);
|
||||
hInstance = GetModuleHandleA((LPCSTR)0x0);
|
||||
dwNewLong = LoadIconA(hInstance,lpIconName);
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
hwnd = (HWND)0x0;
|
||||
}
|
||||
else if (DAT_00c73694 == 0x60001) {
|
||||
hwnd = *GHIDRA_CAST<HWND *>((local_10 + 0x2b4));
|
||||
}
|
||||
else {
|
||||
_glfwInputError(0x1000e,"Win32: Platform not initialized");
|
||||
hwnd = (HWND)0x0;
|
||||
}
|
||||
SetClassLongA(hwnd,-0xe,(LONG)dwNewLong);
|
||||
if ((in_ECX[1] & 0x400U) == 0) {
|
||||
iVar4 = -0x10;
|
||||
hwnd = (HWND)FUN_00a5f090(extraout_ECX_07);
|
||||
windowStyle = GetWindowLongA(hwnd,iVar4);
|
||||
windowStyle = windowStyle & 0xfffeffff;
|
||||
iVar4 = -0x10;
|
||||
hwnd = (HWND)FUN_00a5f090();
|
||||
SetWindowLongA(hwnd,iVar4,windowStyle);
|
||||
}
|
||||
in_ECX[0x2f] = local_10;
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
goto LAB_00a1a0a2;
|
||||
}
|
||||
if (DAT_00c74b80 != 1) {
|
||||
_wassert(L"tls->win32.allocated == GLFW_TRUE",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c"
|
||||
,0x3f);
|
||||
}
|
||||
currentContext = TlsGetValue(DAT_00c74b84);
|
||||
if ((local_10 != 0) && (*GHIDRA_CAST<int *>((local_10 + 500)) == 0)) {
|
||||
_glfwInputError(0x1000a,
|
||||
"Cannot make current with a window that has no OpenGL or OpenGL ES context");
|
||||
goto LAB_00a1a0a2;
|
||||
}
|
||||
if (currentContext == (LPVOID)0x0) {
|
||||
LAB_00a1a092:
|
||||
if (local_10 == 0) goto LAB_00a1a0a2;
|
||||
}
|
||||
else if ((local_10 == 0) || (*GHIDRA_CAST<int *>((local_10 + 0x1f8)) != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(currentContext) + 0x1f8))))
|
||||
{
|
||||
(**(code **)(GHIDRA_CAST<char *>(currentContext) + 0x22c))(0);
|
||||
goto LAB_00a1a092;
|
||||
}
|
||||
(**(code **)(local_10 + 0x22c))(local_10);
|
||||
LAB_00a1a0a2:
|
||||
(*(code *)epoxy_glGetString)(0x1f02);
|
||||
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("OpenGL version %s\n"));
|
||||
(*(code *)epoxy_glGetString)(0x8b8c);
|
||||
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("GLSL version %s\n"));
|
||||
piVar1 = in_ECX + 0x2b;
|
||||
if (*piVar1 != 0) {
|
||||
(*(code *)epoxy_glBindFramebuffer)(0x8d40,0);
|
||||
(*(code *)epoxy_glDeleteFramebuffers)(1,piVar1);
|
||||
}
|
||||
if (epoxy_glGenFramebuffers == GHIDRA_CAST<uint8_t *>(0x0)) {
|
||||
KAGE_LogMessage(8,GHIDRA_CAST<uint8_t *>("glGenFramebuffers is NULL!\n"));
|
||||
return 0;
|
||||
}
|
||||
(*(code *)epoxy_glGenFramebuffers)(1,piVar1);
|
||||
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Framebuffer ID: %d\n"));
|
||||
(*(code *)epoxy_glBindFramebuffer)(0x8d40,*piVar1);
|
||||
update_depth_renderbuffer(in_ECX,1);
|
||||
(*(code *)epoxy_glBindFramebuffer)(0x8d40,0);
|
||||
iVar4 = in_ECX[0x2f];
|
||||
if (iVar4 == 0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x41f);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*(code **)(iVar4 + 0x274) = FUN_00a19bf0;
|
||||
}
|
||||
iVar4 = in_ECX[0x2f];
|
||||
if (iVar4 == 0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x414);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint8_t **>((iVar4 + 0x270)) = &UNK_00a19ca0;
|
||||
}
|
||||
iVar4 = in_ECX[0x2f];
|
||||
if (iVar4 == 0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x440);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else {
|
||||
*GHIDRA_CAST<uint8_t **>((iVar4 + 0x280)) = &UNK_00a19d40;
|
||||
}
|
||||
if ((in_ECX[1] & 0x100U) == 0) {
|
||||
iVar4 = in_ECX[0x2f];
|
||||
if (iVar4 == 0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x245);
|
||||
}
|
||||
piVar3 = in_ECX + 0x34;
|
||||
piVar1 = in_ECX + 0x35;
|
||||
if (piVar3 != GHIDRA_CAST<int *>(0x0)) {
|
||||
*piVar3 = 0;
|
||||
}
|
||||
if (piVar1 != GHIDRA_CAST<int *>(0x0)) {
|
||||
*piVar1 = 0;
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
(**(code **)(*in_ECX + 0x78))();
|
||||
return 1;
|
||||
}
|
||||
(*_DAT_00c73718)(iVar4,piVar3,piVar1);
|
||||
}
|
||||
(**(code **)(*in_ECX + 0x78))();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 00a67bd0
|
||||
uint32_t KAGE_Graphics::submit_batch()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user