1
0
mirror of synced 2025-01-18 17:14:13 +01:00

ui: Fixed graphics artifacts on welcome screen

This commit is contained in:
WerWolv 2022-09-05 14:16:31 +02:00
parent 7312908d4d
commit cb682b6e21
3 changed files with 7 additions and 6 deletions

View File

@ -99,7 +99,7 @@
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices). // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details. // Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int #define ImDrawIdx unsigned int
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList; //struct ImDrawList;

View File

@ -208,7 +208,7 @@ namespace hex {
namespace ImHexApi::Provider { namespace ImHexApi::Provider {
static u32 s_currentProvider = std::numeric_limits<u32>::max(); static i64 s_currentProvider = -1;
static std::vector<prv::Provider *> s_providers; static std::vector<prv::Provider *> s_providers;
namespace impl { namespace impl {
@ -247,7 +247,7 @@ namespace hex {
} }
bool isValid() { bool isValid() {
return !s_providers.empty() && s_currentProvider < s_providers.size(); return !s_providers.empty() && s_currentProvider < i64(s_providers.size());
} }
void markDirty() { void markDirty() {

View File

@ -369,8 +369,6 @@ namespace hex::plugin::builtin {
} }
static void drawNoViewsBackground() { static void drawNoViewsBackground() {
if (isAnyViewOpen() && ImHexApi::Provider::isValid()) return;
if (ImGui::Begin("ImHexDockSpace")) { if (ImGui::Begin("ImHexDockSpace")) {
static char title[256]; static char title[256];
ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock")); ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock"));
@ -395,7 +393,10 @@ namespace hex::plugin::builtin {
updateRecentProviders(); updateRecentProviders();
(void)EventManager::subscribe<EventFrameBegin>(drawWelcomeScreen); (void)EventManager::subscribe<EventFrameBegin>(drawWelcomeScreen);
(void)EventManager::subscribe<EventFrameBegin>(drawNoViewsBackground); (void)EventManager::subscribe<EventFrameBegin>([]{
if (ImHexApi::Provider::isValid() && !isAnyViewOpen())
drawNoViewsBackground();
});
(void)EventManager::subscribe<EventSettingsChanged>([]() { (void)EventManager::subscribe<EventSettingsChanged>([]() {
{ {