mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 22:58:50 +00:00
Merge 79ff4420d9
into db285b7c87
This commit is contained in:
commit
3e2122ac3a
5 changed files with 15 additions and 11 deletions
|
@ -107,6 +107,7 @@
|
||||||
#define DUALSHOCKUDPCLIENT_CONFIG "DSUClient.ini"
|
#define DUALSHOCKUDPCLIENT_CONFIG "DSUClient.ini"
|
||||||
#define FREELOOK_CONFIG "FreeLook.ini"
|
#define FREELOOK_CONFIG "FreeLook.ini"
|
||||||
#define RETROACHIEVEMENTS_CONFIG "RetroAchievements.ini"
|
#define RETROACHIEVEMENTS_CONFIG "RetroAchievements.ini"
|
||||||
|
#define IMGUI_CONFIG "ImGui.ini"
|
||||||
|
|
||||||
// Files in the directory returned by GetUserPath(D_LOGS_IDX)
|
// Files in the directory returned by GetUserPath(D_LOGS_IDX)
|
||||||
#define MAIN_LOG "dolphin.log"
|
#define MAIN_LOG "dolphin.log"
|
||||||
|
|
|
@ -898,6 +898,7 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
||||||
s_user_paths[F_FREELOOKCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + FREELOOK_CONFIG;
|
s_user_paths[F_FREELOOKCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + FREELOOK_CONFIG;
|
||||||
s_user_paths[F_RETROACHIEVEMENTSCONFIG_IDX] =
|
s_user_paths[F_RETROACHIEVEMENTSCONFIG_IDX] =
|
||||||
s_user_paths[D_CONFIG_IDX] + RETROACHIEVEMENTS_CONFIG;
|
s_user_paths[D_CONFIG_IDX] + RETROACHIEVEMENTS_CONFIG;
|
||||||
|
s_user_paths[F_IMGUICONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + IMGUI_CONFIG;
|
||||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||||
s_user_paths[F_MEM1DUMP_IDX] = s_user_paths[D_DUMP_IDX] + MEM1_DUMP;
|
s_user_paths[F_MEM1DUMP_IDX] = s_user_paths[D_DUMP_IDX] + MEM1_DUMP;
|
||||||
s_user_paths[F_MEM2DUMP_IDX] = s_user_paths[D_DUMP_IDX] + MEM2_DUMP;
|
s_user_paths[F_MEM2DUMP_IDX] = s_user_paths[D_DUMP_IDX] + MEM2_DUMP;
|
||||||
|
@ -935,6 +936,7 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
||||||
s_user_paths[F_FREELOOKCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + FREELOOK_CONFIG;
|
s_user_paths[F_FREELOOKCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + FREELOOK_CONFIG;
|
||||||
s_user_paths[F_RETROACHIEVEMENTSCONFIG_IDX] =
|
s_user_paths[F_RETROACHIEVEMENTSCONFIG_IDX] =
|
||||||
s_user_paths[D_CONFIG_IDX] + RETROACHIEVEMENTS_CONFIG;
|
s_user_paths[D_CONFIG_IDX] + RETROACHIEVEMENTS_CONFIG;
|
||||||
|
s_user_paths[F_IMGUICONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + IMGUI_CONFIG;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case D_CACHE_IDX:
|
case D_CACHE_IDX:
|
||||||
|
|
|
@ -96,6 +96,7 @@ enum
|
||||||
F_FREELOOKCONFIG_IDX,
|
F_FREELOOKCONFIG_IDX,
|
||||||
F_GBABIOS_IDX,
|
F_GBABIOS_IDX,
|
||||||
F_RETROACHIEVEMENTSCONFIG_IDX,
|
F_RETROACHIEVEMENTSCONFIG_IDX,
|
||||||
|
F_IMGUICONFIG_IDX,
|
||||||
NUM_PATH_INDICES
|
NUM_PATH_INDICES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "VideoCommon/OnScreenUI.h"
|
#include "VideoCommon/OnScreenUI.h"
|
||||||
|
|
||||||
#include "Common/EnumMap.h"
|
#include "Common/EnumMap.h"
|
||||||
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/Profiler.h"
|
#include "Common/Profiler.h"
|
||||||
#include "Common/Timer.h"
|
#include "Common/Timer.h"
|
||||||
|
|
||||||
|
@ -54,8 +55,7 @@ bool OnScreenUI::Initialize(u32 width, u32 height, float scale)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't create an ini file. TODO: Do we want this in the future?
|
ImGui::GetIO().IniFilename = File::GetUserPath(F_IMGUICONFIG_IDX).data();
|
||||||
ImGui::GetIO().IniFilename = nullptr;
|
|
||||||
SetScale(scale);
|
SetScale(scale);
|
||||||
|
|
||||||
PortableVertexDeclaration vdecl = {};
|
PortableVertexDeclaration vdecl = {};
|
||||||
|
|
|
@ -83,10 +83,9 @@ double PerformanceMetrics::GetLastSpeedDenominator() const
|
||||||
void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
{
|
{
|
||||||
const float bg_alpha = 0.7f;
|
const float bg_alpha = 0.7f;
|
||||||
const auto imgui_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoInputs |
|
const auto imgui_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar |
|
||||||
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings |
|
ImGuiWindowFlags_NoNav | ImGuiWindowFlags_AlwaysAutoResize |
|
||||||
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoNav |
|
ImGuiWindowFlags_NoFocusOnAppearing;
|
||||||
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing;
|
|
||||||
|
|
||||||
const double fps = GetFPS();
|
const double fps = GetFPS();
|
||||||
const double vps = GetVPS();
|
const double vps = GetVPS();
|
||||||
|
@ -119,7 +118,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 4.f * backbuffer_scale));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 4.f * backbuffer_scale));
|
||||||
|
|
||||||
// Position in the top-right corner of the screen.
|
// Position in the top-right corner of the screen.
|
||||||
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_Always, ImVec2(1.0f, 0.0f));
|
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f));
|
||||||
ImGui::SetNextWindowSize(ImVec2(graph_width, graph_height));
|
ImGui::SetNextWindowSize(ImVec2(graph_width, graph_height));
|
||||||
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
||||||
window_y += graph_height + window_padding;
|
window_y += graph_height + window_padding;
|
||||||
|
@ -161,7 +160,8 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
DT_ms(std::max(m_fps_counter.GetSampleWindow(), m_vps_counter.GetSampleWindow())).count();
|
DT_ms(std::max(m_fps_counter.GetSampleWindow(), m_vps_counter.GetSampleWindow())).count();
|
||||||
|
|
||||||
if (ImPlot::BeginPlot("PerformanceGraphs", ImVec2(-1.0, -1.0),
|
if (ImPlot::BeginPlot("PerformanceGraphs", ImVec2(-1.0, -1.0),
|
||||||
ImPlotFlags_NoFrame | ImPlotFlags_NoTitle | ImPlotFlags_NoMenus))
|
ImPlotFlags_NoFrame | ImPlotFlags_NoTitle | ImPlotFlags_NoMenus |
|
||||||
|
ImPlotFlags_NoInputs))
|
||||||
{
|
{
|
||||||
ImPlot::PushStyleColor(ImPlotCol_PlotBg, {0, 0, 0, 0});
|
ImPlot::PushStyleColor(ImPlotCol_PlotBg, {0, 0, 0, 0});
|
||||||
ImPlot::PushStyleColor(ImPlotCol_LegendBg, {0, 0, 0, 0.2f});
|
ImPlot::PushStyleColor(ImPlotCol_LegendBg, {0, 0, 0, 0.2f});
|
||||||
|
@ -192,7 +192,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
// Position in the top-right corner of the screen.
|
// Position in the top-right corner of the screen.
|
||||||
float window_height = 47.f * backbuffer_scale;
|
float window_height = 47.f * backbuffer_scale;
|
||||||
|
|
||||||
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_Always, ImVec2(1.0f, 0.0f));
|
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f));
|
||||||
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
|
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
|
||||||
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
float window_height = (12.f + 17.f * count) * backbuffer_scale;
|
float window_height = (12.f + 17.f * count) * backbuffer_scale;
|
||||||
|
|
||||||
// Position in the top-right corner of the screen.
|
// Position in the top-right corner of the screen.
|
||||||
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_Always, ImVec2(1.0f, 0.0f));
|
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f));
|
||||||
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
|
ImGui::SetNextWindowSize(ImVec2(window_width, window_height));
|
||||||
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ void PerformanceMetrics::DrawImGuiStats(const float backbuffer_scale)
|
||||||
float window_height = (12.f + 17.f * count) * backbuffer_scale;
|
float window_height = (12.f + 17.f * count) * backbuffer_scale;
|
||||||
|
|
||||||
// Position in the top-right corner of the screen.
|
// Position in the top-right corner of the screen.
|
||||||
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_Always, ImVec2(1.0f, 0.0f));
|
ImGui::SetNextWindowPos(ImVec2(window_x, window_y), ImGuiCond_FirstUseEver, ImVec2(1.0f, 0.0f));
|
||||||
ImGui::SetNextWindowSize(ImVec2(window_width, (12.f + 17.f * count) * backbuffer_scale));
|
ImGui::SetNextWindowSize(ImVec2(window_width, (12.f + 17.f * count) * backbuffer_scale));
|
||||||
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
ImGui::SetNextWindowBgAlpha(bg_alpha);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue