public CLR0Entry(CLR0EntryFlags flags, ABGRPixel mask, ABGRPixel color) { _stringOffset = 0; _flags = (uint)flags; _colorMask = mask; _data._data = *(int *)&color; }
public void Set(uint id, string str) { uint len = (uint)str.Length; int i = 0; sbyte *dPtr = (sbyte *)(Address + 8); char * sPtr; _id = id; _stringLength = len; fixed(char *s = str) { sPtr = s; while (i++ < len) { *dPtr++ = (sbyte)*sPtr++; } } //Trailing zero *dPtr++ = 0; //Padding while ((i++ & 3) != 0) { *dPtr++ = 0; } }
public bint _data; //Could be offset or color! Offset from itself public CLR0Entry(CLR0EntryFlags flags, ABGRPixel mask, int offset) { _stringOffset = 0; _flags = (uint)flags; _colorMask = mask; _data = offset; }
public BRESHeader(int size, int numSections) { _tag = Tag; _version = 0xFFFE; _fileSize = (uint)size; _rootOffset = 0x10; _numSections = (ushort)numSections; }
public REFTData(ushort width, ushort height, byte format) { _unknown = 0; _width = width; _height = height; _imagelen = 0; _format = format; _pltFormat = 0; _colorCount = 0; }
public SCLASubEntry(BrawlLib.SSBB.ResourceNodes.SCLAEntryNode.SCLASubEntryClass e) { _unk1 = e._unk1; _unk2 = e._unk2; _unk3 = e._unk3; _unk4 = e._unk4; _index1 = e._index1; _index2 = e._index2; _index3 = e._index3; _index4 = e._index4; }
bool GetValue(string v, out buint value) { string s = (v.StartsWith("0x") ? v.Substring(2, Math.Min(v.Length - 2, 8)) : v.Substring(0, Math.Min(v.Length, 8))); uint t; if (uint.TryParse(s, System.Globalization.NumberStyles.HexNumber, null, out t)) { value = t; return(true); } value = 0; return(false); }
public I4Entry(int index, int step, float tangent) { tangent *= 32.0f; if (tangent < 0) { tangent -= 0.5f; } else { tangent += 0.5f; } _data = (uint)((index << 24) | ((step & 0xFFF) << 12) | (((int)tangent).Clamp(-2048, 2047) & 0xFFF)); }
public PLT0v1(int length, WiiPaletteFormat format) { _bresEntry._tag = Tag; _bresEntry._size = (length * 2) + Size; _bresEntry._version = 1; _bresEntry._bresOffset = 0; _headerLen = Size; _stringOffset = 0; _pixelFormat = (uint)format; _numEntries = (short)length; _pad = 0; _origPathOffset = 0; }
public MDL0Props(int vertices, int faces, int nodes, int unk1, int unk2, int unk3, int unk4, int unk5, Vector3 min, Vector3 max) { _headerLen = 0x40; _mdl0Offset = 0; _unk1 = unk1; _unk2 = unk2; _numVertices = vertices; _numFaces = faces; _unk3 = unk3; _numNodes = nodes; _unk4 = (short)unk4; _unk5 = (short)unk5; _dataOffset = 0x40; _minExtents = min; _maxExtents = max; }
public REFTImageHeader(ushort width, ushort height, byte format, byte pltFormat, ushort colors, uint imgSize, byte lod) { _unknown = 0; _width = width; _height = height; _imagelen = imgSize; _format = format; _pltFormat = pltFormat; _colorCount = colors; _pltSize = (uint)colors * 2; _mipmap = lod; _min_filt = 0; _mag_filt = 0; _reserved = 0; _lod_bias = 0; }
public PLT0(int length, WiiPaletteFormat format) { _bresEntry._tag = Tag; _bresEntry._size = (length * 2) + Size; _bresEntry._version = 1; _bresEntry._bresOffset = 0; _headerLen = 0x40; _stringOffset = 0; _pixelFormat = (uint)format; _numEntries = (short)length; _unk = 0; fixed(uint *p = _padding) for (int i = 0; i < 8; i++) { p[i] = 0; } }
public XFVertexSpecs(int colors, int textures, XFNormalFormat normalFormat) { _data = (((uint)textures & 0xF) << 4) | (((uint)normalFormat & 3) << 2) | ((uint)colors & 3); }
public Bin32(uint val) { _data = val; }
public XFVertexSpecs(uint raw) { _data = raw; }
public void SetHasTexMatrix(int index, bool exists) { _data = _data & ~((uint)2 << index) | ((uint)(exists ? 2 : 0) << index); }
public ItmFreqOffPair(buint off1, buint off2) { _offset1 = off1; _offset2 = off2; }
public void SetColorFormat(int index, XFDataFormat format) { _lo = _lo & ~((uint)3 << (index * 2 + 13)) | ((uint)format << (index * 2 + 13)); }
public void SetHasTexMatrix(int index, bool value) { _lo = _lo & ~(uint)(1 << (index + 1)) | ((uint)(value ? 1 : 0) << (index + 1)); }
public CLR0Material(CLR0EntryFlags flags, RGBAPixel mask, RGBAPixel color) { _stringOffset = 0; _flags = (uint)flags; }
public CPVertexFormat(uint lo, uint hi) { _lo = lo; _hi = hi; }
public GCTCodeLine(uint one, uint two) { _1 = one; _2 = two; }
public void SetHasColor(int index, bool exists) { _data = _data & ~((uint)0x800 << index) | ((uint)(exists ? 0x800 : 0) << index); }
public void SetHasUVs(int index, bool exists) { _data = _data & ~((uint)0x2000 << index) | ((uint)(exists ? 0x2000 : 0) << index); }
public CLR0Material(CLR0EntryFlags flags, ABGRPixel mask, int offset) { _stringOffset = 0; _flags = (uint)flags; }
public MRGHeader(uint numFiles) { _numFiles = numFiles; }