private void createOldMethod(string name) { xmld = new XmlDocument(); Texture2DHolder auxHolder; eFrame tmp; int num = 1; string ruta = ""; switch (Game.Instance.getLoadingType()) { case ResourceManager.LoadingType.RESOURCES_LOAD: ruta = name + "_" + intToStr(num); auxHolder = new Texture2DHolder(ruta); while (auxHolder.Loaded()) { tmp = new eFrame(); tmp.Duration = 500; tmp.Holder = auxHolder; frames.Add(tmp); num++; ruta = name + "_" + intToStr(num); auxHolder = new Texture2DHolder(ruta); } break; case ResourceManager.LoadingType.SYSTEM_IO: ruta = Game.Instance.getSelectedGame() + name + "_" + intToStr(num); string working_extension = ""; foreach (string extension in extensions) { auxHolder = new Texture2DHolder(ruta); if (System.IO.File.Exists(ruta + extension)) { working_extension = extension; break; } } ruta = ruta + working_extension; while (System.IO.File.Exists(ruta)) { tmp = new eFrame(); tmp.Duration = 500; tmp.Holder = new Texture2DHolder(ruta); frames.Add(tmp); num++; ruta = name + "_" + intToStr(num) + working_extension; } break; } }
private void createOldMethod() { xmld = new XmlDocument (); Texture2DHolder auxHolder; eFrame tmp; int num = 1; string ruta = ""; switch (type) { case ResourceManager.LoadingType.RESOURCES_LOAD: ruta = path + "_" + intToStr (num); auxHolder = new Texture2DHolder (ruta,this.type); while(auxHolder.Loaded()){ tmp = new eFrame (); tmp.Duration = 500; tmp.Image = auxHolder.Texture; frames.Add(tmp); num++; ruta = path + "_" + intToStr (num); auxHolder = new Texture2DHolder(ruta, this.type); } break; case ResourceManager.LoadingType.SYSTEM_IO: ruta = path + "_" + intToStr (num); string working_extension = ""; foreach (string extension in extensions) { auxHolder = new Texture2DHolder (ruta, this.type); if (System.IO.File.Exists (ruta + extension)) { working_extension = extension; break; } } ruta = ruta + working_extension; while (System.IO.File.Exists (ruta)) { tmp = new eFrame (); tmp.Duration = 500; tmp.Image = new Texture2DHolder (ruta, this.type).Texture; frames.Add (tmp); num++; ruta = path + "_" + intToStr (num) + working_extension; } break; } }
public Texture2D getImage(string uri) { if (images.ContainsKey(uri)) { return(images [uri].Texture); } else { Texture2DHolder holder = new Texture2DHolder(uri); if (holder.Loaded()) { images.Add(uri, holder); return(holder.Texture); } else { return(null); } } }
public Texture2D getImage(string uri) { if (images.ContainsKey (uri)) return images [uri].Texture; else { Texture2DHolder holder = new Texture2DHolder (Path + uri, type); if (holder.Loaded ()) { images.Add (uri, holder); return holder.Texture; } else return null; } }