Skip to content

Commit

Permalink
Updated texture resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Neodymium146 committed Jun 17, 2017
1 parent 5ab3f68 commit c63cf96
Show file tree
Hide file tree
Showing 11 changed files with 425 additions and 431 deletions.
6 changes: 3 additions & 3 deletions RageLib.GTA5/RageLib.GTA5.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@
<Compile Include="Resources\PC\Particles\Unknown_P_013.cs" />
<Compile Include="Resources\PC\ResourceFileTypes_GTA5_pc.cs" />
<Compile Include="Resources\PC\ResourceFile_GTA5_pc.cs" />
<Compile Include="Resources\PC\Textures\TextureBase_GTA5_pc.cs" />
<Compile Include="Resources\PC\Textures\TextureDictionary_GTA5_pc.cs" />
<Compile Include="Resources\PC\Textures\Texture_GTA5_pc.cs" />
<Compile Include="Resources\PC\Textures\Texture.cs" />
<Compile Include="Resources\PC\Textures\TextureDictionary.cs" />
<Compile Include="Resources\PC\Textures\TextureDX11.cs" />
<Compile Include="Resources\PC\VehicleRecords\VehicleRecordsEntry_GTA5_pc.cs" />
<Compile Include="Resources\PC\VehicleRecords\VehicleRecords_GTA5_pc.cs" />
<Compile Include="Resources\PC\WaypointRecords\WaypointRecordEntry_GTA5_pc.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace RageLib.ResourceWrappers.GTA5.PC.Textures
/// </summary>
public class TextureDictionaryFileWrapper_GTA5_pc : ITextureDictionaryFile
{
private TextureDictionary_GTA5_pc textureDictionary;
private TextureDictionary textureDictionary;

/// <summary>
/// Gets the texture dictionary.
Expand All @@ -45,17 +45,17 @@ public ITextureDictionary TextureDictionary

public TextureDictionaryFileWrapper_GTA5_pc()
{
textureDictionary = new TextureDictionary_GTA5_pc();
textureDictionary = new TextureDictionary();
textureDictionary.TextureNameHashes.Entries = new ResourceSimpleArray<uint_r>();
textureDictionary.Textures.Entries = new ResourcePointerArray64<Texture_GTA5_pc>();
textureDictionary.Textures.Entries = new ResourcePointerArray64<TextureDX11>();
}

/// <summary>
/// Loads the texture dictionary from a file.
/// </summary>
public void Load(string fileName)
{
var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
var resource = new ResourceFile_GTA5_pc<TextureDictionary>();
resource.Load(fileName);

textureDictionary = resource.ResourceData;
Expand All @@ -69,15 +69,15 @@ public void Save(string fileName)
var w = new TextureDictionaryWrapper_GTA5_pc(textureDictionary);
w.UpdateClass();

var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
var resource = new ResourceFile_GTA5_pc<TextureDictionary>();
resource.ResourceData = textureDictionary;
resource.Version = 13;
resource.Save(fileName);
}

public void Load(Stream stream)
{
var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
var resource = new ResourceFile_GTA5_pc<TextureDictionary>();
resource.Load(stream);

if (resource.Version != 13)
Expand All @@ -91,7 +91,7 @@ public void Save(Stream stream)
var w = new TextureDictionaryWrapper_GTA5_pc(textureDictionary);
w.UpdateClass();

var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
var resource = new ResourceFile_GTA5_pc<TextureDictionary>();
resource.ResourceData = textureDictionary;
resource.Version = 13;
resource.Save(stream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace RageLib.ResourceWrappers.GTA5.PC.Textures
/// </summary>
public class TextureDictionaryWrapper_GTA5_pc : ITextureDictionary
{
private TextureDictionary_GTA5_pc textureDictionary;
private TextureDictionary textureDictionary;

public ITextureList Textures
{
Expand All @@ -55,7 +55,7 @@ public ITextureList Textures
public TextureDictionaryWrapper_GTA5_pc()
{ }

public TextureDictionaryWrapper_GTA5_pc(TextureDictionary_GTA5_pc baseClass)
public TextureDictionaryWrapper_GTA5_pc(TextureDictionary baseClass)
{
this.textureDictionary = baseClass;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ public void UpdateClass()

var bak = textureDictionary.Textures;
textureDictionary.TextureNameHashes.Entries = new ResourceSimpleArray<uint_r>();
textureDictionary.Textures.Entries = new ResourcePointerArray64<Texture_GTA5_pc>();
textureDictionary.Textures.Entries = new ResourcePointerArray64<TextureDX11>();
foreach (uint x in theHashList)
{
textureDictionary.TextureNameHashes.Entries.Add((uint_r)x);
Expand Down Expand Up @@ -130,7 +130,7 @@ public void UpdateClass()

}

public TextureDictionary_GTA5_pc GetObject()
public TextureDictionary GetObject()
{
return textureDictionary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ namespace RageLib.ResourceWrappers.GTA5.PC.Textures
/// </summary>
public class TextureListWrapper_GTA5_pc : ITextureList
{
private IList<Texture_GTA5_pc> list;
private IList<TextureDX11> list;

public TextureListWrapper_GTA5_pc(IList<Texture_GTA5_pc> list)
public TextureListWrapper_GTA5_pc(IList<TextureDX11> list)
{
this.list = list;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ IEnumerator IEnumerable.GetEnumerator()
public class TextureWrapper_GTA5_pc : ITexture
{

public Texture_GTA5_pc texture;
public TextureDX11 texture;

public string Name
{
Expand Down Expand Up @@ -194,11 +194,11 @@ public int Stride

public TextureWrapper_GTA5_pc()
{
this.texture = new Texture_GTA5_pc();
this.texture = new TextureDX11();
this.texture.Data = new TextureData_GTA5_pc();
}

public TextureWrapper_GTA5_pc(Texture_GTA5_pc texture)
public TextureWrapper_GTA5_pc(TextureDX11 texture)
{
this.texture = texture;
}
Expand Down
2 changes: 1 addition & 1 deletion RageLib.GTA5/Resources/PC/Drawables/ShaderFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public override void Read(ResourceDataReader reader, params object[] parameters)
{
case 0:
offset += 0;
p.Data = reader.ReadBlockAt<TextureBase_GTA5_pc>(
p.Data = reader.ReadBlockAt<Texture>(
p.DataPointer // offset
);
break;
Expand Down
4 changes: 2 additions & 2 deletions RageLib.GTA5/Resources/PC/Drawables/ShaderGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ShaderGroup : ResourceSystemBlock
public uint Unknown_3Ch; // 0x00000000

// reference data
public TextureDictionary_GTA5_pc TextureDictionary;
public TextureDictionary TextureDictionary;
public ResourcePointerArray64<ShaderFX> Shaders;

/// <summary>
Expand All @@ -76,7 +76,7 @@ public override void Read(ResourceDataReader reader, params object[] parameters)
this.Unknown_3Ch = reader.ReadUInt32();

// read reference data
this.TextureDictionary = reader.ReadBlockAt<TextureDictionary_GTA5_pc>(
this.TextureDictionary = reader.ReadBlockAt<TextureDictionary>(
this.TextureDictionaryPointer // offset
);
this.Shaders = reader.ReadBlockAt<ResourcePointerArray64<ShaderFX>>(
Expand Down
4 changes: 2 additions & 2 deletions RageLib.GTA5/Resources/PC/Particles/ParticleEffectsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ParticleEffectsList : FileBase64_GTA5_pc

// reference data
public string_r Name;
public TextureDictionary_GTA5_pc TextureDictionary;
public TextureDictionary TextureDictionary;
public DrawableDictionary DrawableDictionary;
public ParticleRuleDictionary ParticleRuleDictionary;
public EffectRuleDictionary EffectRuleDictionary;
Expand Down Expand Up @@ -84,7 +84,7 @@ public override void Read(ResourceDataReader reader, params object[] parameters)
this.Name = reader.ReadBlockAt<string_r>(
this.NamePointer // offset
);
this.TextureDictionary = reader.ReadBlockAt<TextureDictionary_GTA5_pc>(
this.TextureDictionary = reader.ReadBlockAt<TextureDictionary>(
this.TextureDictionaryPointer // offset
);
this.DrawableDictionary = reader.ReadBlockAt<DrawableDictionary>(
Expand Down
4 changes: 2 additions & 2 deletions RageLib.GTA5/Resources/PC/Particles/ShaderVarTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ShaderVarTexture : ShaderVar
public uint Unknown_3Ch;

// reference data
public Texture_GTA5_pc Texture;
public TextureDX11 Texture;
public string_r Name;

/// <summary>
Expand All @@ -63,7 +63,7 @@ public override void Read(ResourceDataReader reader, params object[] parameters)
this.Unknown_3Ch = reader.ReadUInt32();

// read reference data
this.Texture = reader.ReadBlockAt<Texture_GTA5_pc>(
this.Texture = reader.ReadBlockAt<TextureDX11>(
this.TexturePointer // offset
);
this.Name = reader.ReadBlockAt<string_r>(
Expand Down
Loading

0 comments on commit c63cf96

Please sign in to comment.