refactor(pipeline): MP1a - lift TextureKey out of the GL atlas class

This commit is contained in:
Erik 2026-07-05 20:01:56 +02:00
parent 651d041e5a
commit d778930853
3 changed files with 39 additions and 29 deletions

View file

@ -0,0 +1,30 @@
using DatReaderWriter.Enums;
using System;
namespace AcDream.Content;
// MP1a (2026-07-05): lifted verbatim out of TextureAtlasManager (GL class)
// so the GL-free mesh-extraction path (MeshExtractor / ObjectMeshData) can
// reference the atlas dedup key without a Silk.NET dependency. Field set,
// equality semantics, and hash behavior are UNCHANGED.
public struct TextureKey : IEquatable<TextureKey> {
public uint SurfaceId;
public uint PaletteId;
public StipplingType Stippling;
public bool IsSolid;
public bool Equals(TextureKey other) {
return SurfaceId == other.SurfaceId &&
PaletteId == other.PaletteId &&
Stippling == other.Stippling &&
IsSolid == other.IsSolid;
}
public override bool Equals(object? obj) {
return obj is TextureKey other && Equals(other);
}
public override int GetHashCode() {
return HashCode.Combine(SurfaceId, PaletteId, Stippling, IsSolid);
}
}