diff --git a/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj b/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj index 24d3407..10329cf 100644 --- a/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj +++ b/RecrownedAthenaeum.Pipeline/RecrownedAthenaeum.Pipeline.csproj @@ -33,11 +33,11 @@ bin\Release\RecrownedAthenaeum.Pipeline.xml - - ..\packages\MonoGame.Framework.Portable.3.7.0.1708\lib\portable-net45+win8+wpa81\MonoGame.Framework.dll + + ..\packages\MonoGame.Framework.Portable.3.7.1.189\lib\portable-net45+win8+wpa81\MonoGame.Framework.dll - - ..\packages\MonoGame.Framework.Content.Pipeline.Portable.3.7.0.1708\lib\portable-net45+win8+wpa81\MonoGame.Framework.Content.Pipeline.dll + + ..\packages\MonoGame.Framework.Content.Pipeline.Portable.3.7.1.189\lib\portable-net45+win8+wpa81\MonoGame.Framework.Content.Pipeline.dll ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/RecrownedAthenaeum.Pipeline/packages.config b/RecrownedAthenaeum.Pipeline/packages.config index 60ec3da..a03f32b 100644 --- a/RecrownedAthenaeum.Pipeline/packages.config +++ b/RecrownedAthenaeum.Pipeline/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs b/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs index 7fd41e3..0fe225b 100644 --- a/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs +++ b/RecrownedAthenaeum/ContentSystem/ContentManagerController.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; using RecrownedAthenaeum.ContentSystem; using System; using System.Collections.Generic; @@ -15,7 +16,7 @@ namespace RecrownedAthenaeum.ContentSystem Thread thread; readonly ContentManager contentManager; readonly Queue queue; - Dictionary assets; + Dictionary assets; /// /// Path modifiers to change the path in which the content manager looks to load a file. Used for better organizing things while not needing to type entire path. /// @@ -44,7 +45,7 @@ namespace RecrownedAthenaeum.ContentSystem public ContentManagerController(ContentManager contentManager) { this.contentManager = contentManager; - assets = new Dictionary(); + assets = new Dictionary(); queue = new Queue(); contentPathModifier = new Dictionary(); } @@ -59,13 +60,14 @@ namespace RecrownedAthenaeum.ContentSystem if (contentPathModifier.ContainsKey(type)) { handler = contentPathModifier[type]; - } else + } + else { handler = normalPathModifier; } path = handler.Modify(assetName); } - assets.Add(assetName, contentManager.Load(path)); + assets.Add(assetName, contentManager.Load(path)); } @@ -89,7 +91,7 @@ namespace RecrownedAthenaeum.ContentSystem /// The type of the asset to be queued. /// Name of asset to look for. /// Whether or not to use the path modifiers. - public void Queue(string assetName, bool usePathModifier = true) where T : IDisposable + public void Queue(string assetName, bool usePathModifier = true) { lock (queue) { @@ -145,7 +147,10 @@ namespace RecrownedAthenaeum.ContentSystem { if (assets.ContainsKey(name)) { - assets[name].Dispose(); + if (assets[name] is IDisposable) + { + ((IDisposable)assets[name]).Dispose(); + } assets.Remove(name); } }