Fix bfres shape flags, msbt text fixes, and extracting archive fixes

This commit is contained in:
KillzXGaming 2019-09-19 20:11:21 -04:00
parent db04c5102a
commit c47d9bc2bc
8 changed files with 24 additions and 11 deletions

View file

@ -268,9 +268,10 @@ namespace FirstPlugin
EntryCount = reader.ReadUInt32();
Offsets = reader.ReadUInt32s((int)EntryCount);
Console.WriteLine($"");
for (int i = 0; i < EntryCount; i++)
{
reader.Position = Offsets[i] + Position;
reader.SeekBegin(Offsets[i] + Position);
ReadMessageString(reader, (uint)i);
}
}
@ -279,13 +280,20 @@ namespace FirstPlugin
{
List<byte> chars = new List<byte>();
short charCheck = reader.ReadInt16();
while (charCheck != 0)
byte charCheck = reader.ReadByte();
byte charCheck2 = reader.ReadByte();
while (charCheck != 0 && charCheck2 != 0)
{
chars.Add((byte)(charCheck >> 8));
chars.Add((byte)(charCheck & 255));
chars.Add(charCheck);
chars.Add(charCheck2);
charCheck = reader.ReadInt16();
if (reader.Position < reader.BaseStream.Length - 2)
{
charCheck = reader.ReadByte();
charCheck2 = reader.ReadByte();
}
else
break;
}
TextData.Add(new StringEntry(chars.ToArray()) { Index = index, });

View file

@ -111,9 +111,9 @@ namespace Toolbox.Library
if (ParentPath != string.Empty)
FilePath = FilePath.Replace(ParentPath, string.Empty);
var path = Path.Combine(overridePath, FilePath);
var path = $"{overridePath}/{FilePath}";
progressBar.Task = $"Extracting File {file}";
progressBar.Task = $"Extracting File {FileName}";
progressBar.Value = (Curfile++ * 100) / Collection.Count();
progressBar.Refresh();
CreateDirectoryIfExists($"{path}");

View file

@ -19,6 +19,12 @@ namespace Toolbox.Library.IO
this.Position = 0;
}
public FileReader(Stream stream, Encoding encoding, bool leaveOpen = false)
: base(stream, encoding, leaveOpen)
{
this.Position = 0;
}
public FileReader(string fileName, bool leaveOpen = false)
: this(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), leaveOpen)
{

View file

@ -34,10 +34,9 @@ void main()
{
// Convert to sRGB.
vec3 whiteColorSRGB = pow(whiteColor.rgb, vec3(1.0 / gamma));
vec3 blackColorSRGB = pow(blackColor.rgb, vec3(1.0 / gamma));
vec3 whiteInterpolation = whiteColor.rgb * textureMap0.rgb;
vec3 blackInterpolation = (vec3(1) - textureMap0.rgb) * blackColorSRGB.rgb;
vec3 whiteInterpolation = whiteColorSRGB.rgb * textureMap0.rgb;
vec3 blackInterpolation = (vec3(1) - textureMap0.rgb) * blackColor.rgb;
vec3 colorBlend = whiteInterpolation + blackInterpolation;