X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=r_light.h;h=6020c915a8ce9f701f7c19b89df02f748db4d0fc;hp=6e29e589b0a65c03948e136a64174e44117751b9;hb=c651b263f8a63fa5846df832051d4f5658680a03;hpb=d7035ef4229a2462ad59a67160494593fbd8f2e0;ds=sidebyside diff --git a/r_light.h b/r_light.h index 6e29e589..6020c915 100644 --- a/r_light.h +++ b/r_light.h @@ -1,20 +1,19 @@ -// LordHavoc: 256 dynamic lights -#define MAX_DLIGHTS 256 -typedef struct -{ - vec3_t origin; - float radius; - float die; // stop lighting after this time - float decay; // drop this each second - entity_t *ent; // the entity that spawned this light (can be NULL if it is not to be replaced repeatedly) - vec3_t color; // LordHavoc: colored lighting -} dlight_t; +#ifndef R_LIGHT_H +#define R_LIGHT_H -// LordHavoc: this affects the lighting scale of the whole game -#define LIGHTOFFSET 4096.0f +extern int r_numdlights; +extern dlight_t r_dlight[MAX_DLIGHTS]; + +void R_UpdateLights(void); +#ifdef LHREMOVESOON +void R_MarkLights(entity_render_t *ent); +#endif +void R_DrawCoronas(void); +void R_CompleteLightPoint(vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal, const vec3_t p, int dynamic, const mleaf_t *leaf); +int R_LightModel(float *ambient4f, float *diffusecolor, float *diffusenormal, const entity_render_t *ent, float colorr, float colorg, float colorb, float colora, int worldcoords); +void R_LightModel_CalcVertexColors(const float *ambientcolor4f, const float *diffusecolor, const float *diffusenormal, int numverts, const float *vertex3f, const float *normal3f, float *color4f); +void R_UpdateEntLights(entity_render_t *ent); + +#endif -extern void R_CompleteLightPoint (vec3_t color, vec3_t p, int dynamic); -extern void R_DynamicLightPoint(vec3_t color, vec3_t org, int *dlightbits); -extern void R_DynamicLightPointNoMask(vec3_t color, vec3_t org); -extern void R_LightPoint (vec3_t color, vec3_t p);