Skip to content

Commit

Permalink
Replace BinaryWriter instances with BinaryWriter2
Browse files Browse the repository at this point in the history
Minor additional updates to AttribSys writing. Also does further cleanup and normalization.
  • Loading branch information
burninrubber0 committed Aug 24, 2023
1 parent 0fd8f41 commit 1d2259a
Show file tree
Hide file tree
Showing 39 changed files with 784 additions and 890 deletions.
5 changes: 3 additions & 2 deletions BaseHandlers/AptData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public static Character Read(BinaryReader2 br, uint dataStart)
return result;
}

public void Write(BinaryWriter bw)
public void Write(BinaryWriter2 bw)
{
bw.Write((uint)Type);
bw.Write(Signature);
Expand Down Expand Up @@ -779,7 +779,8 @@ public bool Read(BundleEntry entry, ILoader loader = null)
public bool Write(BundleEntry entry)
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
BinaryWriter2 bw = new BinaryWriter2(ms);
bw.BigEndian = entry.Console;

// TODO: Write

Expand Down
3 changes: 2 additions & 1 deletion BaseHandlers/IDList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public bool Read(BundleEntry entry, ILoader loader = null)
public bool Write(BundleEntry entry)
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
BinaryWriter2 bw = new BinaryWriter2(ms);
bw.BigEndian = entry.Console;

bw.Write(ReferenceEntryIDOffset);
bw.Write(Unknown2);
Expand Down
5 changes: 3 additions & 2 deletions BaseHandlers/InstanceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static ModelInstance Read(BinaryReader2 br)
return result;
}

public void Write(BinaryWriter bw)
public void Write(BinaryWriter2 bw)
{
bw.Write(ModelEntryPtr);
bw.Write(Unknown2);
Expand Down Expand Up @@ -120,7 +120,8 @@ public bool Read(BundleEntry entry, ILoader loader = null)
public bool Write(BundleEntry entry)
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
BinaryWriter2 bw = new BinaryWriter2(ms);
bw.BigEndian = entry.Console;

bw.Write(Unknown1);
bw.Write(Instances.Count);
Expand Down
5 changes: 3 additions & 2 deletions BaseHandlers/ProgressionData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using BundleFormat;
Expand Down Expand Up @@ -603,7 +603,8 @@ public bool Read(BundleEntry entry, ILoader loader = null)
public bool Write(BundleEntry entry)
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
BinaryWriter2 bw = new BinaryWriter2(ms);
bw.BigEndian = entry.Console;

// TODO: Write

Expand Down
3 changes: 2 additions & 1 deletion BaseHandlers/StreetData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ public bool Read(BundleEntry entry, ILoader loader = null)
public bool Write(BundleEntry entry)
{
MemoryStream ms = new MemoryStream();
BinaryWriter bw = new BinaryWriter(ms);
BinaryWriter2 bw = new BinaryWriter2(ms);
bw.BigEndian = entry.Console;

bw.Write(Unknown1);
long fileSizeOffset = bw.BaseStream.Position;
Expand Down
Loading

0 comments on commit 1d2259a

Please sign in to comment.