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 /hammer/bsplightingthread.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/bsplightingthread.h')
| -rw-r--r-- | hammer/bsplightingthread.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/hammer/bsplightingthread.h b/hammer/bsplightingthread.h new file mode 100644 index 0000000..b6988c5 --- /dev/null +++ b/hammer/bsplightingthread.h @@ -0,0 +1,87 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef BSPLIGHTINGTHREAD_H +#define BSPLIGHTINGTHREAD_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "stdafx.h" +#include "ibsplightingthread.h" +#include "utlvector.h" + + +class CBSPLightingThread : public IBSPLightingThread +{ +public: + + CBSPLightingThread(); + + +// IBSPLightingThread functions. +public: + virtual ~CBSPLightingThread(); + virtual void Release(); + virtual void StartLighting( char const *pVMFFileWithEntities ); + virtual int GetCurrentState(); + virtual void Interrupt(); + virtual float GetPercentComplete(); + + +// Other functions. +public: + + // This is called immediately after the constructor. It creates the thread. + bool Init( IVRadDLL *pDLL ); + + + +// Threadsafe functions. +public: + + enum + { + THREADCMD_NONE=0, + THREADCMD_LIGHT=1, + THREADCMD_EXIT=2 + }; + + // Get the current command to the thread. Resets to THREADCMD_NONE on exit. + int GetThreadCmd(); + void SetThreadCmd( int cmd ); + + // Returns an IBSPLightingThread::STATE_ define. + int GetThreadState(); + void SetThreadState( int state ); + + +public: + + // The thread's run function. + DWORD ThreadMainLoop(); + + +public: + + int m_ThreadCmd; // Next command for the thread to run. + int m_ThreadState; // Current state of the thread. + + CUtlVector<char> m_VMFFileWithEntities; + + +public: + IVRadDLL *m_pVRadDLL; + + HANDLE m_hThread; + DWORD m_ThreadID; + CRITICAL_SECTION m_CS; +}; + + +#endif // BSPLIGHTINGTHREAD_H |