Skip to content

Commit d5cac5e

Browse files
committed
save shaders
1 parent cef33a0 commit d5cac5e

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

CathodeLib/Scripts/CATHODE/Materials.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ override protected bool LoadInternal()
7676
}
7777
reader.BaseStream.Position += 7;
7878
material.UnknownValue0 = reader.ReadInt32();
79-
material.UberShaderIndex = reader.ReadInt32();
79+
material.ShaderIndex = reader.ReadInt32();
8080
reader.BaseStream.Position += 128;
8181
material.UnknownValue1 = reader.ReadInt32();
8282
reader.BaseStream.Position += 48;
@@ -158,7 +158,7 @@ override protected bool SaveInternal()
158158
}
159159
writer.Write(new byte[7]);
160160
writer.Write(Entries[i].UnknownValue0);
161-
writer.Write(Entries[i].UberShaderIndex);
161+
writer.Write(Entries[i].ShaderIndex);
162162
writer.Write(new byte[128]);
163163
writer.Write(Entries[i].UnknownValue1);
164164
writer.Write(new byte[48]);
@@ -207,7 +207,7 @@ public class Material
207207
public ConstantBuffer[] ConstantBuffers = new ConstantBuffer[5]; //Should always be 5 (1 per CST block) - TODO: maybe just change this to 5 variables?
208208

209209
public int UnknownValue0;
210-
public int UberShaderIndex;
210+
public int ShaderIndex;
211211

212212
public int UnknownValue1;
213213

CathodeLib/Scripts/LEGACY_DAN/ShadersPAK.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ShadersPAK(string FullFilePath)
5555

5656
private MaterialPropertyIndex GetMaterialPropertyIndexes(Materials.Material InMaterial)
5757
{
58-
ShaderEntry Shader = Shaders[InMaterial.UberShaderIndex];
58+
ShaderEntry Shader = Shaders[InMaterial.ShaderIndex];
5959

6060
MaterialPropertyIndex toReturn = new MaterialPropertyIndex();
6161

@@ -176,10 +176,9 @@ private MaterialPropertyIndex GetMaterialPropertyIndexes(Materials.Material InMa
176176
return toReturn;
177177
}
178178

179-
public ShaderMaterialMetadata GetMaterialMetadataFromShader(Materials.Material InMaterial, IDXRemap idx)
179+
public ShaderMaterialMetadata GetMaterialMetadataFromShader(Materials.Material InMaterial)
180180
{
181-
int RemappedIndex = idx.Datas[InMaterial.UberShaderIndex].Index;
182-
ShaderEntry Shader = Shaders[RemappedIndex];
181+
ShaderEntry Shader = Shaders[InMaterial.ShaderIndex];
183182
ShaderMaterialMetadata metadata = new ShaderMaterialMetadata();
184183
metadata.shaderCategory = (ShaderCategory)Shader.Header2.ShaderCategory;
185184
switch (metadata.shaderCategory)

CathodeLib/Scripts/Level.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public void Save()
159159
//TODO: This puts the assumption on the user that they have updated all the indexes correctly in Commands. Need to just pass direct objects.
160160
Commands.Save();
161161
EnvironmentAnimations.Save();
162+
Shaders.Save();
162163

163164
/* UPDATE MOVER INDEXES */
164165

0 commit comments

Comments
 (0)