summaryrefslogtreecommitdiff
path: root/platform/iphone
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone')
-rw-r--r--platform/iphone/display_server_iphone.mm2
-rw-r--r--platform/iphone/export/export_plugin.cpp5
-rw-r--r--platform/iphone/joypad_iphone.mm44
-rw-r--r--platform/iphone/keyboard_input_view.mm8
4 files changed, 30 insertions, 29 deletions
diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm
index 7d13a08d39..b746c60d4e 100644
--- a/platform/iphone/display_server_iphone.mm
+++ b/platform/iphone/display_server_iphone.mm
@@ -261,7 +261,7 @@ void DisplayServerIPhone::key(Key p_key, bool p_pressed) {
ev->set_pressed(p_pressed);
ev->set_keycode(p_key);
ev->set_physical_keycode(p_key);
- ev->set_unicode(p_key);
+ ev->set_unicode((char32_t)p_key);
perform_event(ev);
};
diff --git a/platform/iphone/export/export_plugin.cpp b/platform/iphone/export/export_plugin.cpp
index 7450215cfb..0abd255c7c 100644
--- a/platform/iphone/export/export_plugin.cpp
+++ b/platform/iphone/export/export_plugin.cpp
@@ -728,10 +728,10 @@ Error EditorExportPlatformIOS::_export_loading_screen_images(const Ref<EditorExp
Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata) {
Vector<String> dirs;
- String path;
String current_dir = p_da->get_current_dir();
p_da->list_dir_begin();
- while ((path = p_da->get_next()).length() != 0) {
+ String path = p_da->get_next();
+ while (!path.is_empty()) {
if (p_da->current_is_dir()) {
if (path != "." && path != "..") {
dirs.push_back(path);
@@ -743,6 +743,7 @@ Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler
return err;
}
}
+ path = p_da->get_next();
}
p_da->list_dir_end();
diff --git a/platform/iphone/joypad_iphone.mm b/platform/iphone/joypad_iphone.mm
index 45842b38aa..1bf5462d91 100644
--- a/platform/iphone/joypad_iphone.mm
+++ b/platform/iphone/joypad_iphone.mm
@@ -259,31 +259,31 @@ void JoypadIPhone::start_processing() {
int joy_id = [self getJoyIdForController:controller];
if (element == gamepad.buttonA) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_A,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::A,
gamepad.buttonA.isPressed);
} else if (element == gamepad.buttonB) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_B,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::B,
gamepad.buttonB.isPressed);
} else if (element == gamepad.buttonX) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_X,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::X,
gamepad.buttonX.isPressed);
} else if (element == gamepad.buttonY) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_Y,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::Y,
gamepad.buttonY.isPressed);
} else if (element == gamepad.leftShoulder) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_LEFT_SHOULDER,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::LEFT_SHOULDER,
gamepad.leftShoulder.isPressed);
} else if (element == gamepad.rightShoulder) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_RIGHT_SHOULDER,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::RIGHT_SHOULDER,
gamepad.rightShoulder.isPressed);
} else if (element == gamepad.dpad) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_UP,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_UP,
gamepad.dpad.up.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_DOWN,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_DOWN,
gamepad.dpad.down.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_LEFT,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_LEFT,
gamepad.dpad.left.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_RIGHT,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_RIGHT,
gamepad.dpad.right.isPressed);
};
@@ -291,20 +291,20 @@ void JoypadIPhone::start_processing() {
jx.min = -1;
if (element == gamepad.leftThumbstick) {
jx.value = gamepad.leftThumbstick.xAxis.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_LEFT_X, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::LEFT_X, jx);
jx.value = -gamepad.leftThumbstick.yAxis.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_LEFT_Y, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::LEFT_Y, jx);
} else if (element == gamepad.rightThumbstick) {
jx.value = gamepad.rightThumbstick.xAxis.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_RIGHT_X, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::RIGHT_X, jx);
jx.value = -gamepad.rightThumbstick.yAxis.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_RIGHT_Y, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::RIGHT_Y, jx);
} else if (element == gamepad.leftTrigger) {
jx.value = gamepad.leftTrigger.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_TRIGGER_LEFT, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::TRIGGER_LEFT, jx);
} else if (element == gamepad.rightTrigger) {
jx.value = gamepad.rightTrigger.value;
- Input::get_singleton()->joy_axis(joy_id, JOY_AXIS_TRIGGER_RIGHT, jx);
+ Input::get_singleton()->joy_axis(joy_id, JoyAxis::TRIGGER_RIGHT, jx);
};
};
} else if (controller.microGamepad != nil) {
@@ -319,18 +319,18 @@ void JoypadIPhone::start_processing() {
int joy_id = [self getJoyIdForController:controller];
if (element == gamepad.buttonA) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_A,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::A,
gamepad.buttonA.isPressed);
} else if (element == gamepad.buttonX) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_X,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::X,
gamepad.buttonX.isPressed);
} else if (element == gamepad.dpad) {
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_UP,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_UP,
gamepad.dpad.up.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_DOWN,
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_DOWN,
gamepad.dpad.down.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_LEFT, gamepad.dpad.left.isPressed);
- Input::get_singleton()->joy_button(joy_id, JOY_BUTTON_DPAD_RIGHT, gamepad.dpad.right.isPressed);
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_LEFT, gamepad.dpad.left.isPressed);
+ Input::get_singleton()->joy_button(joy_id, JoyButton::DPAD_RIGHT, gamepad.dpad.right.isPressed);
};
};
}
diff --git a/platform/iphone/keyboard_input_view.mm b/platform/iphone/keyboard_input_view.mm
index e2bd0acff4..b11d04181e 100644
--- a/platform/iphone/keyboard_input_view.mm
+++ b/platform/iphone/keyboard_input_view.mm
@@ -115,8 +115,8 @@
- (void)deleteText:(NSInteger)charactersToDelete {
for (int i = 0; i < charactersToDelete; i++) {
- DisplayServerIPhone::get_singleton()->key(KEY_BACKSPACE, true);
- DisplayServerIPhone::get_singleton()->key(KEY_BACKSPACE, false);
+ DisplayServerIPhone::get_singleton()->key(Key::BACKSPACE, true);
+ DisplayServerIPhone::get_singleton()->key(Key::BACKSPACE, false);
}
}
@@ -129,10 +129,10 @@
switch (character) {
case 10:
- character = KEY_ENTER;
+ character = (int)Key::ENTER;
break;
case 8198:
- character = KEY_SPACE;
+ character = (int)Key::SPACE;
break;
default:
break;