This repository has been archived by the owner on Jan 23, 2022. It is now read-only.
-
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.
add rrtex converter, make chunky reader more general (#1)
* add rrtex converter, make chunky reader more general * fix rgd viewer and json converter * use imagesharp file writer
- Loading branch information
Showing
17 changed files
with
586 additions
and
221 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\RGDReader\RGDReader.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,36 @@ | ||
using RGDReader; | ||
using System.Text; | ||
|
||
if (args.Length != 1) | ||
{ | ||
Console.WriteLine("Usage: {0} <File Path>", AppDomain.CurrentDomain.FriendlyName); | ||
return; | ||
} | ||
|
||
string rgdPath = args[0]; | ||
|
||
var reader = new ChunkyFileReader(File.Open(rgdPath, FileMode.Open), Encoding.ASCII); | ||
var fileHeader = reader.ReadChunkyFileHeader(); | ||
Console.WriteLine("File header version: {0}", fileHeader.Version); | ||
|
||
void PrintHeaders(long position, long length, int depth = 0) | ||
{ | ||
reader.BaseStream.Position = position; | ||
foreach (var header in reader.ReadChunkHeaders(length)) | ||
{ | ||
for (int i = 0; i < depth; i++) | ||
{ | ||
Console.Write("\t"); | ||
} | ||
|
||
Console.WriteLine("Chunk Type: {0}, Name: {1}, Data length: {2}, Data position: {3}, Version: {4}, Path: {5}", | ||
header.Type, header.Name, header.Length, header.DataPosition, header.Version, header.Path); | ||
|
||
if (header.Type == "FOLD") | ||
{ | ||
PrintHeaders(header.DataPosition, header.Length, depth + 1); | ||
} | ||
} | ||
} | ||
|
||
PrintHeaders(reader.BaseStream.Position, reader.BaseStream.Length - reader.BaseStream.Position); |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace RGDReader; | ||
|
||
public record class ChunkHeader(string Type, string Name, int Version, int Length, int MinVersion); | ||
public record class ChunkHeader(string Type, string Name, int Version, int Length, string Path, long DataPosition); |
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,15 @@ | ||
namespace RGDReader; | ||
public class ChunkyList : List<KeyValueEntry> | ||
{ | ||
public ChunkyList() | ||
{ | ||
} | ||
|
||
public ChunkyList(IEnumerable<KeyValueEntry> collection) : base(collection) | ||
{ | ||
} | ||
|
||
public ChunkyList(int capacity) : base(capacity) | ||
{ | ||
} | ||
} |
Oops, something went wrong.