Esempio n. 1
0
        public void BeginSpriteBatch(RenderStateVariables renderStates, Layer layer, BeginType beginType, Camera camera)
        {
            Matrix matrix = GetZoomAndMatrix(layer, camera);

            SamplerState samplerState = GetSamplerState(renderStates);


            bool isFullscreen = renderStates.ClipRectangle == null;

            RasterizerState rasterizerState;

            if (isFullscreen)
            {
                rasterizerState = scissorTestDisabled;
            }
            else
            {
                rasterizerState = scissorTestEnabled;
            }


            Rectangle scissorRectangle = new Rectangle();

            if (rasterizerState.ScissorTestEnable)
            {
                scissorRectangle = renderStates.ClipRectangle.Value;

                // make sure values of with and height are never less than 0:
                if (scissorRectangle.Width < 0)
                {
                    scissorRectangle.Width = 0;
                }
                if (scissorRectangle.Height < 0)
                {
                    scissorRectangle.Height = 0;
                }
            }


            DepthStencilState depthStencilState = DepthStencilState.DepthRead;

            if (beginType == BeginType.Begin)
            {
                mSpriteBatch.ReplaceRenderStates(SpriteSortMode.Immediate, renderStates.BlendState,
                                                 samplerState,
                                                 depthStencilState,
                                                 rasterizerState,
                                                 null, matrix,
                                                 scissorRectangle);
            }
            else
            {
                mSpriteBatch.PushRenderStates(SpriteSortMode.Immediate, renderStates.BlendState,
                                              samplerState,
                                              depthStencilState,
                                              rasterizerState,
                                              null, matrix,
                                              scissorRectangle);
            }
        }
Esempio n. 2
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "checking {0}", begin.Type);

            m_details = string.Empty;
        }
        public void VisitBegin(BeginType begin)
        {
            DBC.Assert(!m_checkingCalls, "VisitBegin was called after we started visiting calls");

            // If the class is internal,
            if (begin.Type.IsNotPublic || begin.Type.IsNestedAssembly || begin.Type.IsNestedFamilyAndAssembly)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", begin.Type);

                // and it directly implements one or more public interfaces,
                int count = DoCountInterfaces(begin.Type);
                if (count > 0)
                {
                    // then build a list of all the non-private/protected methods
                    // in the class that were not declared in an interface.
                    foreach (MethodDefinition method in begin.Type.Methods)
                    {
                        if (!method.IsPrivate && !method.IsFamily)
                        {
                            if (!method.IsConstructor)
                            {
                                TypeReference t = method.GetDeclaredIn(Cache);
                                if (t == begin.Type)
                                {
                                    Log.DebugLine(this, "   adding {0}", method.Name);
                                    m_candidates.Add(method, new Info(begin.Type));
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        public void SetBegin(BeginType type)
        {
            string errmes = "";

            switch (type)
            {
            case BeginType.SHOP:
            case BeginType.TRAIN:
            case BeginType.AFTERTRAIN:
            case BeginType.ABLUP:
            case BeginType.TURNEND:
            case BeginType.FIRST:
                if ((sysStateCode & SystemStateCode.__CAN_BEGIN__) != SystemStateCode.__CAN_BEGIN__)
                {
                    errmes = "BEGIN";
                    goto err;
                }
                break;

            //1.729 BEGIN TITLEはどこでも使えるように
            case BeginType.TITLE:
                break;
                //BEGINの処理中でチェック済み
                //default:
                //    throw new ExeEE("不適当なBEGIN呼び出し");
            }
            begintype = type;
            return;

err:
            CalledFunction func = functionList[0];
            string funcName = func.FunctionName;

            throw new CodeEE("@" + funcName + "中で" + errmes + "命令を実行することはできません");
        }
Esempio n. 5
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_needsCheck = begin.Type.ExternallyVisible(Cache);
        }
Esempio n. 6
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "checking {0}", begin.Type);

            m_names      = string.Empty;
            m_needsCheck = begin.Type.ExternallyVisible(Cache);
        }
Esempio n. 7
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_disposable = begin.Type.TypeOrBaseImplements("System.IDisposable", Cache);
            m_hasDispose = false;
        }
Esempio n. 8
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", m_type);

            m_type   = begin.Type;
            m_failed = false;
        }
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_type  = begin.Type;
            m_field = null;
        }
Esempio n. 10
0
        public void VisitBegin(BeginType type)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", type.Type);

            m_needsCheck = type.Type.IsEnum;
            m_foundZero  = false;
        }
Esempio n. 11
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "checking {0}", begin.Type);

            m_needsCheck = !begin.Type.IsEnum && begin.Type.ExternallyVisible(Cache);
            m_details    = string.Empty;
        }
Esempio n. 12
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_hasFinalizer   = false;
            m_hasIntPtrField = false;
        }
Esempio n. 13
0
        public void VisitBegin(BeginType type)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", type.Type);

            m_needsCheck = type.Type.IsEnum && type.Type.CustomAttributes.Has("FlagsAttribute");
            m_values.Clear();
        }
Esempio n. 14
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "checking {0}", begin.Type);

            m_type = begin.Type;
            m_candidates.Clear();
        }
Esempio n. 15
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_type       = begin.Type;
            m_needsCheck = false;
        }
Esempio n. 16
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_needsCheck = !begin.Type.IsEnum && DoIsVisible(begin.Type);
            m_visible.Clear();
        }
Esempio n. 17
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_hasAdd    = false;
            m_hasMinus  = false;
            m_hasEquals = false;
        }
Esempio n. 18
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_type       = begin.Type;
            m_name       = null;
            m_needsCheck = m_type.IsSealed;
        }
Esempio n. 19
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_type       = begin.Type;
            m_ownsField  = false;
            m_disposable = begin.Type.TypeOrBaseImplements("System.IDisposable", Cache);
            m_details    = string.Empty;
        }
Esempio n. 20
0
        public void VisitBegin(BeginType begin)
        {
            m_isAbstract    = begin.Type.IsAbstract;
            m_hasPublicCtor = false;

            if (m_isAbstract)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", begin.Type);
            }
        }
Esempio n. 21
0
        public void VisitBegin(BeginType begin)
        {
            m_needsCheck = begin.Type.ExternallyVisible(Cache);
            m_badFields.Clear();

            if (m_needsCheck)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", begin.Type);
            }
        }
Esempio n. 22
0
        public void VisitBegin(BeginType begin)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "{0}", begin.Type);

            m_needsCheck = !begin.Type.IsInterface && begin.Type.TypeImplements("System.IComparable");
            if (m_needsCheck)
            {
                m_foundCompare = false;
                m_foundEquals  = false;
            }
        }
    void BeginEvents(EngineEvent[] _events, BeginType _type)
    {
        if (!beginMask.MaskContains((int)_type))
        {
            return;
        }

        for (int i = 0; i < _events.Length; i++)
        {
            //_events[i].DoEvent(,);
        }
    }
Esempio n. 24
0
        public void VisitBegin(BeginType begin)
        {
            MethodDefinition finalizer = begin.Type.Methods.GetMethod("Finalize", Type.EmptyTypes);

            m_hasFinalizer = finalizer != null;
            m_hasIntPtr    = false;
            m_hasKeepAlive = false;

            if (m_hasFinalizer)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "checking {0}", begin.Type);
            }
        }
Esempio n. 25
0
        public void VisitBegin(BeginType begin)
        {
            m_needsCheck = begin.Type.IsSubclassOf("System.Exception", Cache) &&
                           begin.Type.ExternallyVisible(Cache);

            if (m_needsCheck)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", begin.Type);

                m_foundInner      = false;
                m_foundSerialized = false;
            }
        }
Esempio n. 26
0
        public void VisitBegin(BeginType begin)
        {
            m_needsCheck = false;
            m_type       = begin.Type;
            m_details    = string.Empty;

            if (m_type.ExternallyVisible(Cache))
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", m_type);

                m_needsCheck = true;
            }
        }
Esempio n. 27
0
        public void BeginSpriteBatch(RenderStateVariables renderStates, Layer layer, BeginType beginType, Camera camera)
        {

            Matrix matrix = GetZoomAndMatrix(layer, camera);

            SamplerState samplerState = GetSamplerState(renderStates);


            bool isFullscreen = renderStates.ClipRectangle == null;

            RasterizerState rasterizerState;
            if (isFullscreen)
            {
                rasterizerState = scissorTestDisabled;
            }
            else
            {
                rasterizerState = scissorTestEnabled;
            }


            Rectangle scissorRectangle = new Rectangle();
            if (rasterizerState.ScissorTestEnable)
            {
                scissorRectangle = renderStates.ClipRectangle.Value;
            }


            DepthStencilState depthStencilState = DepthStencilState.DepthRead;

            if (beginType == BeginType.Begin)
            {
                mSpriteBatch.ReplaceRenderStates(SpriteSortMode.Immediate, renderStates.BlendState,
                    samplerState,
                    depthStencilState,
                    rasterizerState,
                    null, matrix,
                    scissorRectangle);
            }
            else
            {
                mSpriteBatch.PushRenderStates(SpriteSortMode.Immediate, renderStates.BlendState,
                    samplerState,
                    depthStencilState,
                    rasterizerState,
                    null, matrix,
                    scissorRectangle);
            }
        }
Esempio n. 28
0
        public void VisitBegin(BeginType arg)
        {
            Log.DebugLine(this, "-----------------------------------");
            Log.DebugLine(this, "checking {0}", arg.Type);

            m_details    = string.Empty;
            m_type       = arg.Type;
            m_needsCheck = false;

//			if (!m_type.FullName.Contains("PrivateImplementationDetails"))
            if (!m_type.Name.StartsWith("yy") && !m_type.IsCompilerGenerated())
            {
                m_needsCheck = true;
            }
        }
Esempio n. 29
0
 public void ClearFunctionList()
 {
     if (Program.DebugMode && !isClone && GlobalStatic.Process.MethodStack() == 0)
     {
         console.DebugClearTraceLog();
     }
     foreach (CalledFunction called in functionList)
     {
         if (called.CurrentLabel.hasPrivDynamicVar)
         {
             called.CurrentLabel.Out();
         }
     }
     functionList.Clear();
     begintype = BeginType.NULL;
 }
Esempio n. 30
0
        public void VisitBegin(BeginType begin)
        {
            m_needsCheck = begin.Type.IsSubclassOf("System.Attribute", Cache);
            Log.DebugLine(this, "{0}", begin.Type);

            if (m_needsCheck)
            {
                Log.DebugLine(this, "-----------------------------------");
                Log.DebugLine(this, "{0}", begin.Type);

                m_required.Clear();
                m_optional.Clear();
                m_getters.Clear();
                m_setters.Clear();
            }
        }
Esempio n. 31
0
        public void VisitBegin(BeginType begin)
        {
            m_needsCheck  = false;
            m_hasBadField = false;
            m_details     = string.Empty;

            if ((begin.Type.Attributes & TypeAttributes.Serializable) == TypeAttributes.Serializable)
            {
                if (!begin.Type.TypeOrBaseImplements("System.Runtime.Serialization.ISerializable", Cache))
                {
                    m_needsCheck = true;

                    Log.DebugLine(this, "-----------------------------------");
                    Log.DebugLine(this, "checking {0}", begin.Type);
                }
            }
        }
Esempio n. 32
0
 public void SetBegin(BeginType type)
 {
     string errmes = "";
     switch (type)
     {
         case BeginType.SHOP:
         case BeginType.TRAIN:
         case BeginType.AFTERTRAIN:
         case BeginType.ABLUP:
         case BeginType.TURNEND:
         case BeginType.FIRST:
             if ((sysStateCode & SystemStateCode.__CAN_BEGIN__) != SystemStateCode.__CAN_BEGIN__)
             {
                 errmes = "BEGIN";
                 goto err;
             }
             break;
         //1.729 BEGIN TITLEはどこでも使えるように
         case BeginType.TITLE:
             break;
         //BEGINの処理中でチェック済み
         //default:
         //    throw new ExeEE("不適当なBEGIN呼び出し");
     }
     begintype = type;
     return;
     err:
     CalledFunction func = functionList[0];
     string funcName = func.FunctionName;
     throw new CodeEE("@" + funcName + "中で" + errmes + "命令を実行することはできません");
 }
Esempio n. 33
0
        /// <summary>
        /// BEGIN命令によるプログラム状態の変化
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public void Begin()
        {
            //@EVENTSHOPからの呼び出しは一旦破棄
            if (sysStateCode == SystemStateCode.Shop_CallEventShop)
                return;

            switch (begintype)
            {
                case BeginType.SHOP:
                    if (sysStateCode == SystemStateCode.Normal)
                        calledWhenNormal = true;
                    else
                        calledWhenNormal = false;
                    sysStateCode = SystemStateCode.Shop_Begin;
                    break;
                case BeginType.TRAIN:
                    sysStateCode = SystemStateCode.Train_Begin;
                    break;
                case BeginType.AFTERTRAIN:
                    sysStateCode = SystemStateCode.AfterTrain_Begin;
                    break;
                case BeginType.ABLUP:
                    sysStateCode = SystemStateCode.Ablup_Begin;
                    break;
                case BeginType.TURNEND:
                    sysStateCode = SystemStateCode.Turnend_Begin;
                    break;
                case BeginType.FIRST:
                    sysStateCode = SystemStateCode.First_Begin;
                    break;
                case BeginType.TITLE:
                    sysStateCode = SystemStateCode.Title_Begin;
                    break;
                //セット時に判定してるので、ここには来ないはず
                //default:
                //    throw new ExeEE("不適当なBEGIN呼び出し");
            }
            if (Program.DebugMode)
            {
                console.DebugClearTraceLog();
                console.DebugAddTraceLog("BEGIN:" + begintype.ToString());
            }
            foreach (CalledFunction called in functionList)
                if (called.CurrentLabel.hasPrivDynamicVar)
                    called.CurrentLabel.Out();
            functionList.Clear();
            begintype = BeginType.NULL;
            return;
        }
Esempio n. 34
0
 /// <summary>
 /// システムによる強制的なBEGIN
 /// </summary>
 /// <param name="type"></param>
 public void Begin(BeginType type)
 {
     begintype = type;
     sysStateCode = SystemStateCode.Title_Begin;
     Begin();
 }
Esempio n. 35
0
 public void ClearFunctionList()
 {
     if (Program.DebugMode && !isClone && GlobalStatic.Process.MethodStack() == 0)
         console.DebugClearTraceLog();
     foreach (CalledFunction called in functionList)
         if (called.CurrentLabel.hasPrivDynamicVar)
             called.CurrentLabel.Out();
     functionList.Clear();
     begintype = BeginType.NULL;
 }
Esempio n. 36
0
        private void BeginSpriteBatch(RenderStateVariables renderStates, Layer layer, BeginType beginType)
        {
            Matrix matrix = GetZoomAndMatrix(layer);

            SamplerState samplerState = GetSamplerState(renderStates);

            RasterizerState rasterizerState = GetRasterizerState(renderStates, layer);

            Rectangle scissorRectangle = new Rectangle();
            if(rasterizerState.ScissorTestEnable)
            {
                scissorRectangle = layer.GetScissorRectangleFor(mCamera);
            }

            DepthStencilState depthStencilState = DepthStencilState.DepthRead;

            if (beginType == BeginType.Begin)
            {
                mSpriteBatch.Begin(SpriteSortMode.Immediate, renderStates.BlendState,
                    samplerState,
                    depthStencilState,
                    rasterizerState,
                    null, matrix,
                    scissorRectangle);
            }
            else
            {
                mSpriteBatch.Push(SpriteSortMode.Immediate, renderStates.BlendState,
                    samplerState,
                    depthStencilState,
                    rasterizerState,
                    null, matrix,
                    scissorRectangle);
            }
            mDrawCallsPerFrame++;
        }