2013-06-23 07:49:34 +00:00
|
|
|
#ifndef __GL_LIGHTDATA
|
|
|
|
#define __GL_LIGHTDATA
|
|
|
|
|
|
|
|
#include "v_palette.h"
|
2016-01-29 16:13:14 +00:00
|
|
|
#include "p_3dfloors.h"
|
2013-06-23 07:49:34 +00:00
|
|
|
#include "r_data/renderstyle.h"
|
|
|
|
#include "gl/renderer/gl_colormap.h"
|
|
|
|
|
|
|
|
inline int gl_ClampLight(int lightlevel)
|
|
|
|
{
|
|
|
|
return clamp(lightlevel, 0, 255);
|
|
|
|
}
|
|
|
|
|
|
|
|
void gl_GetRenderStyle(FRenderStyle style, bool drawopaque, bool allowcolorblending,
|
|
|
|
int *tm, int *sb, int *db, int *be);
|
|
|
|
|
|
|
|
int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon);
|
2017-03-12 20:57:39 +00:00
|
|
|
void gl_SetColor(int light, int rellight, bool fullbright, const FColormap &cm, float alpha, bool weapon=false);
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2016-12-29 00:12:17 +00:00
|
|
|
float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity);
|
2013-06-23 07:49:34 +00:00
|
|
|
struct sector_t;
|
|
|
|
bool gl_CheckFog(sector_t *frontsector, sector_t *backsector);
|
|
|
|
|
2017-03-12 20:57:39 +00:00
|
|
|
void gl_SetFog(int lightlevel, int rellight, bool fullbright, const FColormap *cm, bool isadditive);
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
inline bool gl_isBlack(PalEntry color)
|
|
|
|
{
|
|
|
|
return color.r + color.g + color.b == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool gl_isWhite(PalEntry color)
|
|
|
|
{
|
|
|
|
return color.r + color.g + color.b == 3*0xff;
|
|
|
|
}
|
|
|
|
|
2016-01-29 16:13:14 +00:00
|
|
|
inline void FColormap::CopyFrom3DLight(lightlist_t *light)
|
|
|
|
{
|
|
|
|
LightColor = light->extra_colormap->Color;
|
|
|
|
desaturation = light->extra_colormap->Desaturate;
|
|
|
|
blendfactor = light->extra_colormap->Color.a;
|
|
|
|
if (light->caster && (light->caster->flags&FF_FADEWALLS) && (light->extra_colormap->Fade & 0xffffff) != 0)
|
|
|
|
FadeColor = light->extra_colormap->Fade;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-05 13:45:15 +00:00
|
|
|
#endif
|