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.

52 lines
1.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PHYSICS_SAVERESTORE_H
  8. #define PHYSICS_SAVERESTORE_H
  9. #if defined( _WIN32 )
  10. #pragma once
  11. #endif
  12. #include "vphysics_interface.h"
  13. class ISaveRestoreBlockHandler;
  14. class IPhysicsObject;
  15. class CPhysCollide;
  16. //-----------------------------------------------------------------------------
  17. ISaveRestoreBlockHandler *GetPhysSaveRestoreBlockHandler();
  18. ISaveRestoreOps *GetPhysObjSaveRestoreOps( PhysInterfaceId_t );
  19. //-------------------------------------
  20. #define DEFINE_PHYSPTR(name) \
  21. { FIELD_CUSTOM, #name, offsetof(classNameTypedef,name), 1, FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name) ) ), NULL }
  22. #define DEFINE_PHYSPTR_ARRAY(name) \
  23. { FIELD_CUSTOM, #name, offsetof(classNameTypedef,name), ARRAYSIZE(((classNameTypedef *)0)->name), FTYPEDESC_SAVE, NULL, GetPhysObjSaveRestoreOps( GetPhysIID( &(((classNameTypedef *)0)->name[0]) ) ), NULL }
  24. //-----------------------------------------------------------------------------
  25. abstract_class IPhysSaveRestoreManager
  26. {
  27. public:
  28. virtual void NoteBBox( const Vector &mins, const Vector &maxs, CPhysCollide * ) = 0;
  29. virtual void AssociateModel( IPhysicsObject *, int modelIndex ) = 0;
  30. virtual void AssociateModel( IPhysicsObject *, const CPhysCollide *pModel ) = 0;
  31. virtual void ForgetModel( IPhysicsObject * ) = 0;
  32. virtual void ForgetAllModels() = 0;
  33. };
  34. extern IPhysSaveRestoreManager *g_pPhysSaveRestoreManager;
  35. //=============================================================================
  36. #endif // PHYSICS_SAVERESTORE_H