Skip to content

Commit

Permalink
Migrate Games namespace to Frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Jan 9, 2024
1 parent adefd13 commit ac6b0b5
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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" +
Expand Down
40 changes: 40 additions & 0 deletions HyperLib/Frameworks/TommunismEngine/AnimationPackage.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HyperLib.Helpers;
using HyperLib.IO.Extensions;

namespace HyperLib.Games.TommunismEngine
namespace HyperLib.Frameworks.TommunismEngine
{
public class Archive : FileBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Newtonsoft.Json;

namespace HyperLib.Games.TommunismEngine
namespace HyperLib.Frameworks.TommunismEngine
{
public class Registry : FileBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using HyperLib.Helpers.Converters;
using Newtonsoft.Json;

namespace HyperLib.Games.TommunismEngine
namespace HyperLib.Frameworks.TommunismEngine
{
public class TexturePackage : FileBase
{
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
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.

0 comments on commit ac6b0b5

Please sign in to comment.