Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'johnbartholomew/minor-worldview-camera-…

…fixes'
  • Loading branch information...
commit 523288aae802b0adac1f0a716ddb24ab9574e3ff 2 parents ffd0159 + ac8cd4e
@robn robn authored
Showing with 23 additions and 25 deletions.
  1. +1 −1  Changelog.txt
  2. +2 −2 src/KeyBindings.cpp
  3. +20 −22 src/WorldView.cpp
View
2  Changelog.txt
@@ -4,7 +4,7 @@ Alpha 27
* The settings screen is now acessible from the main menu (#1187, #1512)
* There's now an option to enable texture compression (#1522)
* New mission type, Scout (get paid to scan particular planets) (#1348, #779)
- * New view modes (Left/Right/Top/Bottom, Cockpit Front/Rear) (#1454, #1539)
+ * New view modes (Left/Right/Top/Bottom, Cockpit Front/Rear) (#1454, #1539, #1544)
NOTE -- view mode controls are bound to Numeric Keypad by default
(they can be rebound in the View tab of the Settings screen)
View
4 src/KeyBindings.cpp
@@ -244,7 +244,7 @@ const BindingPrototype camBindingProtos[] = {
{ Lang::CAMERA_FRONT_VIEW, "BindFrontCamera", &frontCamera, 0 },
{ Lang::CAMERA_REAR_VIEW, "BindRearCamera", &rearCamera, 0 },
{ Lang::CAMERA_LEFT_VIEW, "BindLeftCamera", &leftCamera, 0 },
- { Lang::CAMERA_RIGHT_VIEW, "BindRightCmaera", &rightCamera, 0 },
+ { Lang::CAMERA_RIGHT_VIEW, "BindRightCamera", &rightCamera, 0 },
{ Lang::CAMERA_TOP_VIEW, "BindTopCamera", &topCamera, 0 },
{ Lang::CAMERA_BOTTOM_VIEW, "BindBottomCamera", &bottomCamera, 0 },
{ Lang::EXTERNAL_VIEW, 0, 0, 0 },
@@ -478,7 +478,7 @@ void UpdateBindings()
InitKeyBinding(KeyBindings::frontCamera, "BindFrontCamera", SDLK_KP8);
InitKeyBinding(KeyBindings::rearCamera, "BindRearCamera", SDLK_KP2);
InitKeyBinding(KeyBindings::leftCamera, "BindLeftCamera", SDLK_KP4);
- InitKeyBinding(KeyBindings::rightCamera, "BindRightCmaera", SDLK_KP6);
+ InitKeyBinding(KeyBindings::rightCamera, "BindRightCamera", SDLK_KP6);
InitKeyBinding(KeyBindings::topCamera, "BindTopCamera", SDLK_KP9);
InitKeyBinding(KeyBindings::bottomCamera, "BindBottomCamera", SDLK_KP3);
InitKeyBinding(KeyBindings::cameraRollLeft, "BindCameraRollLeft", SDLK_KP1);
View
42 src/WorldView.cpp
@@ -316,8 +316,6 @@ void WorldView::SetCamType(enum CamType c)
break;
}
- std::transform(cameraName.begin(), cameraName.end(), cameraName.begin(), toupper);
-
if (m_showCameraName)
Remove(m_showCameraName);
@@ -805,25 +803,25 @@ void WorldView::Update()
// XXX ugly hack checking for console here
if (!Pi::IsConsoleActive()) {
if (m_activeCamera->IsExternal() == false) {
- if (KeyBindings::frontCockpit.IsActive() && GetCamType() != COCKPIT_FRONT) SetCamType(COCKPIT_FRONT);
- if (KeyBindings::rearCockpit.IsActive() && GetCamType() != COCKPIT_REAR) SetCamType(COCKPIT_REAR);
- if (KeyBindings::frontCamera.IsActive() && GetCamType() != CAM_FRONT) SetCamType(CAM_FRONT);
- if (KeyBindings::rearCamera.IsActive() && GetCamType() != CAM_REAR) SetCamType(CAM_REAR);
- if (KeyBindings::leftCamera.IsActive() && GetCamType() != CAM_LEFT) SetCamType(CAM_LEFT);
- if (KeyBindings::rightCamera.IsActive() && GetCamType() != CAM_RIGHT) SetCamType(CAM_RIGHT);
- if (KeyBindings::topCamera.IsActive() && GetCamType() != CAM_TOP) SetCamType(CAM_TOP);
- if (KeyBindings::bottomCamera.IsActive() && GetCamType() != CAM_BOTTOM) SetCamType(CAM_BOTTOM);
+ if (KeyBindings::frontCockpit.IsActive() && GetCamType() != COCKPIT_FRONT) SetCamType(COCKPIT_FRONT);
+ if (KeyBindings::rearCockpit.IsActive() && GetCamType() != COCKPIT_REAR) SetCamType(COCKPIT_REAR);
+ if (KeyBindings::frontCamera.IsActive() && GetCamType() != CAM_FRONT) SetCamType(CAM_FRONT);
+ if (KeyBindings::rearCamera.IsActive() && GetCamType() != CAM_REAR) SetCamType(CAM_REAR);
+ if (KeyBindings::leftCamera.IsActive() && GetCamType() != CAM_LEFT) SetCamType(CAM_LEFT);
+ if (KeyBindings::rightCamera.IsActive() && GetCamType() != CAM_RIGHT) SetCamType(CAM_RIGHT);
+ if (KeyBindings::topCamera.IsActive() && GetCamType() != CAM_TOP) SetCamType(CAM_TOP);
+ if (KeyBindings::bottomCamera.IsActive() && GetCamType() != CAM_BOTTOM) SetCamType(CAM_BOTTOM);
} else {
- if (KeyBindings::cameraRotateUp.IsActive()) m_activeCamera->RotateUp(frameTime);
- if (KeyBindings::cameraRotateDown.IsActive()) m_activeCamera->RotateDown(frameTime);
- if (KeyBindings::cameraRotateLeft.IsActive()) m_activeCamera->RotateLeft(frameTime);
- if (KeyBindings::cameraRotateRight.IsActive()) m_activeCamera->RotateRight(frameTime);
- if (KeyBindings::cameraZoomOut.IsActive()) m_activeCamera->ZoomEvent(ZOOM_SPEED*frameTime); // Zoom out
- if (KeyBindings::cameraZoomIn.IsActive()) m_activeCamera->ZoomEvent(-ZOOM_SPEED*frameTime);
- if (KeyBindings::cameraRollLeft.IsActive()) m_activeCamera->RollLeft(frameTime);
- if (KeyBindings::cameraRollRight.IsActive()) m_activeCamera->RollRight(frameTime);
- if (KeyBindings::resetCamera.IsActive()) m_activeCamera->Reset();
- m_activeCamera->ZoomEventUpdate(frameTime);
+ if (KeyBindings::cameraRotateUp.IsActive()) m_activeCamera->RotateUp(frameTime);
+ if (KeyBindings::cameraRotateDown.IsActive()) m_activeCamera->RotateDown(frameTime);
+ if (KeyBindings::cameraRotateLeft.IsActive()) m_activeCamera->RotateLeft(frameTime);
+ if (KeyBindings::cameraRotateRight.IsActive()) m_activeCamera->RotateRight(frameTime);
+ if (KeyBindings::cameraZoomOut.IsActive()) m_activeCamera->ZoomEvent(ZOOM_SPEED*frameTime); // Zoom out
+ if (KeyBindings::cameraZoomIn.IsActive()) m_activeCamera->ZoomEvent(-ZOOM_SPEED*frameTime);
+ if (KeyBindings::cameraRollLeft.IsActive()) m_activeCamera->RollLeft(frameTime);
+ if (KeyBindings::cameraRollRight.IsActive()) m_activeCamera->RollRight(frameTime);
+ if (KeyBindings::resetCamera.IsActive()) m_activeCamera->Reset();
+ m_activeCamera->ZoomEventUpdate(frameTime);
}
// note if we have to target the object in the crosshairs
targetObject = KeyBindings::targetObject.IsActive();
@@ -1557,13 +1555,13 @@ void WorldView::Draw()
// normal crosshairs
if (GetCamType() == WorldView::COCKPIT_FRONT)
- DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE/2.0f, white);
+ DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE, white);
else if (GetCamType() == WorldView::CAM_FRONT)
DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE, white);
else if (GetCamType() == WorldView::COCKPIT_REAR)
DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE/2.0f, white);
else if (GetCamType() == WorldView::CAM_REAR)
- DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE, white);
+ DrawCrosshair(Gui::Screen::GetWidth()/2.0f, Gui::Screen::GetHeight()/2.0f, HUD_CROSSHAIR_SIZE/2.0f, white);
glPopAttrib();
Please sign in to comment.
Something went wrong with that request. Please try again.