Skip to content

Commit

Permalink
Updating EnvCell instancing (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmriggs authored Dec 10, 2018
1 parent 155f133 commit d7ef22f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions DatExplorer/Render/TextureSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ namespace DatExplorer.Render
{
public class TextureSet: IEquatable<TextureSet>
{
public uint Environment;
public List<uint> SurfaceIDs;

public TextureSet(R_EnvCell envCell)
{
Environment = envCell.EnvCell.EnvironmentID;
SurfaceIDs = envCell.EnvCell._envCell.Surfaces;
}

public bool Equals(TextureSet textureSet)
{
if (Environment != textureSet.Environment)
return false;

if (SurfaceIDs.Count != textureSet.SurfaceIDs.Count)
return false;

Expand All @@ -29,6 +34,8 @@ public override int GetHashCode()
{
int hash = 0;

hash = (hash * 397) ^ Environment.GetHashCode();

foreach (var surfaceID in SurfaceIDs)
hash = (hash * 397) ^ surfaceID.GetHashCode();

Expand Down

0 comments on commit d7ef22f

Please sign in to comment.