From 2e5375a646887d03c689b9cd53c5141a46ca3ebf Mon Sep 17 00:00:00 2001 From: kaczy Date: Sat, 23 Dec 2023 13:42:49 +0100 Subject: [PATCH] Better loading of background image --- CentrED/Map/MapManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CentrED/Map/MapManager.cs b/CentrED/Map/MapManager.cs index bb46de1..fa291bd 100644 --- a/CentrED/Map/MapManager.cs +++ b/CentrED/Map/MapManager.cs @@ -92,8 +92,12 @@ public MapManager(GraphicsDevice gd) DepthFormat.Depth24 ); _spriteBatch = new SpriteBatch(gd); - _background = CEDGame.Content.Load("background"); - + + using (var fileStream = File.OpenRead("background.png")) + { + _background = Texture2D.FromStream(gd, fileStream); + } + Client = CEDClient; Client.LandTileReplaced += (tile, newId) => { LandTiles[tile.X, tile.Y].UpdateId(newId); }; Client.LandTileElevated += (tile, newZ) =>