Skip to content

Commit

Permalink
F6 = Full vision
Browse files Browse the repository at this point in the history
  • Loading branch information
ostaf committed Feb 16, 2014
1 parent 5c5ab58 commit e775115
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ClientServices/State/States/GameScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public class GameScreen : State, IState
private RenderImage _sceneTarget;
private RenderImage _tilesTarget;
private bool bPlayerVision = true;
private bool bFullVision = false;
private FXShader finalBlendShader;
private LightArea lightArea1024;
private LightArea lightArea128;
Expand Down Expand Up @@ -667,13 +668,7 @@ public void KeyDown(KeyboardInputEventArgs e)
}
if (e.Key == KeyboardKeys.F6)
{
ILight[] lights = IoCManager.Resolve<ILightManager>().lightsInRadius(
PlayerManager.ControlledEntity.GetComponent<TransformComponent>(ComponentFamily.Transform).Position,
768f);
var r = new Random();
int i = r.Next(lights.Length - 1);
lights[i].SetColor(r.Next(255), r.Next(255), r.Next(255), r.Next(255));
lights[i].LightArea.Calculated = false;
bFullVision = !bFullVision;
}
if (e.Key == KeyboardKeys.F7)
{
Expand Down Expand Up @@ -1321,6 +1316,11 @@ private void RenderLightMap(ILight[] lights)
private void RenderPlayerVisionMap()
{
Vector2D blitPos;
if (bFullVision)
{
playerOcclusionTarget.Clear(Color.LightGray);
return;
}
if (bPlayerVision)
{
playerOcclusionTarget.Clear(Color.Black);
Expand Down

0 comments on commit e775115

Please sign in to comment.