reman3/game_re/gh_fix/r3_restore.cxx

119 lines
4.2 KiB
C++

// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!!
#include <r3/binders/auto.h>
#include <gh_global.h>
extern "C" {
undefined FUN_00470350(void); // 00470350 // FUN_00470350 // cdecl
undefined r3_load_textures_2(void); // 00471760 // r3_load_textures_2 // cdecl
void r3_levelDisplayFn(byte param); // 00446fc0 // r3_levelDisplayFn // cdecl
void r3_noop(void * p_cTxt1, void * p_cTxt2); // 00401100 // r3_noop // stdcall
undefined r3_closeConcatTextureFile(void); // 004711d0 // r3_closeConcatTextureFile // cdecl
undefined FUN_00470db0(void); // 00470db0 // FUN_00470db0 // cdecl
undefined FUN_00503710(void); // 00503710 // FUN_00503710 // cdecl
undefined FUN_00443120(undefined4 param_1); // 00443120 // FUN_00443120 // cdecl
undefined FUN_00442c50(void); // 00442c50 // FUN_00442c50 // cdecl
undefined FUN_00470410(void); // 00470410 // FUN_00470410 // cdecl
undefined FUN_00472150(void); // 00472150 // FUN_00472150 // cdecl
undefined FUN_00445460(void); // 00445460 // FUN_00445460 // cdecl
undefined FUN_00442f70(undefined4 param_1); // 00442f70 // FUN_00442f70 // cdecl
undefined FUN_00445440(void); // 00445440 // FUN_00445440 // cdecl
undefined SND_fn_vResumeSound(void); // 0040a1e0 // SND_fn_vResumeSound // cdecl
undefined IPT_fn_vActivateAllEntryElements(void); // 00505490 // IPT_fn_vActivateAllEntryElements // cdecl
undefined r3_windowLockCursor(void); // 00401320 // r3_windowLockCursor // cdecl
undefined FUN_00402470(HWND param_1); // 00402470 // FUN_00402470 // cdecl
undefined gfx_init2(void); // 00470be0 // gfx_init2 // cdecl
undefined FUN_004725a0(void); // 004725a0 // FUN_004725a0 // cdecl
undefined FUN_0051a900(short hGLDDevice); // 0051a900 // FUN_0051a900 // cdecl
undefined FUN_005038e0(void); // 005038e0 // FUN_005038e0 // cdecl
undefined FUN_004fb300(void); // 004fb300 // FUN_004fb300 // cdecl
undefined FUN_004fa650(void); // 004fa650 // FUN_004fa650 // cdecl
undefined r3_processInput1(void); // 00446f10 // r3_processInput1 // cdecl
undefined FUN_0047bae0(void); // 0047bae0 // FUN_0047bae0 // cdecl
undefined FUN_0051a7a0(short hGLDDevice, undefined4 param_2); // 0051a7a0 // FUN_0051a7a0 // cdecl
// 00401490
/* WARNING: Inlined function: r3_get_engine_mode */
undefined4 __stdcall r3_restore(undefined4 param_1)
{
HWND hWnd;
int iVar1;
DWORD DVar2;
hWnd = g_gameHWND;
if (g_engineRunning != 0) {
return 0;
}
if (g_gameHWND == (HWND)0x0) {
return 0;
}
SetWindowTextA(g_gameHWND,g_windowTitleRestoring);
UpdateWindow(hWnd);
SetForegroundWindow(hWnd);
if (p_fn_vDisplayAll == (void*)&r3_noop) {
/* Set window callback? */
p_fn_vDisplayAll = &r3_levelDisplayFn;
}
if (PTR_r3_processInput1_005bdb1c == (void*)&r3_noop) {
PTR_r3_processInput1_005bdb1c = r3_processInput1;
IPT_fn_vActivateAllEntryElements();
}
iVar1 = FUN_0047bae0();
if (iVar1 == 0) goto LAB_004015f7;
DVar2 = WaitForSingleObject(g_drawSemaphore,500);
if (DVar2 == 0x102) {
return 0;
}
FUN_004725a0();
if (g_currentBinkMovie + Field<32, 4>() == 0) {
FUN_00470410();
}
FUN_0051a900(g_stEngineStructure.hGLDDevice);
FUN_005038e0();
FUN_00503710();
FUN_004fb300();
FUN_00472150();
FUN_00470db0();
FUN_00445440();
gfx_init2();
FUN_00445460();
FUN_00402470(hWnd);
FUN_0051a7a0(g_stEngineStructure.hGLDDevice,0);
if (g_currentBinkMovie + Field<32, 4>() == 0) {
FUN_00442f70(0);
FUN_00443120(0);
FUN_00442f70(1);
FUN_00443120(1);
FUN_00470350();
if (g_currentBinkMovie + Field<32, 4>() != 0) goto LAB_004015bc;
}
else {
LAB_004015bc:
FUN_00445440();
}
r3_load_textures_2();
if (((g_stEngineStructure.eEngineMode == E_EM_ModeStartingProgram) ||
(g_stEngineStructure.eEngineMode == E_EM_ModeEnterGame)) ||
(g_stEngineStructure.eEngineMode == E_EM_ModeEnterLevel)) {
FUN_004fa650();
}
r3_closeConcatTextureFile();
ReleaseSemaphore(g_drawSemaphore,1,(LPLONG)0x0);
LAB_004015f7:
g_stEngineStructure + Field<91, 1>() = 0;
SetWindowTextA(hWnd,g_windowTitle);
UpdateWindow(hWnd);
SetForegroundWindow(hWnd);
FUN_00442c50();
SND_fn_vResumeSound();
r3_windowLockCursor();
/* Keep suspended
*/
return 0;
}
}