Add support for motion recorder filetype

This commit is contained in:
jvyden 2022-02-10 18:27:09 -05:00
commit a9616618cf
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 5 additions and 2 deletions

View file

@ -21,6 +21,7 @@ public static class FileHelper
return file.FileType switch return file.FileType switch
{ {
LbpFileType.MotionRecording => true,
LbpFileType.FileArchive => false, LbpFileType.FileArchive => false,
LbpFileType.Painting => true, LbpFileType.Painting => true,
LbpFileType.Unknown => false, LbpFileType.Unknown => false,
@ -56,17 +57,18 @@ public static class FileHelper
return Encoding.ASCII.GetString(header) switch return Encoding.ASCII.GetString(header) switch
{ {
"REC" => LbpFileType.MotionRecording,
"PTG" => LbpFileType.Painting, "PTG" => LbpFileType.Painting,
"TEX" => LbpFileType.Texture, "TEX" => LbpFileType.Texture,
"FSH" => LbpFileType.Script, "FSH" => LbpFileType.Script,
"VOP" => LbpFileType.Voice, "VOP" => LbpFileType.Voice,
"LVL" => LbpFileType.Level, "LVL" => LbpFileType.Level,
"PLN" => LbpFileType.Plan, "PLN" => LbpFileType.Plan,
_ => determineFileTypePartTwoWeirdName(reader), _ => readAlternateHeader(reader),
}; };
} }
private static LbpFileType determineFileTypePartTwoWeirdName(BinaryReader reader) private static LbpFileType readAlternateHeader(BinaryReader reader)
{ {
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;

View file

@ -8,6 +8,7 @@ public enum LbpFileType
FileArchive, // .farc, (ends with FARC) FileArchive, // .farc, (ends with FARC)
Plan, // PLN, uploaded with levels Plan, // PLN, uploaded with levels
Voice, // VOP, voice data Voice, // VOP, voice data
MotionRecording, // used in LBP2+/V for the motion recorder
Painting, // PTG, paintings Painting, // PTG, paintings
Jpeg, // JFIF / FIF, used in sticker switches, Jpeg, // JFIF / FIF, used in sticker switches,
Png, // used in LBP Vita Png, // used in LBP Vita