diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/client/baseclientrendertargets.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/client/baseclientrendertargets.cpp')
| -rw-r--r-- | mp/src/game/client/baseclientrendertargets.cpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/mp/src/game/client/baseclientrendertargets.cpp b/mp/src/game/client/baseclientrendertargets.cpp index ebbd30cc..3aa642cf 100644 --- a/mp/src/game/client/baseclientrendertargets.cpp +++ b/mp/src/game/client/baseclientrendertargets.cpp @@ -1,78 +1,78 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Implementation for CBaseClientRenderTargets class.
-// Provides Init functions for common render textures used by the engine.
-// Mod makers can inherit from this class, and call the Create functions for
-// only the render textures the want for their mod.
-//=============================================================================//
-
-#include "cbase.h"
-#include "baseclientrendertargets.h" // header
-#include "materialsystem/imaterialsystemhardwareconfig.h" // Hardware config checks
-#include "tier0/icommandline.h"
-
-ITexture* CBaseClientRenderTargets::CreateWaterReflectionTexture( IMaterialSystem* pMaterialSystem, int iSize )
-{
- return pMaterialSystem->CreateNamedRenderTargetTextureEx2(
- "_rt_WaterReflection",
- iSize, iSize, RT_SIZE_PICMIP,
- pMaterialSystem->GetBackBufferFormat(),
- MATERIAL_RT_DEPTH_SHARED,
- TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT,
- CREATERENDERTARGETFLAGS_HDR );
-}
-
-ITexture* CBaseClientRenderTargets::CreateWaterRefractionTexture( IMaterialSystem* pMaterialSystem, int iSize )
-{
- return pMaterialSystem->CreateNamedRenderTargetTextureEx2(
- "_rt_WaterRefraction",
- iSize, iSize, RT_SIZE_PICMIP,
- // This is different than reflection because it has to have alpha for fog factor.
- IMAGE_FORMAT_RGBA8888,
- MATERIAL_RT_DEPTH_SHARED,
- TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT,
- CREATERENDERTARGETFLAGS_HDR );
-}
-
-ITexture* CBaseClientRenderTargets::CreateCameraTexture( IMaterialSystem* pMaterialSystem, int iSize )
-{
- return pMaterialSystem->CreateNamedRenderTargetTextureEx2(
- "_rt_Camera",
- iSize, iSize, RT_SIZE_DEFAULT,
- pMaterialSystem->GetBackBufferFormat(),
- MATERIAL_RT_DEPTH_SHARED,
- 0,
- CREATERENDERTARGETFLAGS_HDR );
-}
-
-//-----------------------------------------------------------------------------
-// Purpose: Called by the engine in material system init and shutdown.
-// Clients should override this in their inherited version, but the base
-// is to init all standard render targets for use.
-// Input : pMaterialSystem - the engine's material system (our singleton is not yet inited at the time this is called)
-// pHardwareConfig - the user hardware config, useful for conditional render target setup
-//-----------------------------------------------------------------------------
-void CBaseClientRenderTargets::InitClientRenderTargets( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig, int iWaterTextureSize, int iCameraTextureSize )
-{
- // Water effects
- m_WaterReflectionTexture.Init( CreateWaterReflectionTexture( pMaterialSystem, iWaterTextureSize ) );
- m_WaterRefractionTexture.Init( CreateWaterRefractionTexture( pMaterialSystem, iWaterTextureSize ) );
-
- // Monitors
- m_CameraTexture.Init( CreateCameraTexture( pMaterialSystem, iCameraTextureSize ) );
-}
-
-//-----------------------------------------------------------------------------
-// Purpose: Shut down each CTextureReference we created in InitClientRenderTargets.
-// Called by the engine in material system shutdown.
-// Input : -
-//-----------------------------------------------------------------------------
-void CBaseClientRenderTargets::ShutdownClientRenderTargets()
-{
- // Water effects
- m_WaterReflectionTexture.Shutdown();
- m_WaterRefractionTexture.Shutdown();
-
- // Monitors
- m_CameraTexture.Shutdown();
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Implementation for CBaseClientRenderTargets class. +// Provides Init functions for common render textures used by the engine. +// Mod makers can inherit from this class, and call the Create functions for +// only the render textures the want for their mod. +//=============================================================================// + +#include "cbase.h" +#include "baseclientrendertargets.h" // header +#include "materialsystem/imaterialsystemhardwareconfig.h" // Hardware config checks +#include "tier0/icommandline.h" + +ITexture* CBaseClientRenderTargets::CreateWaterReflectionTexture( IMaterialSystem* pMaterialSystem, int iSize ) +{ + return pMaterialSystem->CreateNamedRenderTargetTextureEx2( + "_rt_WaterReflection", + iSize, iSize, RT_SIZE_PICMIP, + pMaterialSystem->GetBackBufferFormat(), + MATERIAL_RT_DEPTH_SHARED, + TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT, + CREATERENDERTARGETFLAGS_HDR ); +} + +ITexture* CBaseClientRenderTargets::CreateWaterRefractionTexture( IMaterialSystem* pMaterialSystem, int iSize ) +{ + return pMaterialSystem->CreateNamedRenderTargetTextureEx2( + "_rt_WaterRefraction", + iSize, iSize, RT_SIZE_PICMIP, + // This is different than reflection because it has to have alpha for fog factor. + IMAGE_FORMAT_RGBA8888, + MATERIAL_RT_DEPTH_SHARED, + TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT, + CREATERENDERTARGETFLAGS_HDR ); +} + +ITexture* CBaseClientRenderTargets::CreateCameraTexture( IMaterialSystem* pMaterialSystem, int iSize ) +{ + return pMaterialSystem->CreateNamedRenderTargetTextureEx2( + "_rt_Camera", + iSize, iSize, RT_SIZE_DEFAULT, + pMaterialSystem->GetBackBufferFormat(), + MATERIAL_RT_DEPTH_SHARED, + 0, + CREATERENDERTARGETFLAGS_HDR ); +} + +//----------------------------------------------------------------------------- +// Purpose: Called by the engine in material system init and shutdown. +// Clients should override this in their inherited version, but the base +// is to init all standard render targets for use. +// Input : pMaterialSystem - the engine's material system (our singleton is not yet inited at the time this is called) +// pHardwareConfig - the user hardware config, useful for conditional render target setup +//----------------------------------------------------------------------------- +void CBaseClientRenderTargets::InitClientRenderTargets( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig, int iWaterTextureSize, int iCameraTextureSize ) +{ + // Water effects + m_WaterReflectionTexture.Init( CreateWaterReflectionTexture( pMaterialSystem, iWaterTextureSize ) ); + m_WaterRefractionTexture.Init( CreateWaterRefractionTexture( pMaterialSystem, iWaterTextureSize ) ); + + // Monitors + m_CameraTexture.Init( CreateCameraTexture( pMaterialSystem, iCameraTextureSize ) ); +} + +//----------------------------------------------------------------------------- +// Purpose: Shut down each CTextureReference we created in InitClientRenderTargets. +// Called by the engine in material system shutdown. +// Input : - +//----------------------------------------------------------------------------- +void CBaseClientRenderTargets::ShutdownClientRenderTargets() +{ + // Water effects + m_WaterReflectionTexture.Shutdown(); + m_WaterRefractionTexture.Shutdown(); + + // Monitors + m_CameraTexture.Shutdown(); }
\ No newline at end of file |