Counter Strike : Global Offensive Source Code
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.

51 lines
2.4 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef IRESOURCEDICTIONARY_H
  9. #define IRESOURCEDICTIONARY_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier1/interface.h"
  14. #include "filesystem.h"
  15. #include "tier1/utlstringmap.h"
  16. //-----------------------------------------------------------------------------
  17. // Methods related to resources
  18. //-----------------------------------------------------------------------------
  19. abstract_class IResourceDictionary
  20. {
  21. public:
  22. virtual char *GetPageFile() = 0;
  23. virtual bool Init( unsigned char *pData, int nTransientMemoryBytes, BVHBuilderParams_t &buildParams, bool bToolMode = false ) = 0;
  24. virtual void Destroy( IRenderDevice *pDevice ) = 0;
  25. virtual bool LoadEntrySerial( void *pMemory, uint64 nMemorySize, CBVHDictionaryEntry &entry ) = 0;
  26. virtual int GetNumResources() = 0;
  27. virtual CBVHDictionaryEntry &GetEntry( int i ) = 0;
  28. virtual int GetNumLayoutDescs() = 0;
  29. virtual BVHInputLayoutDesc_t &GetLayoutDesc( int i ) = 0;
  30. virtual RenderInputLayout_t &TranslateInputLayout( int iLayout ) = 0;
  31. virtual void EvictNode( IRenderDevice *pDevice, IBVHNode* pNode ) = 0;
  32. virtual void CalculateNodeResidency( IBVHNode *pNode ) = 0;
  33. // Tools entry points
  34. virtual bool LoadNodeSerial( IRenderDevice *pDevice, IRenderContext *pContext, IBVHNode *pNode, bool bLoadIAData ) = 0;
  35. virtual bool UpdateEntrySerial( void *pMemory, uint64 nMemorySize, uint64 nOffsetFromEntry, CBVHDictionaryEntry &entry ) = 0;
  36. virtual void ShiftEntries( uint64 nByteOffset ) = 0;
  37. virtual void WriteEntries( FileHandle_t fp ) = 0;
  38. virtual void CollectEntries( CUtlVector<CBVHDictionaryEntry> &resourceEntries, CUtlVector<IResourceDictionary*> &dictionaryList, CUtlStringMap<int> &instanceDictionary, int *pResourceRemap ) = 0;
  39. virtual uint64 GetNonEntryDataSize() = 0;
  40. virtual void WriteNonEntryData( int32 nNewResources, char *pNewPageFile, FileHandle_t fp ) = 0;
  41. virtual void AddStaticEntries( CBVHDictionaryEntry *pEntries, int nEntries ) = 0;
  42. virtual int AddEntry( uint8 nFlags, uint64 nSizeBytes, int nResourceType, char *pName, bool bInstanced ) = 0;
  43. virtual void ByteSwapDictionary( CUtlBuffer *pOutBuffer, char *pNewPageFile ) = 0;
  44. virtual void ByteSwapResourceFile( FileHandle_t fp ) = 0;
  45. };
  46. #endif