protected override void DoRender() { for (int x = Math.Max(0, BoundsX); x <= Math.Min(_map.Width - 1, BoundsWidth); x++) { for (int y = Math.Max(0, BoundsY); y <= Math.Min(_map.Height - 1, BoundsHeight); y++) { if (_map.IsVisible(x, y) || Game.HideFov) { Tile tile = _map.GetTile(x, y); Sprite tileSprite = tile.Sprite; if (!string.IsNullOrWhiteSpace(tile.Animation)) { tileSprite = _tileAnimations[tile.Animation].Sprite; } Color color = _lightingManager.GetLitColor(tile.Color.Blend(Color.SlateGray, 0.85f)); Draw.Sprite(tileSprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), color); Prop prop = _map.GetProp(x, y); if (prop != null) { Draw.Sprite(prop.Sprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), _lightingManager.GetLitColor(prop.Color.Blend(Color.SlateGray, 0.85f))); } } else if (_map.IsVisited(x, y) && !Game.HideFov) { Tile tile = _map.GetTile(x, y); Sprite tileSprite = tile.Sprite; Color color = Color.FromNonPremultiplied(50, 50, 50, 255).Darken(1f - _lightingManager.Brightness); if (!string.IsNullOrWhiteSpace(tile.Animation)) { tileSprite = _tileAnimations[tile.Animation].Sprite; } if (tileSprite != null) { Draw.Sprite(tileSprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), color); } Prop prop = _map.GetProp(x, y); if (prop != null) { Draw.Sprite(prop.Sprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), color); } } } } }
protected override void DoRender() { if (!Game.ShowRain) { return; } for (int x = Math.Max(0, BoundsX); x <= Math.Min(_map.Width - 1, BoundsWidth); x++) { for (int y = Math.Max(0, BoundsY); y <= Math.Min(_map.Height - 1, BoundsHeight); y++) { if (_map.IsVisible(x, y) || Game.HideFov) { Draw.Sprite(_rain.Sprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), _lightingManager.GetLitColor(Color.DarkSlateGray * 0.9f, Color.Black)); } else if (_map.IsVisited(x, y) && !Game.HideFov) { Draw.Sprite(_rain.Sprite, new Vector2(x * Game.SpriteWidth, y * Game.SpriteHeight), Color.FromNonPremultiplied(79, 79, 79, 255).Darken(1f - _lightingManager.Brightness) * 0.7f); } } } }
protected override void DoRender() { foreach (Creature creature in _creatures) { if (!InCameraBounds(creature.X, creature.Y)) { continue; } if (!Game.HideFov && !_map.IsVisible(creature.X, creature.Y)) { continue; } Sprite sprite = creature.Sprite; Draw.Sprite(sprite, new Vector2(creature.RenderX, creature.RenderY - creature.RenderZ), _lightingManager.GetLitColor(creature.Color), creature.SpriteEffect); //batch.Draw(sprite.Texture, new Vector2(creature.RenderX, creature.RenderY), sprite.Bounds, LitColor(creature.Color, Color.White), 0f, sprite.Origin, 1f, creature.SpriteEffect, 0); } }