Final commit for tonight
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace BMGEditor
|
namespace BMGEditor
|
||||||
{
|
{
|
||||||
@@ -1248,6 +1247,7 @@ namespace BMGEditor
|
|||||||
ret.Add(0x00);
|
ret.Add(0x00);
|
||||||
ret.Add(0x1A);
|
ret.Add(0x1A);
|
||||||
ret.Add(escSeq.length);
|
ret.Add(escSeq.length);
|
||||||
|
ret.Add(escSeq.unk1);
|
||||||
|
|
||||||
switch (escSeq.length)
|
switch (escSeq.length)
|
||||||
{
|
{
|
||||||
@@ -1296,7 +1296,6 @@ namespace BMGEditor
|
|||||||
{
|
{
|
||||||
ret += String.Format("{0:X2}", m_File.Reader.ReadByte());
|
ret += String.Format("{0:X2}", m_File.Reader.ReadByte());
|
||||||
}
|
}
|
||||||
ret += "*";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret += c;
|
ret += c;
|
||||||
@@ -1382,14 +1381,52 @@ namespace BMGEditor
|
|||||||
{
|
{
|
||||||
if (strToWrite[i].Equals('*'))
|
if (strToWrite[i].Equals('*'))
|
||||||
{
|
{
|
||||||
/*EscapeSequence escSeq = new EscapeSequence();
|
//if (i + 2 > strToWrite.Count)
|
||||||
|
//break;
|
||||||
|
//else
|
||||||
|
{
|
||||||
|
EscapeSequence escSeq = new EscapeSequence();
|
||||||
string strEscSeqLen = String.Concat(strToWrite[i+1], strToWrite[i+2]);
|
string strEscSeqLen = String.Concat(strToWrite[i+1], strToWrite[i+2]);
|
||||||
escSeq.length = Byte.Parse(strEscSeqLen, System.Globalization.NumberStyles.HexNumber);
|
escSeq.length = Byte.Parse(strEscSeqLen, NumberStyles.HexNumber);
|
||||||
Console.WriteLine(String.Format("{0:X2}", escSeq.length));
|
escSeq.unk1 = Byte.Parse(String.Concat(strToWrite[i + 3], strToWrite[i + 4]), NumberStyles.HexNumber);
|
||||||
|
|
||||||
|
switch (escSeq.length)
|
||||||
|
{
|
||||||
|
case 0x06:
|
||||||
|
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x08:
|
||||||
|
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
||||||
|
escSeq.binValue2 = UInt16.Parse(String.Concat(strToWrite[i + 9], strToWrite[i + 10], strToWrite[i + 11], strToWrite[i + 12]), NumberStyles.HexNumber);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x0E:
|
||||||
|
escSeq.binValue1 = UInt16.Parse(String.Concat(strToWrite[i + 5], strToWrite[i + 6], strToWrite[i + 7], strToWrite[i + 8]), NumberStyles.HexNumber);
|
||||||
|
escSeq.binValue2 = UInt16.Parse(String.Concat(strToWrite[i + 9], strToWrite[i + 10], strToWrite[i + 11], strToWrite[i + 12]), NumberStyles.HexNumber);
|
||||||
|
escSeq.binValue3 = UInt16.Parse(String.Concat(strToWrite[i + 13], strToWrite[i + 14], strToWrite[i + 15], strToWrite[i + 16]), NumberStyles.HexNumber);
|
||||||
|
escSeq.binValue4 = UInt16.Parse(String.Concat(strToWrite[i + 17], strToWrite[i + 18], strToWrite[i + 19], strToWrite[i + 20]), NumberStyles.HexNumber);
|
||||||
|
escSeq.binValue5 = UInt16.Parse(String.Concat(strToWrite[i + 21], strToWrite[i + 22], strToWrite[i + 23], strToWrite[i + 24]), NumberStyles.HexNumber);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
System.Windows.Forms.MessageBox.Show("Error, please report this issue to Bussun#0586 on Discord. What went wrong: Unknown escape sequence");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Byte> escSeqToWrite = BytesFromEscapeSequence(escSeq);
|
||||||
|
foreach (Byte b in escSeqToWrite)
|
||||||
|
{
|
||||||
|
m_File.Writer.Write(b);
|
||||||
|
}
|
||||||
|
i += escSeq.length * 2 + 1;
|
||||||
|
/*Console.WriteLine(String.Format("{0:X2}", escSeq.length));
|
||||||
Console.WriteLine("strtowrite i " + strToWrite[i]);
|
Console.WriteLine("strtowrite i " + strToWrite[i]);
|
||||||
Console.WriteLine("strtowrite i+1 " + strToWrite[i+1]);*/
|
Console.WriteLine("strtowrite i+1 " + strToWrite[i+1]);*/
|
||||||
|
|
||||||
m_File.Writer.Write(strToWrite[i]);
|
//m_File.Writer.Write(strToWrite[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_File.Writer.Write(strToWrite[i]);
|
m_File.Writer.Write(strToWrite[i]);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace BMGEditor
|
|||||||
string str = "FF";
|
string str = "FF";
|
||||||
Byte octet = Byte.Parse(str, NumberStyles.HexNumber);
|
Byte octet = Byte.Parse(str, NumberStyles.HexNumber);
|
||||||
Console.WriteLine(octet);
|
Console.WriteLine(octet);
|
||||||
|
//BitConverter.ToUInt16()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user