Пример #1
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            if (Model._isImport || _forceRebuild)
            {
                MDL0VertexData *header = (MDL0VertexData *)address;

                header->_dataLen     = length;
                header->_dataOffset  = 0x40;
                header->_index       = _entryIndex;
                header->_isXYZ       = _enc._hasZ ? 1 : 0;
                header->_type        = (int)_enc._type;
                header->_divisor     = (byte)_enc._scale;
                header->_entryStride = (byte)_enc._dstStride;
                header->_numVertices = (short)_enc._srcCount;
                header->_eMin        = _enc._min;
                header->_eMax        = _enc._max;
                header->_pad1        = header->_pad2 = 0;

                //Write data
                _enc.Write(Vertices, (byte *)address + 0x40);
                _enc.Dispose();
                _enc = null;

                _forceRebuild = false;
            }
            else
            {
                base.OnRebuild(address, length, force);
            }
        }
Пример #2
0
        protected internal override void OnRebuild(VoidPtr address, int length, bool force)
        {
            if (Model._isImport || _forceRebuild)
            {
                MDL0NormalData *header = (MDL0NormalData *)address;

                header->_dataLen     = length;
                header->_dataOffset  = 0x20;
                header->_index       = _entryIndex;
                header->_isNBT       = 0;
                header->_type        = (int)_enc._type;
                header->_divisor     = (byte)_enc._scale;
                header->_entryStride = (byte)_enc._dstStride;
                header->_numVertices = (ushort)_enc._srcCount;

                _enc.Write(Normals, (byte *)header + 0x20);
                _enc.Dispose();
                _enc = null;

                _forceRebuild = false;
            }
            else
            {
                base.OnRebuild(address, length, force);
            }
        }
Пример #3
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            if (Model._isImport || _forceRebuild)
            {
                MDL0UVData *header = (MDL0UVData *)address;

                header->_dataLen     = length;
                header->_dataOffset  = 0x40;
                header->_index       = _entryIndex;
                header->_format      = (int)_enc._type;
                header->_divisor     = (byte)_enc._scale;
                header->_isST        = 1;
                header->_entryStride = (byte)_enc._dstStride;
                header->_numEntries  = (ushort)_enc._srcCount;
                header->_min         = (Vector2)_enc._min;
                header->_min         = (Vector2)_enc._max;
                header->_pad1        = header->_pad2 = header->_pad3 = header->_pad4 = 0;

                _enc.Write(Points, (byte *)address + 0x40);
                _enc.Dispose();
                _enc = null;

                _forceRebuild = false;
            }
            else
            {
                base.OnRebuild(address, length, force);
            }
        }
Пример #4
0
 public override int OnCalculateSize(bool force)
 {
     if (Model._isImport || _forceRebuild)
     {
         _enc = new VertexCodec(Vertices, false, _forceFloat);
         return(_enc._dataLen.Align(0x20) + 0x40);
     }
     else
     {
         return(base.OnCalculateSize(force));
     }
 }
Пример #5
0
 protected override int OnCalculateSize(bool force)
 {
     if (Model._isImport || _forceRebuild)
     {
         _enc = new VertexCodec(Normals, false, _forceRebuild);
         return(_enc._dataLen.Align(0x20) + 0x20);
     }
     else
     {
         return(base.OnCalculateSize(force));
     }
 }
Пример #6
0
        protected internal override void OnRebuild(VoidPtr address, int length, bool force)
        {
            MDL0UVData *header = (MDL0UVData *)address;

            header->_dataLen     = length;
            header->_dataOffset  = 0x40;
            header->_index       = _entryIndex;
            header->_format      = (int)_enc._type;
            header->_divisor     = (byte)_enc._scale;
            header->_isST        = 1;
            header->_entryStride = (byte)_enc._dstStride;
            header->_numEntries  = (ushort)_enc._srcCount;
            header->_min         = (Vector2)_enc._min;
            header->_min         = (Vector2)_enc._max;
            header->_pad1        = header->_pad2 = header->_pad3 = header->_pad4 = 0;

            _enc.Write(Points, (byte *)address + 0x40);
            _enc.Dispose();
            _enc = null;
        }
Пример #7
0
        protected internal override void OnRebuild(VoidPtr address, int length, bool force)
        {
            //Write header
            MDL0VertexData *header = (MDL0VertexData *)address;

            header->_dataLen     = length;
            header->_dataOffset  = 0x40;
            header->_index       = _entryIndex;
            header->_isXYZ       = _enc._hasZ ? 1 : 0;
            header->_type        = (int)_enc._type;
            header->_divisor     = (byte)_enc._scale;
            header->_entryStride = (byte)_enc._dstStride;
            header->_numVertices = (short)_enc._srcCount;
            header->_eMin        = _enc._min;
            header->_eMax        = _enc._max;
            header->_pad1        = header->_pad2 = 0;

            //Write data
            _enc.Write(Vertices, (byte *)address + 0x40);
            _enc.Dispose();
            _enc = null;
        }
Пример #8
0
 protected override int OnCalculateSize(bool force)
 {
     _enc = VertexCodec.Evaluate(Normals, false);
     return(_enc._dataLen.Align(0x20) + 0x20);
 }
Пример #9
0
 protected override int OnCalculateSize(bool force)
 {
     _enc = VertexCodec.Evaluate(Vertices, true);
     return(_enc._dataLen.Align(0x20) + 0x40);
 }