cleanup code
This commit is contained in:
parent
a928660dd3
commit
d1ec1c29a4
|
@ -54,7 +54,7 @@ namespace SevenZip.Compression.LZMA
|
||||||
|
|
||||||
MemoryStream inStream = new MemoryStream(inputBytes);
|
MemoryStream inStream = new MemoryStream(inputBytes);
|
||||||
MemoryStream outStream = new MemoryStream();
|
MemoryStream outStream = new MemoryStream();
|
||||||
SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
|
Encoder encoder = new Encoder();
|
||||||
encoder.SetCoderProperties(propIDs, properties);
|
encoder.SetCoderProperties(propIDs, properties);
|
||||||
encoder.WriteCoderProperties(outStream);
|
encoder.WriteCoderProperties(outStream);
|
||||||
long fileSize = inStream.Length;
|
long fileSize = inStream.Length;
|
||||||
|
@ -68,7 +68,7 @@ namespace SevenZip.Compression.LZMA
|
||||||
{
|
{
|
||||||
MemoryStream newInStream = new MemoryStream(inputBytes);
|
MemoryStream newInStream = new MemoryStream(inputBytes);
|
||||||
|
|
||||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
Decoder decoder = new Decoder();
|
||||||
|
|
||||||
newInStream.Seek(0, 0);
|
newInStream.Seek(0, 0);
|
||||||
MemoryStream newOutStream = new MemoryStream();
|
MemoryStream newOutStream = new MemoryStream();
|
||||||
|
@ -97,7 +97,7 @@ namespace SevenZip.Compression.LZMA
|
||||||
|
|
||||||
public static MemoryStream StreamDecompress(MemoryStream newInStream)
|
public static MemoryStream StreamDecompress(MemoryStream newInStream)
|
||||||
{
|
{
|
||||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
Decoder decoder = new Decoder();
|
||||||
|
|
||||||
newInStream.Seek(0, 0);
|
newInStream.Seek(0, 0);
|
||||||
MemoryStream newOutStream = new MemoryStream();
|
MemoryStream newOutStream = new MemoryStream();
|
||||||
|
@ -124,7 +124,7 @@ namespace SevenZip.Compression.LZMA
|
||||||
|
|
||||||
public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
|
public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
|
||||||
{
|
{
|
||||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
Decoder decoder = new Decoder();
|
||||||
|
|
||||||
newInStream.Seek(0, 0);
|
newInStream.Seek(0, 0);
|
||||||
MemoryStream newOutStream = new MemoryStream();
|
MemoryStream newOutStream = new MemoryStream();
|
||||||
|
|
|
@ -13,12 +13,12 @@ namespace Unity_Studio
|
||||||
public AboutBox()
|
public AboutBox()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = String.Format("About {0}", AssemblyTitle);
|
Text = $"About {AssemblyTitle}";
|
||||||
this.labelProductName.Text = AssemblyProduct;
|
labelProductName.Text = AssemblyProduct;
|
||||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
labelVersion.Text = $"Version {AssemblyVersion}";
|
||||||
this.labelCopyright.Text = AssemblyCopyright;
|
labelCopyright.Text = AssemblyCopyright;
|
||||||
this.labelCompanyName.Text = AssemblyCompany;
|
labelCompanyName.Text = AssemblyCompany;
|
||||||
this.textBoxDescription.Text = AssemblyDescription;
|
textBoxDescription.Text = AssemblyDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Assembly Attribute Accessors
|
#region Assembly Attribute Accessors
|
||||||
|
@ -40,13 +40,7 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AssemblyVersion
|
public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string AssemblyDescription
|
public string AssemblyDescription
|
||||||
{
|
{
|
||||||
|
@ -103,7 +97,7 @@ namespace Unity_Studio
|
||||||
|
|
||||||
private void okButton_Click(object sender, EventArgs e)
|
private void okButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,12 @@ namespace Unity_Studio
|
||||||
showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
|
showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
|
||||||
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
|
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
|
||||||
convertfsb.Checked = (bool)Properties.Settings.Default["convertfsb"];
|
convertfsb.Checked = (bool)Properties.Settings.Default["convertfsb"];
|
||||||
string str = Properties.Settings.Default["convertType"] as string;
|
var str = (string)Properties.Settings.Default["convertType"];
|
||||||
foreach (Control c in panel1.Controls)
|
foreach (Control c in panel1.Controls)
|
||||||
{
|
{
|
||||||
if (c.Text == str)
|
if (c.Text == str)
|
||||||
{
|
{
|
||||||
(c as RadioButton).Checked = true;
|
((RadioButton)c).Checked = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,21 +57,21 @@ namespace Unity_Studio
|
||||||
Properties.Settings.Default["convertfsb"] = convertfsb.Checked;
|
Properties.Settings.Default["convertfsb"] = convertfsb.Checked;
|
||||||
foreach (Control c in panel1.Controls)
|
foreach (Control c in panel1.Controls)
|
||||||
{
|
{
|
||||||
if ((c as RadioButton).Checked)
|
if (((RadioButton)c).Checked)
|
||||||
{
|
{
|
||||||
Properties.Settings.Default["convertType"] = c.Text;
|
Properties.Settings.Default["convertType"] = c.Text;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
this.DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fbxCancel_Click(object sender, EventArgs e)
|
private void fbxCancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exportDeformers_CheckedChanged(object sender, EventArgs e)
|
private void exportDeformers_CheckedChanged(object sender, EventArgs e)
|
||||||
|
|
|
@ -94,23 +94,21 @@ namespace Unity_Studio
|
||||||
|
|
||||||
if (readSwitch)
|
if (readSwitch)
|
||||||
{
|
{
|
||||||
m_AudioData = new byte[m_Size];
|
|
||||||
|
|
||||||
if (m_Source == null)
|
if (m_Source == null)
|
||||||
{
|
{
|
||||||
a_Stream.Read(m_AudioData, 0, (int)m_Size);
|
m_AudioData = a_Stream.ReadBytes((int)m_Size);
|
||||||
}
|
}
|
||||||
else if (File.Exists(m_Source) ||
|
else if (File.Exists(m_Source) ||
|
||||||
File.Exists(m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(m_Source))))
|
File.Exists(m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(m_Source))))
|
||||||
{
|
{
|
||||||
BinaryReader reader = new BinaryReader(File.OpenRead(m_Source));
|
BinaryReader reader = new BinaryReader(File.OpenRead(m_Source));
|
||||||
reader.BaseStream.Position = m_Offset;
|
reader.BaseStream.Position = m_Offset;
|
||||||
reader.Read(m_AudioData, 0, (int)m_Size);
|
m_AudioData = reader.ReadBytes((int)m_Size);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EndianStream estream = null;
|
EndianStream estream;
|
||||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
|
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
|
||||||
{
|
{
|
||||||
estream.Position = m_Offset;
|
estream.Position = m_Offset;
|
||||||
|
|
|
@ -58,10 +58,10 @@ namespace Unity_Studio
|
||||||
m_Tag = a_Stream.ReadUInt16();
|
m_Tag = a_Stream.ReadUInt16();
|
||||||
m_IsActive = a_Stream.ReadBoolean();
|
m_IsActive = a_Stream.ReadBoolean();
|
||||||
|
|
||||||
base.Text = m_Name;
|
Text = m_Name;
|
||||||
preloadData.Text = m_Name;
|
preloadData.Text = m_Name;
|
||||||
//name should be unique
|
//name should be unique
|
||||||
base.Name = uniqueID;
|
Name = uniqueID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,15 +168,14 @@ namespace Unity_Studio
|
||||||
if (File.Exists(path) ||
|
if (File.Exists(path) ||
|
||||||
File.Exists(path = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(path))))
|
File.Exists(path = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(path))))
|
||||||
{
|
{
|
||||||
image_data = new byte[image_data_size];
|
|
||||||
BinaryReader reader = new BinaryReader(File.OpenRead(path));
|
BinaryReader reader = new BinaryReader(File.OpenRead(path));
|
||||||
reader.BaseStream.Position = offset;
|
reader.BaseStream.Position = offset;
|
||||||
reader.Read(image_data, 0, image_data_size);
|
image_data = reader.ReadBytes(image_data_size);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EndianStream estream = null;
|
EndianStream estream;
|
||||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
||||||
{
|
{
|
||||||
estream.Position = offset;
|
estream.Position = offset;
|
||||||
|
@ -186,8 +185,7 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
image_data = new byte[image_data_size];
|
image_data = a_Stream.ReadBytes(image_data_size);
|
||||||
a_Stream.Read(image_data, 0, image_data_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_TextureFormat)
|
switch (m_TextureFormat)
|
||||||
|
|
|
@ -138,11 +138,8 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
return member2;
|
return member2;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
member2.Add(member);
|
member2.Add(member);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return member2;
|
return member2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Lz4;
|
using Lz4;
|
||||||
|
using SevenZip.Compression.LZMA;
|
||||||
|
|
||||||
namespace Unity_Studio
|
namespace Unity_Studio
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ namespace Unity_Studio
|
||||||
byte[] lzmaBuffer = new byte[lzmaSize];
|
byte[] lzmaBuffer = new byte[lzmaSize];
|
||||||
b_Stream.Read(lzmaBuffer, 0, lzmaSize);
|
b_Stream.Read(lzmaBuffer, 0, lzmaSize);
|
||||||
|
|
||||||
using (var lzmaStream = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
|
using (var lzmaStream = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
|
||||||
{
|
{
|
||||||
getFiles(lzmaStream, 0);
|
getFiles(lzmaStream, 0);
|
||||||
}
|
}
|
||||||
|
@ -166,15 +166,14 @@ namespace Unity_Studio
|
||||||
EndianStream blocksInfo;
|
EndianStream blocksInfo;
|
||||||
switch (flag & 0x3F)
|
switch (flag & 0x3F)
|
||||||
{
|
{
|
||||||
default:
|
default://None
|
||||||
case 0://None
|
|
||||||
{
|
{
|
||||||
blocksInfo = new EndianStream(new MemoryStream(blocksInfoBytes), EndianType.BigEndian);
|
blocksInfo = new EndianStream(new MemoryStream(blocksInfoBytes), EndianType.BigEndian);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1://LZMA
|
case 1://LZMA
|
||||||
{
|
{
|
||||||
blocksInfo = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
|
blocksInfo = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2://LZ4
|
case 2://LZ4
|
||||||
|
@ -206,8 +205,7 @@ namespace Unity_Studio
|
||||||
var compressedBytes = b_Stream.ReadBytes(compressedSize);
|
var compressedBytes = b_Stream.ReadBytes(compressedSize);
|
||||||
switch (flag & 0x3F)
|
switch (flag & 0x3F)
|
||||||
{
|
{
|
||||||
default:
|
default://None
|
||||||
case 0://None
|
|
||||||
{
|
{
|
||||||
assetsDataStream.Write(compressedBytes, 0, compressedSize);
|
assetsDataStream.Write(compressedBytes, 0, compressedSize);
|
||||||
break;
|
break;
|
||||||
|
@ -217,7 +215,7 @@ namespace Unity_Studio
|
||||||
var uncompressedBytes = new byte[uncompressedSize];
|
var uncompressedBytes = new byte[uncompressedSize];
|
||||||
using (var mstream = new MemoryStream(compressedBytes))
|
using (var mstream = new MemoryStream(compressedBytes))
|
||||||
{
|
{
|
||||||
var decoder = SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
|
var decoder = SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
|
||||||
decoder.Read(uncompressedBytes, 0, uncompressedSize);
|
decoder.Read(uncompressedBytes, 0, uncompressedSize);
|
||||||
decoder.Dispose();
|
decoder.Dispose();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,115 +20,115 @@ namespace Unity_Studio
|
||||||
|
|
||||||
public EndianStream(Stream stream, EndianType endian) : base(stream) { }
|
public EndianStream(Stream stream, EndianType endian) : base(stream) { }
|
||||||
|
|
||||||
public long Position { get { return base.BaseStream.Position; } set { base.BaseStream.Position = value; } }
|
public long Position { get { return BaseStream.Position; } set { BaseStream.Position = value; } }
|
||||||
|
|
||||||
public override short ReadInt16()
|
public override short ReadInt16()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a16 = base.ReadBytes(2);
|
a16 = ReadBytes(2);
|
||||||
Array.Reverse(a16);
|
Array.Reverse(a16);
|
||||||
return BitConverter.ToInt16(a16, 0);
|
return BitConverter.ToInt16(a16, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadInt16();
|
return base.ReadInt16();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int ReadInt32()
|
public override int ReadInt32()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a32 = base.ReadBytes(4);
|
a32 = ReadBytes(4);
|
||||||
Array.Reverse(a32);
|
Array.Reverse(a32);
|
||||||
return BitConverter.ToInt32(a32, 0);
|
return BitConverter.ToInt32(a32, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadInt32();
|
return base.ReadInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override long ReadInt64()
|
public override long ReadInt64()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a64 = base.ReadBytes(8);
|
a64 = ReadBytes(8);
|
||||||
Array.Reverse(a64);
|
Array.Reverse(a64);
|
||||||
return BitConverter.ToInt64(a64, 0);
|
return BitConverter.ToInt64(a64, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadInt64();
|
return base.ReadInt64();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ushort ReadUInt16()
|
public override ushort ReadUInt16()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a16 = base.ReadBytes(2);
|
a16 = ReadBytes(2);
|
||||||
Array.Reverse(a16);
|
Array.Reverse(a16);
|
||||||
return BitConverter.ToUInt16(a16, 0);
|
return BitConverter.ToUInt16(a16, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadUInt16();
|
return base.ReadUInt16();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override uint ReadUInt32()
|
public override uint ReadUInt32()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a32 = base.ReadBytes(4);
|
a32 = ReadBytes(4);
|
||||||
Array.Reverse(a32);
|
Array.Reverse(a32);
|
||||||
return BitConverter.ToUInt32(a32, 0);
|
return BitConverter.ToUInt32(a32, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadUInt32();
|
return base.ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ulong ReadUInt64()
|
public override ulong ReadUInt64()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a64 = base.ReadBytes(8);
|
a64 = ReadBytes(8);
|
||||||
Array.Reverse(a64);
|
Array.Reverse(a64);
|
||||||
return BitConverter.ToUInt64(a64, 0);
|
return BitConverter.ToUInt64(a64, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadUInt64();
|
return base.ReadUInt64();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float ReadSingle()
|
public override float ReadSingle()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a32 = base.ReadBytes(4);
|
a32 = ReadBytes(4);
|
||||||
Array.Reverse(a32);
|
Array.Reverse(a32);
|
||||||
return BitConverter.ToSingle(a32, 0);
|
return BitConverter.ToSingle(a32, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadSingle();
|
return base.ReadSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override double ReadDouble()
|
public override double ReadDouble()
|
||||||
{
|
{
|
||||||
if (endian == EndianType.BigEndian)
|
if (endian == EndianType.BigEndian)
|
||||||
{
|
{
|
||||||
a64 = base.ReadBytes(8);
|
a64 = ReadBytes(8);
|
||||||
Array.Reverse(a64);
|
Array.Reverse(a64);
|
||||||
return BitConverter.ToUInt64(a64, 0);
|
return BitConverter.ToUInt64(a64, 0);
|
||||||
}
|
}
|
||||||
else return base.ReadDouble();
|
return base.ReadDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadASCII(int length)
|
public string ReadASCII(int length)
|
||||||
{
|
{
|
||||||
return Encoding.ASCII.GetString(base.ReadBytes(length));
|
return Encoding.ASCII.GetString(ReadBytes(length));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AlignStream(int alignment)
|
public void AlignStream(int alignment)
|
||||||
{
|
{
|
||||||
long pos = base.BaseStream.Position;
|
long pos = BaseStream.Position;
|
||||||
//long padding = alignment - pos + (pos / alignment) * alignment;
|
//long padding = alignment - pos + (pos / alignment) * alignment;
|
||||||
//if (padding != alignment) { base.BaseStream.Position += padding; }
|
//if (padding != alignment) { base.BaseStream.Position += padding; }
|
||||||
if ((pos % alignment) != 0) { base.BaseStream.Position += alignment - (pos % alignment); }
|
if ((pos % alignment) != 0) { BaseStream.Position += alignment - (pos % alignment); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadAlignedString(int length)
|
public string ReadAlignedString(int length)
|
||||||
{
|
{
|
||||||
if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
|
if (length > 0 && length < (BaseStream.Length - BaseStream.Position))//crude failsafe
|
||||||
{
|
{
|
||||||
byte[] stringData = new byte[length];
|
byte[] stringData = new byte[length];
|
||||||
base.Read(stringData, 0, length);
|
Read(stringData, 0, length);
|
||||||
var result = Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
var result = Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
||||||
|
|
||||||
/*string result = "";
|
/*string result = "";
|
||||||
|
@ -142,7 +142,7 @@ namespace Unity_Studio
|
||||||
AlignStream(4);
|
AlignStream(4);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else { return ""; }
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadStringToNull()
|
public string ReadStringToNull()
|
||||||
|
|
|
@ -9,10 +9,6 @@ namespace Lz4
|
||||||
{
|
{
|
||||||
public class Lz4DecoderStream : Stream
|
public class Lz4DecoderStream : Stream
|
||||||
{
|
{
|
||||||
public Lz4DecoderStream()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public Lz4DecoderStream(Stream input, long inputLength = long.MaxValue)
|
public Lz4DecoderStream(Stream input, long inputLength = long.MaxValue)
|
||||||
{
|
{
|
||||||
Reset(input, inputLength);
|
Reset(input, inputLength);
|
||||||
|
@ -37,7 +33,7 @@ namespace Lz4
|
||||||
|
|
||||||
public override void Close()
|
public override void Close()
|
||||||
{
|
{
|
||||||
this.input = null;
|
input = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long inputLength;
|
private long inputLength;
|
||||||
|
@ -494,20 +490,11 @@ namespace Lz4
|
||||||
|
|
||||||
#region Stream internals
|
#region Stream internals
|
||||||
|
|
||||||
public override bool CanRead
|
public override bool CanRead => true;
|
||||||
{
|
|
||||||
get { return true; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanSeek
|
public override bool CanSeek => false;
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanWrite
|
public override bool CanWrite => false;
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1105,10 +1105,6 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//bool stop = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshPD.uniqueID = keepID;
|
MeshPD.uniqueID = keepID;
|
||||||
|
@ -1653,7 +1649,8 @@ namespace Unity_Studio
|
||||||
public static bool ExportAudioClip(AssetPreloadData asset, string exportFilename, string exportFileextension)
|
public static bool ExportAudioClip(AssetPreloadData asset, string exportFilename, string exportFileextension)
|
||||||
{
|
{
|
||||||
var oldextension = exportFileextension;
|
var oldextension = exportFileextension;
|
||||||
if ((bool)Properties.Settings.Default["convertfsb"] && exportFileextension == ".fsb")
|
var convertfsb = (bool)Properties.Settings.Default["convertfsb"];
|
||||||
|
if (convertfsb && exportFileextension == ".fsb")
|
||||||
{
|
{
|
||||||
exportFileextension = ".wav";
|
exportFileextension = ".wav";
|
||||||
}
|
}
|
||||||
|
@ -1661,7 +1658,7 @@ namespace Unity_Studio
|
||||||
if (ExportFileExists(exportFullname))
|
if (ExportFileExists(exportFullname))
|
||||||
return false;
|
return false;
|
||||||
var m_AudioClip = new AudioClip(asset, true);
|
var m_AudioClip = new AudioClip(asset, true);
|
||||||
if ((bool)Properties.Settings.Default["convertfsb"] && oldextension == ".fsb")
|
if (convertfsb && oldextension == ".fsb")
|
||||||
{
|
{
|
||||||
FMOD.System system;
|
FMOD.System system;
|
||||||
FMOD.Sound sound;
|
FMOD.Sound sound;
|
||||||
|
@ -1769,10 +1766,10 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
count = 4;
|
count = 4;
|
||||||
}
|
}
|
||||||
var vertices = new ManagedFbx.Vector3[m_Mesh.m_VertexCount];
|
var vertices = new Vector3[m_Mesh.m_VertexCount];
|
||||||
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
||||||
{
|
{
|
||||||
vertices[v] = new ManagedFbx.Vector3(
|
vertices[v] = new Vector3(
|
||||||
m_Mesh.m_Vertices[v * count],
|
m_Mesh.m_Vertices[v * count],
|
||||||
m_Mesh.m_Vertices[v * count + 1],
|
m_Mesh.m_Vertices[v * count + 1],
|
||||||
m_Mesh.m_Vertices[v * count + 2]);
|
m_Mesh.m_Vertices[v * count + 2]);
|
||||||
|
@ -1801,10 +1798,10 @@ namespace Unity_Studio
|
||||||
count = 4;
|
count = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
var normals = new ManagedFbx.Vector3[m_Mesh.m_VertexCount];
|
var normals = new Vector3[m_Mesh.m_VertexCount];
|
||||||
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
||||||
{
|
{
|
||||||
normals[n] = new ManagedFbx.Vector3(
|
normals[n] = new Vector3(
|
||||||
m_Mesh.m_Normals[n * count],
|
m_Mesh.m_Normals[n * count],
|
||||||
m_Mesh.m_Normals[n * count + 1],
|
m_Mesh.m_Normals[n * count + 1],
|
||||||
m_Mesh.m_Normals[n * count + 2]);
|
m_Mesh.m_Normals[n * count + 2]);
|
||||||
|
@ -1815,20 +1812,20 @@ namespace Unity_Studio
|
||||||
#region Colors
|
#region Colors
|
||||||
if (m_Mesh.m_Colors == null)
|
if (m_Mesh.m_Colors == null)
|
||||||
{
|
{
|
||||||
var colors = new ManagedFbx.Colour[m_Mesh.m_VertexCount];
|
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colors[c] = new ManagedFbx.Colour(
|
colors[c] = new Colour(
|
||||||
0.5f, 0.5f, 0.5f, 1.0f);
|
0.5f, 0.5f, 0.5f, 1.0f);
|
||||||
}
|
}
|
||||||
mesh.VertexColours = colors;
|
mesh.VertexColours = colors;
|
||||||
}
|
}
|
||||||
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||||
{
|
{
|
||||||
var colors = new ManagedFbx.Colour[m_Mesh.m_VertexCount];
|
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colors[c] = new ManagedFbx.Colour(
|
colors[c] = new Colour(
|
||||||
m_Mesh.m_Colors[c * 4],
|
m_Mesh.m_Colors[c * 4],
|
||||||
m_Mesh.m_Colors[c * 4 + 1],
|
m_Mesh.m_Colors[c * 4 + 1],
|
||||||
m_Mesh.m_Colors[c * 4 + 2],
|
m_Mesh.m_Colors[c * 4 + 2],
|
||||||
|
@ -1838,10 +1835,10 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var colors = new ManagedFbx.Colour[m_Mesh.m_VertexCount];
|
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colors[c] = new ManagedFbx.Colour(
|
colors[c] = new Colour(
|
||||||
m_Mesh.m_Colors[c * 4],
|
m_Mesh.m_Colors[c * 4],
|
||||||
m_Mesh.m_Colors[c * 4 + 1],
|
m_Mesh.m_Colors[c * 4 + 1],
|
||||||
m_Mesh.m_Colors[c * 4 + 2],
|
m_Mesh.m_Colors[c * 4 + 2],
|
||||||
|
@ -1853,19 +1850,19 @@ namespace Unity_Studio
|
||||||
#region UV
|
#region UV
|
||||||
if (m_Mesh.m_UV1 != null && m_Mesh.m_UV1.Length == m_Mesh.m_VertexCount * 2)
|
if (m_Mesh.m_UV1 != null && m_Mesh.m_UV1.Length == m_Mesh.m_VertexCount * 2)
|
||||||
{
|
{
|
||||||
var uv = new ManagedFbx.Vector2[m_Mesh.m_VertexCount];
|
var uv = new Vector2[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
uv[c] = new ManagedFbx.Vector2(m_Mesh.m_UV1[c * 2], m_Mesh.m_UV1[c * 2 + 1]);
|
uv[c] = new Vector2(m_Mesh.m_UV1[c * 2], m_Mesh.m_UV1[c * 2 + 1]);
|
||||||
}
|
}
|
||||||
mesh.TextureCoords = uv;
|
mesh.TextureCoords = uv;
|
||||||
}
|
}
|
||||||
else if (m_Mesh.m_UV2 != null && m_Mesh.m_UV2.Length == m_Mesh.m_VertexCount * 2)
|
else if (m_Mesh.m_UV2 != null && m_Mesh.m_UV2.Length == m_Mesh.m_VertexCount * 2)
|
||||||
{
|
{
|
||||||
var uv = new ManagedFbx.Vector2[m_Mesh.m_VertexCount];
|
var uv = new Vector2[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
uv[c] = new ManagedFbx.Vector2(m_Mesh.m_UV2[c * 2], m_Mesh.m_UV2[c * 2 + 1]);
|
uv[c] = new Vector2(m_Mesh.m_UV2[c * 2], m_Mesh.m_UV2[c * 2 + 1]);
|
||||||
}
|
}
|
||||||
mesh.TextureCoords = uv;
|
mesh.TextureCoords = uv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,9 +49,9 @@ namespace Unity_Studio
|
||||||
int vboColors;
|
int vboColors;
|
||||||
int vboViewMatrix;
|
int vboViewMatrix;
|
||||||
int eboElements;
|
int eboElements;
|
||||||
OpenTK.Vector3[] vertexData;
|
Vector3[] vertexData;
|
||||||
OpenTK.Vector3[] normalData;
|
Vector3[] normalData;
|
||||||
OpenTK.Vector4[] colorData;
|
Vector4[] colorData;
|
||||||
Matrix4[] viewMatrixData;
|
Matrix4[] viewMatrixData;
|
||||||
int[] indiceData;
|
int[] indiceData;
|
||||||
bool wireFrameView;
|
bool wireFrameView;
|
||||||
|
@ -73,7 +73,7 @@ namespace Unity_Studio
|
||||||
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
|
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
|
||||||
|
|
||||||
|
|
||||||
private void loadFile_Click(object sender, System.EventArgs e)
|
private void loadFile_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadFolder_Click(object sender, System.EventArgs e)
|
private void loadFolder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/*FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
|
/*FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
|
||||||
|
|
||||||
|
@ -274,11 +274,11 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
if (productName != "")
|
if (productName != "")
|
||||||
{
|
{
|
||||||
this.Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||||
}
|
}
|
||||||
else if (assetsfileList.Count > 0)
|
else if (assetsfileList.Count > 0)
|
||||||
{
|
{
|
||||||
this.Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||||
}
|
}
|
||||||
if (!dontLoadAssetsMenuItem.Checked)
|
if (!dontLoadAssetsMenuItem.Checked)
|
||||||
{
|
{
|
||||||
|
@ -596,7 +596,7 @@ namespace Unity_Studio
|
||||||
if (treeSearch.Text == " Search ")
|
if (treeSearch.Text == " Search ")
|
||||||
{
|
{
|
||||||
treeSearch.Text = "";
|
treeSearch.Text = "";
|
||||||
treeSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
treeSearch.ForeColor = SystemColors.WindowText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ namespace Unity_Studio
|
||||||
if (treeSearch.Text == "")
|
if (treeSearch.Text == "")
|
||||||
{
|
{
|
||||||
treeSearch.Text = " Search ";
|
treeSearch.Text = " Search ";
|
||||||
treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
treeSearch.ForeColor = SystemColors.GrayText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -694,7 +694,7 @@ namespace Unity_Studio
|
||||||
if (listSearch.Text == " Filter ")
|
if (listSearch.Text == " Filter ")
|
||||||
{
|
{
|
||||||
listSearch.Text = "";
|
listSearch.Text = "";
|
||||||
listSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
listSearch.ForeColor = SystemColors.WindowText;
|
||||||
enableFiltering = true;
|
enableFiltering = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -705,7 +705,7 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
enableFiltering = false;
|
enableFiltering = false;
|
||||||
listSearch.Text = " Filter ";
|
listSearch.Text = " Filter ";
|
||||||
listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
listSearch.ForeColor = SystemColors.GrayText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ namespace Unity_Studio
|
||||||
assetListView.BeginUpdate();
|
assetListView.BeginUpdate();
|
||||||
assetListView.SelectedIndices.Clear();
|
assetListView.SelectedIndices.Clear();
|
||||||
//visibleListAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.StartsWith(ListSearch.Text, System.StringComparison.CurrentCultureIgnoreCase));
|
//visibleListAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.StartsWith(ListSearch.Text, System.StringComparison.CurrentCultureIgnoreCase));
|
||||||
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, System.StringComparison.CurrentCultureIgnoreCase) >= 0);
|
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, StringComparison.CurrentCultureIgnoreCase) >= 0);
|
||||||
assetListView.VirtualListSize = visibleAssets.Count;
|
assetListView.VirtualListSize = visibleAssets.Count;
|
||||||
assetListView.EndUpdate();
|
assetListView.EndUpdate();
|
||||||
}
|
}
|
||||||
|
@ -742,7 +742,7 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
int xdiff = reverseSort ? b.Text.CompareTo(a.Text) : a.Text.CompareTo(b.Text);
|
int xdiff = reverseSort ? b.Text.CompareTo(a.Text) : a.Text.CompareTo(b.Text);
|
||||||
if (xdiff != 0) return xdiff;
|
if (xdiff != 0) return xdiff;
|
||||||
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
|
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -750,7 +750,7 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
int xdiff = reverseSort ? b.TypeString.CompareTo(a.TypeString) : a.TypeString.CompareTo(b.TypeString);
|
int xdiff = reverseSort ? b.TypeString.CompareTo(a.TypeString) : a.TypeString.CompareTo(b.TypeString);
|
||||||
if (xdiff != 0) return xdiff;
|
if (xdiff != 0) return xdiff;
|
||||||
else return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
|
return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -758,7 +758,7 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
int xdiff = reverseSort ? b.Size.CompareTo(a.Size) : a.Size.CompareTo(b.Size);
|
int xdiff = reverseSort ? b.Size.CompareTo(a.Size) : a.Size.CompareTo(b.Size);
|
||||||
if (xdiff != 0) return xdiff;
|
if (xdiff != 0) return xdiff;
|
||||||
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
|
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -771,7 +771,7 @@ namespace Unity_Studio
|
||||||
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
|
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
previewPanel.BackgroundImage = Properties.Resources.preview;
|
previewPanel.BackgroundImage = Properties.Resources.preview;
|
||||||
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
previewPanel.BackgroundImageLayout = ImageLayout.Center;
|
||||||
assetInfoLabel.Visible = false;
|
assetInfoLabel.Visible = false;
|
||||||
assetInfoLabel.Text = null;
|
assetInfoLabel.Text = null;
|
||||||
textPreviewBox.Visible = false;
|
textPreviewBox.Visible = false;
|
||||||
|
@ -975,10 +975,10 @@ namespace Unity_Studio
|
||||||
{
|
{
|
||||||
count = 4;
|
count = 4;
|
||||||
}
|
}
|
||||||
vertexData = new OpenTK.Vector3[m_Mesh.m_VertexCount];
|
vertexData = new Vector3[m_Mesh.m_VertexCount];
|
||||||
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
||||||
{
|
{
|
||||||
vertexData[v] = new OpenTK.Vector3(
|
vertexData[v] = new Vector3(
|
||||||
m_Mesh.m_Vertices[v * count],
|
m_Mesh.m_Vertices[v * count],
|
||||||
m_Mesh.m_Vertices[v * count + 1],
|
m_Mesh.m_Vertices[v * count + 1],
|
||||||
m_Mesh.m_Vertices[v * count + 2]);
|
m_Mesh.m_Vertices[v * count + 2]);
|
||||||
|
@ -1005,10 +1005,10 @@ namespace Unity_Studio
|
||||||
count = 4;
|
count = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
normalData = new OpenTK.Vector3[m_Mesh.m_VertexCount];
|
normalData = new Vector3[m_Mesh.m_VertexCount];
|
||||||
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
||||||
{
|
{
|
||||||
normalData[n] = new OpenTK.Vector3(
|
normalData[n] = new Vector3(
|
||||||
m_Mesh.m_Normals[n * count],
|
m_Mesh.m_Normals[n * count],
|
||||||
m_Mesh.m_Normals[n * count + 1],
|
m_Mesh.m_Normals[n * count + 1],
|
||||||
m_Mesh.m_Normals[n * count + 2]);
|
m_Mesh.m_Normals[n * count + 2]);
|
||||||
|
@ -1018,19 +1018,19 @@ namespace Unity_Studio
|
||||||
#region Colors
|
#region Colors
|
||||||
if (m_Mesh.m_Colors == null)
|
if (m_Mesh.m_Colors == null)
|
||||||
{
|
{
|
||||||
colorData = new OpenTK.Vector4[m_Mesh.m_VertexCount];
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colorData[c] = new OpenTK.Vector4(
|
colorData[c] = new Vector4(
|
||||||
0.5f, 0.5f, 0.5f, 1.0f);
|
0.5f, 0.5f, 0.5f, 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||||
{
|
{
|
||||||
colorData = new OpenTK.Vector4[m_Mesh.m_VertexCount];
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colorData[c] = new OpenTK.Vector4(
|
colorData[c] = new Vector4(
|
||||||
m_Mesh.m_Colors[c * 4],
|
m_Mesh.m_Colors[c * 4],
|
||||||
m_Mesh.m_Colors[c * 4 + 1],
|
m_Mesh.m_Colors[c * 4 + 1],
|
||||||
m_Mesh.m_Colors[c * 4 + 2],
|
m_Mesh.m_Colors[c * 4 + 2],
|
||||||
|
@ -1039,10 +1039,10 @@ namespace Unity_Studio
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
colorData = new OpenTK.Vector4[m_Mesh.m_VertexCount];
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
{
|
{
|
||||||
colorData[c] = new OpenTK.Vector4(
|
colorData[c] = new Vector4(
|
||||||
m_Mesh.m_Colors[c * 4],
|
m_Mesh.m_Colors[c * 4],
|
||||||
m_Mesh.m_Colors[c * 4 + 1],
|
m_Mesh.m_Colors[c * 4 + 1],
|
||||||
m_Mesh.m_Colors[c * 4 + 2],
|
m_Mesh.m_Colors[c * 4 + 2],
|
||||||
|
@ -1375,7 +1375,7 @@ namespace Unity_Studio
|
||||||
//Environment.Exit(-1);
|
//Environment.Exit(-1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else { return false; }
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void all3DObjectssplitToolStripMenuItem_Click(object sender, EventArgs e)
|
private void all3DObjectssplitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
@ -1734,24 +1734,24 @@ namespace Unity_Studio
|
||||||
GL.DeleteShader(address);
|
GL.DeleteShader(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createVBO(out int vboAddress, OpenTK.Vector3[] data, int address)
|
private void createVBO(out int vboAddress, Vector3[] data, int address)
|
||||||
{
|
{
|
||||||
GL.GenBuffers(1, out vboAddress);
|
GL.GenBuffers(1, out vboAddress);
|
||||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||||
GL.BufferData<OpenTK.Vector3>(BufferTarget.ArrayBuffer,
|
GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
|
||||||
(IntPtr)(data.Length * OpenTK.Vector3.SizeInBytes),
|
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
||||||
data,
|
data,
|
||||||
BufferUsageHint.StaticDraw);
|
BufferUsageHint.StaticDraw);
|
||||||
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
|
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
|
||||||
GL.EnableVertexAttribArray(address);
|
GL.EnableVertexAttribArray(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createVBO(out int vboAddress, OpenTK.Vector4[] data, int address)
|
private void createVBO(out int vboAddress, Vector4[] data, int address)
|
||||||
{
|
{
|
||||||
GL.GenBuffers(1, out vboAddress);
|
GL.GenBuffers(1, out vboAddress);
|
||||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||||
GL.BufferData<OpenTK.Vector4>(BufferTarget.ArrayBuffer,
|
GL.BufferData<Vector4>(BufferTarget.ArrayBuffer,
|
||||||
(IntPtr)(data.Length * OpenTK.Vector4.SizeInBytes),
|
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
||||||
data,
|
data,
|
||||||
BufferUsageHint.StaticDraw);
|
BufferUsageHint.StaticDraw);
|
||||||
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);
|
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);
|
||||||
|
@ -1823,7 +1823,7 @@ namespace Unity_Studio
|
||||||
Properties.Settings.Default["displayInfo"] = displayAssetInfoMenuItem.Checked;
|
Properties.Settings.Default["displayInfo"] = displayAssetInfoMenuItem.Checked;
|
||||||
Properties.Settings.Default.Save();*/
|
Properties.Settings.Default.Save();*/
|
||||||
|
|
||||||
base.Text = "Unity Studio";
|
Text = "Unity Studio";
|
||||||
|
|
||||||
unityFiles.Clear();
|
unityFiles.Clear();
|
||||||
assetsfileList.Clear();
|
assetsfileList.Clear();
|
||||||
|
@ -1841,7 +1841,7 @@ namespace Unity_Studio
|
||||||
classesListView.Groups.Clear();
|
classesListView.Groups.Clear();
|
||||||
|
|
||||||
previewPanel.BackgroundImage = Properties.Resources.preview;
|
previewPanel.BackgroundImage = Properties.Resources.preview;
|
||||||
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
previewPanel.BackgroundImageLayout = ImageLayout.Center;
|
||||||
assetInfoLabel.Visible = false;
|
assetInfoLabel.Visible = false;
|
||||||
assetInfoLabel.Text = null;
|
assetInfoLabel.Text = null;
|
||||||
textPreviewBox.Visible = false;
|
textPreviewBox.Visible = false;
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
7-Zip
|
|
||||||
~~~~~
|
|
||||||
License for use and distribution
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
7-Zip Copyright (C) 1999-2015 Igor Pavlov.
|
|
||||||
|
|
||||||
Licenses for files are:
|
|
||||||
|
|
||||||
1) 7z.dll: GNU LGPL + unRAR restriction
|
|
||||||
2) All other files: GNU LGPL
|
|
||||||
|
|
||||||
The GNU LGPL + unRAR restriction means that you must follow both
|
|
||||||
GNU LGPL rules and unRAR restriction rules.
|
|
||||||
|
|
||||||
|
|
||||||
Note:
|
|
||||||
You can use 7-Zip on any computer, including a computer in a commercial
|
|
||||||
organization. You don't need to register or pay for 7-Zip.
|
|
||||||
|
|
||||||
|
|
||||||
GNU LGPL information
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You can receive a copy of the GNU Lesser General Public License from
|
|
||||||
http://www.gnu.org/
|
|
||||||
|
|
||||||
|
|
||||||
unRAR restriction
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
The decompression engine for RAR archives was developed using source
|
|
||||||
code of unRAR program.
|
|
||||||
All copyrights to original unRAR code are owned by Alexander Roshal.
|
|
||||||
|
|
||||||
The license for original unRAR code has the following restriction:
|
|
||||||
|
|
||||||
The unRAR sources cannot be used to re-create the RAR compression algorithm,
|
|
||||||
which is proprietary. Distribution of modified unRAR sources in separate form
|
|
||||||
or as a part of other software is permitted, provided that it is clearly
|
|
||||||
stated in the documentation and source comments that the code may
|
|
||||||
not be used to develop a RAR (WinRAR) compatible archiver.
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
Igor Pavlov
|
|
Loading…
Reference in New Issue