using System; using System.IO; using System.Drawing; using System.Collections.Generic; using Imaging.DDSReader; namespace DDS { public class FiestaDDS { public static Dictionary LoadItemImages(String FilePath) { Dictionary ItemImages = new Dictionary(); DDSImage DDSFile = new DDSImage(File.ReadAllBytes(FilePath)); Int32 ID = 0; Int32 X = 0; Int32 Y = 0; while (Y != 256) { while (X != 256) { Bitmap ImageMap = new Bitmap(32, 32); Graphics ImageDraw = Graphics.FromImage(ImageMap); ImageDraw.DrawImage(DDSFile.BitmapImage, -X, -Y); ItemImages.Add(ID, ImageMap); ID++; X = (X + 32); } X = 0; Y = (Y + 32); } return ItemImages; } public static Dictionary LoadGrades(String FilePath) { Dictionary Grades = new Dictionary(); DDSImage DDSFile = new DDSImage(File.ReadAllBytes(FilePath)); Int32 ID = 0; Int32 X = 0; Int32 Y = 0; while (Y != 128) { while (X != 128) { Bitmap ImageMap = new Bitmap(32, 32); Graphics ImageDraw = Graphics.FromImage(ImageMap); ImageDraw.DrawImage(DDSFile.BitmapImage, -X, -Y); Grades.Add(ID, ImageMap); ID++; X = (X + 32); } X = 0; Y = (Y + 32); } return Grades; } } }