Exemplo n.º 1
0
        //Use MoveRaw without processing children.
        //Prevents addresses from changing before completion.
        //internal override void MoveRaw(VoidPtr address, int length)
        //{
        //    Memory.Move(address, WorkingSource.Address, (uint)length);
        //    DataSource newsrc = new DataSource(address, length);
        //    if (_compression == CompressionType.None)
        //    {
        //        _replSrc.Close();
        //        _replUncompSrc.Close();
        //        _replSrc = _replUncompSrc = newsrc;
        //    }
        //    else
        //    {
        //        _replSrc.Close();
        //        _replSrc = newsrc;
        //    }
        //}

        public override int OnCalculateSize(bool force)
        {
            int len = 0xD0;

            len += _userEntries.GetSize();
            return(len);
        }
Exemplo n.º 2
0
 public override int OnCalculateSize(bool force)
 {
     int size = VIS0v3.Size + 0x18 + Children.Count * 0x10;
     foreach (ResourceNode e in Children)
         size += e.CalculateSize(force);
     if (_version == 4)
     size += _userEntries.GetSize();
     return size;
 }
Exemplo n.º 3
0
        public override int OnCalculateSize(bool force)
        {
            _specLights = 0;
            int size = SCN0v4.Size + 0x18 + Children.Count * 0x10;

            foreach (SCN0GroupNode n in Children)
            {
                size += n.CalculateSize(true);
            }
            size += _userEntries.GetSize();
            return(size);
        }
Exemplo n.º 4
0
        public override int OnCalculateSize(bool force)
        {
            int size = (_version == 5 ? CHR0v5.Size : CHR0v4_3.Size) + 0x18 + (Children.Count * 0x10);

            foreach (CHR0EntryNode n in Children)
            {
                size += n.CalculateSize(true);
            }
            if (_version == 5)
            {
                size += _userEntries.GetSize();
            }
            return(size);
        }
Exemplo n.º 5
0
        public override int OnCalculateSize(bool force)
        {
            int size = (Version == 5 ? SRT0v5.Size : SRT0v4.Size) + 0x18 + Children.Count * 0x10;

            foreach (SRT0EntryNode entry in Children)
            {
                size += entry.CalculateSize(true);
            }
            if (_version == 5)
            {
                size += _userEntries.GetSize();
            }
            return(size);
        }
Exemplo n.º 6
0
 public override int OnCalculateSize(bool force)
 {
     _lightLen = 0;
     _keyLen   = 0;
     _visLen   = 0;
     if (_name != "<null>")
     {
         for (int i = 0; i < 15; i++)
         {
             if (GetKeys(i)._keyCount > 1)
             {
                 _keyLen += 8 + GetKeys(i)._keyCount * 12;
             }
         }
     }
     return(SCN0Camera.Size + _userEntries.GetSize());
 }
Exemplo n.º 7
0
        public override int OnCalculateSize(bool force)
        {
            int size = (_version == 4 ? CLR0v4.Size : CLR0v3.Size) + 0x18 + Children.Count * 0x10;

            foreach (CLR0MaterialNode n in Children)
            {
                size += 8 + n.Children.Count * 8;
                foreach (CLR0MaterialEntryNode e in n.Children)
                {
                    if (e._numEntries != 0)
                    {
                        size += (e._colors.Count * 4);
                    }
                }
            }
            if (_version == 4)
            {
                size += _userEntries.GetSize();
            }
            return(size);
        }
Exemplo n.º 8
0
        public override int OnCalculateSize(bool force)
        {
            _textureFiles.Clear();
            _paletteFiles.Clear();
            foreach (PAT0EntryNode n in Children)
            {
                foreach (PAT0TextureNode t in n.Children)
                {
                    foreach (PAT0TextureEntryNode e in t.Children)
                    {
                        if (t._hasTex && !String.IsNullOrEmpty(e._tex) && !_textureFiles.Contains(e._tex))
                        {
                            _textureFiles.Add(e._tex);
                        }
                        if (t._hasPlt && !String.IsNullOrEmpty(e._plt) && !_paletteFiles.Contains(e._plt))
                        {
                            _paletteFiles.Add(e._plt);
                        }
                    }
                }
            }

            _textureFiles.Sort();
            _paletteFiles.Sort();

            int size = PAT0v3.Size + 0x18 + Children.Count * 0x10;

            size += (_textureFiles.Count + _paletteFiles.Count) * 8;
            foreach (PAT0EntryNode n in Children)
            {
                size += n.CalculateSize(true);
            }

            if (_version == 4)
            {
                size += _userEntries.GetSize();
            }

            return(size);
        }
Exemplo n.º 9
0
        public override int OnCalculateSize(bool force)
        {
            _strings.Clear();
            int size = (Version == 4 ? SHP0v4.Size : SHP0v3.Size) + 0x18 + Children.Count * 0x10;

            foreach (SHP0EntryNode entry in Children)
            {
                _strings.Add(entry.Name);
                foreach (SHP0VertexSetNode n in entry.Children)
                {
                    _strings.Add(n.Name);
                }

                size += entry.CalculateSize(true);
            }
            size += _strings.Count * 4;
            if (_version == 4)
            {
                size += _userEntries.GetSize();
            }
            return(size);
        }
Exemplo n.º 10
0
        public override int OnCalculateSize(bool force)
        {
            //Reset data lengths
            for (int i = 0; i < 3; i++)
            {
                _dataLengths[i] = 0;
            }

            int size = SCN0Camera.Size;

            if (_name != "<null>")
            {
                //Get the total data size of all keyframes
                for (int i = 0; i < 15; i++)
                {
                    CalcKeyLen(Keyframes[i]);
                }

                //Add the size of the user entries
                size += _userEntries.GetSize();
            }

            return(size);
        }
Exemplo n.º 11
0
        //Use MoveRaw without processing children.
        //Prevents addresses from changing before completion.
        //internal override void MoveRaw(VoidPtr address, int length)
        //{
        //    Memory.Move(address, WorkingSource.Address, (uint)length);
        //    DataSource newsrc = new DataSource(address, length);
        //    if (_compression == CompressionType.None)
        //    {
        //        _replSrc.Close();
        //        _replUncompSrc.Close();
        //        _replSrc = _replUncompSrc = newsrc;
        //    }
        //    else
        //    {
        //        _replSrc.Close();
        //        _replSrc = newsrc;
        //    }
        //}

        public override int OnCalculateSize(bool force)
        {
            return(0xD0 + _userEntries.GetSize());
        }