AnimationPropPage.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // AnimationPropPage.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "w3dview.h"
  22. #include "AnimationPropPage.h"
  23. #include "RendObj.H"
  24. #include "AssetMgr.H"
  25. #include "Mesh.H"
  26. #include "W3DViewDoc.H"
  27. #include "Utils.H"
  28. #ifdef _DEBUG
  29. #define new DEBUG_NEW
  30. #undef THIS_FILE
  31. static char THIS_FILE[] = __FILE__;
  32. #endif
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CAnimationPropPage property page
  35. IMPLEMENT_DYNCREATE(CAnimationPropPage, CPropertyPage)
  36. ////////////////////////////////////////////////////////////////
  37. //
  38. // CAnimationPropPage
  39. //
  40. CAnimationPropPage::CAnimationPropPage (void)
  41. : CPropertyPage(CAnimationPropPage::IDD)
  42. {
  43. //{{AFX_DATA_INIT(CAnimationPropPage)
  44. // NOTE: the ClassWizard will add member initialization here
  45. //}}AFX_DATA_INIT
  46. return ;
  47. }
  48. ////////////////////////////////////////////////////////////////
  49. //
  50. // CAnimationPropPage
  51. //
  52. CAnimationPropPage::~CAnimationPropPage (void)
  53. {
  54. return ;
  55. }
  56. ////////////////////////////////////////////////////////////////
  57. //
  58. // DoDataExchange
  59. //
  60. void
  61. CAnimationPropPage::DoDataExchange (CDataExchange* pDX)
  62. {
  63. // Allow the base class to process this message
  64. CPropertyPage::DoDataExchange(pDX);
  65. //{{AFX_DATA_MAP(CAnimationPropPage)
  66. // NOTE: the ClassWizard will add DDX and DDV calls here
  67. //}}AFX_DATA_MAP
  68. return ;
  69. }
  70. BEGIN_MESSAGE_MAP(CAnimationPropPage, CPropertyPage)
  71. //{{AFX_MSG_MAP(CAnimationPropPage)
  72. //}}AFX_MSG_MAP
  73. END_MESSAGE_MAP()
  74. ////////////////////////////////////////////////////////////////
  75. //
  76. // OnInitDialog
  77. //
  78. BOOL
  79. CAnimationPropPage::OnInitDialog (void)
  80. {
  81. // Allow the base class to process this message
  82. CPropertyPage::OnInitDialog ();
  83. // Get a pointer to the doc so we can get at the current animation object
  84. CW3DViewDoc *pCDoc = ::GetCurrentDocument ();
  85. if (pCDoc && pCDoc->GetCurrentAnimation ())
  86. {
  87. HAnimClass *pCAnimation = pCDoc->GetCurrentAnimation ();
  88. // Set the description text at the top of the dialog
  89. CString stringTemp;
  90. stringTemp.Format (IDS_ANI_PROP_DESC, pCAnimation->Get_Name ());
  91. SetDlgItemText (IDC_DESCRIPTION, stringTemp);
  92. // Fill in the number of frames
  93. SetDlgItemInt (IDC_FRAME_COUNT, pCAnimation->Get_Num_Frames ());
  94. // Fill in the frame rate of the animation
  95. stringTemp.Format ("%.2f fps", pCAnimation->Get_Frame_Rate ());
  96. SetDlgItemText (IDC_FRAME_RATE, stringTemp);
  97. // Fill in the total time taken by the animation
  98. stringTemp.Format ("%.3f seconds", pCAnimation->Get_Total_Time ());
  99. SetDlgItemText (IDC_TOTAL_TIME, stringTemp);
  100. // Set the name of the hierarchy this animation belongs to.
  101. SetDlgItemText (IDC_HIERARCHY_NAME, pCAnimation->Get_HName ());
  102. }
  103. return TRUE;
  104. }