Beispiel #1
0
 public FSTMTrackInfoStub(byte volume, byte pan)
 {
     _volume  = volume;
     _pan     = pan;
     _padding = 0;
     _byteTableReference._type       = (short)FSTMReference.RefType.ByteTable;
     _byteTableReference._padding    = 0;
     _byteTableReference._dataOffset = 12;
     _byteTableCount = 2;
     _byteTable      = 0x00010000;
 }
Beispiel #2
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;
 }
Beispiel #3
0
        public bint             _unk2; //0

        public VIS0(int size, int frameCount, int numEntries, int unk1, int unk2)
        {
            _header._tag        = Tag;
            _header._size       = size;
            _header._version    = 3;
            _header._bresOffset = 0;
            _dataOffset         = 0x24;
            _stringOffset       = 0;
            _unk1       = unk1;
            _frameCount = (short)frameCount;
            _numEntries = (short)numEntries;
            _unk2       = unk2;
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        public CLR0(int size, int unk1, int frames, int entries, int unk2)
        {
            _header._tag        = Tag;
            _header._size       = size;
            _header._bresOffset = 0;
            _header._version    = 3;

            _dataOffset   = Size;
            _stringOffset = 0;
            _unk1         = unk1;
            _frames       = (short)frames;
            _entries      = (short)entries;
            _unk2         = unk2;
        }
Beispiel #6
0
        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;
            }
        }
Beispiel #7
0
        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;
        }
Beispiel #8
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 I6Entry(int index, int step, float tangent)
        {
            _data = (ushort)(index << 5);
            _step = (ushort)step;

            tangent *= 256.0f;
            if (tangent < 0.0f)
            {
                tangent -= 0.5f;
            }
            else
            {
                tangent += 0.5f;
            }

            _exp = (short)((int)tangent).Clamp(-32768, 32767);
        }
Beispiel #10
0
        public SHP0v4(int loop, short frames, short entries)
        {
            _header._tag        = Tag;
            _header._size       = Size;
            _header._version    = 4;
            _header._bresOffset = 0;

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

            _stringListOffset = 0;
            _stringOffset     = 0;
        }
Beispiel #11
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;
        }
Beispiel #12
0
        public unsafe ADPCMInfo(FSTMADPCMInfo o, ushort gain = 0)
        {
            fixed(short *ptr = _coefs)
            {
                for (int i = 0; i < 16; i++)
                {
                    ptr[i] = o._coefs[i];
                }
            }

            _gain = gain;
            _ps   = o._ps;
            _yn1  = o._yn1;
            _yn2  = o._yn2;
            _lps  = o._lps;
            _lyn1 = o._lyn1;
            _lyn2 = o._lyn2;
            _pad  = o._pad;
        }
Beispiel #13
0
        public FSTMADPCMInfo(ADPCMInfo o)
        {
            short[] c = o.Coefs;

            fixed(short *ptr = _coefs)
            for (int i = 0; i < 16; i++)
            {
                ptr[i] = c[i].Reverse();
            }

            _ps = o._ps;

            _yn1  = o._yn1;
            _yn2  = o._yn2;
            _lps  = o._lps;
            _lyn1 = o._lyn1;
            _lyn2 = o._lyn2;
            _pad  = o._pad;
        }
Beispiel #14
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;
            }
        }
Beispiel #15
0
        public ColObject(int planeIndex, int planeCount, int pointOffset, int pointCount, Vector2 boxMin, Vector2 boxMax, string modelName, string boneName,
                         int unk1, int unk2, int unk3, int flags, int unk5, int unk6, int boneIndex)
        {
            _planeIndex  = (short)planeIndex;
            _planeCount  = (short)planeCount;
            _unk1        = unk1;
            _unk2        = unk2;
            _unk3        = unk3;
            _flags       = (ushort)flags;
            _unk5        = (short)unk5;
            _boxMin      = boxMin;
            _boxMax      = boxMax;
            _pointOffset = (short)pointOffset;
            _pointCount  = (short)pointCount;
            _unk6        = (short)unk6;
            _boneIndex   = (short)boneIndex;

            fixed(byte *p = _modelName)
            SetStr(p, modelName);

            fixed(byte *p = _boneName)
            SetStr(p, boneName);
        }
Beispiel #16
0
        public TEX0(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;
            _unknown       = 0;
            _lodBias       = mipLevels - 1.0f;

            fixed(uint *p = _padding)
            for (int i = 0; i < 4; i++)
            {
                p[i] = 0;
            }
        }