2012-06-01 10:17:47 +00:00
|
|
|
|
using System;
|
|
|
|
|
using SlimDX;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|
|
|
|
{
|
2012-06-01 10:17:47 +00:00
|
|
|
|
public class GZDoomLight {
|
|
|
|
|
public int Type; //holds GZDoomLightType
|
2012-04-17 19:13:47 +00:00
|
|
|
|
public Color3 Color;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
public int PrimaryRadius;
|
|
|
|
|
public int SecondaryRadius;
|
|
|
|
|
public int Interval;
|
|
|
|
|
public Vector3 Offset;
|
|
|
|
|
public bool Subtractive;
|
|
|
|
|
public bool DontLightSelf;
|
|
|
|
|
|
|
|
|
|
public GZDoomLight() {
|
|
|
|
|
Color = new Color3();
|
|
|
|
|
Offset = new Vector3();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int[] GetDefaultLightSettings(int type) {
|
|
|
|
|
int light_id = Array.IndexOf(GZBuilder.GZGeneral.GZ_LIGHTS, type);
|
|
|
|
|
if (light_id != -1) {
|
|
|
|
|
int[] args = new int[5];
|
|
|
|
|
|
|
|
|
|
if (light_id == (int)GZDoomLightType.VAVOOM_COLORED) {
|
|
|
|
|
args[0] = 16;
|
|
|
|
|
args[1] = 255;
|
|
|
|
|
args[2] = 255;
|
|
|
|
|
args[3] = 255;
|
|
|
|
|
} else if (light_id == (int)GZDoomLightType.VAVOOM) {
|
|
|
|
|
args[0] = 16;
|
|
|
|
|
} else {
|
|
|
|
|
int n;
|
|
|
|
|
if (light_id < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[0]) {
|
|
|
|
|
n = 0;
|
|
|
|
|
} else if (light_id < GZBuilder.GZGeneral.GZ_LIGHT_TYPES[1]) {
|
|
|
|
|
n = 10;
|
|
|
|
|
} else {
|
|
|
|
|
n = 20;
|
|
|
|
|
}
|
|
|
|
|
light_id = type - 9800 - n;
|
|
|
|
|
|
|
|
|
|
args[0] = 255;
|
|
|
|
|
args[1] = 255;
|
|
|
|
|
args[2] = 255;
|
|
|
|
|
|
|
|
|
|
if (light_id == (int)GZDoomLightType.SECTOR)
|
|
|
|
|
args[3] = 4;
|
|
|
|
|
else
|
|
|
|
|
args[3] = 64;
|
|
|
|
|
|
|
|
|
|
if (Array.IndexOf(GZBuilder.GZGeneral.GZ_ANIMATED_LIGHT_TYPES, light_id) != -1) {
|
|
|
|
|
args[4] = 32;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return args;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
|
|
|
|
public enum GZDoomLightType : int
|
|
|
|
|
{
|
|
|
|
|
NORMAL = 0,
|
|
|
|
|
PULSE = 1,
|
|
|
|
|
FLICKER = 2,
|
|
|
|
|
SECTOR = 3,
|
|
|
|
|
RANDOM = 4,
|
|
|
|
|
VAVOOM = 1502,
|
2012-06-01 10:17:47 +00:00
|
|
|
|
VAVOOM_COLORED = 1503,
|
2012-04-17 19:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//divide these by 100 to get light color alpha
|
|
|
|
|
public enum GZDoomLightRenderStyle : int
|
|
|
|
|
{
|
2012-04-25 11:44:36 +00:00
|
|
|
|
NORMAL = 99,
|
|
|
|
|
VAVOOM = 50,
|
2012-04-17 19:13:47 +00:00
|
|
|
|
ADDITIVE = 25,
|
2012-06-01 10:17:47 +00:00
|
|
|
|
NEGATIVE = 100,
|
2012-04-17 19:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|