public static AnimSheet GetSpellSheet(SpellAnimType animType, int num) { AnimSheet cacheSheet = spellCache.Get(animType.ToString() + num); if (cacheSheet != null) { return(cacheSheet); } if (File.Exists(Paths.EffectsPath + animType.ToString() + "-" + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.EffectsPath + animType.ToString() + "-" + num + ".png"); sheet.LoadTextureFromPixels32(); switch (animType) { case SpellAnimType.Spell: sheet.GenerateDataBuffer(1, 1); break; case SpellAnimType.Arrow: sheet.GenerateDataBuffer(8, 1); break; case SpellAnimType.Beam: sheet.GenerateDataBuffer(8, 4); break; } spellCache.Add(animType.ToString() + num, sheet); return(sheet); } spellCache.Add(animType.ToString() + num, ErrorTexture); return(ErrorTexture); }
public static AnimSheet GetItemSheet(int num) { AnimSheet cacheSheet = itemCache.Get(num); if (cacheSheet != null) { return(cacheSheet); } if (File.Exists(Paths.ItemsPath + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.ItemsPath + num + ".png"); sheet.LoadTextureFromPixels32(); sheet.GenerateDataBuffer(1, 1); itemCache.Add(num, sheet); return(sheet); } itemCache.Add(num, ErrorTexture); return(ErrorTexture); }
public static AnimSheet GetStatusSheet(int num) { AnimSheet cacheSheet = statusCache.Get(num); if (cacheSheet != null) { return(cacheSheet); } if (File.Exists(Paths.DataPath + "\\Graphics\\Status\\Status-" + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.DataPath + "\\Graphics\\Status\\Status-" + num + ".png"); sheet.LoadTextureFromPixels32(); sheet.GenerateDataBuffer(1, 1); statusCache.Add(num, sheet); return(sheet); } statusCache.Add(num, ErrorTexture); return(ErrorTexture); }
public static AnimSheet GetObjectSheet(int num) { AnimSheet cacheSheet = objectCache.Get(num); if (cacheSheet != null) { return(cacheSheet); } if (System.IO.File.Exists(Paths.DataPath + "Graphics\\Object\\Object-" + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.DataPath + "Graphics\\Object\\Object-" + num + ".png"); sheet.LoadTextureFromPixels32(); sheet.GenerateDataBuffer(1, 1); objectCache.Add(num, sheet); return(sheet); } objectCache.Add(num, ErrorTexture); return(ErrorTexture); }
public static AnimSheet GetStatusSheet(int num) { AnimSheet cacheSheet = statusCache.Get(num); if (cacheSheet != null) return cacheSheet; if (System.IO.File.Exists(Paths.DataPath + "\\Graphics\\Status\\Status-" + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.DataPath + "\\Graphics\\Status\\Status-" + num + ".png"); sheet.LoadTextureFromPixels32(); sheet.GenerateDataBuffer(1, 1); statusCache.Add(num, sheet); return sheet; } statusCache.Add(num, ErrorTexture); return ErrorTexture; }
public static AnimSheet GetSpellSheet(SpellAnimType animType, int num) { AnimSheet cacheSheet = spellCache.Get(animType.ToString() + num); if (cacheSheet != null) return cacheSheet; if (System.IO.File.Exists(Paths.EffectsPath + animType.ToString() + "-" + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.EffectsPath + animType.ToString() + "-" + num + ".png"); sheet.LoadTextureFromPixels32(); switch (animType) { case SpellAnimType.Spell: sheet.GenerateDataBuffer(1, 1); break; case SpellAnimType.Arrow: sheet.GenerateDataBuffer(8, 1); break; case SpellAnimType.Beam: sheet.GenerateDataBuffer(8, 4); break; } spellCache.Add(animType.ToString() + num, sheet); return sheet; } spellCache.Add(animType.ToString() + num, ErrorTexture); return ErrorTexture; }
public static AnimSheet GetItemSheet(int num) { AnimSheet cacheSheet = itemCache.Get(num); if (cacheSheet != null) return cacheSheet; if (System.IO.File.Exists(Paths.ItemsPath + num + ".png")) { AnimSheet sheet = new AnimSheet(); sheet.LoadPixelsFromFile32(Paths.ItemsPath + num + ".png"); sheet.LoadTextureFromPixels32(); sheet.GenerateDataBuffer(1, 1); itemCache.Add(num, sheet); return sheet; } itemCache.Add(num, ErrorTexture); return ErrorTexture; }