mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Fix custom UI backgrounds again by initializing lazily (turned out to be the cause of #10662)
This commit is contained in:
parent
1e940f4973
commit
18db8b0bd6
@ -71,6 +71,8 @@ static const uint32_t colors[4] = {
|
||||
|
||||
static std::unique_ptr<ManagedTexture> bgTexture;
|
||||
|
||||
static bool backgroundInited;
|
||||
|
||||
void UIBackgroundInit(UIContext &dc) {
|
||||
const std::string bgPng = GetSysDirectory(DIRECTORY_SYSTEM) + "background.png";
|
||||
const std::string bgJpg = GetSysDirectory(DIRECTORY_SYSTEM) + "background.jpg";
|
||||
@ -82,9 +84,15 @@ void UIBackgroundInit(UIContext &dc) {
|
||||
|
||||
void UIBackgroundShutdown() {
|
||||
bgTexture.reset(nullptr);
|
||||
backgroundInited = false;
|
||||
}
|
||||
|
||||
void DrawBackground(UIContext &dc, float alpha) {
|
||||
if (!backgroundInited) {
|
||||
UIBackgroundInit(dc);
|
||||
backgroundInited = true;
|
||||
}
|
||||
|
||||
static float xbase[100] = {0};
|
||||
static float ybase[100] = {0};
|
||||
float xres = dc.GetBounds().w;
|
||||
|
@ -664,8 +664,6 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
|
||||
screenManager->setDrawContext(g_draw);
|
||||
screenManager->setPostRenderCallback(&RenderOverlays, nullptr);
|
||||
|
||||
UIBackgroundInit(*uiContext);
|
||||
|
||||
#ifdef _WIN32
|
||||
winAudioBackend = CreateAudioBackend((AudioBackendType)g_Config.iAudioBackend);
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
|
Loading…
x
Reference in New Issue
Block a user