summaryrefslogtreecommitdiff
path: root/platform/uwp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-08 17:05:51 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-08 17:06:33 -0300
commit547a57777b199f451305a6d4b6ad63fb0b2bd3ed (patch)
tree9fb9ce5851ea3ccc39c6ebce607ceeca771fd991 /platform/uwp
parent6323779596dea0db7f58afef7d3d3d5588ef20cb (diff)
renamed joystick to joypad everywhere around source code!
Diffstat (limited to 'platform/uwp')
-rw-r--r--platform/uwp/joystick_uwp.cpp24
-rw-r--r--platform/uwp/joystick_uwp.h12
-rw-r--r--platform/uwp/os_uwp.cpp8
-rw-r--r--platform/uwp/os_uwp.h6
4 files changed, 25 insertions, 25 deletions
diff --git a/platform/uwp/joystick_uwp.cpp b/platform/uwp/joystick_uwp.cpp
index 8ed6473c37..e26b81bb6d 100644
--- a/platform/uwp/joystick_uwp.cpp
+++ b/platform/uwp/joystick_uwp.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* joystick_uwp.cpp */
+/* joypad_uwp.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,20 +27,20 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "joystick_uwp.h"
+#include "joypad_uwp.h"
using namespace Windows::Gaming::Input;
using namespace Windows::Foundation;
-void JoystickUWP::register_events() {
+void JoypadUWP::register_events() {
Gamepad::GamepadAdded +=
- ref new EventHandler<Gamepad^>(this, &JoystickUWP::OnGamepadAdded);
+ ref new EventHandler<Gamepad^>(this, &JoypadUWP::OnGamepadAdded);
Gamepad::GamepadRemoved +=
- ref new EventHandler<Gamepad^>(this, &JoystickUWP::OnGamepadRemoved);
+ ref new EventHandler<Gamepad^>(this, &JoypadUWP::OnGamepadRemoved);
}
-uint32_t JoystickUWP::process_controllers(uint32_t p_last_id) {
+uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) {
for (int i = 0; i < MAX_CONTROLLERS; i++) {
@@ -74,20 +74,20 @@ uint32_t JoystickUWP::process_controllers(uint32_t p_last_id) {
return p_last_id;
}
-JoystickUWP::JoystickUWP() {
+JoypadUWP::JoypadUWP() {
for (int i = 0; i < MAX_CONTROLLERS; i++)
controllers[i].id = i;
}
-JoystickUWP::JoystickUWP(InputDefault * p_input) {
+JoypadUWP::JoypadUWP(InputDefault * p_input) {
input = p_input;
- JoystickUWP();
+ JoypadUWP();
}
-void JoystickUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
+void JoypadUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
short idx = -1;
@@ -109,7 +109,7 @@ void JoystickUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Inp
input->joy_connection_changed(controllers[idx].id, true, "Xbox Controller", "__UWP_GAMEPAD__");
}
-void JoystickUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
+void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) {
short idx = -1;
@@ -136,7 +136,7 @@ void JoystickUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::I
input->joy_connection_changed(idx, false, "Xbox Controller");
}
-InputDefault::JoyAxis JoystickUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const {
+InputDefault::JoyAxis JoypadUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const {
InputDefault::JoyAxis jx;
diff --git a/platform/uwp/joystick_uwp.h b/platform/uwp/joystick_uwp.h
index f854f0b471..7e15e5ddb1 100644
--- a/platform/uwp/joystick_uwp.h
+++ b/platform/uwp/joystick_uwp.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* joystick_uwp.h */
+/* joypad_uwp.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -26,20 +26,20 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef JOYSTICK_UWP_H
-#define JOYSTICK_UWP_H
+#ifndef JOYPAD_UWP_H
+#define JOYPAD_UWP_H
#include "main/input_default.h"
-ref class JoystickUWP sealed {
+ref class JoypadUWP sealed {
internal:
void register_events();
uint32_t process_controllers(uint32_t p_last_id);
- JoystickUWP();
- JoystickUWP(InputDefault* p_input);
+ JoypadUWP();
+ JoypadUWP(InputDefault* p_input);
private:
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 387cfe579f..34977bc048 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -285,8 +285,8 @@ void OSUWP::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio
input = memnew( InputDefault );
- joystick = ref new JoystickUWP(input);
- joystick->register_events();
+ joypad = ref new JoypadUWP(input);
+ joypad->register_events();
AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton();
@@ -429,7 +429,7 @@ void OSUWP::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
- joystick = nullptr;
+ joypad = nullptr;
}
void OSUWP::finalize_core() {
@@ -725,7 +725,7 @@ uint64_t OSUWP::get_ticks_usec() const {
void OSUWP::process_events() {
- last_id = joystick->process_controllers(last_id);
+ last_id = joypad->process_controllers(last_id);
process_key_events();
}
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index c50d34aca2..82376dd2f6 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -55,7 +55,7 @@
#include <stdio.h>
#include "main/input_default.h"
-#include "joystick_uwp.h"
+#include "joypad_uwp.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
@@ -85,7 +85,7 @@ public:
private:
enum {
- JOYSTICKS_MAX = 8,
+ JOYPADS_MAX = 8,
JOY_AXIS_COUNT = 6,
MAX_JOY_AXIS = 32768, // I've no idea
KEY_EVENT_BUFFER_SIZE=512
@@ -137,7 +137,7 @@ private:
InputDefault *input;
- JoystickUWP^ joystick;
+ JoypadUWP^ joypad;
Windows::System::Display::DisplayRequest^ display_request;