private List <string> FindTextureFiles(string[] directories) { if (directories == null) { throw new ArgumentNullException("Directories is null"); } List <string> textureFiles = new List <string>(); foreach (string directory in directories) { loadWaitWorker.ReportProgress(-1, string.Format("Looking for textures in {0}...", directory)); string localDataPath = Path.Combine(DataPath, directory); if (!Directory.Exists(localDataPath)) { continue; } List <string> filePaths = Directory.EnumerateFiles(localDataPath, "*.*", SearchOption.AllDirectories) .Where(x => (Path.GetExtension(x) == ".ntfp" || Path.GetExtension(x) == ".nbfp")) .ToList(); foreach (string filePath in filePaths) { if (File.Exists(Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath) + ".cmp")) || File.Exists(Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath) + ".ntft")) || File.Exists(Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath) + ".nbfc"))) { textureFiles.Add(Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileNameWithoutExtension(filePath))); } } TilePalettePair t = null; //tiled 256x128 auto(4bpp) //t = new TilePalettePair(this, textureFiles.FirstOrDefault(x => x.EndsWith("i_dmp_bg_01")), TilePalettePair.Formats.Auto, 256, 128); //texture auto auto(8bpp) //t = new TilePalettePair(this, textureFiles.FirstOrDefault(x => x.EndsWith("SampleCamp")), TilePalettePair.Formats.Auto); //texture auto auto(4bpp) //t = new TilePalettePair(this, textureFiles.FirstOrDefault(x => x.EndsWith("i_cam_font01")), TilePalettePair.Formats.Auto); //texture auto 8bpp //t = new TilePalettePair(this, textureFiles.FirstOrDefault(x => x.EndsWith("nt_logo")), TilePalettePair.Formats._8bpp); //texture auto auto(8bpp) //t = new TilePalettePair(this, textureFiles.FirstOrDefault(x => x.EndsWith("i_es_over1a")), TilePalettePair.Formats.Auto); //t.Image.Save(t.TileData.Filename + ".png"); } return(textureFiles); }
public void Initialize(GameDataManager gameDataManager) { Program.Logger.LogMessage("Initializing {0}...", GetType().Name); brushEmpty = new SolidBrush(Color.FromArgb(0x01, 0x28, 0x47)); brushFloor = new SolidBrush(Color.FromArgb(0x2F, 0x83, 0xB2)); brushWall = new SolidBrush(Color.FromArgb(0x94, 0xFF, 0xEF)); this.gameDataManager = gameDataManager; mainMapTiles = new TilePalettePair(gameDataManager, Path.Combine(gameDataManager.DataPath, @"data\Data\Tex\Map\Bg\i_dmp_bg_01"), TilePalettePair.Formats.Auto, 256, 128, true); mapTileGeomagneticField = new TilePalettePair(gameDataManager, Path.Combine(gameDataManager.DataPath, @"data\Data\Tex\Map\Obj\p_10\i_dmp_icon12_00.nbfc"), Path.Combine(gameDataManager.DataPath, @"data\Data\Tex\Map\Obj\p_10\map_obj_palette_10.nbfp"), TilePalettePair.Formats.Auto, 16, 16, true); mapTileRefreshingWater = new TilePalettePair(gameDataManager, Path.Combine(gameDataManager.DataPath, @"data\Data\Tex\Map\Obj\p_09\i_dmp_icon11_00.nbfc"), Path.Combine(gameDataManager.DataPath, @"data\Data\Tex\Map\Obj\p_09\map_obj_palette_09.nbfp"), TilePalettePair.Formats.Auto, 16, 16, true); Rebuild(); }