1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Add hotkey for "force gamma correction" setting.

Fixed #2318 Request: Keyboard shortcut to enable Custom Gamma Correction Levels
This commit is contained in:
Sergey Lipskiy 2020-12-05 17:35:02 +07:00
parent 22842a56fc
commit 8500bc08e2
5 changed files with 15 additions and 0 deletions

View File

@ -184,6 +184,8 @@ const char* Config::hotkeyIniName(u32 _idx)
return "hkOsdInternalResolution"; return "hkOsdInternalResolution";
case Config::HotKey::hkOsdRenderingResolution: case Config::HotKey::hkOsdRenderingResolution:
return "hkOsdRenderingResolution"; return "hkOsdRenderingResolution";
case Config::HotKey::hkForceGammaCorrection:
return "hkForceGammaCorrection";
} }
return nullptr; return nullptr;
} }

View File

@ -225,6 +225,7 @@ struct Config
hkOsdPercent, hkOsdPercent,
hkOsdInternalResolution, hkOsdInternalResolution,
hkOsdRenderingResolution, hkOsdRenderingResolution,
hkForceGammaCorrection,
hkTotal hkTotal
}; };

View File

@ -95,6 +95,8 @@ QString ConfigDialog::_hotkeyDescription(quint32 _idx) const
return tr("Toggle OSD internal resolution"); return tr("Toggle OSD internal resolution");
case Config::HotKey::hkOsdRenderingResolution: case Config::HotKey::hkOsdRenderingResolution:
return tr("Toggle OSD rendering resolution"); return tr("Toggle OSD rendering resolution");
case Config::HotKey::hkForceGammaCorrection:
return tr("Toggle force gamma correction");
} }
return tr("Unknown hotkey"); return tr("Unknown hotkey");
} }

View File

@ -187,6 +187,14 @@ static void checkHotkeys()
if (osal_is_key_pressed(config.hotkeys.keys[Config::hkOsdRenderingResolution], 0x0001)) { if (osal_is_key_pressed(config.hotkeys.keys[Config::hkOsdRenderingResolution], 0x0001)) {
config.onScreenDisplay.renderingResolution = !config.onScreenDisplay.renderingResolution; config.onScreenDisplay.renderingResolution = !config.onScreenDisplay.renderingResolution;
} }
if (osal_is_key_pressed(config.hotkeys.keys[Config::hkForceGammaCorrection], 0x0001)) {
if (config.gammaCorrection.force == 0)
dwnd().getDrawer().showMessage("Force gamma correction on\n", Milliseconds(750));
else
dwnd().getDrawer().showMessage("Force gamma correction off\n", Milliseconds(750));
config.gammaCorrection.force = !config.gammaCorrection.force;
}
} }
void VI_UpdateScreen() void VI_UpdateScreen()

View File

@ -45,6 +45,8 @@ const char* _hotkeyDescription(u32 _idx)
return "Hotkey: toggle OSD internal resolution"; return "Hotkey: toggle OSD internal resolution";
case Config::HotKey::hkOsdRenderingResolution: case Config::HotKey::hkOsdRenderingResolution:
return "Hotkey: toggle OSD rendering resolution"; return "Hotkey: toggle OSD rendering resolution";
case Config::HotKey::hkForceGammaCorrection:
return "Hotkey: toggle force gamma correction";
} }
return "Unknown hotkey"; return "Unknown hotkey";
} }