@@ -71,7 +71,6 @@ IMPLEMENT_DYNCREATE(CGraphicView, CView)
7171// //////////////////////////////////////////////////////////////////////////
7272CGraphicView::CGraphicView (void )
7373 : m_bInitialized (FALSE ),
74- m_pCamera (NULL ),
7574 m_TimerID (0 ),
7675 m_bMouseDown (FALSE ),
7776 m_bRMouseDown (FALSE ),
@@ -83,7 +82,6 @@ CGraphicView::CGraphicView (void)
8382 m_objectRotation (NoRotation),
8483 m_LightRotation (NoRotation),
8584 m_bLightMeshInScene (false ),
86- m_pLightMesh (NULL ),
8785 m_ParticleCountUpdate (0 ),
8886 m_CameraBonePosX (false ),
8987 m_UpdateCounter (0 ),
@@ -216,7 +214,7 @@ CGraphicView::InitializeGraphicView (void)
216214 if (bReturn && (m_pCamera == NULL ))
217215 {
218216 // Instantiate a new camera class
219- m_pCamera = new CameraClass ();
217+ m_pCamera = RefCountPtr<CameraClass>:: Create_NoAddRef ( new CameraClass () );
220218 bReturn = (m_pCamera != NULL );
221219
222220 // Were we successful in creating a camera?
@@ -234,7 +232,7 @@ CGraphicView::InitializeGraphicView (void)
234232 //
235233 // Attach the 'listener' to the camera
236234 //
237- WWAudioClass::Get_Instance ()->Get_Sound_Scene ()->Attach_Listener_To_Obj (m_pCamera);
235+ WWAudioClass::Get_Instance ()->Get_Sound_Scene ()->Attach_Listener_To_Obj (m_pCamera. Peek () );
238236 }
239237
240238 Reset_FOV ();
@@ -244,7 +242,7 @@ CGraphicView::InitializeGraphicView (void)
244242 ResourceFileClass light_mesh_file (NULL , " Light.w3d" );
245243 WW3DAssetManager::Get_Instance ()->Load_3D_Assets (light_mesh_file);
246244
247- m_pLightMesh = WW3DAssetManager::Get_Instance ()->Create_Render_Obj (" LIGHT" );
245+ m_pLightMesh = RefCountPtr<RenderObjClass>:: Create_NoAddRef ( WW3DAssetManager::Get_Instance ()->Create_Render_Obj (" LIGHT" ) );
248246 ASSERT (m_pLightMesh != NULL );
249247 m_bLightMeshInScene = false ;
250248 }
@@ -531,7 +529,7 @@ CGraphicView::RepaintView
531529 // Wait for all previous rendering to complete before starting benchmark.
532530 DWORD profile_time = ::Get_CPU_Clock (pt_high);
533531
534- WW3D::Render (doc->GetScene (), m_pCamera, FALSE , FALSE );
532+ WW3D::Render (doc->GetScene (), m_pCamera. Peek () , FALSE , FALSE );
535533
536534 // Wait for all rendering to complete before stopping benchmark.
537535 DWORD milliseconds = (::Get_CPU_Clock (pt_high) - profile_time) / 1000 ;
@@ -542,7 +540,7 @@ CGraphicView::RepaintView
542540 WW3D::Render (doc->GetCursorScene (), doc->Get2DCamera (), FALSE , FALSE );
543541
544542 // Render the dazzles
545- doc->Render_Dazzles (m_pCamera);
543+ doc->Render_Dazzles (m_pCamera. Peek () );
546544
547545 // Finish out the rendering process
548546 WW3D::End_Render ();
@@ -601,7 +599,7 @@ CGraphicView::UpdateDisplay (void)
601599
602600 // Render the current view inside the frame
603601 WW3D::Begin_Render (TRUE, TRUE, Vector3 (0.2,0.4,0.6));
604- WW3D::Render (doc->GetScene (), m_pCamera, FALSE, FALSE);
602+ WW3D::Render (doc->GetScene (), m_pCamera.Peek() , FALSE, FALSE);
605603 WW3D::End_Render ();
606604 } */
607605
0 commit comments