コード例 #1
0
        protected override void ReadObjectData(BinaryReader xReader)
        {
            // Object name
            xReader.BaseStream.Position = _dataStart + 0x00000024;
            xReader.BaseStream.Position = _dataStart + xReader.ReadUInt32();
            String strModelName = new String(xReader.ReadChars(8));

            _name = Utility.CleanName(strModelName);

            // Texture type
            //xReader.BaseStream.Position = m_uDataStart + 0x44;
            //if (xReader.ReadUInt64() != 0xFFFFFFFFFFFFFFFF)
            //{
            //    m_ePlatform = Platform.PSX;
            //}
            //else
            //{
            _platform = Platform.PC;
            //}

            // Model data
            xReader.BaseStream.Position = _dataStart + 0x0000000C;
            _modelCount = 1; //xReader.ReadUInt16();
            _animCount  = 0; //xReader.ReadUInt16();
            _modelStart = _dataStart + xReader.ReadUInt32();
            _animStart  = 0; //m_uDataStart + xReader.ReadUInt32();

            _models = new SR2Model[_modelCount];
            for (UInt16 m = 0; m < _modelCount; m++)
            {
                _models[m] = SR2ObjectModel.Load(xReader, _dataStart, _modelStart, _name, _platform, m, _version);
            }
        }
コード例 #2
0
ファイル: SR2File.cs プロジェクト: afradley/ModelEx5
        protected override void ReadObjectData(BinaryReader reader, ExportOptions options)
        {
            // Object name
            reader.BaseStream.Position = _dataStart + 0x00000024;
            reader.BaseStream.Position = _dataStart + reader.ReadUInt32();
            String strModelName = new String(reader.ReadChars(8));

            _name = Utility.CleanObjectName(strModelName);

            // Texture type
            //reader.BaseStream.Position = _dataStart + 0x44;
            //if (reader.ReadUInt64() != 0xFFFFFFFFFFFFFFFF)
            //{
            //    _platform = Platform.PSX;
            //}
            //else
            //{
            if (options.ForcedPlatform == CDC.Platform.None)
            {
                _platform = Platform.PC;
            }
            else
            {
                _platform = options.ForcedPlatform;
            }
            //}

            // Model data
            reader.BaseStream.Position = _dataStart + 0x00000008;
            _modelCount = reader.ReadUInt16();
            _modelCount = 1;            // There are multiple models, but Defiance might have too many. Override for now.
            _animCount  = 0;            //reader.ReadUInt16();
            reader.BaseStream.Position += 0x02;
            _modelStart = _dataStart + reader.ReadUInt32();
            _animStart  = 0;            //_dataStart + reader.ReadUInt32();

            _models = new SR2Model[_modelCount];
            for (UInt16 m = 0; m < _modelCount; m++)
            {
                _models[m] = SR2ObjectModel.Load(reader, _dataStart, _modelStart, _name, _platform, m, _version, options);
            }
        }