content system now has done check; cleaned assets;

This commit is contained in:
2018-09-12 21:39:21 -05:00
parent e45d998c3a
commit 71600738d4
12 changed files with 21 additions and 350 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,8 +11,8 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem
{
class ContentSystem
{
volatile bool queued;
Thread thread;
internal volatile bool loading;
readonly ContentManager contentManager;
readonly Queue<ContentLoad> queue;
Dictionary<string, IDisposable> assets;
@@ -41,6 +42,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem
ContentLoad content = queue.Dequeue();
Load(content.assetName, content.type);
}
queued = false;
}
}
@@ -54,6 +56,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem
void Queue(string assetName, Type type)
{
queued = true;
lock (queue)
{
if (!assets.ContainsKey(assetName))
@@ -86,5 +89,10 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem
assets.Remove(asset.Key);
}
}
bool Done()
{
return queued;
}
}
}