Updating more code

--HG--
branch : axios-newgsm
This commit is contained in:
nathan@daedalus 2012-04-17 22:21:33 -05:00
parent 494a128094
commit 7cc7e9130c
9 changed files with 24 additions and 7 deletions

View File

@ -69,7 +69,7 @@ namespace Axios.Engine
this.ScaleChanged(gameObject);
}
private void OnEvent(AxiosHandler e, AxiosGameScreen gameScreen, InputHelper input)
private void OnEvent(AxiosHandler e, AxiosGameScreen gameScreen, InputState input)
{
AxiosHandler handle = e;
if (handle != null)

View File

@ -334,7 +334,7 @@ namespace Axios.Engine
}
}
public override void HandleInput(InputState input, GameTime gameTime)
public override void HandleInput(GameTime gameTime, InputState input)
{
base.HandleInput(input, gameTime);
@ -345,7 +345,7 @@ namespace Axios.Engine
g.HandleInput(this, input, gameTime);
}
public override void UnloadContent()
public override void Deactivate()
{
base.UnloadContent();
//AxiosLog.Instance.AddLine("Memory usage before cleanup: " + GC.GetTotalMemory(true).ToString(), LoggingFlag.DEBUG);

View File

@ -35,6 +35,7 @@ namespace GameStateManagement
/// </summary>
public abstract class GameScreen
{
protected bool HasCursor = false;
/// <summary>
/// Normally when one screen is brought up over the top of another,
/// the first screen will transition off to make room for the new

View File

@ -146,6 +146,7 @@ namespace FarseerPhysics.SamplesFramework
public void LoadContent()
{
_cursorSprite = new Sprite(_manager.Content.Load<Texture2D>("Common/cursor"));
#if WINDOWS_PHONE
// virtual stick content

View File

@ -62,8 +62,8 @@ namespace GameStateManagement
public override void HandleInput(GameTime gameTime, InputState input)
{
//input.
if (input.KeyboardState.GetPressedKeys().Length > 0 ||
input.GamePadState.IsButtonDown(Buttons.A | Buttons.Start | Buttons.Back) ||
if (input.CurrentKeyboardStates[0].GetPressedKeys().Length > 0 ||
input.CurrentGamePadStates[0].IsButtonDown(Buttons.A | Buttons.Start | Buttons.Back) ||
input.MouseState.LeftButton == ButtonState.Pressed)
{
_duration = TimeSpan.Zero;

View File

@ -9,6 +9,7 @@
#region Using Statements
using Microsoft.Xna.Framework;
using GameStateManagementSample;
#endregion
namespace GameStateManagement

View File

@ -9,6 +9,7 @@
using System;
using GameStateManagement;
using GameStateManagementSample;
using Microsoft.Xna.Framework;
namespace GameStateManagement

View File

@ -72,12 +72,13 @@ namespace GameStateManagement
{
if (!Axios.Settings.ScreenSaver)
{
ContentManager man = new ContentManager(this.ScreenManager.Game.Services, "Content");
DebugView = new DebugViewXNA(World);
DebugView.RemoveFlags(DebugViewFlags.Shape);
DebugView.RemoveFlags(DebugViewFlags.Joint);
DebugView.DefaultShapeColor = Color.White;
DebugView.SleepingShapeColor = Color.LightGray;
DebugView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.Content);
DebugView.LoadContent(ScreenManager.GraphicsDevice, man);
}
}

View File

@ -18,6 +18,7 @@ using Microsoft.Xna.Framework.Input.Touch;
using System.IO;
using System.IO.IsolatedStorage;
using System.Xml.Linq;
using FarseerPhysics.SamplesFramework;
#endregion
namespace GameStateManagement
@ -37,7 +38,7 @@ namespace GameStateManagement
List<GameScreen> screens = new List<GameScreen>();
List<GameScreen> tempScreensList = new List<GameScreen>();
InputState input = new InputState();
InputState input;
SpriteBatch spriteBatch;
SpriteFont font;
@ -47,11 +48,21 @@ namespace GameStateManagement
bool traceEnabled;
/// <summary>
/// Contains all the fonts avaliable for use.
/// </summary>
private SpriteFonts _spriteFonts;
#endregion
#region Properties
public SpriteFonts Fonts
{
get { return _spriteFonts; }
}
/// <summary>
/// A default SpriteBatch shared by all the screens. This saves
/// each screen having to bother creating their own local instance.
@ -107,6 +118,7 @@ namespace GameStateManagement
// we must set EnabledGestures before we can query for them, but
// we don't assume the game wants to read them.
TouchPanel.EnabledGestures = GestureType.None;
this.input = new InputState(this);
}