1 // PofViewView.cpp : implementation of the CPofViewView class
7 #include "pofviewdoc.h"
8 #include "pofviewview.h"
23 static char THIS_FILE[] = __FILE__;
26 /////////////////////////////////////////////////////////////////////////////
29 IMPLEMENT_DYNCREATE(CPofViewView, CView)
31 BEGIN_MESSAGE_MAP(CPofViewView, CView)
32 //{{AFX_MSG_MAP(CPofViewView)
38 ON_COMMAND(ID_POF_OUTLINE, OnPofOutline)
39 ON_UPDATE_COMMAND_UI(ID_POF_OUTLINE, OnUpdatePofOutline)
40 ON_COMMAND(ID_POF_LIGHTING, OnPofLighting)
41 ON_UPDATE_COMMAND_UI(ID_POF_LIGHTING, OnUpdatePofLighting)
42 ON_COMMAND(ID_POF_PIVOTS, OnPofPivots)
43 ON_UPDATE_COMMAND_UI(ID_POF_PIVOTS, OnUpdatePofPivots)
44 ON_UPDATE_COMMAND_UI(ID_DETAIL_1, OnUpdateDetail1)
45 ON_COMMAND(ID_DETAIL_1, OnDetail1)
46 ON_COMMAND(ID_DETAIL_2, OnDetail2)
47 ON_UPDATE_COMMAND_UI(ID_DETAIL_2, OnUpdateDetail2)
48 ON_COMMAND(ID_DETAIL_3, OnDetail3)
49 ON_UPDATE_COMMAND_UI(ID_DETAIL_3, OnUpdateDetail3)
50 ON_COMMAND(ID_DETAIL_4, OnDetail4)
51 ON_UPDATE_COMMAND_UI(ID_DETAIL_4, OnUpdateDetail4)
52 ON_COMMAND(ID_DETAIL_5, OnDetail5)
53 ON_UPDATE_COMMAND_UI(ID_DETAIL_5, OnUpdateDetail5)
54 ON_COMMAND(ID_DETAIL_6, OnDetail6)
55 ON_UPDATE_COMMAND_UI(ID_DETAIL_6, OnUpdateDetail6)
56 ON_COMMAND(ID_SHOW_TREE, OnShowTree)
57 ON_UPDATE_COMMAND_UI(ID_SHOW_TREE, OnUpdateShowTree)
58 ON_COMMAND(ID_POF_PATHS, OnPofPaths)
59 ON_UPDATE_COMMAND_UI(ID_POF_PATHS, OnUpdatePofPaths)
60 ON_COMMAND(ID_POF_RADIUS, OnPofRadius)
61 ON_UPDATE_COMMAND_UI(ID_POF_RADIUS, OnUpdatePofRadius)
62 ON_COMMAND(ID_POF_OVERWRITE, OnPofOverwrite)
63 ON_UPDATE_COMMAND_UI(ID_POF_OVERWRITE, OnUpdatePofOverwrite)
64 ON_COMMAND(IDC_SHOW_DAMAGED_SUBOBJECTS, OnShowDamagedSubobjects)
65 ON_UPDATE_COMMAND_UI(IDC_SHOW_DAMAGED_SUBOBJECTS, OnUpdateShowDamagedSubobjects)
66 ON_COMMAND(IDC_SHOW_DEBRIS, OnShowDebris)
67 ON_UPDATE_COMMAND_UI(IDC_SHOW_DEBRIS, OnUpdateShowDebris)
71 ON_COMMAND(ID_POF_SMOOTHING, OnPofSmoothing)
72 ON_UPDATE_COMMAND_UI(ID_POF_SMOOTHING, OnUpdatePofSmoothing)
73 ON_COMMAND(ID_POF_TEXTURING, OnPofTexturing)
74 ON_UPDATE_COMMAND_UI(ID_POF_TEXTURING, OnUpdatePofTexturing)
75 ON_COMMAND(ID_POF_SHIELDS, OnPofShields)
76 ON_UPDATE_COMMAND_UI(ID_POF_SHIELDS, OnUpdatePofShields)
77 ON_COMMAND(IDC_TOGGLE_LIGHTING, OnToggleLighting)
78 ON_UPDATE_COMMAND_UI(IDC_TOGGLE_LIGHTING, OnUpdateToggleLighting)
79 ON_COMMAND(ID_INVISIBLEFACES, OnInvisiblefaces)
80 ON_UPDATE_COMMAND_UI(ID_INVISIBLEFACES, OnUpdateInvisiblefaces)
81 ON_COMMAND(ID_BAY_PATHS, OnBayPaths)
82 ON_UPDATE_COMMAND_UI(ID_BAY_PATHS, OnUpdateBayPaths)
83 ON_COMMAND(ID_AUTOCEN, OnAutocenter)
84 ON_UPDATE_COMMAND_UI(ID_AUTOCEN, OnUpdateAutocenter)
86 // Standard printing commands
87 ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
88 ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
89 ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
92 /////////////////////////////////////////////////////////////////////////////
93 // CPofViewView construction/destruction
95 CPofViewView::CPofViewView()
97 // TODO: add construction code here
101 matrix temp_orient = IDENTITY_MATRIX;
102 vector temp_pos = {0.0f, 0.0f, -10.0f};
105 m_ViewerPos = temp_pos;
106 m_ViewerOrient = temp_orient;
107 m_ObjectOrient = vmd_identity_matrix;
109 // m_ViewerPos.x=f2fl(0xadd3); m_ViewerPos.y = f2fl(0x32cbb); m_ViewerPos.z =f2fl(0x10006e);
110 // m_ViewerOrient.rvec.x=f2fl(0xffff40e2); m_ViewerOrient.rvec.y=f2fl(0x2b3); m_ViewerOrient.rvec.z = f2fl(0xffff55b4);
111 // m_ViewerOrient.uvec.x=f2fl(0x5cba); m_ViewerOrient.uvec.y=f2fl(0xd859); m_ViewerOrient.uvec.z = f2fl(0xffff9b5d);
112 // m_ViewerOrient.fvec.x=f2fl(0x8edd); m_ViewerOrient.fvec.y=f2fl(0xffff772f); m_ViewerOrient.fvec.z=f2fl(0xffff5d80);
114 physics_init( &m_ViewerPhysics );
115 m_ViewerPhysics.flags |= PF_ACCELERATES | PF_SLIDE_ENABLED;
117 memset( &m_Viewer_ci, 0, sizeof(control_info) );
122 m_current_detail_level = 1; // If 0, show debris
125 m_show_overwrite = 0;
126 m_show_destroyed_subobjects = 0;
128 m_show_invisible_faces = 0;
129 m_show_bay_paths = 0;
135 m_mouse_x = m_mouse_y = 0;
136 m_mouse_dx = m_mouse_dy = 0;
142 // CObjectTree m_subobjects;
145 void CPofViewView::MoveViewer(float FrameTime, BOOL is_active, int key )
147 control_info * ci = &m_Viewer_ci;
149 polymodel *pm = NULL;
151 CPofViewDoc* pDoc = GetDocument();
154 int n_detail_levels = 0;
155 if ( pDoc->m_model_num > -1 ) {
156 pm = model_get(pDoc->m_model_num);
157 n_detail_levels = pm->n_detail_levels;
162 if ( n_detail_levels >= 1){
163 m_current_detail_level = 1;
167 if ( n_detail_levels >= 2){
168 m_current_detail_level = 2;
172 if ( n_detail_levels >= 3){
173 m_current_detail_level = 3;
177 if ( n_detail_levels >= 4){
178 m_current_detail_level = 4;
182 if ( n_detail_levels >= 5){
183 m_current_detail_level = 5;
187 if ( n_detail_levels >= 6){
188 m_current_detail_level = 6;
192 // Scales the engines thrusters by this much
193 model_thrust -= 0.1f;
194 if ( model_thrust < 0.0f ){
199 // Scales the engines thrusters by this much
200 model_thrust += 0.1f;
201 if ( model_thrust > 1.0f ){
207 float c_scale = 1.0f;
209 if((pm != NULL) && (pm->core_radius < 200.0f)){
210 c_scale = 1.0f / 6.0f;
215 float temp = ci->heading;
216 float temp1 = ci->pitch;
217 memset( ci, 0, sizeof(control_info) );
221 if ( keyd_pressed[KEY_BACKSP] ) {
222 model_afterburner = 1;
224 model_afterburner = 0;
228 kh = (key_down_timef(KEY_PAD6) - key_down_timef(KEY_PAD4)) / 32.0f;
231 } else if (kh > 0.0f) {
232 if (ci->heading < 0.0f){
236 if (ci->heading > 0.0f){
242 kh = (key_down_timef(KEY_PAD8) - key_down_timef(KEY_PAD2)) / 32.0f;
245 } else if (kh > 0.0f) {
246 if (ci->pitch < 0.0f){
250 if (ci->pitch > 0.0f){
256 ci->bank = (key_down_timef(KEY_PAD7) - key_down_timef(KEY_PAD9)) / 8.0f;
257 ci->forward = (key_down_timef(KEY_A) - key_down_timef(KEY_Z)) * c_scale;
258 ci->sideways = (key_down_timef(KEY_PAD3) - key_down_timef(KEY_PAD1)) * c_scale;
259 ci->vertical = (key_down_timef(KEY_PADMINUS) - key_down_timef(KEY_PADPLUS)) * c_scale;
261 memset( ci, 0, sizeof(control_info) );
263 physics_read_flying_controls( &m_ViewerOrient, &m_ViewerPhysics, &m_Viewer_ci, FrameTime );
265 physics_sim(&m_ViewerPos, &m_ViewerOrient, &m_ViewerPhysics, FrameTime * 6 );
269 if ( m_mouse_down ) {
270 matrix tempm, mousem;
272 if ( m_mouse_dx || m_mouse_dy ) {
273 vm_trackball( -m_mouse_dx, m_mouse_dy, &mousem );
274 vm_matrix_x_matrix(&tempm, &m_ObjectOrient, &mousem);
275 m_ObjectOrient = tempm;
277 m_mouse_dx = m_mouse_dy = 0;
284 CPofViewView::~CPofViewView()
290 extern int shipp_thruster_glow_bitmap;
291 extern float shipp_thruster_glow_noise;
292 extern int shipp_thruster_bitmap; // In PofView.cpp // What frame the current thruster bitmap is at for this ship
293 extern int Tmap_show_layers;
294 extern float Ambient_light;
297 /////////////////////////////////////////////////////////////////////////////
298 // CPofViewView drawing
299 void CPofViewView::OnDraw(CDC* pDC)
301 CPofViewDoc* pDoc = GetDocument();
303 polymodel * pm = NULL;
305 // TODO: add draw code for native data here
307 if ( pDoc->m_model_num >= 0 ) {
311 pm = model_get(pDoc->m_model_num);
314 GetClientRect(&client);
315 w = client.right - client.left + 1;
316 h = client.bottom - client.top + 1;
317 if (w>= gr_screen.max_w ) w = gr_screen.max_w-1;
318 if (h>= gr_screen.max_h ) h = gr_screen.max_h-1;
321 gr_set_clip(0,0,w,h);
326 gr_set_color( 127, 127, 127 );
328 float saved_Ambient_light = Ambient_light;
331 static vector Global_light_world = { -0.208758f, -0.688253f, 0.694782f };
335 light_add_directional( &Global_light_world, 1.0f, 1.0f, 1.0f, 1.0f );
337 Ambient_light = 0.0f;
343 g3_set_view_matrix(&m_ViewerPos, &m_ViewerOrient, m_ViewerZoom);
345 uint render_flags = 0;
346 if ( !m_dolighting ) render_flags |= MR_NO_LIGHTING;
347 if ( m_show_outline ) {
348 render_flags |= MR_SHOW_OUTLINE;
349 model_set_outline_color(0,0,0);
352 if ( m_show_shields ){
353 render_flags |= MR_SHOW_SHIELDS;
356 if ( m_show_invisible_faces ) {
357 render_flags |= MR_SHOW_INVISIBLE_FACES;
360 if (m_show_overwrite){
361 Tmap_show_layers = 1;
363 Tmap_show_layers = 0;
366 if ( m_show_pivots ) render_flags |= MR_SHOW_PIVOTS;
367 if ( m_show_paths ) render_flags |= MR_SHOW_PATHS;
368 if ( m_show_radius ) render_flags |= MR_SHOW_RADIUS;
369 if ( !m_smoothing ) render_flags |= MR_NO_SMOOTHING;
370 if ( !m_texturing ) render_flags |= MR_NO_TEXTURING;
371 if ( m_current_detail_level > 0 ) {
372 render_flags |= MR_LOCK_DETAIL;
373 model_set_detail_level(m_current_detail_level-1);
376 if(m_show_bay_paths) render_flags |= MR_BAY_PATHS;
378 if(m_autocenter) render_flags |= MR_AUTOCENTER;
380 vector temp_pos = {0.0f, 0.0f, 0.0f };
382 model_clear_instance( pDoc->m_model_num );
384 model_show_damaged(pDoc->m_model_num, m_show_destroyed_subobjects );
386 if ( model_afterburner ){
387 model_set_thrust( pDoc->m_model_num, 1.0f, shipp_thruster_bitmap, shipp_thruster_glow_bitmap, shipp_thruster_glow_noise );
389 model_set_thrust( pDoc->m_model_num, model_thrust, shipp_thruster_bitmap, shipp_thruster_glow_bitmap, shipp_thruster_glow_noise );
392 render_flags |= MR_SHOW_THRUSTERS;
394 static int whee = -1;
396 whee = bm_load("helvig.pcx");
399 model_set_insignia_bitmap(whee);
402 if ( m_current_detail_level > 0 ) {
403 model_render( pDoc->m_model_num, &m_ObjectOrient, &temp_pos, render_flags );
406 for (i=0; i<pm->num_debris_objects; i++ ) {
407 vector tmp = {0.0f, 0.0f, 0.0f };
408 vector tmp1 = pm->submodel[pm->debris_objects[i]].offset;
409 model_find_world_point(&tmp, &tmp1, pDoc->m_model_num, -1,&m_ObjectOrient, &temp_pos );
410 submodel_render( pDoc->m_model_num, pm->debris_objects[i],&m_ObjectOrient, &tmp, render_flags );
417 vm_vec_scale_add( &tmp1, &m_ViewerPos, &m_ViewerOrient.fvec, 100.0f );
418 int hit = model_check_collision(pDoc->m_model_num,&vmd_identity_matrix,&temp_pos, &m_ViewerPos, &tmp1, &hitpos, 0 );
424 flags = g3_rotate_vertex(&pt,&hitpos);
427 g3_project_vertex(&pt);
428 if (!(pt.flags & PF_OVERFLOW)) {
429 gr_set_color(128,0,0);
430 g3_draw_sphere( &pt, 1.0f );
437 gr_flip_window((uint) pDC->m_hDC, 0, 0, w, h );
439 Ambient_light = saved_Ambient_light;
443 /////////////////////////////////////////////////////////////////////////////
444 // CPofViewView printing
446 BOOL CPofViewView::OnPreparePrinting(CPrintInfo* pInfo)
448 // default preparation
449 return DoPreparePrinting(pInfo);
452 void CPofViewView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
454 // TODO: add extra initialization before printing
457 void CPofViewView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
459 // TODO: add cleanup after printing
462 /////////////////////////////////////////////////////////////////////////////
463 // CPofViewView diagnostics
466 void CPofViewView::AssertValid() const
468 CView::AssertValid();
471 void CPofViewView::Dump(CDumpContext& dc) const
476 CPofViewDoc* CPofViewView::GetDocument() // non-debug version is inline
478 ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPofViewDoc)));
479 return (CPofViewDoc*)m_pDocument;
483 /////////////////////////////////////////////////////////////////////////////
484 // CPofViewView message handlers
486 void CPofViewView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
488 // TODO: Add your message handler code here and/or call default
489 key_mark( nFlags&0x7F, 1, 0 );
491 CView::OnKeyDown(nChar, nRepCnt, nFlags);
494 void CPofViewView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
496 // TODO: Add your message handler code here and/or call default
497 key_mark( nFlags&0x7F, 0, 0 );
499 CView::OnKeyUp(nChar, nRepCnt, nFlags);
502 extern int pofview_focus;
504 void CPofViewView::OnSetFocus(CWnd* pOldWnd)
506 CView::OnSetFocus(pOldWnd);
508 // TODO: Add your message handler code here
514 void CPofViewView::OnKillFocus(CWnd* pNewWnd)
516 CView::OnKillFocus(pNewWnd);
518 // TODO: Add your message handler code here
526 void CPofViewView::OnPofOutline()
528 m_show_outline = !m_show_outline;
532 void CPofViewView::OnUpdatePofOutline(CCmdUI* pCmdUI)
534 pCmdUI->SetCheck( m_show_outline );
537 void CPofViewView::OnPofLighting()
539 m_dolighting = !m_dolighting;
542 void CPofViewView::OnUpdatePofLighting(CCmdUI* pCmdUI)
544 pCmdUI->SetCheck( m_dolighting );
547 void CPofViewView::OnPofPivots()
549 m_show_pivots = !m_show_pivots;
553 void CPofViewView::OnUpdatePofPivots(CCmdUI* pCmdUI)
555 pCmdUI->SetCheck( m_show_pivots );
558 void CPofViewView::OnDetail1()
560 m_current_detail_level = 1;
563 void CPofViewView::OnUpdateDetail1(CCmdUI* pCmdUI)
565 CPofViewDoc* pDoc = GetDocument();
566 if ( pDoc->m_model_num > -1 ) {
567 polymodel * pm = model_get(pDoc->m_model_num);
568 if ( (pm->n_detail_levels >= 1) && (m_current_detail_level!=1) )
569 pCmdUI->Enable(TRUE);
571 pCmdUI->Enable(FALSE);
575 void CPofViewView::OnDetail2()
577 m_current_detail_level = 2;
580 void CPofViewView::OnUpdateDetail2(CCmdUI* pCmdUI)
582 CPofViewDoc* pDoc = GetDocument();
583 if ( pDoc->m_model_num > -1 ) {
584 polymodel * pm = model_get(pDoc->m_model_num);
585 if ( (pm->n_detail_levels >= 2) && (m_current_detail_level!=2) )
586 pCmdUI->Enable(TRUE);
588 pCmdUI->Enable(FALSE);
592 void CPofViewView::OnDetail3()
594 m_current_detail_level = 3;
597 void CPofViewView::OnUpdateDetail3(CCmdUI* pCmdUI)
599 CPofViewDoc* pDoc = GetDocument();
600 if ( pDoc->m_model_num > -1 ) {
601 polymodel * pm = model_get(pDoc->m_model_num);
602 if ( (pm->n_detail_levels >= 3) && (m_current_detail_level!=3) )
603 pCmdUI->Enable(TRUE);
605 pCmdUI->Enable(FALSE);
609 void CPofViewView::OnDetail4()
611 m_current_detail_level = 4;
614 void CPofViewView::OnUpdateDetail4(CCmdUI* pCmdUI)
616 CPofViewDoc* pDoc = GetDocument();
617 if ( pDoc->m_model_num > -1 ) {
618 polymodel * pm = model_get(pDoc->m_model_num);
619 if ( (pm->n_detail_levels >= 4) && (m_current_detail_level!=4) )
620 pCmdUI->Enable(TRUE);
622 pCmdUI->Enable(FALSE);
626 void CPofViewView::OnDetail5()
628 m_current_detail_level = 5;
631 void CPofViewView::OnUpdateDetail5(CCmdUI* pCmdUI)
633 CPofViewDoc* pDoc = GetDocument();
634 if ( pDoc->m_model_num > -1 ) {
635 polymodel * pm = model_get(pDoc->m_model_num);
636 if ( (pm->n_detail_levels >= 5) && (m_current_detail_level!=5) )
637 pCmdUI->Enable(TRUE);
639 pCmdUI->Enable(FALSE);
645 void CPofViewView::OnDetail6()
647 m_current_detail_level = 6;
650 void CPofViewView::OnUpdateDetail6(CCmdUI* pCmdUI)
652 CPofViewDoc* pDoc = GetDocument();
653 if ( pDoc->m_model_num > -1 ) {
654 polymodel * pm = model_get(pDoc->m_model_num);
655 if ( (pm->n_detail_levels >= 6) && (m_current_detail_level!=6) )
656 pCmdUI->Enable(TRUE);
658 pCmdUI->Enable(FALSE);
662 void CPofViewView::OnInitialUpdate()
664 CView::OnInitialUpdate();
666 // TODO: Add your specialized code here and/or call the base class
670 void CPofViewView::OnShowTree()
672 // TODO: Add your command handler code here
673 CPofViewDoc* pDoc = GetDocument();
674 if ( pDoc->m_model_num > -1 ) {
675 m_TreeDialog.MyCreate(this);
680 void CPofViewView::OnUpdateShowTree(CCmdUI* pCmdUI)
682 // TODO: Add your command update UI handler code here
686 void CPofViewView::OnPofPaths()
688 m_show_paths = !m_show_paths;
691 void CPofViewView::OnUpdatePofPaths(CCmdUI* pCmdUI)
693 pCmdUI->SetCheck( m_show_paths );
696 void CPofViewView::OnPofRadius()
698 m_show_radius = !m_show_radius;
702 void CPofViewView::OnUpdatePofRadius(CCmdUI* pCmdUI)
704 pCmdUI->SetCheck( m_show_radius );
707 void CPofViewView::OnPofOverwrite()
709 m_show_overwrite = !m_show_overwrite;
713 void CPofViewView::OnUpdatePofOverwrite(CCmdUI* pCmdUI)
715 pCmdUI->Enable(TRUE);
716 pCmdUI->SetCheck( m_show_destroyed_subobjects );
719 void CPofViewView::OnShowDamagedSubobjects()
721 m_show_destroyed_subobjects = !m_show_destroyed_subobjects;
724 void CPofViewView::OnUpdateShowDamagedSubobjects(CCmdUI* pCmdUI)
726 // TODO: Add your command update UI handler code here
730 void CPofViewView::OnShowDebris()
732 m_current_detail_level = 0;
735 void CPofViewView::OnUpdateShowDebris(CCmdUI* pCmdUI)
737 CPofViewDoc* pDoc = GetDocument();
738 if ( pDoc->m_model_num > -1 ) {
739 polymodel * pm = model_get(pDoc->m_model_num);
740 if ( (pm->num_debris_objects >= 1) && (m_current_detail_level!=0) )
741 pCmdUI->Enable(TRUE);
743 pCmdUI->Enable(FALSE);
747 void CPofViewView::OnMouseMove(UINT nFlags, CPoint point)
749 if (m_mouse_inited) {
750 m_mouse_dx = point.x - m_mouse_x;
751 m_mouse_dy = point.y - m_mouse_y;
759 CView::OnMouseMove(nFlags, point);
762 void CPofViewView::OnLButtonDown(UINT nFlags, CPoint point)
766 CView::OnLButtonDown(nFlags, point);
769 void CPofViewView::OnLButtonUp(UINT nFlags, CPoint point)
773 CView::OnLButtonUp(nFlags, point);
776 void CPofViewView::OnPofSmoothing()
778 m_smoothing = !m_smoothing;
781 void CPofViewView::OnUpdatePofSmoothing(CCmdUI* pCmdUI)
783 pCmdUI->SetCheck( m_smoothing );
786 void CPofViewView::OnPofTexturing()
788 m_texturing = !m_texturing;
791 void CPofViewView::OnUpdatePofTexturing(CCmdUI* pCmdUI)
793 pCmdUI->SetCheck( m_texturing );
796 void CPofViewView::OnPofShields()
798 m_show_shields = !m_show_shields;
801 void CPofViewView::OnUpdatePofShields(CCmdUI* pCmdUI)
803 pCmdUI->SetCheck( m_show_shields );
806 void CPofViewView::OnToggleLighting()
808 m_lights_on = !m_lights_on;
811 void CPofViewView::OnUpdateToggleLighting(CCmdUI* pCmdUI)
813 pCmdUI->SetCheck( m_lights_on );
817 void CPofViewView::OnInvisiblefaces()
819 m_show_invisible_faces = !m_show_invisible_faces;
822 void CPofViewView::OnUpdateInvisiblefaces(CCmdUI* pCmdUI)
824 pCmdUI->SetCheck( m_show_invisible_faces );
827 void CPofViewView::OnBayPaths()
829 m_show_bay_paths = !m_show_bay_paths;
832 void CPofViewView::OnUpdateBayPaths(CCmdUI* pCmdUI)
834 pCmdUI->SetCheck( m_show_bay_paths );
837 void CPofViewView::OnAutocenter()
839 m_autocenter = !m_autocenter;
842 void CPofViewView::OnUpdateAutocenter(CCmdUI* pCmdUI)
844 pCmdUI->SetCheck( m_autocenter );
847 void CPofViewView::OnSize(UINT nType, int cx, int cy)
849 CView::OnSize(nType, cx, cy);
851 if ((cx > 0) && (cy > 0)) {
852 gr_init(GR_640, GR_SOFTWARE, 8, cx, cy);