Example #1
0
 public EFLSEntry(int id1, int id2, int stringOffset, int unk)
 {
     _brresID1 = (short)id1;
     _brresID2 = (short)id2;
     _stringOffset = stringOffset;
     _unk = unk;
     _re3dOffset = 0;
 }
 public UserDataEntry(int entries, UserValueType type, int id)
 {
     _totalLen = 0;
     _dataOffset = type == UserValueType.String ? 0 : 0x18;
     _entryCount = entries;
     _type = (int)type;
     _stringOffset = 0;
     _id = id;
 }
Example #3
0
 public ARCFileHeader(ARCFileType type, int index, int size, byte groupIndex, short id)
 {
     _type = (short)type;
     _index = (short)index;
     _size = size;
     _groupIndex = groupIndex;
     _padding = 0;
     _redirectIndex = id;
     _pad1 = _pad2 = _pad3 = _pad4 = _pad5 = 0;
 }
Example #4
0
        public PLT0v1(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;
            _pad = 0;
            _origPathOffset = 0;
        }
Example #5
0
        public CHR0v4_3(int version, int size, int frames, int entries, int loop)
        {
            _header._tag = Tag;
            _header._size = size;
            _header._bresOffset = 0;

            _header._version = version;
            _dataOffset = Size;
            _stringOffset = 0;
            _origPathOffset = _scalingRule = 0;
            _numFrames = (ushort)frames;
            _numEntries = (ushort)entries;
            _loop = loop;
        }
Example #6
0
        public TEX0v1(int width, int height, WiiPixelFormat format, int mipLevels)
        {
            _header._tag = Tag;
            _header._size = TextureConverter.Get(format).GetMipOffset(width, height, mipLevels + 1) + Size;
            _header._version = 1;
            _header._bresOffset = 0;

            _headerLen = Size;
            _stringOffset = 0;
            _hasPalette = ((format == WiiPixelFormat.CI4) || (format == WiiPixelFormat.CI8)) ? 1 : 0;
            _width = (short)width;
            _height = (short)height;
            _pixelFormat = (int)format;
            _levelOfDetail = mipLevels;
            _minLod = 0;
            _maxLod = mipLevels - 1.0f;
            _origPathOffset = 0;
        }
Example #7
0
        public bint _maskOffset4; //For banks

        #region Constructors

        public SYMBHeader(int length)
        {
            _header._tag = Tag;
            _header._length = length;
            _stringOffset = 0x14;
            _maskOffset1 = _maskOffset2 = _maskOffset3 = _maskOffset4 = 0;
        }
Example #8
0
        public void Set(int symbLen, int infoLen, int fileLen, byte vMinor)
        {
            int offset = 0x40;

            _header._tag = Tag;
            _header.Endian = Endian.Big;
            _header._version = (ushort)(0x100 + vMinor);
            _header._firstOffset = 0x40;
            _header._numEntries = 3;

            _symbOffset = offset;
            _symbLength = symbLen;
            _infoOffset = offset += symbLen;
            _infoLength = infoLen;
            _fileOffset = offset += infoLen;
            _fileLength = fileLen;

            _header._length = offset + fileLen;
        }
Example #9
0
        public SRT0v5(ushort frames, int loop, ushort entries, int matrixMode)
        {
            _header._tag = Tag;
            _header._size = Size;
            _header._version = 5;
            _header._bresOffset = 0;

            _dataOffset = Size;
            _userDataOffset = _origPathOffset = 0;
            _matrixMode = matrixMode;
            _numFrames = frames;
            _loop = loop;
            _stringOffset = 0;
            _numEntries = entries;
        }
        private void ParseScripts(bint* hdr)
        {
            Script s = null;
            int size, count;
            bint* actionOffset;
            _subActions = new BindingList<SubActionEntry>();
            _actions = new BindingList<ActionEntry>();

            if (hdr[3] > 0)
            {
                ActionEntry ag;
                sActionFlags* aflags = (sActionFlags*)Address(hdr[3]);
                if (hdr[5] > 0)
                {
                    actionOffset = (bint*)Address(hdr[5]);
                    size = _root.GetSize(hdr[5]);
                    for (int z = 0; z < size / 4; z++)
                    {
                        sActionFlags flag = aflags[z];
                        _actions.Add(ag = new ActionEntry(flag, z, z));
                        if (actionOffset[z] > 0)
                            ag._entry = Parse<Script>(actionOffset[z], this);
                        else
                            ag._entry = new Script(this);
                    }
                }
            }
            if (hdr[4] > 0)
            {
                SubActionEntry sg;
                sSubActionFlags* sflags = (sSubActionFlags*)Address(hdr[4]);
                size = _root.GetSize(hdr[6]);
                count = size / 4;
                for (int z = 0; z < count; z++)
                {
                    sSubActionFlags flag = sflags[z];
                    _subActions.Add(sg = new SubActionEntry(flag, flag._stringOffset > 0 ? new String((sbyte*)Address(flag._stringOffset)) : "<null>", z));
                }
                for (int i = 0; i < 3; i++)
                {
                    int x = hdr[6 + i];
                    if (x <= 0)
                        continue;

                    actionOffset = (bint*)Address(x);
                    for (int z = 0; z < count; z++)
                    {
                        if (actionOffset[z] > 0)
                            s = Parse<Script>(actionOffset[z], this);
                        else
                            s = new Script(this);
                        _subActions[z].SetWithType(i, s);
                    }
                }
            }
        }
Example #11
0
 public MDL0Props(int version, int vertices, int faces, int nodes, int scalingRule, int texMtxMode, bool needsNrmArr, bool needsTexArr, bool enableExtents, byte envMtxMode, Vector3 min, Vector3 max)
 {
     _headerLen = 0x40;
     if (version == 9 || version == 8)
         _mdl0Offset = -64;
     else
         _mdl0Offset = -76;
     _scalingRule = scalingRule;
     _texMatrixMode = texMtxMode;
     _numVertices = vertices;
     _numFaces = faces;
     _origPathOffset = 0;
     _numNodes = nodes;
     _needNrmMtxArray = (byte)(needsNrmArr ? 1 : 0);
     _needTexMtxArray = (byte)(needsTexArr ? 1 : 0);
     _enableExtents = (byte)(enableExtents ? 1 : 0);
     _envMtxMode = envMtxMode;
     _dataOffset = 0x40;
     _minExtents = min;
     _maxExtents = max;
 }
Example #12
0
 public VIS0Entry(VIS0Flags flags)
 {
     _stringOffset = 0;
     _flags = (int)flags;
 }
        public CollisionHeader(int numPoints, int numPlanes, int numObjects, int unk1)
        {
            _numPoints = (short)numPoints;
            _numPlanes = (short)numPlanes;
            _numObjects = (short)numObjects;
            _unk1 = (short)unk1;
            _pointOffset = 0x28;
            _planeOffset = 0x28 + (numPoints * 8);
            _objectOffset = 0x28 + (numPoints * 8) + (numPlanes * ColPlane.Size);

            fixed (int* p = _pad)
                for (int i = 0; i < 5; i++)
                    p[i] = 0;
        }
Example #14
0
 public void Set(int length)
 {
     _tag = Tag;
     _length = length;
     _dataOffset = 0x18;
     _pad1 = 0;
 }
 public ColPlane(int pInd1, int pInd2, int pLink1, int pLink2, CollisionPlaneType type, CollisionPlaneFlags2 flags2, CollisionPlaneFlags flags, CollisionPlaneMaterial material)
 {
     _point1 = (short)pInd1;
     _point2 = (short)pInd2;
     _link1 = (short)pLink1;
     _link2 = (short)pLink2;
     _magic = -1;
     _type = (ushort)((int)flags2 | (int)type);
     _flags = flags;
     _material = material;
 }
        public void Set(int planeIndex, int planeCount, Vector2 boxMin, Vector2 boxMax, string modelName, string boneName)
        {
            _planeIndex = (short)planeIndex;
            _planeCount = (short)planeCount;
            _unk1 = 0;
            _unk2 = 0;
            _unk3 = 0;
            _flags = 0;
            _boxMin = boxMin;
            _boxMax = boxMax;
            _unk5 = 0;
            _unk6 = 0;

            ModelName = modelName;
            BoneName = boneName;
        }
Example #17
0
 public VIS0v3(int size, ushort frameCount, ushort numEntries, int loop)
 {
     _header._tag = Tag;
     _header._size = size;
     _header._version = 3;
     _header._bresOffset = 0;
     _dataOffset = 0x24;
     _stringOffset = 0;
     _origPathOffset = 0;
     _numFrames = frameCount;
     _numEntries = numEntries;
     _loop = loop;
 }
Example #18
0
        public void Set(int groupLen, int lightSetLen, int ambLightLen, int lightLen, int fogLen, int cameraLen)
        {
            _dataOffset = Size;

            _header._tag = Tag;
            _header._version = 5;
            _header._bresOffset = 0;

            _lightSetOffset = _dataOffset + groupLen;
            _ambLightOffset = _lightSetOffset + lightSetLen;
            _lightOffset = _ambLightOffset + ambLightLen;
            _fogOffset = _lightOffset + lightLen;
            _cameraOffset = _fogOffset + fogLen;
            _header._size = _cameraOffset + cameraLen;

            if (lightSetLen == 0) _lightSetOffset = 0;
            if (ambLightLen == 0) _ambLightOffset = 0;
            if (lightLen == 0) _lightOffset = 0;
            if (fogLen == 0) _fogOffset = 0;
            if (cameraLen == 0) _cameraOffset = 0;
        }
Example #19
0
 //Entry offsets here for each texture
 public SRT0Entry(int textureIndices, int indirectIndices)
 {
     _textureIndices = textureIndices;
     _indirectIndices = indirectIndices;
     _stringOffset = 0;
 }
Example #20
0
        public void Set(int headLen, int adpcLen, int dataLen)
        {
            int len = 0x40;

            //Set header
            _header._tag = Tag;
            _header.Endian = Endian.Big;
            _header._version = 0x100;
            _header._firstOffset = 0x40;
            _header._numEntries = 2;

            //Set offsets/lengths
            _headOffset = len;
            _headLength = headLen;
            _adpcOffset = (len += headLen);
            _adpcLength = adpcLen;
            _dataOffset = (len += adpcLen);
            _dataLength = dataLen;

            _header._length = len + dataLen;

            //Fill padding
            Memory.Fill(Address + 0x28, 0x18, 0);
        }
Example #21
0
        public SHP0v3(int loop, ushort frames, ushort entries)
        {
            _header._tag = Tag;
            _header._size = Size;
            _header._version = 3;
            _header._bresOffset = 0;

            _dataOffset = 0x28;
            _origPathOffset = 0;
            _numFrames = frames;
            _loop = loop;
            _stringOffset = 0;
            _numEntries = entries;

            _stringListOffset = 0;
            _stringOffset = 0;
        }