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.

66 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef GL_CVARS_H
  9. #define GL_CVARS_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "convar.h"
  14. #include "cmd.h"
  15. // Stuff that's dealt with by the material system
  16. extern ConVar mat_wireframe; // Draw the world in wireframe mode
  17. extern ConVar mat_normals; // Draw the world with vertex normals
  18. extern ConVar mat_luxels; // Draw lightmaps as checkerboards
  19. extern ConVar mat_loadtextures; // Can help load levels quickly for debugging.
  20. extern ConVar mat_bumpbasis; // Draw the world with the bump basis vectors drawn
  21. extern ConVar mat_envmapsize; // Dimensions of square skybox bitmap (in 3D screen shots, not game textures)
  22. extern ConVar mat_envmaptgasize;
  23. extern ConVar mat_levelflush;
  24. extern ConVar mat_hdr_level;
  25. static inline bool CanCheat()
  26. {
  27. extern ConVar sv_cheats;
  28. extern ConVar cl_debug_respect_cheat_vars;
  29. #ifdef _DEBUG
  30. bool bRespectCheatVars = cl_debug_respect_cheat_vars.GetBool() && !Cmd_IsRptActive();
  31. if ( bRespectCheatVars )
  32. return sv_cheats.GetBool();
  33. return true;
  34. #else
  35. return sv_cheats.GetBool();
  36. // johns 07/10/2015 - Disabled -- RPT's conditions for activating are not sufficient for this to be reasonable -
  37. // though it requires the remote client have valve credentials to issue commands, it can be set
  38. // to 'active' on demand by clients, and thus needs to be reworked before it can be allowed to
  39. // bypass cheats.
  40. // return ( sv_cheats.GetBool() || Cmd_IsRptActive() );
  41. #endif
  42. }
  43. static inline int WireFrameMode( void )
  44. {
  45. if ( CanCheat() )
  46. return mat_wireframe.GetInt();
  47. return 0;
  48. }
  49. static inline bool ShouldDrawInWireFrameMode( void )
  50. {
  51. if ( CanCheat() )
  52. return ( mat_wireframe.GetInt() != 0 );
  53. return false;
  54. }
  55. extern ConVar r_drawbrushmodels;
  56. #endif //GL_CVARS_H