From 1ceb7d02122826e36236aacbda6da8acc1d0cabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 7 Nov 2024 20:22:33 +0100 Subject: [PATCH] Fix incorrect rendering of menu and entities background maps Load the map images for the menu and entities background maps before the respective map layers. Otherwise, the total number of images is `0` when loading the layers, which causes the images of tiles and quads layers to be considered invalid during the initialization, which results in the wrong tile/quad memory layout being used. Regression from #9213. --- src/game/client/components/background.cpp | 4 +++- src/game/client/components/menu_background.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/background.cpp b/src/game/client/components/background.cpp index d0acd143e..73f658c61 100644 --- a/src/game/client/components/background.cpp +++ b/src/game/client/components/background.cpp @@ -80,9 +80,11 @@ void CBackground::LoadBackground() if(m_Loaded) { - CMapLayers::OnMapLoad(); if(NeedImageLoading) + { m_pImages->LoadBackground(m_pLayers, m_pMap); + } + CMapLayers::OnMapLoad(); } } } diff --git a/src/game/client/components/menu_background.cpp b/src/game/client/components/menu_background.cpp index aa63454e8..9d57db9c0 100644 --- a/src/game/client/components/menu_background.cpp +++ b/src/game/client/components/menu_background.cpp @@ -256,8 +256,8 @@ void CMenuBackground::LoadMenuBackground(bool HasDayHint, bool HasNightHint) { m_pLayers->Init(m_pMap, true); - CMapLayers::OnMapLoad(); m_pImages->LoadBackground(m_pLayers, m_pMap); + CMapLayers::OnMapLoad(); // look for custom positions CMapItemLayerTilemap *pTLayer = m_pLayers->GameLayer();