diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp index ed30102f2a..85dddd2c21 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp @@ -96,6 +96,11 @@ namespace rsx if (background_image && background_image->get_data()) { result.add(background_poster.get_compiled()); + + if (background_overlay_image && background_overlay_image->get_data()) + { + result.add(background_overlay_poster.get_compiled()); + } } result.add(background.get_compiled()); @@ -357,15 +362,27 @@ namespace rsx if (!background_image) { + game_content_type background_content_type = game_content_type::background_picture; + for (game_content_type type : { game_content_type::background_picture, game_content_type::content_icon, game_content_type::overlay_picture }) { if (const std::string picture_path = rpcs3::utils::get_game_content_path(type); fs::is_file(picture_path)) { + background_content_type = type; background_image = std::make_unique(picture_path); dirty |= !!background_image->get_data(); break; } } + + if (background_image && !background_overlay_image && background_content_type == game_content_type::background_picture) + { + if (const std::string picture_path = rpcs3::utils::get_game_content_path(game_content_type::overlay_picture); fs::is_file(picture_path)) + { + background_overlay_image = std::make_unique(picture_path); + dirty |= !!background_overlay_image->get_data(); + } + } } if (dirty && background_image && background_image->get_data()) @@ -393,6 +410,17 @@ namespace rsx const int padding = (background_poster.w - static_cast(background_image->w * (background_poster.h / static_cast(background_image->h)))) / 2; background_poster.set_padding(padding, padding, 0, 0); } + + if (background_overlay_image && background_overlay_image->get_data()) + { + const f32 color = (100 - background_darkening_strength) / 100.f; + background_overlay_poster.fore_color = color4f(color, color, color, 1.); + + background_overlay_poster.set_pos(std::min(virtual_width - background_overlay_image->w, virtual_width * 2 / 3), (virtual_height - background_overlay_image->h) / 2); + background_overlay_poster.set_size(background_overlay_image->w, background_overlay_image->h); + background_overlay_poster.set_raw_image(background_overlay_image.get()); + background_overlay_poster.set_blur_strength(static_cast(background_blur_strength)); + } } } else @@ -402,6 +430,13 @@ namespace rsx background_poster.clear_image(); background_image.reset(); } + + if (background_overlay_image) + { + background_overlay_poster.clear_image(); + background_overlay_image.reset(); + } + background.back_color.a = 0.85f; } } diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h index 933510e5c6..171dd80fac 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h @@ -16,8 +16,10 @@ namespace rsx image_button btn_ok; image_button btn_cancel; - overlay_element bottom_bar, background; + overlay_element bottom_bar; + overlay_element background; image_view background_poster; + image_view background_overlay_poster; std::array progress_bars{}; u8 num_progress_bars = 0; s32 taskbar_index = 0; @@ -31,6 +33,7 @@ namespace rsx u32 background_blur_strength = 0; u32 background_darkening_strength = 0; std::unique_ptr background_image; + std::unique_ptr background_overlay_image; animation_color_interpolate fade_animation;