renderer: Add a missing texture asset and a user check

When an asset is missing, instead of a black screen, render an obnoxious, yet standard, missing texture.

Additionally, warn the user assets failed to load.

Shoutout to Arch for having their assets broken for months. Fix your shit. I am tired of it, and it's negatively impacting users.
This commit is contained in:
Vaxry
2024-11-01 15:52:03 +00:00
parent 3852418d24
commit d8b865366a
5 changed files with 139 additions and 71 deletions

View File

@@ -1063,22 +1063,16 @@ void CHyprRenderer::renderSessionLockMissing(PHLMONITOR pMonitor) {
if (ANY_PRESENT) {
// render image2, without instructions. Lock still "alive", unless texture dead
if (g_pHyprOpenGL->m_pLockDead2Texture)
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockDead2Texture, &monbox, ALPHA);
else
g_pHyprOpenGL->renderRect(&monbox, CColor(1.0, 0.2, 0.2, ALPHA));
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockDead2Texture, &monbox, ALPHA);
} else {
// render image, with instructions. Lock is gone.
if (g_pHyprOpenGL->m_pLockDeadTexture) {
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockDeadTexture, &monbox, ALPHA);
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockDeadTexture, &monbox, ALPHA);
// also render text for the tty number
if (g_pHyprOpenGL->m_pLockTtyTextTexture) {
CBox texbox = {{}, g_pHyprOpenGL->m_pLockTtyTextTexture->m_vSize};
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockTtyTextTexture, &texbox, 1.F);
}
} else
g_pHyprOpenGL->renderRect(&monbox, CColor(1.0, 0.2, 0.2, ALPHA));
// also render text for the tty number
if (g_pHyprOpenGL->m_pLockTtyTextTexture) {
CBox texbox = {{}, g_pHyprOpenGL->m_pLockTtyTextTexture->m_vSize};
g_pHyprOpenGL->renderTexture(g_pHyprOpenGL->m_pLockTtyTextTexture, &texbox, 1.F);
}
}
if (ALPHA < 1.f) /* animate */