public override void Init(object arg) { splashFont = GameStateManager.Content.Load <SpriteFont>("SplashScreenFont"); loadingText = Strings.Loading; Vector2 size = splashFont.MeasureString(loadingText); loadingTextSize = new Point((int)size.X, (int)size.Y); backgroundTex = GameStateManager.Content.Load <Texture2D>("SplashScreen"); progressTex = GameStateManager.Content.Load <Texture2D>("SplashScreenLoad"); contentTotal = 0; contentLoaded = 0; SpriteBatch spriteBatch = new SpriteBatch(GameStateManager.GraphicsDevice); GameStateManager.GraphicsDevice.Clear(Color.Black); Render(spriteBatch); GameStateManager.GraphicsDevice.Present(); contentTotal += Menu.ContentCount(); contentTotal += CardResources.ContentCount(); contentTotal += MessageWindow.ContentCount(); nextGameState = GameState.Menu; Thread thread = new Thread(this.LoadContent); thread.Start(); }
protected void LoadContent(object data) { Menu.LoadContent(GameStateManager.Content, this.OnContentPieceLoaded); if (contentLoaded != Menu.ContentCount()) { object obj = null; obj.ToString(); } CardResources.LoadResources(GameStateManager.GraphicsDevice, GameStateManager.Content, this.OnContentPieceLoaded); if (contentLoaded != Menu.ContentCount() + CardResources.ContentCount()) { object obj = null; obj.ToString(); } MessageWindow.LoadContent(GameStateManager.Content, this.OnContentPieceLoaded); if (contentLoaded != contentTotal) { object obj = null; obj.ToString(); } }