refactor(pipeline): MP1a - lift TextureKey out of the GL atlas class
This commit is contained in:
parent
651d041e5a
commit
d778930853
3 changed files with 39 additions and 29 deletions
30
src/AcDream.Content/TextureKey.cs
Normal file
30
src/AcDream.Content/TextureKey.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue