ChunkViewDoc.cpp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : ChunkView *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/ChunkView/ChunkViewDoc.cpp $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 9/28/99 9:48a $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. // ChunkViewDoc.cpp : implementation of the CChunkViewDoc class
  36. //
  37. #include "stdafx.h"
  38. #include "ChunkView.h"
  39. #include "ChunkViewDoc.h"
  40. #include "MainFrm.h"
  41. #ifdef _DEBUG
  42. #define new DEBUG_NEW
  43. #undef THIS_FILE
  44. static char THIS_FILE[] = __FILE__;
  45. #endif
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CChunkViewDoc
  48. IMPLEMENT_DYNCREATE(CChunkViewDoc, CDocument)
  49. BEGIN_MESSAGE_MAP(CChunkViewDoc, CDocument)
  50. //{{AFX_MSG_MAP(CChunkViewDoc)
  51. // NOTE - the ClassWizard will add and remove mapping macros here.
  52. // DO NOT EDIT what you see in these blocks of generated code!
  53. //}}AFX_MSG_MAP
  54. END_MESSAGE_MAP()
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CChunkViewDoc construction/destruction
  57. CChunkViewDoc::CChunkViewDoc() :
  58. m_pCurChunk(NULL)
  59. {
  60. // TODO: add one-time construction code here
  61. }
  62. CChunkViewDoc::~CChunkViewDoc()
  63. {
  64. }
  65. BOOL CChunkViewDoc::OnNewDocument()
  66. {
  67. if (!CDocument::OnNewDocument())
  68. return FALSE;
  69. // TODO: add reinitialization code here
  70. // (SDI documents will reuse this document)
  71. return TRUE;
  72. }
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CChunkViewDoc serialization
  75. void CChunkViewDoc::Serialize(CArchive& ar)
  76. {
  77. if (ar.IsStoring())
  78. {
  79. }
  80. else
  81. {
  82. m_ChunkFileImage.Load(ar.m_strFileName);
  83. }
  84. }
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CChunkViewDoc diagnostics
  87. #ifdef _DEBUG
  88. void CChunkViewDoc::AssertValid() const
  89. {
  90. CDocument::AssertValid();
  91. }
  92. void CChunkViewDoc::Dump(CDumpContext& dc) const
  93. {
  94. CDocument::Dump(dc);
  95. }
  96. #endif //_DEBUG
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CChunkViewDoc commands
  99. const ChunkFileImageClass & CChunkViewDoc::Get_File_Image(void)
  100. {
  101. return m_ChunkFileImage;
  102. }
  103. void CChunkViewDoc::Set_Cur_Chunk(ChunkImageClass * cur_chunk)
  104. {
  105. // The ChunkTreeView calls this when the user clicks on a particular chunk
  106. if (m_pCurChunk != cur_chunk) {
  107. m_pCurChunk = cur_chunk;
  108. }
  109. }
  110. const ChunkImageClass * CChunkViewDoc::Get_Cur_Chunk(void)
  111. {
  112. return m_pCurChunk;
  113. }