Merge branch 'Flakebi-fixes'

This commit is contained in:
hiker 2014-11-27 00:07:00 +11:00
commit 673a9f39c6
5 changed files with 33 additions and 33 deletions

View File

@ -663,24 +663,24 @@ namespace UserConfigParams
"If the kart is driving backwards faster than this value,\n"
"switch automatically to reverse camera (set to 0 to disable).") );
PARAM_PREFIX FloatUserConfigParam m_fspcam_direction_speed
PARAM_DEFAULT( FloatUserConfigParam(0.003f, "fspcam_rotation_speed",
PARAM_PREFIX FloatUserConfigParam m_fpscam_direction_speed
PARAM_DEFAULT( FloatUserConfigParam(0.003f, "fpscam_rotation_speed",
&m_camera,
"How fast the first person camera's direction speed changes when\n"
"moving the mouse (means acceleration).") );
PARAM_PREFIX FloatUserConfigParam m_fspcam_smooth_direction_max_speed
PARAM_DEFAULT( FloatUserConfigParam(0.04f, "fspcam_smooth_rotation_max_speed",
PARAM_PREFIX FloatUserConfigParam m_fpscam_smooth_direction_max_speed
PARAM_DEFAULT( FloatUserConfigParam(0.04f, "fpscam_smooth_rotation_max_speed",
&m_camera,
"How fast the first person camera's direction can change.") );
PARAM_PREFIX FloatUserConfigParam m_fspcam_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(0.02f, "fspcam_angular_velocity",
PARAM_PREFIX FloatUserConfigParam m_fpscam_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(0.02f, "fpscam_angular_velocity",
&m_camera,
"How fast the first person camera's rotation speed changes.") );
PARAM_PREFIX FloatUserConfigParam m_fspcam_max_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(1.0f, "fspcam_max_angular_velocity",
PARAM_PREFIX FloatUserConfigParam m_fpscam_max_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(1.0f, "fpscam_max_angular_velocity",
&m_camera,
"How fast the first person camera can rotate.") );

View File

@ -501,13 +501,13 @@ void Camera::update(float dt)
// Angular velocity
if (m_angular_velocity < m_target_angular_velocity)
{
m_angular_velocity += UserConfigParams::m_fspcam_angular_velocity;
m_angular_velocity += UserConfigParams::m_fpscam_angular_velocity;
if (m_angular_velocity > m_target_angular_velocity)
m_angular_velocity = m_target_angular_velocity;
}
else if (m_angular_velocity > m_target_angular_velocity)
{
m_angular_velocity -= UserConfigParams::m_fspcam_angular_velocity;
m_angular_velocity -= UserConfigParams::m_fpscam_angular_velocity;
if (m_angular_velocity < m_target_angular_velocity)
m_angular_velocity = m_target_angular_velocity;
}
@ -525,13 +525,13 @@ void Camera::update(float dt)
diff = m_target_direction - direction;
if (diff.X != 0 || diff.Y != 0 || diff.Z != 0)
{
diff.setLength(UserConfigParams::m_fspcam_direction_speed);
diff.setLength(UserConfigParams::m_fpscam_direction_speed);
m_direction_velocity += diff;
if (m_direction_velocity.getLengthSQ() >
UserConfigParams::m_fspcam_smooth_direction_max_speed *
UserConfigParams::m_fspcam_smooth_direction_max_speed)
UserConfigParams::m_fpscam_smooth_direction_max_speed *
UserConfigParams::m_fpscam_smooth_direction_max_speed)
m_direction_velocity.setLength(
UserConfigParams::m_fspcam_smooth_direction_max_speed);
UserConfigParams::m_fpscam_smooth_direction_max_speed);
direction += m_direction_velocity;
m_target_direction = direction;
}
@ -541,9 +541,9 @@ void Camera::update(float dt)
if (diff.X != 0 || diff.Y != 0 || diff.Z != 0)
{
if (diff.getLengthSQ() >
UserConfigParams::m_fspcam_angular_velocity *
UserConfigParams::m_fspcam_angular_velocity)
diff.setLength(UserConfigParams::m_fspcam_angular_velocity);
UserConfigParams::m_fpscam_angular_velocity *
UserConfigParams::m_fpscam_angular_velocity)
diff.setLength(UserConfigParams::m_fpscam_angular_velocity);
up += diff;
}
}

View File

@ -515,7 +515,8 @@ void IrrDriver::initDevice()
#else
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1));
#endif
initGL();
if (!ProfileWorld::isNoGraphics())
initGL();
m_sync = 0;
// Parse extensions

View File

@ -215,7 +215,7 @@ void InputManager::handleStaticAction(int key, int value)
Camera *active_cam = Camera::getActiveCamera();
active_cam->setAngularVelocity(value ?
UserConfigParams::m_fspcam_max_angular_velocity : 0.0f);
UserConfigParams::m_fpscam_max_angular_velocity : 0.0f);
break;
}
case KEY_KEY_E:
@ -225,7 +225,7 @@ void InputManager::handleStaticAction(int key, int value)
Camera *active_cam = Camera::getActiveCamera();
active_cam->setAngularVelocity(value ?
-UserConfigParams::m_fspcam_max_angular_velocity : 0);
-UserConfigParams::m_fpscam_max_angular_velocity : 0);
break;
}
@ -971,9 +971,9 @@ EventPropagation InputManager::input(const SEvent& event)
int diff_x = event.MouseInput.X - m_mouse_val_x;
int diff_y = event.MouseInput.Y - m_mouse_val_y;
float mouse_x = ((float) diff_x) *
UserConfigParams::m_fspcam_direction_speed;
UserConfigParams::m_fpscam_direction_speed;
float mouse_y = ((float) diff_y) *
-UserConfigParams::m_fspcam_direction_speed;
-UserConfigParams::m_fpscam_direction_speed;
// No movement the first time it's used
// At the moment there's also a hard limit because the mouse
// gets reset to the middle of the screen and sometimes there
@ -1044,7 +1044,10 @@ EventPropagation InputManager::input(const SEvent& event)
Camera *cam = Camera::getActiveCamera();
if (event.MouseInput.Wheel < 0)
{
cam->setMaximumVelocity(cam->getMaximumVelocity() - 3);
float vel = cam->getMaximumVelocity() - 3;
if (vel < 0.0f)
vel = 0.0f;
cam->setMaximumVelocity(vel);
}
else if (event.MouseInput.Wheel > 0)
{

View File

@ -533,17 +533,13 @@ bool KartSelectionScreen::joinPlayer(InputDevice* device)
}
}
// select something (anything) in the ribbon; by default, only the
// game master has something selected. Thus, when a new player joins,
// we need to select something for them
w->setSelection(new_player_id, new_player_id, true);
if (!first_player)
{
// select something (anything) in the ribbon; by default, only the
// game master has something selected. Thus, when a new player joins,
// we need to select something for them
w->setSelection(new_player_id, new_player_id, true);
newPlayerWidget->m_player_ident_spinner
->setFocusForPlayer(new_player_id);
}
newPlayerWidget->m_player_ident_spinner
->setFocusForPlayer(new_player_id);
if (!m_multiplayer)
{