예제 #1
0
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            base.OnRebuild(address, length, force);

            _matchAddr = null;

            SCN0AmbientLight *header = (SCN0AmbientLight *)address;

            header->_pad1 = 0;
            header->_pad2 = 0;

            if (_name == "<null>")
            {
                return;
            }

            int flags = _fixedFlags;

            _dataAddrs[1] += WriteColors(
                ref flags,
                0x80,
                _solidColor,
                _colors,
                _constant,
                FrameCount,
                header->_lighting.Address,
                ref _matchAddr,
                _match == null ? null : _match._matchAddr,
                (RGBAPixel *)_dataAddrs[1]);

            header->_fixedFlags = (byte)flags;
            header->_flags      = _usageFlags;
        }
        public override void OnRebuild(VoidPtr address, int length, bool force)
        {
            base.OnRebuild(address, length, force);

            _matchAddr = null;

            SCN0AmbientLight *header = (SCN0AmbientLight *)address;

            header->_header._length = _length = SCN0AmbientLight.Size;

            if (_name != "<null>")
            {
                header->_fixedFlags = 128;
                header->_pad1       = 0;
                header->_pad2       = 0;
                header->_flags      = usageFlags;
                if (_numEntries != 0)
                {
                    header->_fixedFlags = 0;

                    _matchAddr = lightAddr;
                    if (_match == null)
                    {
                        *((bint *)header->_lighting.Address) = (int)lightAddr - (int)header->_lighting.Address;
                        for (int i = 0; i <= ((SCN0Node)Parent.Parent).FrameCount; i++)
                        {
                            if (i < _colors.Count)
                            {
                                *lightAddr++ = (RGBAPixel)_colors[i];
                            }
                            else
                            {
                                *lightAddr++ = new RGBAPixel();
                            }
                        }
                    }
                    else
                    {
                        *((bint *)header->_lighting.Address) = (int)_match._matchAddr - (int)header->_lighting.Address;
                    }
                }
                else
                {
                    header->_lighting = (RGBAPixel)_solidColor;
                }
            }
        }
        protected internal override void OnRebuild(VoidPtr address, int length, bool force)
        {
            base.OnRebuild(address, length, force);

            SCN0AmbientLight *header = (SCN0AmbientLight *)address;

            if (_name != "<null>")
            {
                header->_fixedFlags = fixedFlags;
                header->_unk2       = 0;
                header->_unk3       = 0;
                header->_unk4       = unk4;
                if (_lighting.Count > 1)
                {
                    *((bint *)header->_lighting.Address) = (int)lightAddr - (int)header->_lighting.Address;
                    for (int i = 0; i <= ((SCN0Node)Parent.Parent).FrameCount; i++)
                    {
                        if (i < _lighting.Count)
                        {
                            *lightAddr++ = _lighting[i];
                        }
                        else
                        {
                            *lightAddr++ = new RGBAPixel();
                        }
                    }
                }
                else if (_lighting.Count == 1)
                {
                    header->_lighting = _lighting[0];
                }
                else
                {
                    header->_lighting = new RGBAPixel();
                }
            }
        }