Remove render_mango as it's no longer needed

remotes/origin/pr/380^2
FlightlessMango 4 years ago
parent 9974992f7a
commit b9b20d1117

@ -13,8 +13,6 @@ void create_fonts(const overlay_params& params, ImFont*& small_font, ImFont*& te
float font_size_text = params.font_size_text;
if (font_size_text < FLT_EPSILON)
font_size_text = font_size;
if(params.render_mango)
font_size = 42;
static const ImWchar default_range[] =
{
0x0020, 0x00FF, // Basic Latin + Latin Supplement

@ -338,7 +338,6 @@ parse_font_glyph_ranges(const char *str)
#define parse_background_alpha(s) parse_float(s)
#define parse_alpha(s) parse_float(s)
#define parse_permit_upload(s) parse_unsigned(s)
#define parse_render_mango(s) parse_unsigned(s)
#define parse_cpu_color(s) parse_color(s)
#define parse_gpu_color(s) parse_color(s)
@ -522,7 +521,6 @@ parse_overlay_config(struct overlay_params *params,
params->log_interval = 100;
params->media_player_order = { MP_ORDER_TITLE, MP_ORDER_ARTIST, MP_ORDER_ALBUM };
params->permit_upload = 0;
params->render_mango = 0;
params->benchmark_percentiles = { "97", "AVG", "1", "0.1" };
params->gpu_load_value = { 90, 60 };
params->cpu_load_value = { 90, 60 };

@ -102,7 +102,6 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_CUSTOM(gpu_text) \
OVERLAY_PARAM_CUSTOM(log_interval) \
OVERLAY_PARAM_CUSTOM(permit_upload) \
OVERLAY_PARAM_CUSTOM(render_mango) \
OVERLAY_PARAM_CUSTOM(benchmark_percentiles) \
OVERLAY_PARAM_CUSTOM(help) \
OVERLAY_PARAM_CUSTOM(gpu_load_value) \
@ -174,7 +173,6 @@ struct overlay_params {
std::vector<unsigned> cpu_load_value;
unsigned media_player_color;
unsigned tableCols;
unsigned render_mango;
float font_size, font_scale;
float font_size_text;
float font_scale_media_player;

@ -915,82 +915,6 @@ void render_benchmark(swapchain_stats& data, struct overlay_params& params, ImVe
ImGui::End();
}
void render_mango(swapchain_stats& data, struct overlay_params& params, ImVec2& window_size, bool is_vulkan){
static int tableCols = 2;
static float ralign_width = 0, old_scale = 0;
window_size = ImVec2(300, params.height);
if (old_scale != params.font_scale) {
ralign_width = ImGui::CalcTextSize("A").x * 4 /* characters */;
old_scale = params.font_scale;
}
ImGui::Begin("Main", &open, ImGuiWindowFlags_NoDecoration);
ImGui::BeginTable("hud", tableCols);
if (params.enabled[OVERLAY_PARAM_ENABLED_gpu_stats]){
ImGui::TableNextRow();
const char* gpu_text;
if (params.gpu_text.empty())
gpu_text = "GPU";
else
gpu_text = params.gpu_text.c_str();
ImGui::TextColored(data.colors.gpu, "%s", gpu_text);
ImGui::TableNextCell();
right_aligned_text(data.colors.text, ralign_width, "%i", gpu_info.load);
ImGui::SameLine(0, 1.0f);
ImGui::Text("%%");
}
if(params.enabled[OVERLAY_PARAM_ENABLED_cpu_stats]){
ImGui::TableNextRow();
const char* cpu_text;
if (params.cpu_text.empty())
cpu_text = "CPU";
else
cpu_text = params.cpu_text.c_str();
ImGui::TextColored(data.colors.cpu, "%s", cpu_text);
ImGui::TableNextCell();
right_aligned_text(data.colors.text, ralign_width, "%d", int(cpuStats.GetCPUDataTotal().percent));
ImGui::SameLine(0, 1.0f);
ImGui::Text("%%");
}
if (params.enabled[OVERLAY_PARAM_ENABLED_fps]){
ImGui::TableNextRow();
ImGui::TextColored(data.colors.engine, "%s", is_vulkan ? data.engineName.c_str() : "OpenGL");
ImGui::TableNextCell();
right_aligned_text(data.colors.text, ralign_width, "%.0f", data.fps);
ImGui::SameLine(0, 1.0f);
ImGui::PushFont(data.font1);
ImGui::Text("FPS");
ImGui::PopFont();
}
ImGui::EndTable();
if (params.enabled[OVERLAY_PARAM_ENABLED_frame_timing]){
ImGui::Dummy(ImVec2(0.0f, 8.0f));
ImGui::PushFont(data.font1);
ImGui::TextColored(data.colors.engine, "%s", "Frametime");
ImGui::PopFont();
char hash[40];
snprintf(hash, sizeof(hash), "##%s", overlay_param_names[OVERLAY_PARAM_ENABLED_frame_timing]);
data.stat_selector = OVERLAY_PLOTS_frame_timing;
data.time_dividor = 1000.0f;
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
double min_time = 0.0f;
double max_time = 50.0f;
ImGui::PlotLines(hash, get_time_stat, &data,
ARRAY_SIZE(data.frames_stats), 0,
NULL, min_time, max_time,
ImVec2(ImGui::GetContentRegionAvailWidth(), 50));
ImGui::PopStyleColor();
}
if(logger->is_active())
ImGui::GetWindowDrawList()->AddCircleFilled(ImVec2(data.main_window_pos.x + window_size.x - 15, data.main_window_pos.y + 15), 10, params.engine_color, 20);
ImGui::End();
window_size = ImVec2(window_size.x, 200);
}
int change_on_load_temp (int info, int high, int med) {
if (info >= high) {
return 1;
@ -1359,12 +1283,7 @@ static void compute_swapchain_display(struct swapchain_data *data)
{
scoped_lock lk(instance_data->notifier.mutex);
position_layer(data->sw_stats, instance_data->params, data->window_size);
#ifdef __gnu_linux__
if(instance_data->params.render_mango)
render_mango(data->sw_stats, instance_data->params, data->window_size, true);
else
render_imgui(data->sw_stats, instance_data->params, data->window_size, true);
#endif
render_imgui(data->sw_stats, instance_data->params, data->window_size, true);
}
ImGui::PopStyleVar(3);

Loading…
Cancel
Save