content system now has done check; cleaned assets;
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user