Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef R_LOCAL_H
  9. #define R_LOCAL_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "surfacehandle.h"
  14. #include "bspfile.h"
  15. extern int r_framecount;
  16. // NOTE: We store all 256 here so that 255 can be accessed easily...
  17. extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
  18. extern int d_lightstyleframe[256]; // Frame when the light style value changed
  19. extern int d_lightstylenumframes[256]; // number of frames in the lightstyle
  20. extern ConVar r_lightmapcolorscale;
  21. extern ConVar r_decals;
  22. extern ConVar mp_decals;
  23. extern ConVar r_lightmap;
  24. extern ConVar r_lightstyle;
  25. extern int r_dlightchanged; // which ones changed
  26. extern int r_dlightactive; // which ones are active
  27. extern VMatrix g_BrushToWorldMatrix;
  28. class IClientEntity;
  29. colorVec R_LightPoint (Vector& p);
  30. // returns surfID
  31. SurfaceHandle_t R_LightVec (const Vector& start, const Vector& end, bool bUseLightStyles, Vector& c, float *textureS = NULL, float *textureT = NULL, float *lightmapS = NULL, float *lightmapT = NULL);
  32. // This is to allow us to do R_LightVec on a brush model
  33. void R_LightVecUseModel(model_t* pModel = 0);
  34. void R_InitStudio( void );
  35. void R_LoadSkys (void);
  36. void R_DecalInit ( void );
  37. void R_AnimateLight (void);
  38. void MarkDLightsOnStaticProps( void );
  39. //-----------------------------------------------------------------------------
  40. // Method to get at the light style value
  41. //-----------------------------------------------------------------------------
  42. inline float LightStyleValue( int style )
  43. {
  44. Assert( style >= 0 && style < MAX_LIGHTSTYLES );
  45. return ( float )d_lightstylevalue[style] * (1.0f / 264.0f);
  46. }
  47. #endif // R_LOCAL_H