- Barotrauma's projects are in the Barotrauma directory - All libraries are in the Libraries directory - MonoGame is now managed by NuGet, rather than referenced from the installed files (TODO: consider using PCL for easier cross-platform development?) - NuGet libraries are not included in the repo, as getting the latest versions automatically should be preferred - Removed Content/effects.mgfx as it didn't seem to be used anywhere - Removed some references to Subsurface directory - Renamed Launcher2 to Launcher
60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using FarseerPhysics;
|
|
using FarseerPhysics.Common;
|
|
using FarseerPhysics.Dynamics;
|
|
using FarseerPhysics.Factories;
|
|
using Lidgren.Network;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using Voronoi2;
|
|
using Barotrauma.RuinGeneration;
|
|
|
|
namespace Barotrauma
|
|
{
|
|
partial class Level
|
|
{
|
|
private LevelRenderer renderer;
|
|
|
|
public void DrawFront(SpriteBatch spriteBatch)
|
|
{
|
|
if (renderer == null) return;
|
|
renderer.Draw(spriteBatch);
|
|
|
|
if (GameMain.DebugDraw)
|
|
{
|
|
foreach (InterestingPosition pos in positionsOfInterest)
|
|
{
|
|
Color color = Color.Yellow;
|
|
if (pos.PositionType == PositionType.Cave)
|
|
{
|
|
color = Color.DarkOrange;
|
|
}
|
|
else if (pos.PositionType == PositionType.Ruin)
|
|
{
|
|
color = Color.LightGray;
|
|
}
|
|
|
|
|
|
GUI.DrawRectangle(spriteBatch, new Vector2(pos.Position.X - 15.0f, -pos.Position.Y - 15.0f), new Vector2(30.0f, 30.0f), color, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void DrawBack(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, BackgroundCreatureManager backgroundSpriteManager = null)
|
|
{
|
|
float brightness = MathHelper.Clamp(50.0f + (cam.Position.Y - Size.Y) / 2000.0f, 10.0f, 40.0f);
|
|
|
|
float avgValue = (backgroundColor.R + backgroundColor.G + backgroundColor.G) / 3;
|
|
GameMain.LightManager.AmbientLight = new Color(backgroundColor * (brightness / avgValue), 1.0f);
|
|
|
|
graphics.Clear(backgroundColor);
|
|
|
|
if (renderer == null) return;
|
|
renderer.DrawBackground(spriteBatch, cam, backgroundSpriteManager);
|
|
}
|
|
}
|
|
}
|