]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/camwindow.cpp
radiant: Increase the far-clip distance
[xonotic/netradiant.git] / radiant / camwindow.cpp
index 04110ee7ab11f13fca10b49e36c77857ee31fe50..a533eec2c7c0c91bef931855f7753f10eaf49e07 100644 (file)
@@ -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<float>( 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<float>( 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 );
 }
 
@@ -1627,8 +1632,8 @@ void Camera_CubeIn(){
 void Camera_CubeOut(){
        CamWnd& camwnd = *g_camwnd;
        g_camwindow_globals.m_nCubicScale++;
-       if ( g_camwindow_globals.m_nCubicScale > 23 ) {
-               g_camwindow_globals.m_nCubicScale = 23;
+       if ( g_camwindow_globals.m_nCubicScale > 46 ) {
+               g_camwindow_globals.m_nCubicScale = 46;
        }
        Camera_updateProjection( camwnd.getCamera() );
        CamWnd_Update( camwnd );