From 9afcc355ff8b942689e047576db5d1f98ae7fab0 Mon Sep 17 00:00:00 2001 From: erorcun Date: Sun, 27 Dec 2020 23:26:00 +0300 Subject: Dynamically add pipelines options, only if neo.txd exists --- src/core/re3.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/core/re3.cpp') diff --git a/src/core/re3.cpp b/src/core/re3.cpp index bb5e4ab6..bd38cb89 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -33,9 +33,10 @@ #include "postfx.h" #include "custompipes.h" #include "MemoryHeap.h" +#include "custompipes.h" +#include "FileMgr.h" #ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS -#include "FileMgr.h" #include "ControllerConfig.h" #endif @@ -84,6 +85,30 @@ void CustomFrontendOptionsPopulate(void) { // Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h + + // These work only if we have neo folder, so they're dynamically added +#ifdef EXTENDED_PIPELINES + const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" }; + const char *off_on[] = { "FEM_OFF", "FEM_ON" }; + int fd = CFileMgr::OpenFile("neo/neo.txd","r"); + if (fd) { +#ifdef GRAPHICS_MENU_OPTIONS + FrontendOptionSetCursor(MENUPAGE_GRAPHICS_SETTINGS, -3, false); + FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "VehiclePipeline"); + FrontendOptionAddSelect("FED_PRM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "NeoRimLight"); + FrontendOptionAddSelect("FED_WLM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "NeoLightMaps"); + FrontendOptionAddSelect("FED_RGL", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "NeoRoadGloss"); +#else + FrontendOptionSetCursor(MENUPAGE_DISPLAY_SETTINGS, -3, false); + FrontendOptionAddSelect("FED_VPL", 0, 0, MENUALIGN_LEFT, vehPipelineNames, ARRAY_SIZE(vehPipelineNames), (int8*)&CustomPipes::VehiclePipeSwitch, false, nil, "VehiclePipeline"); + FrontendOptionAddSelect("FED_PRM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::RimlightEnable, false, nil, "NeoRimLight"); + FrontendOptionAddSelect("FED_WLM", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::LightmapEnable, false, nil, "NeoLightMaps"); + FrontendOptionAddSelect("FED_RGL", 0, 0, MENUALIGN_LEFT, off_on, 2, (int8*)&CustomPipes::GlossEnable, false, nil, "NeoRoadGloss"); +#endif + CFileMgr::CloseFile(fd); + } +#endif + } #endif -- cgit v1.2.3