예제 #1
0
        public void Read(sFile file)
        {
            System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path));
            string ext = new String(Encoding.ASCII.GetChars(br.ReadBytes(4)));

            br.Close();

            if (ext == "CG4 ")
            {
                CGx cgx = new CGx(file.path, file.id, false, file.name);
                pluginHost.Set_Palette(cgx.Palette);
                pluginHost.Set_Image(cgx);
            }
            else if (ext == "CG8 ")
            {
                CGx cgx = new CGx(file.path, file.id, true, file.name);
                pluginHost.Set_Palette(cgx.Palette);
                pluginHost.Set_Image(cgx);
            }
            else if (ext == "SC4 " || ext == "SC8 ")
            {
                SCx scx = new SCx(file.path, file.id, file.name);
                pluginHost.Set_Map(scx);
            }
            else if (ext == "CGT ")
            {
                CGT cgt = new CGT(file.path, file.id, file.name);
                pluginHost.Set_Palette(cgt.Palette);
                pluginHost.Set_Image(cgt);
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: MetLob/tinke
        public void Read(sFile file)
        {
            System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path));
            string ext = new String(Encoding.ASCII.GetChars(br.ReadBytes(4)));
            br.Close();

            if (ext == "CG4 ")
            {
                CGx cgx = new CGx(file.path, file.id, false, file.name);
                pluginHost.Set_Palette(cgx.Palette);
                pluginHost.Set_Image(cgx);
            }
            else if (ext == "CG8 ")
            {
                CGx cgx = new CGx(file.path, file.id, true, file.name);
                pluginHost.Set_Palette(cgx.Palette);
                pluginHost.Set_Image(cgx);
            }
            else if (ext == "SC4 " || ext == "SC8 ")
            {
                SCx scx = new SCx(file.path, file.id, file.name);
                pluginHost.Set_Map(scx);
            }
            else if (ext == "CGT ")
            {
                CGT cgt = new CGT(file.path, file.id, file.name);
                pluginHost.Set_Palette(cgt.Palette);
                pluginHost.Set_Image(cgt);
            }
        }