X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fcamwindow.cpp;h=fb05ae0f0603d4f67f4ce9eab97da361d4dc435c;hb=f01b611436ae1403b915260c2c21473f4edef946;hp=04110ee7ab11f13fca10b49e36c77857ee31fe50;hpb=fea0d2e6575b21945c4800805d66e43a2247ded5;p=xonotic%2Fnetradiant.git diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 04110ee7..fb05ae0f 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -171,7 +171,10 @@ struct camera_t origin( 0, 0, 0 ), angles( 0, 0, 0 ), color( 0, 0, 0 ), + projection( g_matrix4_identity ), + modelview( g_matrix4_identity ), movementflags( 0 ), + m_keycontrol_timer(), m_keymove_handler( 0 ), fieldOfView( 90.0f ), m_mouseMove( motionDelta, this ), @@ -1264,7 +1267,7 @@ void CamWnd::Cam_PositionDrag(){ CamWnd_Update( camwnd ); CameraMovedNotify(); - Sys_SetCursorPos( m_parent, m_PositionDragCursorX, m_PositionDragCursorY ); + Sys_SetCursorPos( m_gl_widget, m_PositionDragCursorX, m_PositionDragCursorY ); } } #endif @@ -1289,7 +1292,7 @@ void CamWnd::EnableFreeMove(){ gtk_window_set_focus( m_parent, m_gl_widget ); m_freemove_handle_focusout = m_gl_widget.connect( "focus_out_event", G_CALLBACK( camwindow_freemove_focusout ), this ); - m_freezePointer.freeze_pointer( m_parent, Camera_motionDelta, &m_Camera ); + m_freezePointer.freeze_pointer( m_gl_widget, Camera_motionDelta, &m_Camera ); CamWnd_Update( *this ); } @@ -1304,7 +1307,7 @@ void CamWnd::DisableFreeMove(){ CamWnd_Remove_Handlers_FreeMove( *this ); CamWnd_Add_Handlers_Move( *this ); - m_freezePointer.unfreeze_pointer( m_parent ); + m_freezePointer.unfreeze_pointer( m_gl_widget ); g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_freemove_handle_focusout ); CamWnd_Update( *this ); @@ -1358,9 +1361,11 @@ void PopState(){ m_state_stack.pop_back(); } void Highlight( EHighlightMode mode, bool bEnable = true ){ - ( bEnable ) - ? m_state_stack.back().m_highlight |= mode - : m_state_stack.back().m_highlight &= ~mode; + if ( bEnable ) { + m_state_stack.back().m_highlight |= mode; + } else { + m_state_stack.back().m_highlight &= ~mode; + } } void setLights( const LightList& lights ){ m_state_stack.back().m_lights = &lights; @@ -1583,7 +1588,7 @@ void CamWnd::BenchMark(){ Vector3 angles; angles[CAMERA_ROLL] = 0; angles[CAMERA_PITCH] = 0; - angles[CAMERA_YAW] = static_cast( i * ( 360.0 / 100.0 ) ); + angles[CAMERA_YAW] = i * 360.0f / 100.0f; Camera_setAngles( *this, angles ); } double dEnd = Sys_DoubleTime(); @@ -1599,7 +1604,7 @@ void GlobalCamera_ResetAngles(){ CamWnd& camwnd = *g_camwnd; Vector3 angles; angles[CAMERA_ROLL] = angles[CAMERA_PITCH] = 0; - angles[CAMERA_YAW] = static_cast( 22.5 * floor( ( Camera_getAngles( camwnd )[CAMERA_YAW] + 11 ) / 22.5 ) ); + angles[CAMERA_YAW] = 22.5f * floorf( ( Camera_getAngles( camwnd )[CAMERA_YAW] + 11 ) / 22.5f ); Camera_setAngles( camwnd, angles ); }