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 /utils/vrad/iincremental.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/vrad/iincremental.h')
| -rw-r--r-- | utils/vrad/iincremental.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/utils/vrad/iincremental.h b/utils/vrad/iincremental.h new file mode 100644 index 0000000..c80854f --- /dev/null +++ b/utils/vrad/iincremental.h @@ -0,0 +1,71 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef IINCREMENTAL_H +#define IINCREMENTAL_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "mathlib/vector.h" +#include "utlvector.h" + + +typedef unsigned short IncrementalLightID; + + +// Incremental lighting manager. +class IIncremental +{ +// IIncremental overrides. +public: + + virtual ~IIncremental() {} + + // Sets up for incremental mode. The BSP file (in bsplib) should be loaded + // already so it can detect if the incremental file is up to date. + virtual bool Init( char const *pBSPFilename, char const *pIncrementalFilename ) = 0; + + // Prepare to light. You must call Init once, but then you can + // do as many Prepare/AddLight/Finalize phases as you want. + virtual bool PrepareForLighting() = 0; + + // Called every time light is added to a face. + // NOTE: This is the ONLY threadsafe function in IIncremental. + virtual void AddLightToFace( + IncrementalLightID lightID, + int iFace, + int iSample, + int lmSize, + float dot, + int iThread ) = 0; + + // Called when it's done applying light from the specified light to the specified face. + virtual void FinishFace ( + IncrementalLightID lightID, + int iFace, + int iThread ) = 0; + + // For each face that was changed during the lighting process, save out + // new data for it in the incremental file. + // Returns false if the incremental lighting isn't active. + virtual bool Finalize() = 0; + + // Grows touched to a size of 'numfaces' and sets each byte to 0 or 1 telling + // if the face's lightmap was updated in Finalize. + virtual void GetFacesTouched( CUtlVector<unsigned char> &touched ) = 0; + + // This saves the .r0 file and updates the lighting in the BSP file. + virtual bool Serialize() = 0; +}; + + +extern IIncremental* GetIncremental(); + + +#endif // IINCREMENTAL_H |