public new static GameObject Load(String PathName) { // First we load up the Data In the Serialization file. String gameDataObjectXMLPath = System.IO.Path.Combine(PathName, "ImageSequence"); GameImageSequence sequenceLoaded = LoadSerializationFileForFolder(gameDataObjectXMLPath); // Now lets look for and load up any images that we find. String[] tgaFilesArray = Directory.GetFiles(PathName, "*.tga"); List <String> sortedTgaFiles = new List <string>(tgaFilesArray); // Make sure they are sorted. sortedTgaFiles.Sort(); sequenceLoaded.m_Images = new ImageBuffer[sortedTgaFiles.Count]; int imageIndex = 0; foreach (String tgaFile in sortedTgaFiles) { sequenceLoaded.m_Images[imageIndex] = new ImageBuffer(new BlenderPreMultBGRA()); Stream imageStream = File.Open(tgaFile, FileMode.Open); ImageTgaIO.LoadImageData(sequenceLoaded.m_Images[imageIndex], imageStream, 32); imageIndex++; } if (sequenceLoaded.m_CenterOriginDurringPreprocessing) { sequenceLoaded.CenterOriginOffset(); } if (sequenceLoaded.m_CropToVisibleDurringPreprocessing) { sequenceLoaded.CropToVisible(); } return(sequenceLoaded); }
private static GameImageSequence LoadSerializationFileForFolder(String gameDataObjectXMLPath) { GameImageSequence sequenceLoaded; sequenceLoaded = (GameImageSequence)GameObject.Load(gameDataObjectXMLPath); if (sequenceLoaded == null) { sequenceLoaded = new GameImageSequence(); sequenceLoaded.SaveXML(gameDataObjectXMLPath); } return(sequenceLoaded); }
private static GameImageSequence LoadSerializationFileForFolder(String gameDataObjectXMLPath) { GameImageSequence sequenceLoaded; sequenceLoaded = (GameImageSequence)GameObject.Load(gameDataObjectXMLPath); if (sequenceLoaded == null) { sequenceLoaded = new GameImageSequence(); sequenceLoaded.SaveXML(gameDataObjectXMLPath); } return sequenceLoaded; }