]> icculus.org git repositories - taylor/freespace2.git/blob - src/pofview/pofviewdoc.cpp
Initial revision
[taylor/freespace2.git] / src / pofview / pofviewdoc.cpp
1 // PofViewDoc.cpp : implementation of the CPofViewDoc class
2 //
3
4 #include "stdafx.h"
5 #include "pofview.h"
6
7 #include "pofviewdoc.h"
8
9 #include "model.h"
10
11 #ifdef _DEBUG
12 #define new DEBUG_NEW
13 #undef THIS_FILE
14 static char THIS_FILE[] = __FILE__;
15 #endif
16
17 /////////////////////////////////////////////////////////////////////////////
18 // CPofViewDoc
19
20 IMPLEMENT_DYNCREATE(CPofViewDoc, CDocument)
21
22 BEGIN_MESSAGE_MAP(CPofViewDoc, CDocument)
23         //{{AFX_MSG_MAP(CPofViewDoc)
24                 // NOTE - the ClassWizard will add and remove mapping macros here.
25                 //    DO NOT EDIT what you see in these blocks of generated code!
26         //}}AFX_MSG_MAP
27 END_MESSAGE_MAP()
28
29 /////////////////////////////////////////////////////////////////////////////
30 // CPofViewDoc construction/destruction
31
32 CPofViewDoc::CPofViewDoc()
33 {
34         // TODO: add one-time construction code here
35
36 }
37
38 CPofViewDoc::~CPofViewDoc()
39 {
40 }
41
42 BOOL CPofViewDoc::OnNewDocument()
43 {
44         m_model_num     = -1;
45
46         if (!CDocument::OnNewDocument())
47                 return FALSE;
48
49         // TODO: add reinitialization code here
50         // (SDI documents will reuse this document)
51
52         return TRUE;
53 }
54
55 /////////////////////////////////////////////////////////////////////////////
56 // CPofViewDoc serialization
57
58 void CPofViewDoc::Serialize(CArchive& ar)
59 {
60         if (ar.IsStoring())
61         {
62                 // TODO: add storing code here
63         }
64         else
65         {
66                 // TODO: add loading code here
67                 m_model_num = model_load((char *)LPCTSTR(ar.GetFile()->GetFilePath()), 0, NULL);
68         }
69 }
70
71 /////////////////////////////////////////////////////////////////////////////
72 // CPofViewDoc diagnostics
73
74 #ifdef _DEBUG
75 void CPofViewDoc::AssertValid() const
76 {
77         CDocument::AssertValid();
78 }
79
80 void CPofViewDoc::Dump(CDumpContext& dc) const
81 {
82         CDocument::Dump(dc);
83 }
84 #endif //_DEBUG
85
86 /////////////////////////////////////////////////////////////////////////////
87 // CPofViewDoc commands