Esempio n. 1
0
        protected virtual void PrepareDrawActorCostume(ICostumeRenderer bcr)
        {
            bcr.ActorID = Number;
            bcr.ActorX = _position.X - _scumm.MainVirtScreen.XStart;
            bcr.ActorY = _position.Y - _elevation;

            if (_scumm.Game.Version == 4 && (BoxScale & 0x8000) != 0)
            {
                bcr.ScaleX = bcr.ScaleY = (byte)_scumm.GetScaleFromSlot((BoxScale & 0x7fff) + 1, _position.X, _position.Y);
            }
            else
            {
                bcr.ScaleX = ScaleX;
                bcr.ScaleY = ScaleY;
            }

            bcr.ShadowMode = ShadowMode;
            if (_scumm.Game.Version >= 5)
            {
                bcr.ShadowTable = _scumm.ShadowPalette;
            }

            bcr.SetCostume(Costume, 0);
            bcr.SetPalette(_palette);
            bcr.SetFacing(this);

            if (_scumm.Game.Version >= 7)
            {
                bcr.ZBuffer = ForceClip;
                if (bcr.ZBuffer == 100)
                {
                    bcr.ZBuffer = (byte)_scumm.GetBoxMask(Walkbox);
                    if (bcr.ZBuffer > _scumm.Gdi.NumZBuffer - 1)
                        bcr.ZBuffer = (byte)(_scumm.Gdi.NumZBuffer - 1);
                }

            }
            else
            {
                if (ForceClip > 0)
                    bcr.ZBuffer = ForceClip;
                else if (IsInClass(ObjectClass.NeverClip))
                    bcr.ZBuffer = 0;
                else
                {
                    bcr.ZBuffer = (byte)_scumm.GetBoxMask(Walkbox);
                    if (_scumm.Game.Version == 0)
                        bcr.ZBuffer &= 0x03;
                    if (bcr.ZBuffer > _scumm.Gdi.NumZBuffer - 1)
                        bcr.ZBuffer = (byte)(_scumm.Gdi.NumZBuffer - 1);
                }
            }

            bcr.DrawTop = 0x7fffffff;
            bcr.DrawBottom = 0;
        }