diff --git a/RSDKv3/Backgrounds.cs b/RSDKv3/Backgrounds.cs index f7a32a6..b4595a2 100644 --- a/RSDKv3/Backgrounds.cs +++ b/RSDKv3/Backgrounds.cs @@ -11,7 +11,7 @@ public class ScrollInfo /// how fast the line moves while the player is moving, relative to 0x100. /// E.G: 0x100 == move 1 pixel per 1 pixel of camera movement, 0x80 = 1 pixel every 2 pixels of camera movement, etc /// - public short parallaxFactor = 0x100; + public ushort parallaxFactor = 0x100; /// /// How fast the line moves without the player moving @@ -36,7 +36,7 @@ public float parallaxFactorF } set { - parallaxFactor = (byte)(value * 256.0f); + parallaxFactor = (ushort)(value * 256.0f); } } @@ -66,7 +66,7 @@ public ScrollInfo(Reader reader) public void Read(Reader reader) { // 2 bytes, big-endian, unsigned - parallaxFactor = (short)(reader.ReadByte() << 8); + parallaxFactor = (ushort)(reader.ReadByte() << 8); parallaxFactor |= reader.ReadByte(); scrollSpeed = reader.ReadByte(); deform = reader.ReadBoolean(); @@ -130,7 +130,7 @@ public enum LayerTypes /// how fast the Layer moves while the player is moving, relative to 0x100. /// E.G: 0x100 == move 1 pixel per 1 pixel of camera movement, 0x80 = 1 pixel every 2 pixels of camera movement, etc /// - public short parallaxFactor = 0x100; + public ushort parallaxFactor = 0x100; /// /// how fast the layer moves while the player isn't moving @@ -155,7 +155,7 @@ public float parallaxFactorF } set { - parallaxFactor = (byte)(value * 256.0f); + parallaxFactor = (ushort)(value * 256.0f); } } @@ -197,7 +197,7 @@ public void Read(Reader reader) height = reader.ReadByte(); type = (LayerTypes)reader.ReadByte(); - parallaxFactor = (short)(reader.ReadByte() << 8); + parallaxFactor = (ushort)(reader.ReadByte() << 8); parallaxFactor |= reader.ReadByte(); scrollSpeed = reader.ReadByte(); diff --git a/RSDKv4/Backgrounds.cs b/RSDKv4/Backgrounds.cs index 0ec731a..f42215f 100644 --- a/RSDKv4/Backgrounds.cs +++ b/RSDKv4/Backgrounds.cs @@ -11,7 +11,7 @@ public class ScrollInfo /// how fast the line moves while the player is moving, relative to 0x100. /// E.G: 0x100 == move 1 pixel per 1 pixel of camera movement, 0x80 = 1 pixel every 2 pixels of camera movement, etc /// - public short parallaxFactor = 0x100; + public ushort parallaxFactor = 0x100; /// /// How fast the line moves without the player moving @@ -36,7 +36,7 @@ public float parallaxFactorF } set { - parallaxFactor = (byte)(value * 256.0f); + parallaxFactor = (ushort)(value * 256.0f); } } @@ -67,7 +67,7 @@ public void Read(Reader reader) { // 2 bytes, little-endian, signed parallaxFactor = reader.ReadByte(); - parallaxFactor |= (short)(reader.ReadByte() << 8); + parallaxFactor |= (ushort)(reader.ReadByte() << 8); scrollSpeed = reader.ReadByte(); deform = reader.ReadBoolean(); } @@ -127,7 +127,7 @@ public enum LayerTypes /// how fast the Layer moves while the player is moving, relative to 0x100. /// E.G: 0x100 == move 1 pixel per 1 pixel of camera movement, 0x80 = 1 pixel every 2 pixels of camera movement, etc /// - public short parallaxFactor = 0x100; + public ushort parallaxFactor = 0x100; /// /// how fast the layer moves while the player isn't moving /// @@ -151,7 +151,7 @@ public float parallaxFactorF } set { - parallaxFactor = (byte)(value * 256.0f); + parallaxFactor = (ushort)(value * 256.0f); } } @@ -199,7 +199,7 @@ public void Read(Reader reader) // 2 bytes, little-endian, signed parallaxFactor = reader.ReadByte(); - parallaxFactor |= (short)(reader.ReadByte() << 8); + parallaxFactor |= (ushort)(reader.ReadByte() << 8); scrollSpeed = reader.ReadByte(); lineScroll = new byte[height * 128]; diff --git a/RSDKv4/DataPack.cs b/RSDKv4/DataPack.cs index 2c12502..cbfafcb 100644 --- a/RSDKv4/DataPack.cs +++ b/RSDKv4/DataPack.cs @@ -166,7 +166,7 @@ public void Read(Reader reader, List fileNames = null, int fileI reader.BaseStream.Position = fileOffset; // Decrypt File if Encrypted - if (encrypted && !name.usingHash) + if (encrypted) data = Decrypt(reader.ReadBytes(fileSize), false); else data = reader.ReadBytes(fileSize); @@ -226,7 +226,7 @@ public void WriteFileHeader(Writer writer, uint offset = 0) public void WriteFileData(Writer writer) { - if (encrypted && !name.usingHash) + if (encrypted) writer.Write(Decrypt(data, true)); else writer.Write(data);