mirror of https://github.com/PCSX2/pcsx2.git
Achievements: Fix UI crash with DX11
This commit is contained in:
parent
e782ddc143
commit
1eed8a2a86
|
@ -21,6 +21,7 @@
|
||||||
#include "CDVD/CDVD.h"
|
#include "CDVD/CDVD.h"
|
||||||
#include "Elfheader.h"
|
#include "Elfheader.h"
|
||||||
#include "Host.h"
|
#include "Host.h"
|
||||||
|
#include "GS/Renderers/Common/GSTexture.h"
|
||||||
#include "ImGui/FullscreenUI.h"
|
#include "ImGui/FullscreenUI.h"
|
||||||
#include "ImGui/ImGuiFullscreen.h"
|
#include "ImGui/ImGuiFullscreen.h"
|
||||||
#include "ImGui/ImGuiManager.h"
|
#include "ImGui/ImGuiManager.h"
|
||||||
|
@ -1881,7 +1882,7 @@ void Achievements::DrawGameOverlays()
|
||||||
GSTexture* badge = ImGuiFullscreen::GetCachedTextureAsync(indicator.badge_path.c_str());
|
GSTexture* badge = ImGuiFullscreen::GetCachedTextureAsync(indicator.badge_path.c_str());
|
||||||
if (badge)
|
if (badge)
|
||||||
{
|
{
|
||||||
dl->AddImage(badge, current_position, current_position + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
dl->AddImage(badge->GetNativeHandle(), current_position, current_position + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||||
current_position.x -= x_advance;
|
current_position.x -= x_advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1921,7 +1922,7 @@ void Achievements::DrawGameOverlays()
|
||||||
if (badge)
|
if (badge)
|
||||||
{
|
{
|
||||||
const ImVec2 badge_pos = box_min + ImVec2(padding, padding);
|
const ImVec2 badge_pos = box_min + ImVec2(padding, padding);
|
||||||
dl->AddImage(badge, badge_pos, badge_pos + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
dl->AddImage(badge->GetNativeHandle(), badge_pos, badge_pos + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), col);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImVec2 text_pos = box_min + ImVec2(padding + image_size.x + spacing, (box_max.y - box_min.y - text_size.y) * 0.5f);
|
const ImVec2 text_pos = box_min + ImVec2(padding + image_size.x + spacing, (box_max.y - box_min.y - text_size.y) * 0.5f);
|
||||||
|
@ -2019,7 +2020,7 @@ void Achievements::DrawPauseMenuOverlays()
|
||||||
if (!badge)
|
if (!badge)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
dl->AddImage(badge, position, position + image_size);
|
dl->AddImage(badge->GetNativeHandle(), position, position + image_size);
|
||||||
|
|
||||||
const char* achievement_title = indicator.achievement->title;
|
const char* achievement_title = indicator.achievement->title;
|
||||||
const char* achievement_title_end = achievement_title + std::strlen(indicator.achievement->title);
|
const char* achievement_title_end = achievement_title + std::strlen(indicator.achievement->title);
|
||||||
|
@ -2110,7 +2111,7 @@ void Achievements::DrawAchievementsWindow()
|
||||||
if (badge)
|
if (badge)
|
||||||
{
|
{
|
||||||
ImGui::GetWindowDrawList()->AddImage(
|
ImGui::GetWindowDrawList()->AddImage(
|
||||||
badge, icon_min, icon_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
badge->GetNativeHandle(), icon_min, icon_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2273,7 +2274,7 @@ void Achievements::DrawAchievement(const rc_client_achievement_t* cheevo)
|
||||||
if (badge)
|
if (badge)
|
||||||
{
|
{
|
||||||
ImGui::GetWindowDrawList()->AddImage(
|
ImGui::GetWindowDrawList()->AddImage(
|
||||||
badge, bb.Min, bb.Min + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
badge->GetNativeHandle(), bb.Min, bb.Min + image_size, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2421,7 +2422,7 @@ void Achievements::DrawLeaderboardsWindow()
|
||||||
if (badge)
|
if (badge)
|
||||||
{
|
{
|
||||||
ImGui::GetWindowDrawList()->AddImage(
|
ImGui::GetWindowDrawList()->AddImage(
|
||||||
badge, icon_min, icon_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
badge->GetNativeHandle(), icon_min, icon_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f), IM_COL32(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2712,7 +2713,7 @@ void Achievements::DrawLeaderboardEntry(const rc_client_leaderboard_entry_t& ent
|
||||||
if (icon_tex)
|
if (icon_tex)
|
||||||
{
|
{
|
||||||
ImGui::GetWindowDrawList()->AddImage(
|
ImGui::GetWindowDrawList()->AddImage(
|
||||||
reinterpret_cast<ImTextureID>(icon_tex), icon_bb.Min, icon_bb.Min + ImVec2(icon_size, icon_size));
|
icon_tex->GetNativeHandle(), icon_bb.Min, icon_bb.Min + ImVec2(icon_size, icon_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImRect user_bb(ImVec2(text_start_x + column_spacing + icon_size, bb.Min.y), ImVec2(bb.Max.x, midpoint));
|
const ImRect user_bb(ImVec2(text_start_x + column_spacing + icon_size, bb.Min.y), ImVec2(bb.Max.x, midpoint));
|
||||||
|
|
|
@ -2512,7 +2512,7 @@ void ImGuiFullscreen::DrawNotifications(ImVec2& position, float spacing)
|
||||||
GSTexture* tex = GetCachedTexture(notif.badge_path.c_str());
|
GSTexture* tex = GetCachedTexture(notif.badge_path.c_str());
|
||||||
if (tex)
|
if (tex)
|
||||||
{
|
{
|
||||||
dl->AddImage(tex, badge_min, badge_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f),
|
dl->AddImage(tex->GetNativeHandle(), badge_min, badge_max, ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f),
|
||||||
IM_COL32(255, 255, 255, opacity));
|
IM_COL32(255, 255, 255, opacity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue