1
0
mirror of synced 2024-11-13 18:50:50 +01:00

Set the shader type properly

This commit is contained in:
KillzXGaming 2019-05-31 19:14:25 -04:00
parent 01ae391de6
commit ffa130a98b
3 changed files with 7 additions and 2 deletions

Binary file not shown.

View File

@ -58,7 +58,7 @@ namespace FirstPlugin
{
ShaderProgram program = new ShaderProgram();
program.Text = reader.LoadString(true, typeof(ulong));
uint unk = reader.ReadUInt32();
uint Type = reader.ReadUInt32();
uint unk2 = reader.ReadUInt32(); //Usually 2
long BinaryOffset = reader.ReadOffset(true, typeof(ulong));
ulong BinarySize = reader.ReadUInt64();
@ -66,6 +66,11 @@ namespace FirstPlugin
ulong padding = reader.ReadUInt64();
ulong padding2 = reader.ReadUInt64();
if (Type == 0)
program.ShaderType = NSWShaderDecompile.NswShaderType.Vertex;
if (Type == 2)
program.ShaderType = NSWShaderDecompile.NswShaderType.Fragment;
using (reader.TemporarySeek(BinaryOffset, System.IO.SeekOrigin.Begin))
{
program.Data = reader.ReadBytes((int)BinarySize);
@ -86,7 +91,7 @@ namespace FirstPlugin
public class ShaderProgram : TreeNodeCustom
{
NSWShaderDecompile.NswShaderType ShaderType { get; set; }
public NSWShaderDecompile.NswShaderType ShaderType { get; set; }
public byte[] Data { get; set; }