public void FinishLoad() { var keyState = new KeyboardState(); var controllerState = new GamePadState(); Global.update_input(Game, new GameTime(), Game.IsActive, keyState, controllerState); }
private void UpdateScene(GameTime gameTime, KeyboardState keyState, GamePadState controllerState) { if (Paused) { FrameAdvanced = true; } if (!Global.scene.skip_frame()) { if (Paused) { Global.update_input(Game, gameTime, Game.IsActive, keyState, controllerState); } #if !MONOGAME && DEBUG Global.update_text_input(); #endif Global.update_scene(keyState); } }
public IEnumerable <GameTime> Update(GameTime gameTime) { KeyboardState keyState = Keyboard.GetState(); GamePadState controllerState = GamePad.GetState(PlayerIndex.One); #if !MONOGAME OpenALInterface.update(); #endif #if DEBUG // Stereoscopy debugging if (Tactile.Global.Input.pressed(Inputs.Select)) { if (Global.Input.triggered(Inputs.Right)) { Global.gameSettings.Graphics.ConfirmSetting( Tactile.Options.GraphicsSetting.Stereoscopic, 0, Global.gameSettings.Graphics.StereoscopicLevel + 5); } if (Global.Input.triggered(Inputs.Left)) { Global.gameSettings.Graphics.ConfirmSetting( Tactile.Options.GraphicsSetting.Stereoscopic, 0, Global.gameSettings.Graphics.StereoscopicLevel - 5); } } #endif // If changing zoom or fullscreen, return if (UpdateZoom()) { PreviousKeyState = keyState; yield break; } int updateLoops = UpdateFramerate(gameTime, keyState, controllerState); UpdateInitialLoad(); int i; for (i = 0; ; i++) { if (!Paused) { Global.update_input(Game, gameTime, Game.IsActive, keyState, controllerState); Global.Rumble.Update(gameTime); Renderer.UpdateTouch(); } UpdatePause(keyState, controllerState); bool processNextFrame = (!Paused || FrameAdvanced); if (i > 0) { #if !MONOGAME OpenALInterface.update(); #endif } // Don't update audio handling when the game is paused, // to better debug fades etc if (processNextFrame) { Global.Audio.update(GameInactive); } Stereoscopic_Graphic_Object.update_stereoscopy(); UpdateIO(); UpdateSceneChange(); if (Global.scene != null) { // Suspend IOHandler.UpdateSuspend(); // Update Scene if (processNextFrame) { UpdateScene(gameTime, keyState, controllerState); } } yield return(gameTime); if (updateLoops > 1) { float updateLoopTime = (float)(HyperspeedStopWatch.ElapsedTicks / ((double)Stopwatch.Frequency)); // If a normal frame worth of time has passed, or if the fixed number of hyperspeed loops have occurred if (updateLoopTime > 1f / FRAME_RATE || i >= updateLoops - 1) { break; } #if DEBUG || GET_FPS else { FramerateFrames++; } #endif } else { break; } } UpdateOpenGameSite(); Global.Audio.post_update(); Renderer.UpdateScreenScale(); UpdateTextGlow(i + 1); HyperspeedStopWatch.Stop(); //@Debug PreviousKeyState = keyState; }