gzdoom-last-svn/src/gl/renderer/gl_lightdata.h
Christoph Oelckers dbd6c3d6b5 - Update to ZDoom r3224:
Emulate the size limit of Doom's lightscale table by capping the value of vis passed to GETPALOOKUP. The end result is that there is a minimum distance around you where light amplification stops and it gets no brighter. Should this scale with visibility? I can't say. So, yeah, it turns out all these years ago, I made this out to be harder than it really is.
    Fixed: Light levels outside the range [0,255] really do matter.
    Added FDARI's latest actor pointer submission.
    Added kgsws's 3D floor textute rotation fix.
    Added DavidPH's damage type specific damage color submission.
    Added DavidPH's A_PainAttack extension submission.
    Fixed: Telefrag damage should not be affected by skill damage factors.
    Added A_GunFlash extension submission.
    Added DONTCORPSE submission.
    Added SEEINVISIBLE submission.
    Added submission for disabling some new and rather pointless GCC warnings.
    Fixed: Selecting TiMidity++ as a MIDI device without a working timidity.exe, then switching to a different MIDI device would leave music silent until a new song was started. (The discrepancy between mus_playing.handle and currSong is one which should probably be handled properly at some point.)
    Fixed: Typo in FClipRect::Intersect() could case bad clipping.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1216 b0f79afe-0144-0410-b225-9a4edf0717df
2011-06-12 09:08:10 +00:00

63 lines
No EOL
2 KiB
C

#ifndef __GL_LIGHTDATA
#define __GL_LIGHTDATA
#include "v_palette.h"
#include "r_blend.h"
#include "gl/renderer/gl_colormap.h"
bool gl_BrightmapsActive();
bool gl_GlowActive();
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);
void gl_SetFogParams(int _fogdensity, PalEntry _outsidefogcolor, int _outsidefogdensity, int _skyfog);
int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon);
PalEntry gl_CalcLightColor(int light, PalEntry pe, int blendfactor);
void gl_GetLightColor(int lightlevel, int rellight, const FColormap * cm, float * pred, float * pgreen, float * pblue, bool weapon=false);
void gl_SetColor(int light, int rellight, const FColormap * cm, float alpha, PalEntry ThingColor = 0xffffff, bool weapon=false);
void gl_SetColor(int light, int rellight, const FColormap * cm, float *red, float *green, float *blue, PalEntry ThingColor=0xffffff, bool weapon=false);
float gl_GetFogDensity(int lightlevel, PalEntry fogcolor);
struct sector_t;
bool gl_CheckFog(sector_t *frontsector, sector_t *backsector);
void gl_SetFog(int lightlevel, int rellight, const FColormap *cm, bool isadditive);
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;
}
extern DWORD gl_fixedcolormap;
inline bool gl_isFullbright(PalEntry color, int lightlevel)
{
return gl_fixedcolormap || (gl_isWhite(color) && lightlevel==255);
}
__forceinline void gl_Desaturate(int gray, int ired, int igreen, int iblue, BYTE & red, BYTE & green, BYTE & blue, int fac)
{
red = (ired*(31-fac) + gray*fac)/31;
green = (igreen*(31-fac) + gray*fac)/31;
blue = (iblue*(31-fac) + gray*fac)/31;
}
void gl_ModifyColor(BYTE & red, BYTE & green, BYTE & blue, int cm);
extern int fogdensity;
extern int outsidefogdensity;
extern int skyfog;
#endif