Skip to content

Commit

Permalink
Merge pull request #45 from burninrubber0/console-support
Browse files Browse the repository at this point in the history
Add console support
  • Loading branch information
burninrubber0 authored Aug 27, 2023
2 parents 51f23e0 + 1d2259a commit 6433e91
Show file tree
Hide file tree
Showing 43 changed files with 1,093 additions and 1,364 deletions.
9 changes: 5 additions & 4 deletions BaseHandlers/AptData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public class Character
// Data
public CharacterData Data;

private static Frame ReadFrame(BinaryReader br, uint dataStart)
private static Frame ReadFrame(BinaryReader2 br, uint dataStart)
{
Frame frame = new Frame();

Expand Down Expand Up @@ -435,7 +435,7 @@ private static Frame ReadFrame(BinaryReader br, uint dataStart)
return frame;
}

public static Character Read(BinaryReader br, uint dataStart)
public static Character Read(BinaryReader2 br, uint dataStart)
{
Character result = new Character();

Expand Down Expand Up @@ -669,7 +669,7 @@ public static Character Read(BinaryReader 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
7 changes: 4 additions & 3 deletions BaseHandlers/InstanceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ModelInstance

public Vector4 Rotation => Transform.ExtractRotation().ToAxisAngle();

public static ModelInstance Read(BinaryReader br)
public static ModelInstance Read(BinaryReader2 br)
{
ModelInstance result = new ModelInstance();

Expand All @@ -38,7 +38,7 @@ public static ModelInstance Read(BinaryReader 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
4 changes: 2 additions & 2 deletions BaseHandlers/Renderable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void BuildModel()
Model = new Model(meshes);
}

public VertexData ReadVertex(BinaryReader br, VertexAttribute attribute)
public VertexData ReadVertex(BinaryReader2 br, VertexAttribute attribute)
{
switch (attribute.Size) // We don't use type here. This is wrong tbh.
{
Expand Down Expand Up @@ -196,7 +196,7 @@ public VertexData ReadVertex(BinaryReader br, VertexAttribute attribute)
return new VertexData();
}

public void ReadBody(BinaryReader br)
public void ReadBody(BinaryReader2 br)
{
for (int i = 0; i < NumIndices; i++)
{
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 6433e91

Please sign in to comment.