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