Removing cache from Gleed2D as ContentManager automatically does this

Adding cache
Adding XOR Shift random class
This commit is contained in:
Nathan Adams
2014-12-30 22:07:05 -06:00
parent 1a04355fde
commit 67ab74899f
13 changed files with 147 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ namespace Axios.Engine.Gleed2D
/// Called by Level.FromFile(filename) on each Item after the deserialization process.
/// Should be overriden and can be used to load anything needed by the Item (e.g. a texture).
/// </summary>
public virtual void load(AxiosGameScreen gameScreen, ref Dictionary<string, Texture2D> cache)
public virtual void load(AxiosGameScreen gameScreen)
{
}

View File

@@ -30,9 +30,9 @@ namespace Axios.Engine.Gleed2D
this._item = i;
}
public override void load(AxiosGameScreen gameScreen, ref Dictionary<string, Texture2D> cache)
public override void load(AxiosGameScreen gameScreen)
{
base.load(gameScreen, ref cache);
base.load(gameScreen);
Vertices v = new Vertices(LayerItem.LocalPoints.Count);
foreach (Vector2 vec in LayerItem.LocalPoints)

View File

@@ -39,20 +39,20 @@ namespace Axios.Engine.Gleed2D
/// You must provide your own implementation. However, you can rely on all public fields being
/// filled by the level deserialization process.
/// </summary>
public override void load(AxiosGameScreen gameScreen, ref Dictionary<string, Texture2D> cache)
public override void load(AxiosGameScreen gameScreen)
{
base.load(gameScreen, ref cache);
base.load(gameScreen);
//throw new NotImplementedException();
//TODO: provide your own implementation of how a TextureItem loads its assets
//for example:
//this.texture = Texture2D.FromFile(<GraphicsDevice>, texture_filename);
//or by using the Content Pipeline:
if (!cache.ContainsKey(LayerItem.AssetName))
/*if (!cache.ContainsKey(LayerItem.AssetName))
{
cache[LayerItem.AssetName] = gameScreen.ScreenManager.Game.Content.Load<Texture2D>(LayerItem.AssetName);
}
this.texture = cache[LayerItem.AssetName];
}*/
this.texture = gameScreen.ScreenManager.Game.Content.Load<Texture2D>(LayerItem.AssetName);
//Visible = gameScreen.LoadTextureItem(this);
//this.texture = cm.Load<Texture2D>(asset_name);