mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Make imdebugger visibility a config option instead of emuscreen state
This commit is contained in:
parent
df104e7e31
commit
39a07a033c
@ -206,6 +206,7 @@ static const ConfigSetting generalSettings[] = {
|
||||
ConfigSetting("IgnoreBadMemAccess", &g_Config.bIgnoreBadMemAccess, true, CfgFlag::DEFAULT),
|
||||
ConfigSetting("CurrentDirectory", &g_Config.currentDirectory, "", CfgFlag::DEFAULT),
|
||||
ConfigSetting("ShowDebuggerOnLoad", &g_Config.bShowDebuggerOnLoad, false, CfgFlag::DEFAULT),
|
||||
ConfigSetting("ShowImDebugger", &g_Config.bShowImDebugger, false, CfgFlag::DONT_SAVE),
|
||||
ConfigSetting("CheckForNewVersion", &g_Config.bCheckForNewVersion, true, CfgFlag::DEFAULT),
|
||||
ConfigSetting("Language", &g_Config.sLanguageIni, &DefaultLangRegion, CfgFlag::DEFAULT),
|
||||
ConfigSetting("ForceLagSync2", &g_Config.bForceLagSync, false, CfgFlag::PER_GAME),
|
||||
|
@ -190,6 +190,8 @@ public:
|
||||
bool bIgnoreScreenInsets; // Android: Center screen disregarding insets if this is enabled.
|
||||
bool bVSync;
|
||||
|
||||
bool bShowImDebugger;
|
||||
|
||||
int iFrameSkip;
|
||||
int iFrameSkipType;
|
||||
int iFastForwardMode; // See FastForwardMode in ConfigValues.h.
|
||||
|
@ -656,7 +656,7 @@ bool EmuScreen::UnsyncTouch(const TouchInput &touch) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!(imguiVisible_ && imguiInited_)) {
|
||||
if (!(g_Config.bShowImDebugger && imguiInited_)) {
|
||||
GamepadTouch();
|
||||
}
|
||||
|
||||
@ -673,7 +673,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
switch (virtualKeyCode) {
|
||||
case VIRTKEY_TOGGLE_DEBUGGER:
|
||||
if (down) {
|
||||
imguiVisible_ = !imguiVisible_;
|
||||
g_Config.bShowImDebugger = !g_Config.bShowImDebugger;
|
||||
}
|
||||
break;
|
||||
case VIRTKEY_FASTFORWARD:
|
||||
@ -952,10 +952,10 @@ void EmuScreen::onVKeyAnalog(int virtualKeyCode, float value) {
|
||||
|
||||
bool EmuScreen::UnsyncKey(const KeyInput &key) {
|
||||
System_Notify(SystemNotification::ACTIVITY);
|
||||
if (UI::IsFocusMovementEnabled() || (imguiVisible_ && imguiInited_)) {
|
||||
if (UI::IsFocusMovementEnabled() || (g_Config.bShowImDebugger && imguiInited_)) {
|
||||
// Note: Allow some Vkeys through, so we can toggle the imgui for example (since we actually block the control mapper otherwise in imgui mode).
|
||||
// We need to manually implement it here :/
|
||||
if (imguiVisible_ && imguiInited_ && (key.flags & (KEY_UP | KEY_DOWN))) {
|
||||
if (g_Config.bShowImDebugger && imguiInited_ && (key.flags & (KEY_UP | KEY_DOWN))) {
|
||||
InputMapping mapping(key.deviceId, key.keyCode);
|
||||
std::vector<int> pspButtons;
|
||||
bool mappingFound = KeyMap::InputMappingToPspButton(mapping, &pspButtons);
|
||||
@ -976,7 +976,7 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) {
|
||||
bool EmuScreen::key(const KeyInput &key) {
|
||||
bool retval = UIScreen::key(key);
|
||||
|
||||
if (!retval && imguiVisible_ && imguiInited_) {
|
||||
if (!retval && g_Config.bShowImDebugger && imguiInited_) {
|
||||
ImGui_ImplPlatform_KeyEvent(key);
|
||||
}
|
||||
|
||||
@ -993,7 +993,7 @@ bool EmuScreen::key(const KeyInput &key) {
|
||||
}
|
||||
|
||||
void EmuScreen::touch(const TouchInput &touch) {
|
||||
if (imguiVisible_ && imguiInited_) {
|
||||
if (g_Config.bShowImDebugger && imguiInited_) {
|
||||
ImGui_ImplPlatform_TouchEvent(touch);
|
||||
} else {
|
||||
UIScreen::touch(touch);
|
||||
@ -1637,13 +1637,14 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||
darken();
|
||||
}
|
||||
|
||||
if (imguiVisible_ && !imguiInited_) {
|
||||
if (g_Config.bShowImDebugger) {
|
||||
if (!imguiInited_) {
|
||||
imguiInited_ = true;
|
||||
imDebugger_ = std::make_unique<ImDebugger>();
|
||||
ImGui_ImplThin3d_Init(draw);
|
||||
}
|
||||
|
||||
if (imguiVisible_ && imguiInited_ && PSP_IsInited()) {
|
||||
if (PSP_IsInited()) {
|
||||
_dbg_assert_(imDebugger_);
|
||||
|
||||
ImGui_ImplPlatform_NewFrame();
|
||||
@ -1655,6 +1656,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||
ImGui::Render();
|
||||
ImGui_ImplThin3d_RenderDrawData(ImGui::GetDrawData(), draw);
|
||||
}
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -134,5 +134,4 @@ private:
|
||||
std::unique_ptr<ImDebugger> imDebugger_ = nullptr;
|
||||
|
||||
bool imguiInited_ = false;
|
||||
bool imguiVisible_ = false;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user