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.

55 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef C_PIXEL_VISIBILITY_H
  7. #define C_PIXEL_VISIBILITY_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. const float PIXELVIS_DEFAULT_PROXY_SIZE = 2.0f;
  12. const float PIXELVIS_DEFAULT_FADE_TIME = 0.0625f;
  13. typedef int pixelvis_handle_t;
  14. struct pixelvis_queryparams_t
  15. {
  16. pixelvis_queryparams_t()
  17. {
  18. bSetup = false;
  19. }
  20. void Init( const Vector &origin, float proxySizeIn = PIXELVIS_DEFAULT_PROXY_SIZE, float proxyAspectIn = 1.0f, float fadeTimeIn = PIXELVIS_DEFAULT_FADE_TIME )
  21. {
  22. position = origin;
  23. proxySize = proxySizeIn;
  24. proxyAspect = proxyAspectIn;
  25. fadeTime = fadeTimeIn;
  26. bSetup = true;
  27. bSizeInScreenspace = false;
  28. }
  29. Vector position;
  30. float proxySize;
  31. float proxyAspect;
  32. float fadeTime;
  33. bool bSetup;
  34. bool bSizeInScreenspace;
  35. };
  36. float PixelVisibility_FractionVisible( const pixelvis_queryparams_t &params, pixelvis_handle_t *queryHandle );
  37. float StandardGlowBlend( const pixelvis_queryparams_t &params, pixelvis_handle_t *queryHandle, int rendermode, int renderfx, int alpha, float *pscale );
  38. void PixelVisibility_ShiftVisibilityViews( int iSourceViewID, int iDestViewID ); //mainly needed by portal mod to avoid a pop in visibility when teleporting the player
  39. void PixelVisibility_EndCurrentView();
  40. void PixelVisibility_EndScene();
  41. float GlowSightDistance( const Vector &glowOrigin, bool bShouldTrace );
  42. // returns true if the video hardware is doing the tests, false is traceline is doing so.
  43. bool PixelVisibility_IsAvailable();
  44. #endif // C_PIXEL_VISIBILITY_H