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.

75 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef IVP_H
  7. #define IVP_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "utlvector.h"
  12. class CPhysCollide;
  13. class CTextBuffer;
  14. class IPhysicsCollision;
  15. extern IPhysicsCollision *physcollision;
  16. // a list of all of the materials in the world model
  17. extern int RemapWorldMaterial( int materialIndexIn );
  18. class CPhysCollisionEntry
  19. {
  20. public:
  21. CPhysCollisionEntry( CPhysCollide *pCollide );
  22. virtual void WriteToTextBuffer( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ) = 0;
  23. virtual void DumpCollide( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex ) = 0;
  24. unsigned int GetCollisionBinarySize();
  25. unsigned int WriteCollisionBinary( char *pDest );
  26. protected:
  27. void DumpCollideFileName( const char *pName, int modelIndex, CTextBuffer *pTextBuffer );
  28. protected:
  29. CPhysCollide *m_pCollide;
  30. };
  31. class CPhysCollisionEntryStaticMesh : public CPhysCollisionEntry
  32. {
  33. public:
  34. CPhysCollisionEntryStaticMesh( CPhysCollide *pCollide, const char *pMaterialName );
  35. virtual void WriteToTextBuffer( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex );
  36. virtual void DumpCollide( CTextBuffer *pTextBuffer, int modelIndex, int collideIndex );
  37. private:
  38. const char *m_pMaterial;
  39. };
  40. class CTextBuffer
  41. {
  42. public:
  43. CTextBuffer( void );
  44. ~CTextBuffer( void );
  45. inline int GetSize( void ) { return m_buffer.Count(); }
  46. inline char *GetData( void ) { return m_buffer.Base(); }
  47. void WriteText( const char *pText );
  48. void WriteIntKey( const char *pKeyName, int outputData );
  49. void WriteStringKey( const char *pKeyName, const char *outputData );
  50. void WriteFloatKey( const char *pKeyName, float outputData );
  51. void WriteFloatArrayKey( const char *pKeyName, const float *outputData, int count );
  52. void CopyStringQuotes( const char *pString );
  53. void Terminate( void );
  54. private:
  55. void CopyData( const char *pData, int len );
  56. CUtlVector<char> m_buffer;
  57. };
  58. #endif // IVP_H