diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/c_pixel_visibility.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/c_pixel_visibility.h')
| -rw-r--r-- | game/client/c_pixel_visibility.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/game/client/c_pixel_visibility.h b/game/client/c_pixel_visibility.h new file mode 100644 index 0000000..3c07514 --- /dev/null +++ b/game/client/c_pixel_visibility.h @@ -0,0 +1,55 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef C_PIXEL_VISIBILITY_H +#define C_PIXEL_VISIBILITY_H +#ifdef _WIN32 +#pragma once +#endif + + +const float PIXELVIS_DEFAULT_PROXY_SIZE = 2.0f; +const float PIXELVIS_DEFAULT_FADE_TIME = 0.0625f; + +typedef int pixelvis_handle_t; +struct pixelvis_queryparams_t +{ + pixelvis_queryparams_t() + { + bSetup = false; + } + + void Init( const Vector &origin, float proxySizeIn = PIXELVIS_DEFAULT_PROXY_SIZE, float proxyAspectIn = 1.0f, float fadeTimeIn = PIXELVIS_DEFAULT_FADE_TIME ) + { + position = origin; + proxySize = proxySizeIn; + proxyAspect = proxyAspectIn; + fadeTime = fadeTimeIn; + bSetup = true; + bSizeInScreenspace = false; + } + + Vector position; + float proxySize; + float proxyAspect; + float fadeTime; + bool bSetup; + bool bSizeInScreenspace; +}; + +float PixelVisibility_FractionVisible( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle ); +float StandardGlowBlend( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle, int rendermode, int renderfx, int alpha, float *pscale ); + +void PixelVisibility_ShiftVisibilityViews( int iSourceViewID, int iDestViewID ); //mainly needed by portal mod to avoid a pop in visibility when teleporting the player + +void PixelVisibility_EndCurrentView(); +void PixelVisibility_EndScene(); +float GlowSightDistance( const Vector &glowOrigin, bool bShouldTrace ); + +// returns true if the video hardware is doing the tests, false is traceline is doing so. +bool PixelVisibility_IsAvailable(); + +#endif // C_PIXEL_VISIBILITY_H |