コード例 #1
0
 public void SetScreen(Screen screen)
 {
     if (m_process != null)
     {
         m_process.SetScreen(screen);
     }
 }
コード例 #2
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public Screen()
 {
     LSystem.AUTO_REPAINT = true;
     Screen.StaticCurrentSceen = this;
     this.runnables = new List<Runnable>(1);
     this.handler = LSystem.screenProcess;
     this.width = LSystem.screenRect.width;
     this.height = LSystem.screenRect.height;
     this.halfWidth = width / 2;
     this.halfHeight = height / 2;
     this.fristOrder = DRAW_USER_PAINT();
     this.secondOrder = DRAW_SPRITE_PAINT();
     this.lastOrder = DRAW_DESKTOP_PAINT();
     this.fristPaintFlag = true;
     this.secondPaintFlag = true;
     this.lastPaintFlag = true;
 }
コード例 #3
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public virtual void AddScreen(Screen screen)
 {
     if (handler != null)
     {
         handler.AddScreen(screen);
     }
 }
コード例 #4
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public Replace_Thread(Screen s)
 {
     this.screen = s;
 }
コード例 #5
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
        public virtual void ReplaceScreen(Screen screen, MoveMethod m)
        {
            if (screen != null && screen != this)
            {
                screen.SetOnLoadState(false);
                SetLock(true);
                screen.SetLock(true);
                this.replaceMethod = m;
                this.replaceDstScreen = screen;

                screen.SetRepaintMode(SCREEN_CANVAS_REPAINT);
                switch (m)
                {
                    case MoveMethod.FROM_LEFT:
                        dstPos.SetLocation(-GetWidth(), 0);
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_RIGHT:
                        dstPos.SetLocation(GetWidth(), 0);
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UP:
                        dstPos.SetLocation(0, -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_DOWN:
                        dstPos.SetLocation(0, GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UPPER_LEFT:
                        dstPos.SetLocation(-GetWidth(), -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_UPPER_RIGHT:
                        dstPos.SetLocation(GetWidth(), -GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_LOWER_LEFT:
                        dstPos.SetLocation(-GetWidth(), GetHeight());
                        isScreenFrom = true;
                        break;
                    case MoveMethod.FROM_LOWER_RIGHT:
                        dstPos.SetLocation(GetWidth(), GetHeight());
                        isScreenFrom = true;
                        break;
                    default:
                        dstPos.SetLocation(0, 0);
                        isScreenFrom = false;
                        break;
                }

                Replace_Thread loading = new Replace_Thread(screen);
                CallEvent(loading);
                replaceLoading = true;
            }
        }
コード例 #6
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public PaintOrder(byte t, Screen s)
 {
     this.type = t;
     this.screen = s;
 }
コード例 #7
0
ファイル: Screen.cs プロジェクト: 207h2Flogintvg/LGame
 public virtual void SetScreen(Screen screen)
 {
     if (handler != null)
     {
         this.handler.SetScreen(screen);
     }
 }
コード例 #8
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 private void SetScreen(Screen @screen, bool @put)
 {
     lock (this)
     {
         if (screen == null)
         {
             this.isInstance = false;
             throw new RuntimeException(
                     "Cannot create a [Screen] instance !");
         }
         InitDestory();
         if (!LSystem.isLogo)
         {
             if (currentControl != null)
             {
                 SetTransition(screen.OnTransition());
             }
             else
             {
                 LTransition transition = screen.OnTransition();
                 if (transition == null)
                 {
                     switch (MathUtils.Random(0, 3))
                     {
                         case 0:
                             transition = LTransition.NewFadeIn();
                             break;
                         case 1:
                             transition = LTransition.NewArc();
                             break;
                         case 2:
                             transition = LTransition
                                     .NewSplitRandom(LColor.black);
                             break;
                         case 3:
                             transition = LTransition
                                     .NewCrossRandom(LColor.black);
                             break;
                     }
                 }
                 SetTransition(transition);
             }
         }
         screen.SetOnLoadState(false);
         if (currentControl == null)
         {
             currentControl = screen;
         }
         else
         {
             lock (currentControl)
             {
                 currentControl.Destroy();
                 currentControl = screen;
             }
         }
         this.isInstance = true;
         if (screen is EmulatorListener)
         {
             SetEmulatorListener((EmulatorListener)screen);
         }
         else
         {
             SetEmulatorListener(null);
         }
         StartTransition();
         screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);
         if (!running || GLEx.Device == null || loading_Control != null)
         {
             screen.SetClose(false);
             screen.OnLoad();
             screen.SetOnLoadState(true);
             screen.OnLoaded();
             EndTransition();
         }
         else
         {
             Thread load = null;
             try
             {
                 load = new _LoadingScreen(this, screen);
                 load.Start();
             }
             catch (System.Exception ex)
             {
                 throw new RuntimeException(currentControl.GetName()
                         + " onLoad:" + ex.Message);
             }
             finally
             {
                 load = null;
             }
         }
         if (screen != null)
         {
             if (screen is LFlickerListener)
             {
                 if (currentInput != null)
                 {
                     currentInput.Flicker = (LFlickerListener)screen;
                 }
             }
         }
         if (put)
         {
             screens.AddLast(screen);
         }
         loading_Control = null;
         Thread.Yield();
     }
 }
コード例 #9
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 public void AddScreen(Screen screen)
 {
     if (screen == null)
     {
         throw new RuntimeException("Cannot create a [IScreen] instance !");
     }
     screens.AddLast(screen);
 }
コード例 #10
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 public void SetCurrentScreen(Screen screen)
 {
     if (screen != null)
     {
         this.isInstance = false;
         if (currentControl != null)
         {
             currentControl.Destroy();
         }
         this.currentControl = screen;
         currentControl.SetLock(false);
         currentControl.SetLocation(0, 0);
         currentControl.SetClose(false);
         currentControl.SetOnLoadState(true);
         if (screen.GetBackground() != null)
         {
             currentControl.SetRepaintMode(Screen.SCREEN_BITMAP_REPAINT);
         }
         this.isInstance = true;
         if (screen is EmulatorListener)
         {
             SetEmulatorListener((EmulatorListener)screen);
         }
         else
         {
             SetEmulatorListener(null);
         }
         screens.AddLast(screen);
     }
 }
コード例 #11
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 public void SetScreen(Screen screen)
 {
     if (GLEx.Device == null)
     {
         loading_Control = screen;
         loading_complete = true;
     }
     else
     {
         SetScreen(screen, true);
     }
 }
コード例 #12
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 public void OnDestroy()
 {
     EndTransition();
     if (GLEx.Self != null)
     {
         GLEx.Self.Dispose();
     }
     scene = null;
     screens.Clear();
     if (isInstance)
     {
         isInstance = false;
         loads.Clear();
         unloads.Clear();
         drawings.Clear();
         if (currentControl != null)
         {
             currentControl.Destroy();
             currentControl = null;
         }
         LSystem.isLogo = false;
         LTextures.DisposeAll();
         XNACircle.Free();
         InitDestory();
     }
 }
コード例 #13
0
ファイル: LProcess.cs プロジェクト: hellogithubtesting/LGame
 public _LoadingScreen(LProcess p, Screen s)
 {
     this.process = p;
     this.screen = s;
 }
コード例 #14
0
ファイル: LProcess.cs プロジェクト: 207h2Flogintvg/LGame
        private void SetScreen(Screen screen, bool put)
        {
            if (currentControl != null && currentControl.IsOnLoadComplete())
            {
                return;
            }
            lock (this)
            {
                if (screen == null)
                {
                    this.isInstance = false;
                    throw new RuntimeException(
                            "Cannot create a [Screen] instance !");
                }
                GLLoader.Destory();
                if (!LSystem.isLogo)
                {
                    if (currentControl != null)
                    {
                        SetTransition(screen.OnTransition());
                    }
                    else
                    {
                        LTransition transition = screen.OnTransition();
                        if (transition == null)
                        {
                            switch (MathUtils.Random(0, 3))
                            {
                                case 0:
                                    transition = LTransition.NewFadeIn();
                                    break;
                                case 1:
                                    transition = LTransition.NewArc();
                                    break;
                                case 2:
                                    transition = LTransition
                                            .NewSplitRandom(LColor.black);
                                    break;
                                case 3:
                                    transition = LTransition
                                            .NewCrossRandom(LColor.black);
                                    break;
                            }
                        }
                        SetTransition(transition);
                    }
                }
                screen.SetOnLoadState(false);
                if (currentControl == null)
                {
                    currentControl = screen;
                }
                else
                {
                    lock (currentControl)
                    {
                        currentControl.Destroy();
                        currentControl = screen;
                    }
                }
                this.isInstance = true;
                if (screen is EmulatorListener)
                {
                    SetEmulatorListener((EmulatorListener)screen);
                }
                else
                {
                    SetEmulatorListener(null);
                }

                screen.OnCreate(LSystem.screenRect.width, LSystem.screenRect.height);

                LSystem.CallScreenRunnable(new _LoadingScreen(this, screen));

                if (put)
                {
                    screens.AddLast(screen);
                }
                loading_Control = null;
            }
        }
コード例 #15
0
ファイル: LProcess.cs プロジェクト: 207h2Flogintvg/LGame
 public _LoadingScreen(LProcess p, Screen s)
     : base("ProcessThread")
 {
     this.process = p;
     this.screen = s;
 }
コード例 #16
0
ファイル: Screen.cs プロジェクト: hellogithubtesting/LGame
 public Screen()
 {
     LSystem.AUTO_REPAINT = true;
     Screen.StaticCurrentSceen = this;
     this.log = LogFactory.GetInstance(GetType());
     this.runnables = new List<Runnable>(1);
     this.handler = LSystem.screenProcess;
     this.width = LSystem.screenRect.width;
     this.height = LSystem.screenRect.height;
     this.halfWidth = width / 2;
     this.halfHeight = height / 2;
     this.fristOrder = DRAW_USER;
     this.secondOrder = DRAW_SPRITE;
     this.lastOrder = DRAW_DESKTOP;
     this.fristPaintFlag = true;
     this.secondPaintFlag = true;
     this.lastPaintFlag = true;
     this.SetFPS(GetMaxFPS());
 }