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.

119 lines
3.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MDLLIB_H
  7. #define MDLLIB_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tier1/utlbuffer.h"
  12. #include "appframework/IAppSystem.h"
  13. //
  14. // Forward interface declarations
  15. //
  16. abstract_class IMdlLib;
  17. abstract_class IMdlStripInfo;
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Interface to accessing model data operations
  20. //-----------------------------------------------------------------------------
  21. #define MDLLIB_INTERFACE_VERSION "VMDLLIB001"
  22. abstract_class IMdlLib : public IAppSystem
  23. {
  24. //
  25. // Stripping routines
  26. //
  27. public:
  28. //
  29. // StripModelBuffers
  30. // The main function that strips the model buffers
  31. // mdlBuffer - mdl buffer, updated, no size change
  32. // vvdBuffer - vvd buffer, updated, size reduced
  33. // vtxBuffer - vtx buffer, updated, size reduced
  34. // ppStripInfo - if nonzero on return will be filled with the stripping info
  35. //
  36. virtual bool StripModelBuffers( CUtlBuffer &mdlBuffer, CUtlBuffer &vvdBuffer, CUtlBuffer &vtxBuffer, IMdlStripInfo **ppStripInfo ) = 0;
  37. //
  38. // CreateNewStripInfo
  39. // Creates an empty strip info or resets an existing strip info so that it can be reused.
  40. //
  41. virtual bool CreateNewStripInfo( IMdlStripInfo **ppStripInfo ) = 0;
  42. };
  43. abstract_class IMdlStripInfo
  44. {
  45. //
  46. // Serialization
  47. //
  48. public:
  49. // Save the strip info to the buffer (appends to the end)
  50. virtual bool Serialize( CUtlBuffer &bufStorage ) const = 0;
  51. // Load the strip info from the buffer (reads from the current position as much as needed)
  52. virtual bool UnSerialize( CUtlBuffer &bufData ) = 0;
  53. //
  54. // Stripping info state
  55. //
  56. public:
  57. // Returns the checksums that the stripping info was generated for:
  58. // plChecksumOriginal if non-NULL will hold the checksum of the original model submitted for stripping
  59. // plChecksumStripped if non-NULL will hold the resulting checksum of the stripped model
  60. virtual bool GetCheckSum( long *plChecksumOriginal, long *plChecksumStripped ) const = 0;
  61. //
  62. // Stripping
  63. //
  64. public:
  65. //
  66. // StripHardwareVertsBuffer
  67. // The main function that strips the vhv buffer
  68. // vhvBuffer - vhv buffer, updated, size reduced
  69. //
  70. virtual bool StripHardwareVertsBuffer( CUtlBuffer &vhvBuffer ) = 0;
  71. //
  72. // StripModelBuffer
  73. // The main function that strips the mdl buffer
  74. // mdlBuffer - mdl buffer, updated
  75. //
  76. virtual bool StripModelBuffer( CUtlBuffer &mdlBuffer ) = 0;
  77. //
  78. // StripVertexDataBuffer
  79. // The main function that strips the vvd buffer
  80. // vvdBuffer - vvd buffer, updated, size reduced
  81. //
  82. virtual bool StripVertexDataBuffer( CUtlBuffer &vvdBuffer ) = 0;
  83. //
  84. // StripOptimizedModelBuffer
  85. // The main function that strips the vtx buffer
  86. // vtxBuffer - vtx buffer, updated, size reduced
  87. //
  88. virtual bool StripOptimizedModelBuffer( CUtlBuffer &vtxBuffer ) = 0;
  89. //
  90. // Release the object with "delete this"
  91. //
  92. public:
  93. virtual void DeleteThis() = 0;
  94. };
  95. #endif // MDLLIB_H