private void DrawObjects(SpriteBatch spriteBatch, SpriteSortMode sortMode, BlendState blendState, bool drawDecals, bool shadowPass) { Matrix cameraTransform = Camera.Instance.GetTransformMatrix(); NodeObject obj = new NodeObject(); GraphicsDevice graphics = this.ScreenManager.GraphicsDevice; spriteBatch.Begin(sortMode, blendState, SamplerState.AnisotropicWrap, null, null, null, cameraTransform); if (drawDecals) { this._level.DecalManager.Draw(spriteBatch); SpriteManager.Instance.Draw(spriteBatch); } Player.Instance.Draw(spriteBatch); for (int i = 0; i < _level.ObjectsList.Count; i++) { obj = _level.ObjectsList[i]; // If it is the shadow pass and the object doesn't cast // shadows, move on. if (shadowPass && !obj.CastShadows) { continue; } obj.Draw(spriteBatch, graphics); } spriteBatch.End(); }