Esempio n. 1
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            if (Model._isImport || _forceRebuild)
            {
                MDL0FurPosData *header = (MDL0FurPosData *)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->_numLayers     = NumLayers;
                header->_offsetOfLayer = LayerOffset;

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

                _forceRebuild = false;
            }
            else
            {
                base.OnRebuild(address, length, force);
            }
        }
Esempio n. 2
0
        protected internal override void PostProcess(VoidPtr mdlAddress, VoidPtr dataAddress, StringTable stringTable)
        {
            MDL0FurPosData *header = (MDL0FurPosData *)dataAddress;

            header->_mdl0Offset   = (int)mdlAddress - (int)dataAddress;
            header->_stringOffset = (int)stringTable[Name] + 4 - (int)dataAddress;
            header->_index        = Index;
        }
Esempio n. 3
0
        public static Vector3[] ExtractVertices(MDL0FurPosData *vertices)
        {
            if (vertices != null)
            {
                return(ExtractVertices(vertices->Data, vertices->_numVertices, vertices->_isXYZ != 0, vertices->Type,
                                       1 << vertices->_divisor));
            }

            return(null);
        }