From 84204471a51f4bd0a4f89619d2dbdb5b59e21be7 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 31 May 2019 11:44:43 +0200 Subject: more high level functions --- src/re3.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/re3.cpp') diff --git a/src/re3.cpp b/src/re3.cpp index 0d235cc0..08d02d12 100644 --- a/src/re3.cpp +++ b/src/re3.cpp @@ -4,6 +4,7 @@ #include "patcher.h" #include "Renderer.h" #include "Credits.h" +#include "Camera.h" #include "debugmenu_public.h" void **rwengine = *(void***)0x5A10E1; @@ -71,10 +72,30 @@ open_script(const char *path, const char *mode) int gDbgSurf; +void (*DebugMenuProcess)(void); +void (*DebugMenuRender)(void); +static void stub(void) { } + +void +DebugMenuInit(void) +{ + if(DebugMenuLoad()){ + DebugMenuProcess = (void(*)(void))GetProcAddress(gDebugMenuAPI.module, "DebugMenuProcess"); + DebugMenuRender = (void(*)(void))GetProcAddress(gDebugMenuAPI.module, "DebugMenuRender"); + } + if(DebugMenuProcess == nil || DebugMenuRender == nil){ + DebugMenuProcess = stub; + DebugMenuRender = stub; + } + +} + int (*RsEventHandler_orig)(int a, int b); int delayedPatches10(int a, int b) { + DebugMenuInit(); + if(DebugMenuLoad()){ DebugMenuAddVarBool8("Debug", "Show Ped Road Groups", (int8*)&gbShowPedRoadGroups, nil); DebugMenuAddVarBool8("Debug", "Show Car Road Groups", (int8*)&gbShowCarRoadGroups, nil); @@ -85,6 +106,8 @@ delayedPatches10(int a, int b) DebugMenuAddVarBool8("Debug", "Don't render Objects", (int8*)&gbDontRenderObjects, nil); DebugMenuAddVar("Debug", "Dbg Surface", &gDbgSurf, nil, 1, 0, 34, nil); + DebugMenuAddVar("Debug", "blur type", &TheCamera.m_BlurType, nil, 1, 0, 10, nil); + DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); } -- cgit v1.2.3