private static void UpdateLGChooseGameLEFT() { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); if (LastPage != null && !LastPage.IsDisposed) { LastPage.Dispose(); CurrentLastPageLoc = Vector2.Zero; } if (OffScreenBuffer != null && !OffScreenBuffer.IsDisposed) { lock (OffScreenBuffer) { LastPage = new Texture2D(Memory.graphics.GraphicsDevice, OffScreenBuffer.Width, OffScreenBuffer.Height); lock (LastPage) { Color[] texdata = new Color[OffScreenBuffer.Width * OffScreenBuffer.Height]; OffScreenBuffer.GetData(texdata); LastPage.SetData(texdata); LastPageTarget = new Vector2(vp_per.X, CurrentPageLoc.Y); CurrentPageLoc = new Vector2(-PageSize.X, CurrentPageLoc.Y); } } } Blockpage--; }
private static bool UpdateLGChooseGame() { bool ret = false; if (BlockLocs != null && BlockLocs.Length > 0 && BlockLocs[0] != null) { for (int i = 0; i < BlockLocs.Length && BlockLocs[i] != null; i++) { if (BlockLocs[i].Item1.Contains(ml)) { BlockLoc = (sbyte)i; ret = true; if (Input.Button(Buttons.MouseWheelup)) { UpdateLGChooseGameLEFT(); return(true); } else if (Input.Button(Buttons.MouseWheeldown)) { UpdateLGChooseGameRIGHT(); return(true); } break; } } if (Input.Button(Buttons.Down)) { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); BlockLoc++; ret = true; } else if (Input.Button(Buttons.Left)) { UpdateLGChooseGameLEFT(); ret = true; } else if (Input.Button(Buttons.Right)) { UpdateLGChooseGameRIGHT(); ret = true; } else if (Input.Button(Buttons.Up)) { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); BlockLoc--; ret = true; } else if (Input.Button(Keys.PageDown)) { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); SlotLoc++; ret = true; } else if (Input.Button(Keys.PageUp)) { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(0); SlotLoc--; ret = true; } else if (Input.Button(Buttons.Cancel)) { Input.ResetInputLimit(); init_debugger_Audio.PlaySound(8); init_debugger_Audio.StopMusic(); Dchoose = 0; Fade = 0.0f; State = MainMenuStates.LoadGameChooseSlot; ret = true; } else if (Input.Button(Buttons.Okay)) { PercentLoaded = 0f; //State = MainMenuStates.LoadGameCheckingSlot; State = MainMenuStates.LoadGameLoading; } } if (scale != lastscale && OffScreenBuffer != null && !OffScreenBuffer.IsDisposed) { OffScreenBuffer.Dispose(); } if (OffScreenBuffer == null || OffScreenBuffer.IsDisposed) { //if you make these with out disposing enough times gfx driver crashes. //happened many times if i left this running and had this just ran every draw call. heh. OffScreenBuffer = new RenderTarget2D(Memory.graphics.GraphicsDevice, (int)(vp_per.X * 0.65625f), (int)(vp_per.Y * 0.6625f), false, SurfaceFormat.Color, DepthFormat.None); } return(ret); }