From 4598939a90b86ac1d5c46ff7249027c9202a3f07 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Mon, 31 Jan 2022 18:54:12 +0100 Subject: [PATCH] Add inaccurate texture coordinates hotkey --- src/Config.cpp | 4 ++++ src/Config.h | 1 + src/GLideNUI/ConfigDialog.cpp | 2 ++ src/VI.cpp | 10 ++++++++++ src/mupenplus/Config_mupenplus.cpp | 2 ++ 5 files changed, 19 insertions(+) diff --git a/src/Config.cpp b/src/Config.cpp index 2999d605..ab42bd81 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -202,6 +202,8 @@ const char* Config::hotkeyIniName(u32 _idx) return "hkOsdRenderingResolution"; case Config::HotKey::hkForceGammaCorrection: return "hkForceGammaCorrection"; + case Config::HotKey::hkInaccurateTexCords: + return "hkInaccurateTexCords"; } return nullptr; } @@ -238,6 +240,8 @@ const char* Config::enabledHotkeyIniName(u32 _idx) return "hkOsdRenderingResolutionEnabled"; case Config::HotKey::hkForceGammaCorrection: return "hkForceGammaCorrectionEnabled"; + case Config::HotKey::hkInaccurateTexCords: + return "hkInaccurateTexCordsEnabled"; } return nullptr; } diff --git a/src/Config.h b/src/Config.h index 845a4679..62cb14f5 100644 --- a/src/Config.h +++ b/src/Config.h @@ -234,6 +234,7 @@ struct Config hkOsdInternalResolution, hkOsdRenderingResolution, hkForceGammaCorrection, + hkInaccurateTexCords, hkTotal }; diff --git a/src/GLideNUI/ConfigDialog.cpp b/src/GLideNUI/ConfigDialog.cpp index ec1b74a5..3bea132c 100644 --- a/src/GLideNUI/ConfigDialog.cpp +++ b/src/GLideNUI/ConfigDialog.cpp @@ -103,6 +103,8 @@ QString ConfigDialog::_hotkeyDescription(quint32 _idx) const return tr("Toggle OSD rendering resolution"); case Config::HotKey::hkForceGammaCorrection: return tr("Toggle force gamma correction"); + case Config::HotKey::hkInaccurateTexCords: + return tr("Toggle inaccurate texture coordinates"); } return tr("Unknown hotkey"); } diff --git a/src/VI.cpp b/src/VI.cpp index 6a8719e2..ce23c3f4 100644 --- a/src/VI.cpp +++ b/src/VI.cpp @@ -216,6 +216,16 @@ static void checkHotkeys() dwnd().getDrawer().showMessage("Force gamma correction off\n", Milliseconds(750)); config.gammaCorrection.force = !config.gammaCorrection.force; } + + if (osal_is_key_pressed(config.hotkeys.enabledKeys[Config::hkInaccurateTexCords], 0x0001)) { + config.generalEmulation.enableInaccurateTextureCoordinates = !config.generalEmulation.enableInaccurateTextureCoordinates; + dwnd().stop(); + dwnd().start(); + if (config.generalEmulation.enableInaccurateTextureCoordinates == 0) + dwnd().getDrawer().showMessage("Disable inaccurate texture coordinates\n", Milliseconds(1000)); + else + dwnd().getDrawer().showMessage("Enable inaccurate texture coordinates\n", Milliseconds(1000)); + } } void VI_UpdateScreen() diff --git a/src/mupenplus/Config_mupenplus.cpp b/src/mupenplus/Config_mupenplus.cpp index 8b2cac4c..1b38b50d 100644 --- a/src/mupenplus/Config_mupenplus.cpp +++ b/src/mupenplus/Config_mupenplus.cpp @@ -51,6 +51,8 @@ const char* _hotkeyDescription(u32 _idx) return "Hotkey: toggle OSD rendering resolution"; case Config::HotKey::hkForceGammaCorrection: return "Hotkey: toggle force gamma correction"; + case Config::HotKey::hkInaccurateTexCords: + return "Hotkey: toggle inaccurate texture coordinates"; } return "Unknown hotkey"; }