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

View file

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