예제 #1
0
        protected override void RunImport()
        {
            Bk2Movie       movie = Result.Movie;
            MiscHeaderInfo info;

            movie.HeaderEntries[HeaderKeys.PLATFORM] = "PSX";

            using (var fs = SourceFile.OpenRead())
            {
                using (var br = new BinaryReader(fs))
                {
                    info = parseHeader(movie, "PXM ", br);

                    fs.Seek(info.controllerDataOffset, SeekOrigin.Begin);

                    if (info.binaryFormat)
                    {
                        parseBinaryInputLog(br, movie, info);
                    }
                    else
                    {
                        parseTextInputLog(br, movie, info);
                    }
                }
            }

            movie.Save();
        }
        public static Bk2Movie ToBk2(this IMovie old, bool copy = false, bool backup = false)
        {
            var bk2 = new Bk2Movie(old.Filename.Replace(old.PreferredExtension, Bk2Movie.Extension));

            for (var i = 0; i < old.InputLogLength; i++)
            {
                var input = old.GetInputState(i);
                bk2.AppendFrame(input);
            }

            if (!copy)
            {
                old.Truncate(0);                 // Trying to minimize ram usage
            }

            bk2.HeaderEntries.Clear();
            foreach (var kvp in old.HeaderEntries)
            {
                bk2.HeaderEntries[kvp.Key] = kvp.Value;
            }

            bk2.SyncSettingsJson = old.SyncSettingsJson;

            bk2.Comments.Clear();
            foreach (var comment in old.Comments)
            {
                bk2.Comments.Add(comment);
            }

            bk2.Subtitles.Clear();
            foreach (var sub in old.Subtitles)
            {
                bk2.Subtitles.Add(sub);
            }

            bk2.TextSavestate   = old.TextSavestate;
            bk2.BinarySavestate = old.BinarySavestate;
            bk2.SaveRam         = old.SaveRam;

            if (!backup)
            {
                bk2.Save();
            }

            return(bk2);
        }
예제 #3
0
        public static Bk2Movie ToBk2(BkmMovie old)
        {
            var bk2 = new Bk2Movie(old.Filename.Replace(old.PreferredExtension, Bk2Movie.Extension));

            for (var i = 0; i < old.InputLogLength; i++)
            {
                var input = old.GetInputState(i);
                bk2.AppendFrame(input);
            }

            bk2.HeaderEntries.Clear();
            foreach (var kvp in old.HeaderEntries)
            {
                bk2.HeaderEntries[kvp.Key] = kvp.Value;
            }

            bk2.SyncSettingsJson = old.SyncSettingsJson;

            bk2.Comments.Clear();
            foreach (var comment in old.Comments)
            {
                bk2.Comments.Add(comment);
            }

            bk2.Subtitles.Clear();
            foreach (var sub in old.Subtitles)
            {
                bk2.Subtitles.Add(sub);
            }

            bk2.TextSavestate   = old.TextSavestate;
            bk2.BinarySavestate = old.BinarySavestate;

            bk2.Save();

            return(bk2);
        }
예제 #4
0
		public static Bk2Movie ToBk2(this IMovie old)
		{
			var newFilename = old.Filename + "." + Bk2Movie.Extension;
			var bk2 = new Bk2Movie(newFilename);
			bk2.HeaderEntries.Clear();
			foreach(var kvp in old.HeaderEntries)
			{
				bk2.HeaderEntries[kvp.Key] = kvp.Value;
			}

			bk2.SyncSettingsJson = old.SyncSettingsJson;

			bk2.Comments.Clear();
			foreach(var comment in old.Comments)
			{
				bk2.Comments.Add(comment);
			}

			bk2.Subtitles.Clear();
			foreach(var sub in old.Subtitles)
			{
				bk2.Subtitles.Add(sub);
			}

			bk2.TextSavestate = old.TextSavestate;
			bk2.BinarySavestate = old.BinarySavestate;

			for (var i = 0; i < old.InputLogLength; i++)
			{
				var input = old.GetInputState(i);
				bk2.AppendFrame(input);
			}

			bk2.Save();
			return bk2;
		}
예제 #5
0
        public static Bk2Movie ToBk2(this IMovie old, bool copy = false, bool backup = false)
        {
            var bk2 = new Bk2Movie(old.Filename.Replace(old.PreferredExtension, Bk2Movie.Extension));

            for (var i = 0; i < old.InputLogLength; i++)
            {
                var input = old.GetInputState(i);
                bk2.AppendFrame(input);
            }

            if (!copy)
            {
                old.Truncate(0); // Trying to minimize ram usage
            }

            bk2.HeaderEntries.Clear();
            foreach (var kvp in old.HeaderEntries)
            {
                bk2.HeaderEntries[kvp.Key] = kvp.Value;
            }

            bk2.SyncSettingsJson = old.SyncSettingsJson;

            bk2.Comments.Clear();
            foreach (var comment in old.Comments)
            {
                bk2.Comments.Add(comment);
            }

            bk2.Subtitles.Clear();
            foreach (var sub in old.Subtitles)
            {
                bk2.Subtitles.Add(sub);
            }

            bk2.TextSavestate = old.TextSavestate;
            bk2.BinarySavestate = old.BinarySavestate;
            bk2.SaveRam = old.SaveRam;

            if (!backup)
                bk2.Save();

            return bk2;
        }