-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of random dirs, fix saving uncompressed scenes
- Loading branch information
1 parent
51682f4
commit f150e0e
Showing
52 changed files
with
1,208 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using MiloLib.Assets.Rnd; | ||
using MiloLib.Classes; | ||
using MiloLib.Utils; | ||
|
||
namespace MiloLib.Assets.Band | ||
{ | ||
[Name("BandScoreboard"), Description("Scoreboard HUD element including stars")] | ||
public class BandScoreboard : RndDir | ||
{ | ||
public ushort altRevision; | ||
public ushort revision; | ||
|
||
public Symbol sym = new(0, ""); | ||
|
||
public BandScoreboard(ushort revision, ushort altRevision = 0) : base(revision, altRevision) | ||
{ | ||
revision = revision; | ||
altRevision = altRevision; | ||
return; | ||
} | ||
|
||
public BandScoreboard Read(EndianReader reader, bool standalone, DirectoryMeta parent, DirectoryMeta.Entry entry) | ||
{ | ||
uint combinedRevision = reader.ReadUInt32(); | ||
if (BitConverter.IsLittleEndian) (revision, altRevision) = ((ushort)(combinedRevision & 0xFFFF), (ushort)(combinedRevision >> 16 & 0xFFFF)); | ||
else (altRevision, revision) = ((ushort)(combinedRevision & 0xFFFF), (ushort)(combinedRevision >> 16 & 0xFFFF)); | ||
|
||
if (!entry.isDir) | ||
{ | ||
sym = Symbol.Read(reader); | ||
} | ||
|
||
base.Read(reader, false, parent, entry); | ||
|
||
if (standalone) | ||
if ((reader.Endianness == Endian.BigEndian ? 0xADDEADDE : 0xDEADDEAD) != reader.ReadUInt32()) throw new Exception("Got to end of standalone asset but didn't find the expected end bytes, read likely did not succeed"); | ||
|
||
return this; | ||
} | ||
|
||
public override void Write(EndianWriter writer, bool standalone) | ||
{ | ||
writer.WriteUInt32(BitConverter.IsLittleEndian ? (uint)(altRevision << 16 | revision) : (uint)(revision << 16 | altRevision)); | ||
|
||
base.Write(writer, false); | ||
|
||
if (standalone) | ||
writer.WriteBlock(new byte[4] { 0xAD, 0xDE, 0xAD, 0xDE }); | ||
} | ||
|
||
public override bool IsDirectory() | ||
{ | ||
return true; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.