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 ),
CamWnd_Update( camwnd );
CameraMovedNotify();
- Sys_SetCursorPos( m_parent, m_PositionDragCursorX, m_PositionDragCursorY );
+ Sys_SetCursorPos( m_gl_widget, m_PositionDragCursorX, m_PositionDragCursorY );
}
}
#endif
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 );
}
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 );
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;
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();
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 );
}
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 );