Decal system (TODO: add decals for explosions and fire), moved some of the client-specific Hull update logic to the client project

This commit is contained in:
Joonas Rikkonen
2017-07-06 21:38:32 +03:00
parent 90a584d122
commit 4d2e7c33b1
11 changed files with 391 additions and 93 deletions
@@ -0,0 +1,39 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Barotrauma.Particles
{
class DecalPrefab
{
public readonly string Name;
public readonly List<Sprite> Sprites;
public readonly Color Color;
public readonly float LifeTime;
public readonly float FadeTime;
public DecalPrefab(XElement element)
{
Name = element.Name.ToString();
Sprites = new List<Sprite>();
foreach (XElement subElement in element.Elements())
{
if (subElement.Name.ToString().ToLowerInvariant() == "sprite")
{
Sprites.Add(new Sprite(subElement));
}
}
Color = new Color(ToolBox.GetAttributeVector4(element, "color", Vector4.One));
LifeTime = ToolBox.GetAttributeFloat(element, "lifetime", 10.0f);
FadeTime = Math.Min(LifeTime, ToolBox.GetAttributeFloat(element, "fadetime", 1.0f));
}
}
}