mirror of
https://github.com/lscharen/iigs-sprite-compiler.git
synced 2024-12-21 16:30:15 +00:00
33 lines
811 B
C#
33 lines
811 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SpriteCompiler.Problem
|
|
{
|
|
public struct SpriteByte
|
|
{
|
|
private static byte DataToMask(byte data)
|
|
{
|
|
return (byte)((((data & 0xF0) == 0x00) ? 0xF0 : 0x00) | (((data & 0x0F) == 0x00) ? 0x0F : 0x00));
|
|
}
|
|
|
|
public SpriteByte(byte data, ushort offset)
|
|
: this(data, DataToMask(data), offset)
|
|
{
|
|
}
|
|
|
|
public SpriteByte(byte data, byte mask, ushort offset)
|
|
{
|
|
Data = data;
|
|
Mask = mask;
|
|
Offset = offset;
|
|
}
|
|
|
|
public byte Data { get; private set; }
|
|
public byte Mask { get; private set; }
|
|
public ushort Offset { get; private set; }
|
|
}
|
|
}
|