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.1 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "movieobjects/dmebookmark.h"
  7. #include "tier0/dbg.h"
  8. #include "datamodel/dmelementfactoryhelper.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Class factory
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_ELEMENT_FACTORY( DmeBookmark, CDmeBookmark );
  15. //-----------------------------------------------------------------------------
  16. // Constructor, destructor
  17. //-----------------------------------------------------------------------------
  18. void CDmeBookmark::OnConstruction()
  19. {
  20. m_Time.InitAndSet( this, "time", DMETIME_ZERO );
  21. m_Duration.InitAndSet( this, "duration", DMETIME_ZERO );
  22. m_Note.Init( this, "note" );
  23. }
  24. void CDmeBookmark::OnDestruction()
  25. {
  26. }
  27. //-----------------------------------------------------------------------------
  28. // Class factory
  29. //-----------------------------------------------------------------------------
  30. IMPLEMENT_ELEMENT_FACTORY( DmeBookmarkSet, CDmeBookmarkSet );
  31. //-----------------------------------------------------------------------------
  32. // Constructor, destructor
  33. //-----------------------------------------------------------------------------
  34. void CDmeBookmarkSet::OnConstruction()
  35. {
  36. m_Bookmarks.Init( this, "bookmarks" );
  37. }
  38. void CDmeBookmarkSet::OnDestruction()
  39. {
  40. }
  41. const CDmaElementArray< CDmeBookmark > &CDmeBookmarkSet::GetBookmarks() const
  42. {
  43. return m_Bookmarks;
  44. }
  45. CDmaElementArray< CDmeBookmark > &CDmeBookmarkSet::GetBookmarks()
  46. {
  47. return m_Bookmarks;
  48. }
  49. void CDmeBookmarkSet::ScaleBookmarkTimes( float scale )
  50. {
  51. int nBookmarks = m_Bookmarks.Count();
  52. for ( int i = 0; i < nBookmarks; ++i )
  53. {
  54. CDmeBookmark *pBookmark = m_Bookmarks[ i ];
  55. if ( !pBookmark )
  56. continue;
  57. pBookmark->SetTime ( pBookmark->GetTime () * scale );
  58. pBookmark->SetDuration( pBookmark->GetDuration() * scale );
  59. }
  60. }