| 574 | } |
| 575 | |
| 576 | static void HandleHotkeyActions() |
| 577 | { |
| 578 | // Save screenshot. |
| 579 | static bool dbScreenshot = true; |
| 580 | if ((KeyMap[OIS::KC_SYSRQ] || KeyMap[OIS::KC_F12]) && dbScreenshot) |
| 581 | g_Renderer.SaveScreenshot(); |
| 582 | dbScreenshot = !(KeyMap[OIS::KC_SYSRQ] || KeyMap[OIS::KC_F12]); |
| 583 | |
| 584 | // Toggle fullscreen. |
| 585 | static bool dbFullscreen = true; |
| 586 | if ((KeyMap[OIS::KC_LMENU] || KeyMap[OIS::KC_RMENU]) && KeyMap[OIS::KC_RETURN] && dbFullscreen) |
| 587 | { |
| 588 | g_Configuration.EnableWindowedMode = !g_Configuration.EnableWindowedMode; |
| 589 | SaveConfiguration(); |
| 590 | g_Renderer.ToggleFullScreen(); |
| 591 | } |
| 592 | dbFullscreen = !((KeyMap[OIS::KC_LMENU] || KeyMap[OIS::KC_RMENU]) && KeyMap[OIS::KC_RETURN]); |
| 593 | |
| 594 | if (!DebugMode) |
| 595 | return; |
| 596 | |
| 597 | // Switch debug page. |
| 598 | static bool dbDebugPage = true; |
| 599 | if ((KeyMap[OIS::KC_F10] || KeyMap[OIS::KC_F11]) && dbDebugPage) |
| 600 | g_Renderer.SwitchDebugPage(KeyMap[OIS::KC_F10]); |
| 601 | dbDebugPage = !(KeyMap[OIS::KC_F10] || KeyMap[OIS::KC_F11]); |
| 602 | |
| 603 | // Cycle pathfinding display with TAB when on pathfinding debug page. |
| 604 | static bool dbPathfindingCycle = true; |
| 605 | if (KeyMap[OIS::KC_TAB] && dbPathfindingCycle && |
| 606 | g_Renderer.GetDebugPage() == RendererDebugPage::PathfindingStats) |
| 607 | { |
| 608 | CyclePathfindingDisplay(); |
| 609 | } |
| 610 | dbPathfindingCycle = !KeyMap[OIS::KC_TAB]; |
| 611 | |
| 612 | // Reload shaders. |
| 613 | static bool dbReloadShaders = true; |
| 614 | if (KeyMap[OIS::KC_F9] && dbReloadShaders) |
| 615 | g_Renderer.ReloadShaders(); |
| 616 | dbReloadShaders = !KeyMap[OIS::KC_F9]; |
| 617 | } |
| 618 | |
| 619 | static void UpdateRumble() |
| 620 | { |
no test coverage detected