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 /engine/DownloadListGenerator.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'engine/DownloadListGenerator.h')
| -rw-r--r-- | engine/DownloadListGenerator.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/engine/DownloadListGenerator.h b/engine/DownloadListGenerator.h new file mode 100644 index 0000000..3e9b510 --- /dev/null +++ b/engine/DownloadListGenerator.h @@ -0,0 +1,78 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef DOWNLOADLISTGENERATOR_H +#define DOWNLOADLISTGENERATOR_H +#ifdef _WIN32 +#pragma once +#endif + +#include "filesystem.h" +#include "utlvector.h" +#include "utlsymbol.h" +#include "networkstringtable.h" + +#define DOWNLOADABLE_FILE_TABLENAME "downloadables" +#define MAX_DOWNLOADABLE_FILES 8192 + +enum ConsistencyType +{ + CONSISTENCY_NONE, + CONSISTENCY_EXACT, + CONSISTENCY_SIMPLE_MATERIAL, // uses ExactFileUserData + CONSISTENCY_BOUNDS, +}; + +struct ExactFileUserData +{ + unsigned char consistencyType; + unsigned long crc; +}; + +struct ModelBoundsUserData +{ + unsigned char consistencyType; + Vector mins; + Vector maxs; +}; + +//----------------------------------------------------------------------------- +// Purpose: Handles collating lists of resources on level load +// Used to generate reslists for in-game downloads +//----------------------------------------------------------------------------- +class CDownloadListGenerator +{ +public: + CDownloadListGenerator(); + + void SetStringTable( INetworkStringTable *pStringTable ); + + // call to mark level load/end + void OnLevelLoadStart(const char *levelName); + void OnLevelLoadEnd(); + + // call to mark resources as being precached + void OnResourcePrecached(const char *relativePathFileName); + void OnModelPrecached(const char *relativePathFileName); + void OnSoundPrecached(const char *relativePathFileName); + + void ForceModelBounds( const char *relativePathFileName, const Vector &mins, const Vector &maxs ); + void ForceSimpleMaterial( const char *relativePathFileName ); + +private: + void OnResourcePrecachedFullPath(char *fullPathFileName, const char *relativeFileName ); + char m_gameDir[256]; + char m_mapName[64]; + FileHandle_t m_hReslistFile; + CUtlSymbolTable m_AlreadyWrittenFileNames; + INetworkStringTable *m_pStringTable; +}; + +// singleton accessor +CDownloadListGenerator &DownloadListGenerator(); + + +#endif // DOWNLOADLISTGENERATOR_H |