Skip to content

Commit

Permalink
More fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
MainMemory committed Sep 21, 2015
1 parent 8b27b8f commit 52502b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SonLVLAPI/DataTypes.cs
Expand Up @@ -2409,8 +2409,10 @@ public static Sprite LoadChaotixSprite(byte[] file, int addr)
public void SaveChaotixSprite(string filename)
{
List<byte> result = new List<byte>();
result.AddRange(ByteConverter.GetBytes((short)Left));
result.AddRange(ByteConverter.GetBytes((short)(Right - 1)));
int left = Left & ~1;
int right = (Right & 1) == 1 ? Right + 1 : Right;
result.AddRange(ByteConverter.GetBytes((short)left));
result.AddRange(ByteConverter.GetBytes((short)(right - 1)));
result.Add((byte)(sbyte)Top);
result.Add((byte)0);
result.Add((byte)(sbyte)(Bottom - 1));
Expand All @@ -2435,8 +2437,8 @@ public void SaveChaotixSprite(string filename)
xl &= ~1;
if ((xr - xl) % 2 != 0)
++xr;
result.Add((byte)(sbyte)(xl + Left));
result.Add((byte)(sbyte)(xr + Left));
result.Add((byte)(sbyte)(xl + left));
result.Add((byte)(sbyte)(xr + left));
result.Add((byte)(sbyte)(y + Top));
result.Add((byte)0);
for (int x = xl; x < xr; x++)
Expand Down

0 comments on commit 52502b2

Please sign in to comment.