diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/scenefilecache/SceneImageFile.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/scenefilecache/SceneImageFile.h')
| -rw-r--r-- | mp/src/public/scenefilecache/SceneImageFile.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mp/src/public/scenefilecache/SceneImageFile.h b/mp/src/public/scenefilecache/SceneImageFile.h new file mode 100644 index 00000000..258dbb90 --- /dev/null +++ b/mp/src/public/scenefilecache/SceneImageFile.h @@ -0,0 +1,58 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: A Scene Image file aggregates all the compiled binary VCD files into
+// a single file.
+//
+//=====================================================================================//
+#ifndef SCENE_IMAGE_FILE_H
+#define SCENE_IMAGE_FILE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "commonmacros.h"
+#include "tier1/checksum_crc.h"
+
+#define SCENE_IMAGE_ID MAKEID( 'V','S','I','F' )
+#define SCENE_IMAGE_VERSION 2
+
+// scene summary: cached calcs for commmon startup queries, variable sized
+struct SceneImageSummary_t
+{
+ unsigned int msecs;
+ int numSounds;
+ int soundStrings[1]; // has numSounds
+};
+
+// stored sorted by crc filename for binary search
+struct SceneImageEntry_t
+{
+ CRC32_t crcFilename; // expected to be normalized as scenes\???.vcd
+ int nDataOffset; // offset to dword aligned data from start
+ int nDataLength;
+ int nSceneSummaryOffset; // offset to summary
+};
+
+struct SceneImageHeader_t
+{
+ int nId;
+ int nVersion;
+ int nNumScenes; // number of scene files
+ int nNumStrings; // number of unique strings in table
+ int nSceneEntryOffset;
+
+ inline const char *String( short iString )
+ {
+ if ( iString < 0 || iString >= nNumStrings )
+ {
+ Assert( 0 );
+ return NULL;
+ }
+
+ // access string table (after header) to access pool
+ unsigned int *pTable = (unsigned int *)((byte *)this + sizeof( SceneImageHeader_t ));
+ return (char *)this + pTable[iString];
+ }
+};
+
+#endif // SCENE_IMAGE_FILE_H
|