Пример #1
0
        protected override bool OnInitialize()
        {
            base.OnInitialize();

            _version = Header->_version;

            if (_version == 4)
            {
                VIS0v4 *header = Header4;
                _frameCount = header->_numFrames;
                _loop       = header->_loop;
                if ((_name == null) && (header->_stringOffset != 0))
                {
                    _name = header->ResourceString;
                }
            }
            else
            {
                VIS0v3 *header = Header3;
                _frameCount = header->_numFrames;
                _loop       = header->_loop;
                if ((_name == null) && (header->_stringOffset != 0))
                {
                    _name = header->ResourceString;
                }
            }

            return(Header3->Group->_numEntries > 0);
        }
Пример #2
0
        public override bool OnInitialize()
        {
            base.OnInitialize();

            _version = Header->_version;

            if (_version == 4)
            {
                VIS0v4* header = Header4;
                _numFrames = header->_numFrames;
                _loop = header->_loop;
                if ((_name == null) && (header->_stringOffset != 0))
                    _name = header->ResourceString;

                if (Header4->_origPathOffset > 0)
                    _originalPath = Header4->OrigPath;

                (_userEntries = new UserDataCollection()).Read(Header4->UserData);
            }
            else
            {
                VIS0v3* header = Header3;
                _numFrames = header->_numFrames;
                _loop = header->_loop;

                if ((_name == null) && (header->_stringOffset != 0))
                    _name = header->ResourceString;

                if (Header3->_origPathOffset > 0)
                    _originalPath = Header3->OrigPath;
            }

            return Header3->Group->_numEntries > 0;
        }
Пример #3
0
        protected internal override void OnRebuild(VoidPtr address, int length, bool force)
        {
            int            count = Children.Count;
            ResourceGroup *group;

            if (_version == 4)
            {
                VIS0v4 *header = (VIS0v4 *)address;
                *       header = new VIS0v4(length, (ushort)_frameCount, (ushort)count, _loop);
                group = header->Group;
            }
            else
            {
                VIS0v3 *header = (VIS0v3 *)address;
                *       header = new VIS0v3(length, (ushort)_frameCount, (ushort)count, _loop);
                group = header->Group;
            }

            *group = new ResourceGroup(count);
            ResourceEntry *entry = group->First;

            VoidPtr dataAddress = group->EndAddress;

            foreach (ResourceNode n in Children)
            {
                (entry++)->_dataOffset = (int)dataAddress - (int)group;

                int len = n._calcSize;
                n.Rebuild(dataAddress, len, force);
                dataAddress += len;
            }
        }
Пример #4
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            int            count = Children.Count;
            ResourceGroup *group;

            if (_version == 4)
            {
                VIS0v4 *header = (VIS0v4 *)address;
                *       header = new VIS0v4(length, (ushort)(_numFrames - ConversionBias), (ushort)count, _loop);
                group = header->Group;
            }
            else
            {
                VIS0v3 *header = (VIS0v3 *)address;
                *       header = new VIS0v3(length, (ushort)(_numFrames - ConversionBias), (ushort)count, _loop);
                group = header->Group;
            }

            *group = new ResourceGroup(count);
            ResourceEntry *entry = group->First;

            VoidPtr dataAddress = group->EndAddress;

            foreach (ResourceNode n in Children)
            {
                (entry++)->_dataOffset = (int)dataAddress - (int)group;

                int len = n._calcSize;
                n.Rebuild(dataAddress, len, force);
                dataAddress += len;
            }

            if (_userEntries.Count > 0 && _version == 4)
            {
                VIS0v4 *header = (VIS0v4 *)address;
                header->UserData = dataAddress;
                _userEntries.Write(dataAddress);
            }
        }