Skip to content

Commit

Permalink
now MapManager can load the background itself :)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Nov 9, 2023
1 parent 38cd621 commit 451abd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions CentrED/CentrEDGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ protected override void Initialize()

NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, "x64", "zlib.dll"));
Log.Start(LogTypes.All);
var background = Content.Load<Texture2D>("background");
MapManager = new MapManager(_gdm.GraphicsDevice, background);
MapManager = new MapManager(_gdm.GraphicsDevice);
UIManager = new UIManager(_gdm.GraphicsDevice);

base.Initialize();
Expand Down
7 changes: 4 additions & 3 deletions CentrED/Map/MapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using static CentrED.Application;

namespace CentrED.Map;

Expand Down Expand Up @@ -70,7 +71,7 @@ private void DarkenTexture(ushort[] pixels)
}
}

public MapManager(GraphicsDevice gd, Texture2D background)
public MapManager(GraphicsDevice gd)
{
_gfxDevice = gd;
_mapEffect = new MapEffect(gd);
Expand All @@ -92,9 +93,9 @@ public MapManager(GraphicsDevice gd, Texture2D background)
DepthFormat.Depth24);
_postProcessRenderer = new PostProcessRenderer(gd);
_spriteBatch = new SpriteBatch(gd);
_background = background;
_background = CEDGame.Content.Load<Texture2D>("background");

Client = Application.CEDClient;
Client = CEDClient;
Client.LandTileReplaced += (tile, newId) => {
LandTiles.Find(l => l.LandTile.Equals(tile))?.UpdateId(newId);
};
Expand Down

0 comments on commit 451abd6

Please sign in to comment.