frame_timing: don't use implot for horizontal

pull/1199/head
flightlessmango 5 months ago
parent 1d357e17c8
commit 53281f3f2c

@ -789,28 +789,36 @@ void HudElements::frame_timing(){
NULL, min_time, max_time, NULL, min_time, max_time,
ImVec2(width, height)); ImVec2(width, height));
#else #else
if (ImPlot::BeginPlot("My Plot", ImVec2(width, height), ImPlotFlags_CanvasOnly | ImPlotFlags_NoInputs)) {
ImPlotStyle& style = ImPlot::GetStyle(); if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_horizontal]) {
style.Colors[ImPlotCol_PlotBg] = ImVec4(0.92f, 0.92f, 0.95f, 0.00f); ImGui::PlotLines(hash, get_time_stat, HUDElements.sw_stats,
style.Colors[ImPlotCol_AxisGrid] = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); ARRAY_SIZE(HUDElements.sw_stats->frames_stats), 0,
style.Colors[ImPlotCol_AxisTick] = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); NULL, min_time, max_time,
ImPlotAxisFlags ax_flags_x = ImPlotAxisFlags_NoDecorations; ImVec2(width, height));
ImPlotAxisFlags ax_flags_y = ImPlotAxisFlags_NoDecorations; } else {
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_frame_timing_detailed]) if (ImPlot::BeginPlot("My Plot", ImVec2(width, height), ImPlotFlags_CanvasOnly | ImPlotFlags_NoInputs)) {
ax_flags_y = ImPlotAxisFlags_Opposite | ImPlotAxisFlags_NoMenus; ImPlotStyle& style = ImPlot::GetStyle();
style.Colors[ImPlotCol_PlotBg] = ImVec4(0.92f, 0.92f, 0.95f, 0.00f);
ImPlot::SetupAxes(nullptr, nullptr, ax_flags_x, ax_flags_y); style.Colors[ImPlotCol_AxisGrid] = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);
ImPlot::SetupAxisScale(ImAxis_Y1, TransformForward_Custom, TransformInverse_Custom); style.Colors[ImPlotCol_AxisTick] = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);
ImPlot::SetupAxesLimits(0, 200, min_time, max_time); ImPlotAxisFlags ax_flags_x = ImPlotAxisFlags_NoDecorations;
ImPlot::SetNextLineStyle(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), 1.5); ImPlotAxisFlags ax_flags_y = ImPlotAxisFlags_NoDecorations;
ImPlot::PlotLine("frametime line", frametime_data.data(), frametime_data.size()); if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_frame_timing_detailed])
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_throttling_status_graph] && throttling){ ax_flags_y = ImPlotAxisFlags_Opposite | ImPlotAxisFlags_NoMenus;
ImPlot::SetNextLineStyle(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), 1.5);
ImPlot::PlotLine("power line", throttling->power.data(), throttling->power.size()); ImPlot::SetupAxes(nullptr, nullptr, ax_flags_x, ax_flags_y);
ImPlot::SetNextLineStyle(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 1.5); ImPlot::SetupAxisScale(ImAxis_Y1, TransformForward_Custom, TransformInverse_Custom);
ImPlot::PlotLine("thermal line", throttling->thermal.data(), throttling->thermal.size()); ImPlot::SetupAxesLimits(0, 200, min_time, max_time);
ImPlot::SetNextLineStyle(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), 1.5);
ImPlot::PlotLine("frametime line", frametime_data.data(), frametime_data.size());
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_throttling_status_graph] && throttling){
ImPlot::SetNextLineStyle(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), 1.5);
ImPlot::PlotLine("power line", throttling->power.data(), throttling->power.size());
ImPlot::SetNextLineStyle(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 1.5);
ImPlot::PlotLine("thermal line", throttling->thermal.data(), throttling->thermal.size());
}
ImPlot::EndPlot();
} }
ImPlot::EndPlot();
} }
#endif #endif
} }

Loading…
Cancel
Save