Removed frametime_alpha and replace it with an overall alpha for text and frametime

pull/58/head
FlightlessMango 4 years ago
parent ab9e3e2625
commit 77b3033cc7

@ -1013,6 +1013,7 @@ void position_layer(struct overlay_params& params, ImVec2 window_size, unsigned
ImGui::SetNextWindowSize(window_size, ImGuiCond_Always);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(8,-3));
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, params.alpha);
switch (params.position) {
case LAYER_POSITION_TOP_LEFT:
@ -1073,7 +1074,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
ImGui::TableNextCell();
right_aligned_text(char_width * 4, "%i", gpu_info.temp);
ImGui::SameLine(0, 1.0f);
ImGui::Text("°C");
ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, 1.0), "°C");
}
if (params.enabled[OVERLAY_PARAM_ENABLED_gpu_core_clock]){
ImGui::TableNextCell();
@ -1291,7 +1292,7 @@ static void compute_swapchain_display(struct swapchain_data *data)
position_layer(instance_data->params, data->window_size, data->width, data->height);
render_imgui(data->sw_stats, instance_data->params, data->window_size, data->width, data->height);
ImGui::PopStyleVar(2);
ImGui::PopStyleVar(3);
ImGui::EndFrame();
ImGui::Render();

@ -83,7 +83,7 @@ parse_background_alpha(const char *str)
}
static float
parse_frametime_alpha(const char *str)
parse_alpha(const char *str)
{
return strtof(str, NULL);
}
@ -310,7 +310,7 @@ parse_overlay_config(struct overlay_params *params,
params->offset_x = 0;
params->offset_y = 0;
params->background_alpha = 0.5;
params->frametime_alpha = 1.0;
params->alpha = 1.0;
params->time_format = "%T";
params->gpu_color = strtol("2e9762", NULL, 16);
params->cpu_color = strtol("2e97cb", NULL, 16);
@ -368,7 +368,7 @@ parse_overlay_config(struct overlay_params *params,
// Command buffer gets reused and timestamps cause hangs for some reason, force off for now
params->enabled[OVERLAY_PARAM_ENABLED_gpu_timing] = false;
// Convert from 0xRRGGBB to ImGui's format
std::array<unsigned *, 8> colors = {
std::array<unsigned *, 9> colors = {
&params->crosshair_color,
&params->cpu_color,
&params->gpu_color,
@ -377,6 +377,7 @@ parse_overlay_config(struct overlay_params *params,
&params->engine_color,
&params->io_color,
&params->background_color,
&params->frametime_color,
};
for (auto color : colors){
@ -387,12 +388,6 @@ parse_overlay_config(struct overlay_params *params,
255);
}
params->frametime_color =
IM_COL32(RGBGetRValue(params->frametime_color),
RGBGetGValue(params->frametime_color),
RGBGetBValue(params->frametime_color),
params->frametime_alpha * 255);
params->tableCols = 3;
if (!params->font_size) {

@ -89,9 +89,9 @@ extern "C" {
OVERLAY_PARAM_CUSTOM(ram_color) \
OVERLAY_PARAM_CUSTOM(engine_color) \
OVERLAY_PARAM_CUSTOM(frametime_color) \
OVERLAY_PARAM_CUSTOM(frametime_alpha) \
OVERLAY_PARAM_CUSTOM(background_color) \
OVERLAY_PARAM_CUSTOM(io_color) \
OVERLAY_PARAM_CUSTOM(alpha) \
OVERLAY_PARAM_CUSTOM(help)
enum overlay_param_position {
@ -129,7 +129,7 @@ struct overlay_params {
unsigned crosshair_color, cpu_color, gpu_color, vram_color, ram_color, engine_color, io_color, frametime_color, background_color;
unsigned tableCols;
float font_size;
float background_alpha, frametime_alpha;
float background_alpha, alpha;
KeySym toggle_hud;
KeySym toggle_logging;
KeySym refresh_config;

Loading…
Cancel
Save