diff --git a/HyperLib.CLI/Commands/Impl/Games/TommunismEngine.cs b/HyperLib.CLI/Commands/Impl/Frameworks/TommunismEngine.cs similarity index 96% rename from HyperLib.CLI/Commands/Impl/Games/TommunismEngine.cs rename to HyperLib.CLI/Commands/Impl/Frameworks/TommunismEngine.cs index 6b05935..20e8782 100644 --- a/HyperLib.CLI/Commands/Impl/Games/TommunismEngine.cs +++ b/HyperLib.CLI/Commands/Impl/Frameworks/TommunismEngine.cs @@ -1,7 +1,7 @@ -using HyperLib.Games.TommunismEngine; +using HyperLib.Frameworks.TommunismEngine; using HyperLib.Helpers; -namespace HyperLib.CLI.Commands.Impl.Games +namespace HyperLib.CLI.Commands.Impl.Frameworks { [Command("TommunismEngine", "tom", [typeof(string), typeof(string)], "The game engine developed for Super Meat Boy.", "\n\t--TommunismEngine Archive [file|directory] [opt: destination]\n" + diff --git a/HyperLib/Frameworks/TommunismEngine/AnimationPackage.cs b/HyperLib/Frameworks/TommunismEngine/AnimationPackage.cs new file mode 100644 index 0000000..a5d5ab6 --- /dev/null +++ b/HyperLib/Frameworks/TommunismEngine/AnimationPackage.cs @@ -0,0 +1,40 @@ +namespace HyperLib.Frameworks.TommunismEngine +{ + public class AnimationPackage : FileBase + { + public override string Extension => ".am"; + + public FormatVersion Version = FormatVersion.Unknown; + + public AnimationPackage() { } + + public AnimationPackage(string in_path) : base(in_path) { } + + public override void Read(Stream in_stream) + { + var reader = new BinaryValueReader(in_stream, StreamOwnership.Retain, Endianness.Little, Encoding.UTF8); + + Version = (FormatVersion)reader.ReadInt32(); + + if (!Enum.IsDefined(Version)) + { + Version = FormatVersion.Unknown; + + reader.Seek(-4, SeekOrigin.Begin); + } + + var stringTableLength = reader.ReadUInt16(); + var animationCount = reader.ReadUInt16(); + var framerate = reader.ReadSingle(); + + // TODO + } + + public enum FormatVersion : int + { + Unknown = -1, + F100 = 0x46313030, + F101 = 0x46313031 + } + } +} diff --git a/HyperLib/Games/TommunismEngine/Archive.cs b/HyperLib/Frameworks/TommunismEngine/Archive.cs similarity index 99% rename from HyperLib/Games/TommunismEngine/Archive.cs rename to HyperLib/Frameworks/TommunismEngine/Archive.cs index 632d30c..3d12a7c 100644 --- a/HyperLib/Games/TommunismEngine/Archive.cs +++ b/HyperLib/Frameworks/TommunismEngine/Archive.cs @@ -1,7 +1,7 @@ using HyperLib.Helpers; using HyperLib.IO.Extensions; -namespace HyperLib.Games.TommunismEngine +namespace HyperLib.Frameworks.TommunismEngine { public class Archive : FileBase { diff --git a/HyperLib/Games/TommunismEngine/Registry.cs b/HyperLib/Frameworks/TommunismEngine/Registry.cs similarity index 98% rename from HyperLib/Games/TommunismEngine/Registry.cs rename to HyperLib/Frameworks/TommunismEngine/Registry.cs index f3ef368..145bd84 100644 --- a/HyperLib/Games/TommunismEngine/Registry.cs +++ b/HyperLib/Frameworks/TommunismEngine/Registry.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace HyperLib.Games.TommunismEngine +namespace HyperLib.Frameworks.TommunismEngine { public class Registry : FileBase { diff --git a/HyperLib/Games/TommunismEngine/TexturePackage.cs b/HyperLib/Frameworks/TommunismEngine/TexturePackage.cs similarity index 98% rename from HyperLib/Games/TommunismEngine/TexturePackage.cs rename to HyperLib/Frameworks/TommunismEngine/TexturePackage.cs index e0f51cf..b322bfd 100644 --- a/HyperLib/Games/TommunismEngine/TexturePackage.cs +++ b/HyperLib/Frameworks/TommunismEngine/TexturePackage.cs @@ -2,7 +2,7 @@ using HyperLib.Helpers.Converters; using Newtonsoft.Json; -namespace HyperLib.Games.TommunismEngine +namespace HyperLib.Frameworks.TommunismEngine { public class TexturePackage : FileBase { diff --git a/README.md b/README.md index 50ad048..e30ef85 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ # HyperLib A work-in-progress general purpose library for software research. -# Games +# Frameworks ## TommunismEngine -The game engine developed for Super Meat Boy. +### Used by +- Super Meat Boy ### Supported formats -Type|Support|[1:1](## "Can this library generate a binary identical file from the original source?")|Description| -----|-------|---------------------------------------------------------------------------------------|-----------| -[Archive (*.dat)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/Archive.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|[⚠️](## "The table of contents is not sorted in the same way the original archive is, but the resulting file is read correctly by the game.")|An uncompressed archive format. -[Texture Package (*.tp)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/TexturePackage.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|✔️|An uncompressed texture container format. -[Registry (reg*.dat)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/Registry.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|✔️|A basic property format used for storing user option data. \ No newline at end of file +Type|Support|[Platforms](## "This column indicates platforms the library has been tested and confirmed working with.")|[1:1](## "Can this library generate a binary identical file from the original source?")|Description +----|-------|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|----------- +[Archive (*.dat)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/Archive.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|PC, [Xbox 360](## "WAV audio data is exported in an unknown format.")|[⚠️](## "The table of contents is not sorted in the same way the original archive is, but the resulting file is read correctly by the game.")|An uncompressed archive format. +[Registry (reg*.dat)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/Registry.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|PC|✔️|A basic property format used for storing user option data. +[Texture Package (*.tp)](https://github.com/hyperbx/HyperLib/blob/main/HyperLib/Games/TommunismEngine/TexturePackage.cs)|[📜](## "Read") [💾](## "Write") [📥](## "Import") [📤](## "Export")|PC, Xbox 360|✔️|An uncompressed texture container format. \ No newline at end of file