예제 #1
0
        private static void MixInput(INP inpId, int keyId, int btnId)
        {
            int freezeInputFrame_BKUP = GameEngine.FreezeInputFrame;

            GameEngine.FreezeInputFrame = 0;

            bool keyDown = 1 <= GameKeyboard.GetKeyInput(keyId);
            bool btnDown = 1 <= GamePad.GetPadInput(GameGround.I.PrimaryPadId, btnId);

            GameEngine.FreezeInputFrame = freezeInputFrame_BKUP;

            GameDefine.UpdateInput(ref InputStatus[(int)inpId], keyDown || btnDown);
        }
예제 #2
0
        public static void EachFrame()
        {
            //if (SEEachFrame()) // TODO
            {
                GameMusic.MusicEachFrame();
            }
            GameGround.I.EL.ExecuteAllTask();
            GameToolkit.CurtainEachFrame();

            if (GameGround.I.MainScreen != null && SubScreen.CurrDrawScreenHandle == GameGround.I.MainScreen.GetHandle())
            {
                SubScreen.ChangeDrawScreen(DX.DX_SCREEN_BACK);

                if (GameGround.I.RealScreenDrawRect.W == -1)
                {
                    if (DX.DrawExtendGraph(0, 0, GameGround.I.RealScreenSize.W, GameGround.I.RealScreenSize.H, GameGround.I.MainScreen.GetHandle(), 0) != 0)                     // ? 失敗
                    {
                        throw new GameError();
                    }
                }
                else
                {
                    if (DX.DrawBox(0, 0, GameGround.I.RealScreenSize.W, GameGround.I.RealScreenSize.H, DX.GetColor(0, 0, 0), 1) != 0)                     // ? 失敗
                    {
                        throw new GameError();
                    }

                    if (DX.DrawExtendGraph(
                            GameGround.I.RealScreenDrawRect.L,
                            GameGround.I.RealScreenDrawRect.T,
                            GameGround.I.RealScreenDrawRect.L + GameGround.I.RealScreenDrawRect.W,
                            GameGround.I.RealScreenDrawRect.T + GameGround.I.RealScreenDrawRect.H, GameGround.I.MainScreen.GetHandle(), 0) != 0)                     // ? 失敗
                    {
                        throw new GameError();
                    }
                }
            }

            // DxLib >

            DX.ScreenFlip();

            if ((IgnoreEscapeKey == false && DX.CheckHitKey(DX.KEY_INPUT_ESCAPE) == 1) || DX.ProcessMessage() == -1)
            {
                throw new GameError.EndProc();
            }

            // < DxLib

            CheckHz();

            ProcFrame++;
            if (IntTools.IMAX < ProcFrame)             // 192.9日程度でカンスト
            {
                throw new GameError();
            }
            GameDefine.CountDown(ref FreezeInputFrame);
            WindowIsActive = GameSystem.IsWindowActive();

            GamePad.PadEachFrame();
            GameKeyboard.KeyEachFrame();
            GameInput.InputEachFrame();
            GameMouse.I.MouseEachFrame();

            if (GameGround.I.RealScreenSize.W != GameGround.I.ScreenSize.W || GameGround.I.RealScreenSize.H != GameGround.I.ScreenSize.H)
            {
                if (GameGround.I.MainScreen == null)
                {
                    GameGround.I.MainScreen = new SubScreen(GameGround.I.ScreenSize.W, GameGround.I.ScreenSize.H);
                }

                SubScreen.ChangeDrawScreen(GameGround.I.MainScreen);
            }
        }