diff --git a/binaries/data/config/default.cfg b/binaries/data/config/default.cfg index 2d36a1c25c..ec0510b4ce 100644 --- a/binaries/data/config/default.cfg +++ b/binaries/data/config/default.cfg @@ -434,13 +434,6 @@ enemy = "150 20 20" ; Color of enemies when diplomacy colors are e [joystick] ; EXPERIMENTAL: joystick/gamepad settings enable = false deadzone = 8192 -[joystick.camera] -pan.x = 0 -pan.y = 1 -rotate.x = 3 -rotate.y = 2 -zoom.in = 5 -zoom.out = 4 [chat] timestamp = true ; Show at which time chat messages have been sent diff --git a/source/graphics/CameraController.cpp b/source/graphics/CameraController.cpp index be3b122a7c..49ee764d4a 100644 --- a/source/graphics/CameraController.cpp +++ b/source/graphics/CameraController.cpp @@ -32,7 +32,6 @@ #include "ps/Game.h" #include "ps/Globals.h" #include "ps/Hotkey.h" -#include "ps/Joystick.h" #include "ps/Pyrogenesis.h" #include "ps/TouchInput.h" #include "ps/World.h" @@ -76,12 +75,6 @@ CCameraController::CCameraController(CCamera& camera) m_ViewFOV(DEGTORAD(45.f)), m_ViewNear(2.f), m_ViewFar(4096.f), - m_JoystickPanX(-1), - m_JoystickPanY(-1), - m_JoystickRotateX(-1), - m_JoystickRotateY(-1), - m_JoystickZoomIn(-1), - m_JoystickZoomOut(-1), m_HeightSmoothness(0.5f), m_HeightMin(16.f), @@ -126,13 +119,6 @@ void CCameraController::LoadConfig() CFG_GET_VAL("view.zoom.default", m_ViewZoomDefault); CFG_GET_VAL("view.zoom.speed.modifier", m_ViewZoomSpeedModifier); - CFG_GET_VAL("joystick.camera.pan.x", m_JoystickPanX); - CFG_GET_VAL("joystick.camera.pan.y", m_JoystickPanY); - CFG_GET_VAL("joystick.camera.rotate.x", m_JoystickRotateX); - CFG_GET_VAL("joystick.camera.rotate.y", m_JoystickRotateY); - CFG_GET_VAL("joystick.camera.zoom.in", m_JoystickZoomIn); - CFG_GET_VAL("joystick.camera.zoom.out", m_JoystickZoomOut); - CFG_GET_VAL("view.height.smoothness", m_HeightSmoothness); CFG_GET_VAL("view.height.min", m_HeightMin); @@ -217,22 +203,6 @@ void CCameraController::Update(const float deltaRealTime) if (HotkeyIsPressed("camera.down")) moveForward -= m_ViewScrollSpeed * deltaRealTime; - if (g_Joystick.IsEnabled()) - { - // This could all be improved with extra speed and sensitivity settings - // (maybe use pow to allow finer control?), and inversion settings - - moveRightward += g_Joystick.GetAxisValue(m_JoystickPanX) * m_ViewScrollSpeed * deltaRealTime; - moveForward -= g_Joystick.GetAxisValue(m_JoystickPanY) * m_ViewScrollSpeed * deltaRealTime; - - m_RotateX.AddSmoothly(g_Joystick.GetAxisValue(m_JoystickRotateX) * m_ViewRotateXSpeed * deltaRealTime); - m_RotateY.AddSmoothly(-g_Joystick.GetAxisValue(m_JoystickRotateY) * m_ViewRotateYSpeed * deltaRealTime); - - // Use a +1 bias for zoom because I want this to work with trigger buttons that default to -1 - m_Zoom.AddSmoothly((g_Joystick.GetAxisValue(m_JoystickZoomIn) + 1.0f) / 2.0f * m_ViewZoomSpeed * deltaRealTime); - m_Zoom.AddSmoothly(-(g_Joystick.GetAxisValue(m_JoystickZoomOut) + 1.0f) / 2.0f * m_ViewZoomSpeed * deltaRealTime); - } - if (moveRightward || moveForward) { // Break out of following mode when the user starts scrolling diff --git a/source/graphics/CameraController.h b/source/graphics/CameraController.h index 33b3b965c2..bc24efd822 100644 --- a/source/graphics/CameraController.h +++ b/source/graphics/CameraController.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -106,12 +106,6 @@ private: float m_ViewFOV; float m_ViewNear; float m_ViewFar; - int m_JoystickPanX; - int m_JoystickPanY; - int m_JoystickRotateX; - int m_JoystickRotateY; - int m_JoystickZoomIn; - int m_JoystickZoomOut; float m_HeightSmoothness; float m_HeightMin; diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index 860370d55e..59137c9965 100644 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -47,7 +47,6 @@ #include "ps/Game.h" #include "ps/Globals.h" #include "ps/Hotkey.h" -#include "ps/Joystick.h" #include "ps/Loader.h" #include "ps/LoaderThunks.h" #include "ps/Profile.h"