-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamePaneRF.cpp
More file actions
106 lines (83 loc) · 2.52 KB
/
GamePaneRF.cpp
File metadata and controls
106 lines (83 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// GamePaneRF.cpp : implementation file
//
#include "stdafx.h"
#include "modview32.h"
#include "GamePaneRF.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGamePaneRF
IMPLEMENT_DYNCREATE(CGamePaneRF, CFormView)
CGamePaneRF::CGamePaneRF()
: CFormView(CGamePaneRF::IDD)
{
//{{AFX_DATA_INIT(CGamePaneRF)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CGamePaneRF::~CGamePaneRF()
{
}
void CGamePaneRF::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGamePaneRF)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGamePaneRF, CFormView)
//{{AFX_MSG_MAP(CGamePaneRF)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGamePaneRF diagnostics
#ifdef _DEBUG
void CGamePaneRF::AssertValid() const
{
CFormView::AssertValid();
}
void CGamePaneRF::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
CMODVIEW32Doc * CGamePaneRF::GetDocument()
{
return (CMODVIEW32Doc *)GetMainFrame()->GetDocument();
}
CMainFrame * CGamePaneRF::GetMainFrame()
{
return static_cast<CMainFrame*>(GetParentFrame());
}
CMODVIEW32View * CGamePaneRF::GetMainView()
{
return (CMODVIEW32View *)GetMainFrame()->GetCurrentView();
}
/////////////////////////////////////////////////////////////////////////////
// CGamePaneRF message handlers
void CGamePaneRF::Init()
{
CMODVIEW32Doc *pDoc=GetDocument();
int num_vertices=0;
for(int i=0;i<pDoc->m_RF_Model.num_geounits;i++)
num_vertices+=pDoc->m_RF_Model.geounit[i].mNumVerts;
int num_polygons=0;
for(int i=0;i<pDoc->m_RF_Model.num_geounits;i++)
num_polygons+=pDoc->m_RF_Model.geounit[i].mNumTris;
CStatic *ctrl;
char *temp=new char[256];
CString sep=" ";
ctrl=(CStatic *)GetDlgItem(IDC_RF_VERTICIES);
ctrl->SetWindowText(sep+_itoa(num_vertices,temp,10));
ctrl=(CStatic *)GetDlgItem(IDC_RF_POLYGONS);
ctrl->SetWindowText(sep+_itoa(num_polygons,temp,10));
ctrl=(CStatic *)GetDlgItem(IDC_RF_TEXTURES);
ctrl->SetWindowText(sep+_itoa(pDoc->m_RF_Model.num_textures,temp,10));
ctrl=(CStatic *)GetDlgItem(IDC_RF_SOBJ);
ctrl->SetWindowText(sep+_itoa(pDoc->m_RF_Model.num_geounits,temp,10));
delete[] temp;
}