private byte[] GetData32bpp() { var newData = new byte[Data.Length]; for (var i = 0; i < newData.Length - 3; i += 4) { newData[i + 0] = Data[i + 2]; newData[i + 1] = Data[i + 1]; newData[i + 2] = Data[i + 0]; newData[i + 3] = Ps2.FromPs2Alpha(Data[i + 3]); } return newData; }
private byte[] GetClut4() { var data = new byte[16 * 4]; for (var i = 0; i < 16; i++) { data[i * 4 + 0] = Clut[(i & 15) * 4 + 0]; data[i * 4 + 1] = Clut[(i & 15) * 4 + 1]; data[i * 4 + 2] = Clut[(i & 15) * 4 + 2]; data[i * 4 + 3] = Ps2.FromPs2Alpha(Clut[(i & 15) * 4 + 3]); } return data; }
private static byte[] GetData32bpp(byte[] data) { var newData = new byte[data.Length]; for (var i = 0; i < newData.Length - 3; i += 4) { newData[i + 0] = data[i + 2]; newData[i + 1] = data[i + 1]; newData[i + 2] = data[i + 0]; newData[i + 3] = Ps2.FromPs2Alpha(data[i + 3]); } return(newData); }
private byte[] GetClut8() { var data = new byte[256 * 4]; for (var i = 0; i < 256; i++) { var srcIndex = Ps2.Repl(i); data[i * 4 + 0] = Clut[srcIndex * 4 + 0]; data[i * 4 + 1] = Clut[srcIndex * 4 + 1]; data[i * 4 + 2] = Clut[srcIndex * 4 + 2]; data[i * 4 + 3] = Ps2.FromPs2Alpha(Clut[srcIndex * 4 + 3]); } return data; }
private static byte[] GetClut8(byte[] clut, int cbp, int csa) { var data = new byte[256 * 4]; for (var i = 0; i < 256; i++) { var srcIndex = GetClutPointer(i, cbp, csa); data[i * 4 + 0] = clut[srcIndex * 4 + 0]; data[i * 4 + 1] = clut[srcIndex * 4 + 1]; data[i * 4 + 2] = clut[srcIndex * 4 + 2]; data[i * 4 + 3] = Ps2.FromPs2Alpha(clut[srcIndex * 4 + 3]); } return(data); }