示例#1
0
 private void InitializeInstanceFields()
 {
     alphaTestFlag   = new EnableDisableFlag(this, "GU_ALPHA_TEST", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_ALPHA_TEST);
     depthTestFlag   = new EnableDisableFlag(this, "GU_DEPTH_TEST", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_DEPTH_TEST);
     scissorTestFlag = new EnableDisableFlag(this, "GU_SCISSOR_TEST", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_SCISSOR_TEST);
     stencilTestFlag = new EnableDisableFlag(this, "GU_STENCIL_TEST", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_STENCIL_TEST);
     blendFlag       = new EnableDisableFlag(this, "GU_BLEND", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_BLEND);
     cullFaceFlag    = new EnableDisableFlag(this, "GU_CULL_FACE", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_CULL_FACE);
     ditherFlag      = new EnableDisableFlag(this, "GU_DITHER", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_DITHER);
     fogFlag         = new EnableDisableFlag(this, "GU_FOG", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_FOG);
     clipPlanesFlag  = new EnableDisableFlag(this, "GU_CLIP_PLANES", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_CLIP_PLANES);
     textureFlag     = new EnableDisableFlag(this, "GU_TEXTURE_2D", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_TEXTURE_2D);
     lightingFlag    = new EnableDisableFlag(this, "GU_LIGHTING", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LIGHTING);
     lightFlags      = new EnableDisableFlag[]
     {
         new EnableDisableFlag(this, "GU_LIGHT0", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LIGHT0),
         new EnableDisableFlag(this, "GU_LIGHT1", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LIGHT1),
         new EnableDisableFlag(this, "GU_LIGHT2", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LIGHT2),
         new EnableDisableFlag(this, "GU_LIGHT3", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LIGHT3)
     };
     lineSmoothFlag        = new EnableDisableFlag(this, "GU_LINE_SMOOTH", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_LINE_SMOOTH);
     patchCullFaceFlag     = new EnableDisableFlag(this, "GU_PATCH_CULL_FACE", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_PATCH_CULL_FACE);
     colorTestFlag         = new EnableDisableFlag(this, "GU_COLOR_TEST", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_COLOR_TEST);
     colorLogicOpFlag      = new EnableDisableFlag(this, "GU_COLOR_LOGIC_OP", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_COLOR_LOGIC_OP);
     faceNormalReverseFlag = new EnableDisableFlag(this, "GU_FACE_NORMAL_REVERSE", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_FACE_NORMAL_REVERSE);
     patchFaceFlag         = new EnableDisableFlag(this, "GU_PATCH_FACE", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_PATCH_FACE);
     fragment2xFlag        = new EnableDisableFlag(this, "GU_FRAGMENT_2X", pspsharp.graphics.RE.IRenderingEngine_Fields.GU_FRAGMENT_2X);
     reColorMaterial       = new EnableDisableFlag(this, "RE_COLOR_MATERIAL", pspsharp.graphics.RE.IRenderingEngine_Fields.RE_COLOR_MATERIAL);
     reTextureGenS         = new EnableDisableFlag(this, "RE_TEXTURE_GEN_S", pspsharp.graphics.RE.IRenderingEngine_Fields.RE_TEXTURE_GEN_S);
     reTextureGenT         = new EnableDisableFlag(this, "RE_TEXTURE_GEN_T", pspsharp.graphics.RE.IRenderingEngine_Fields.RE_TEXTURE_GEN_T);
 }
示例#2
0
        void EventManager_OnSOGOwnerGroupChanged(SceneObjectGroup sog, UUID oldGroup, UUID newGroup)
        {
            ILandObject parcel        = _scene.LandChannel.GetLandObject(sog.RootPart.GroupPosition.X, sog.RootPart.GroupPosition.Y);
            bool        scriptsCanRun = ScriptsCanRun(parcel, sog.RootPart);

            EnableDisableFlag flag =
                scriptsCanRun ? EnableDisableFlag.ParcelEnable : EnableDisableFlag.ParcelDisable;

            sog.ForEachPart(delegate(SceneObjectPart part)
            {
                foreach (TaskInventoryItem script in part.Inventory.GetScripts())
                {
                    _exeScheduler.ChangeEnabledStatus(script.ItemID, flag);
                }
            });
        }
        internal void AddEnableDisableEvent(UUID itemId, EnableDisableFlag enableDisableFlag)
        {
            DeferredEventList eventList;

            if (_eventsByScript.TryGetValue(itemId, out eventList))
            {
                eventList.EnableDisableList.Add(enableDisableFlag);
            }
            else
            {
                eventList = new DeferredEventList(itemId);
                eventList.EnableDisableList.Add(enableDisableFlag);
                _eventsByScript.Add(itemId, eventList);

                C5.IPriorityQueueHandle <DeferredEventList> handle = null;
                _sortedEvents.Add(ref handle, eventList);
                eventList.Handle = handle;
            }
        }
示例#4
0
        public void SetScriptState(OpenMetaverse.UUID itemID, bool state)
        {
            EnableDisableFlag flag = state ? EnableDisableFlag.GeneralEnable : EnableDisableFlag.GeneralDisable;

            _exeScheduler.ChangeEnabledStatus(itemID, flag);
        }
示例#5
0
        void EventManager_OnGroupCrossedToNewParcel(SceneObjectGroup group, ILandObject oldParcel, ILandObject newParcel)
        {
            if (group.IsAttachment)
            {
                //attachment scripts always run and are unaffected by crossings
                return;
            }

            bool scriptsCouldRun = false;
            bool scriptsCanRun   = false;

            bool oldParcelAllowedOtherScripts = oldParcel != null && (oldParcel.landData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0;
            bool oldParcelAllowedGroupScripts = oldParcel != null && (oldParcel.landData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0;
            bool oldParcelMatchesObjectGroup  = oldParcel != null && oldParcel.landData.GroupID == group.GroupID;
            bool ownerOwnedOldParcel          = oldParcel != null && oldParcel.landData.OwnerID == group.OwnerID;

            bool newParcelAllowsOtherScripts = newParcel != null && (newParcel.landData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0;
            bool newParcelAllowsGroupScripts = newParcel != null && (newParcel.landData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0;
            bool newParcelMatchesObjectGroup = newParcel != null && newParcel.landData.GroupID == group.GroupID;
            bool ownerOwnsNewParcel          = newParcel != null && newParcel.landData.OwnerID == group.OwnerID;

            if (oldParcel == null ||
                ownerOwnedOldParcel ||
                oldParcelAllowedOtherScripts ||
                (oldParcelAllowedGroupScripts && oldParcelMatchesObjectGroup))
            {
                scriptsCouldRun = true;
            }

            if (ownerOwnsNewParcel ||
                newParcelAllowsOtherScripts ||
                (newParcelAllowsGroupScripts && newParcelMatchesObjectGroup))
            {
                scriptsCanRun = true;
            }

            List <TaskInventoryItem> scripts = new List <TaskInventoryItem>();

            if (scriptsCanRun != scriptsCouldRun)
            {
                EnableDisableFlag flag =
                    scriptsCanRun ? EnableDisableFlag.ParcelEnable : EnableDisableFlag.ParcelDisable;

                if (flag == EnableDisableFlag.ParcelDisable)
                {
                    //do not parcel disable any scripted group that is holding avatar controls
                    if (group.HasAvatarControls)
                    {
                        return;
                    }
                }

                group.ForEachPart(delegate(SceneObjectPart part)
                {
                    foreach (TaskInventoryItem script in part.Inventory.GetScripts())
                    {
                        _exeScheduler.ChangeEnabledStatus(script.ItemID, flag);
                    }
                });
            }
        }