2019-05-18 02:04:16 +08:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
namespace Revitalize.Framework.Illuminate
|
|
|
|
{
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Deals with recreating light sources in SDV.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public class FakeLightSource
|
|
|
|
{
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The id for the light. Refers to the type of texture used.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public int id;
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The position offset from the source object this is attached to.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public Vector2 positionOffset;
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The color for the light.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public Color color;
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The radius for the light.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public float radius;
|
|
|
|
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Empty constructor.
|
|
|
|
/// </summary>
|
2019-05-18 02:04:16 +08:00
|
|
|
public FakeLightSource()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Constructor.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ID">The id for the light source.</param>
|
|
|
|
/// <param name="Position">The position for the light source.</param>
|
|
|
|
/// <param name="Color">The color for the light.</param>
|
|
|
|
/// <param name="Raidus">The radius for the light.</param>
|
2019-05-18 02:04:16 +08:00
|
|
|
public FakeLightSource(int ID, Vector2 Position, Color Color, float Raidus)
|
|
|
|
{
|
|
|
|
this.id = ID;
|
|
|
|
this.positionOffset = Position;
|
|
|
|
this.color = Color;
|
|
|
|
this.radius = Raidus;
|
|
|
|
}
|
|
|
|
|
2019-08-17 06:32:14 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Gets a copy of the fake light source.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
public FakeLightSource Copy()
|
|
|
|
{
|
|
|
|
return new FakeLightSource(this.id, new Vector2(this.positionOffset.X, this.positionOffset.Y), new Color(this.color.R, this.color.G, this.color.B, this.color.A), this.radius);
|
|
|
|
}
|
|
|
|
|
2019-05-18 02:04:16 +08:00
|
|
|
}
|
|
|
|
}
|