Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: A Scene Image file aggregates all the compiled binary VCD files into
  4. // a single file.
  5. //
  6. //=====================================================================================//
  7. #ifndef SCENE_IMAGE_FILE_H
  8. #define SCENE_IMAGE_FILE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "commonmacros.h"
  13. #include "tier1/checksum_crc.h"
  14. #define SCENE_IMAGE_ID MAKEID( 'V','S','I','F' )
  15. #define SCENE_IMAGE_VERSION 2
  16. // scene summary: cached calcs for commmon startup queries, variable sized
  17. struct SceneImageSummary_t
  18. {
  19. unsigned int msecs;
  20. int numSounds;
  21. int soundStrings[1]; // has numSounds
  22. };
  23. // stored sorted by crc filename for binary search
  24. struct SceneImageEntry_t
  25. {
  26. CRC32_t crcFilename; // expected to be normalized as scenes\???.vcd
  27. int nDataOffset; // offset to dword aligned data from start
  28. int nDataLength;
  29. int nSceneSummaryOffset; // offset to summary
  30. };
  31. struct SceneImageHeader_t
  32. {
  33. int nId;
  34. int nVersion;
  35. int nNumScenes; // number of scene files
  36. int nNumStrings; // number of unique strings in table
  37. int nSceneEntryOffset;
  38. inline const char *String( short iString )
  39. {
  40. if ( iString < 0 || iString >= nNumStrings )
  41. {
  42. Assert( 0 );
  43. return NULL;
  44. }
  45. // access string table (after header) to access pool
  46. unsigned int *pTable = (unsigned int *)((byte *)this + sizeof( SceneImageHeader_t ));
  47. return (char *)this + pTable[iString];
  48. }
  49. };
  50. #endif // SCENE_IMAGE_FILE_H