Ejemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
#if ENABLE_FRAME_LIMIT && !PROFILE
            FramerateLimiter();
#endif // ENABLE_FRAME_LIMIT && !PROFILE

            if (!m_paused)
            {
                if (MenuInputComponent.MenuStillDebouncing() == false)
                {
                    if ((GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed) ||
                        (Keyboard.GetState().IsKeyDown(Keys.F1)))
                    {
                        m_paused = true;

                        MenuInputComponent.Enable();
                        m_pause_menu.ShowMenu();
                    }
                }

                m_emulator.Update();
            }

            base.Update(gameTime);
        }
Ejemplo n.º 2
0
        public override void Update(GameTime gameTime)
        {
            if (m_active)
            {
                MenuInputComponent.EMenuInput input = MenuInputComponent.PollInput();

                switch (input)
                {
                case MenuInputComponent.EMenuInput.Up:
                {
                    m_menu_index -= 1;
                    if (m_menu_index < 0)
                    {
                        m_menu_index = m_menu_choices.Length - 1;
                    }
                }
                break;

                case MenuInputComponent.EMenuInput.Down:
                {
                    m_menu_index += 1;
                    if (m_menu_index >= m_menu_choices.Length)
                    {
                        m_menu_index = 0;
                    }
                }
                break;

                case MenuInputComponent.EMenuInput.Select:
                {
                    if (m_menu_choices[m_menu_index].m_is_toggle)
                    {
                        m_menu_choices[m_menu_index].m_toggle_on = !m_menu_choices[m_menu_index].m_toggle_on;
                    }

                    m_callback(m_menu_index);
                }
                break;

                case MenuInputComponent.EMenuInput.Back:
                case MenuInputComponent.EMenuInput.Start:
                {
                    m_callback(-1);
                }
                break;
                }
            }

            if (m_intro_text_time > 0)
            {
                m_intro_text_time -= gameTime.ElapsedGameTime.Milliseconds;
            }

            base.Update(gameTime);
        }
Ejemplo n.º 3
0
        public void Unpause()
        {
            // Remove the menus and unpause
            m_paused = false;
            m_pause_menu.Close();
            m_snapshot_menu.Close();
            MenuInputComponent.Disable();

            // Try and clean up any allocs
            GC.Collect();
        }