summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp3
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/Godot.java3
-rw-r--r--platform/iphone/export/export.cpp9
-rw-r--r--platform/iphone/godot_iphone.cpp3
-rw-r--r--platform/linuxbsd/detect_prime_x11.cpp3
-rw-r--r--platform/linuxbsd/display_server_x11.cpp12
-rw-r--r--platform/linuxbsd/joypad_linux.cpp3
-rw-r--r--platform/osx/display_server_osx.mm6
-rw-r--r--platform/osx/joypad_osx.cpp9
-rw-r--r--platform/uwp/export/export.cpp39
-rw-r--r--platform/uwp/joypad_uwp.cpp3
-rw-r--r--platform/uwp/os_uwp.cpp6
-rw-r--r--platform/windows/display_server_windows.cpp12
-rw-r--r--platform/windows/joypad_windows.cpp6
14 files changed, 78 insertions, 39 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index d4fc52eaa9..f346ca54d2 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -372,7 +372,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
d.name = vendor + " " + device;
- if (device == String()) continue;
+ if (device == String())
+ continue;
}
ndevices.push_back(d);
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java
index 957f6223a9..ffe5402a54 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java
@@ -920,7 +920,8 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe
int cnt = 0;
for (int i = cc.length; --i >= 0; cnt += cc[i] != 0 ? 1 : 0)
;
- if (cnt == 0) return super.onKeyMultiple(inKeyCode, repeatCount, event);
+ if (cnt == 0)
+ return super.onKeyMultiple(inKeyCode, repeatCount, event);
mRenderView.queueOnRenderThread(new Runnable() {
// This method will be called on the rendering thread:
public void run() {
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 3efe338ac7..2222a7f552 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -423,7 +423,8 @@ String EditorExportPlatformIOS::_get_linker_flags() {
String result;
for (int i = 0; i < export_plugins.size(); ++i) {
String flags = export_plugins[i]->get_ios_linker_flags();
- if (flags.length() == 0) continue;
+ if (flags.length() == 0)
+ continue;
if (result.length() > 0) {
result += ' ';
}
@@ -456,8 +457,10 @@ void EditorExportPlatformIOS::_blend_and_rotate(Ref<Image> &p_dst, Ref<Image> &p
int xs = (x_pos >= 0) ? 0 : -x_pos;
int ys = (y_pos >= 0) ? 0 : -y_pos;
- if (sw + x_pos > p_dst->get_width()) sw = p_dst->get_width() - x_pos;
- if (sh + y_pos > p_dst->get_height()) sh = p_dst->get_height() - y_pos;
+ if (sw + x_pos > p_dst->get_width())
+ sw = p_dst->get_width() - x_pos;
+ if (sh + y_pos > p_dst->get_height())
+ sh = p_dst->get_height() - y_pos;
for (int y = ys; y < sh; y++) {
for (int x = xs; x < sw; x++) {
diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp
index 3e67362e16..cea0e5c7f0 100644
--- a/platform/iphone/godot_iphone.cpp
+++ b/platform/iphone/godot_iphone.cpp
@@ -50,7 +50,8 @@ int iphone_main(int width, int height, int argc, char **argv, String data_dir) {
size_t len = strlen(argv[0]);
while (len--) {
- if (argv[0][len] == '/') break;
+ if (argv[0][len] == '/')
+ break;
}
if (len >= 0) {
diff --git a/platform/linuxbsd/detect_prime_x11.cpp b/platform/linuxbsd/detect_prime_x11.cpp
index 1bec65ff04..1e46d3222d 100644
--- a/platform/linuxbsd/detect_prime_x11.cpp
+++ b/platform/linuxbsd/detect_prime_x11.cpp
@@ -178,7 +178,8 @@ int detect_prime() {
close(fdset[0]);
- if (i) setenv("DRI_PRIME", "1", 1);
+ if (i)
+ setenv("DRI_PRIME", "1", 1);
create_context();
const char *vendor = (const char *)glGetString(GL_VENDOR);
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index dd9298d667..f016892453 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -551,7 +551,8 @@ int DisplayServerX11::get_screen_count() const {
// Using Xinerama Extension
int event_base, error_base;
const Bool ext_okay = XineramaQueryExtension(x11_display, &event_base, &error_base);
- if (!ext_okay) return 0;
+ if (!ext_okay)
+ return 0;
int count;
XineramaScreenInfo *xsi = XineramaQueryScreens(x11_display, &count);
@@ -600,11 +601,13 @@ Rect2i DisplayServerX11::screen_get_usable_rect(int p_screen) const {
// Using Xinerama Extension
int event_base, error_base;
const Bool ext_okay = XineramaQueryExtension(x11_display, &event_base, &error_base);
- if (!ext_okay) return Rect2i(0, 0, 0, 0);
+ if (!ext_okay)
+ return Rect2i(0, 0, 0, 0);
int count;
XineramaScreenInfo *xsi = XineramaQueryScreens(x11_display, &count);
- if (p_screen >= count) return Rect2i(0, 0, 0, 0);
+ if (p_screen >= count)
+ return Rect2i(0, 0, 0, 0);
Rect2i rect = Rect2i(xsi[p_screen].x_org, xsi[p_screen].y_org, xsi[p_screen].width, xsi[p_screen].height);
XFree(xsi);
@@ -827,7 +830,8 @@ void DisplayServerX11::window_set_current_screen(int p_screen, WindowID p_window
WindowData &wd = windows[p_window];
int count = get_screen_count();
- if (p_screen >= count) return;
+ if (p_screen >= count)
+ return;
if (window_get_mode(p_window) == WINDOW_MODE_FULLSCREEN) {
Point2i position = screen_get_position(p_screen);
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index 5ceea788e0..f57f74907f 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -463,7 +463,8 @@ void JoypadLinux::process_joypads() {
}
for (int i = 0; i < JOYPADS_MAX; i++) {
- if (joypads[i].fd == -1) continue;
+ if (joypads[i].fd == -1)
+ continue;
input_event events[32];
Joypad *joy = &joypads[i];
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index 9d92992332..5dc14bc33f 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -1656,7 +1656,8 @@ String DisplayServerOSX::global_menu_get_item_submenu(const String &p_menu_root,
const NSMenu *sub_menu = [menu_item submenu];
if (sub_menu) {
for (Map<String, NSMenu *>::Element *E = submenu.front(); E; E = E->next()) {
- if (E->get() == sub_menu) return E->key();
+ if (E->get() == sub_menu)
+ return E->key();
}
}
}
@@ -2479,7 +2480,8 @@ void DisplayServerOSX::_set_window_per_pixel_transparency_enabled(bool p_enabled
ERR_FAIL_COND(!windows.has(p_window));
WindowData &wd = windows[p_window];
- if (!OS_OSX::get_singleton()->is_layered_allowed()) return;
+ if (!OS_OSX::get_singleton()->is_layered_allowed())
+ return;
if (wd.layered_window != p_enabled) {
if (p_enabled) {
[wd.window_object setBackgroundColor:[NSColor clearColor]];
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index 7f5ec05967..0f50ba63c6 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -374,7 +374,8 @@ bool joypad::check_ff_features() {
if (ret == FF_OK && (features.supportedEffects & FFCAP_ET_CONSTANTFORCE)) {
uint32_t val;
ret = FFDeviceGetForceFeedbackProperty(ff_device, FFPROP_FFGAIN, &val, sizeof(val));
- if (ret != FF_OK) return false;
+ if (ret != FF_OK)
+ return false;
int num_axes = features.numFfAxes;
ff_axes = (DWORD *)memalloc(sizeof(DWORD) * num_axes);
ff_directions = (LONG *)memalloc(sizeof(LONG) * num_axes);
@@ -509,14 +510,16 @@ void JoypadOSX::joypad_vibration_stop(int p_id, uint64_t p_timestamp) {
int JoypadOSX::get_joy_index(int p_id) const {
for (int i = 0; i < device_list.size(); i++) {
- if (device_list[i].id == p_id) return i;
+ if (device_list[i].id == p_id)
+ return i;
}
return -1;
}
int JoypadOSX::get_joy_ref(IOHIDDeviceRef p_device) const {
for (int i = 0; i < device_list.size(); i++) {
- if (device_list[i].device_ref == p_device) return i;
+ if (device_list[i].device_ref == p_device)
+ return i;
}
return -1;
}
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index 06bf738dc1..f6618bfb47 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -265,7 +265,8 @@ void AppxPackager::make_content_types(const String &p_path) {
String ext = file_metadata[i].name.get_extension();
- if (types.has(ext)) continue;
+ if (types.has(ext))
+ continue;
types[ext] = content_type(ext);
@@ -664,8 +665,10 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
bool _valid_resource_name(const String &p_name) const {
- if (p_name.empty()) return false;
- if (p_name.ends_with(".")) return false;
+ if (p_name.empty())
+ return false;
+ if (p_name.ends_with("."))
+ return false;
static const char *invalid_names[] = {
"CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7",
@@ -675,7 +678,8 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
const char **t = invalid_names;
while (*t) {
- if (p_name == *t) return false;
+ if (p_name == *t)
+ return false;
t++;
}
@@ -686,19 +690,25 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
Vector<String> parts = p_guid.split("-");
- if (parts.size() != 5) return false;
- if (parts[0].length() != 8) return false;
+ if (parts.size() != 5)
+ return false;
+ if (parts[0].length() != 8)
+ return false;
for (int i = 1; i < 4; i++)
- if (parts[i].length() != 4) return false;
- if (parts[4].length() != 12) return false;
+ if (parts[i].length() != 4)
+ return false;
+ if (parts[4].length() != 12)
+ return false;
return true;
}
bool _valid_bgcolor(const String &p_color) const {
- if (p_color.empty()) return true;
- if (p_color.begins_with("#") && p_color.is_valid_html_color()) return true;
+ if (p_color.empty())
+ return true;
+ if (p_color.begins_with("#") && p_color.is_valid_html_color())
+ return true;
// Colors from https://msdn.microsoft.com/en-us/library/windows/apps/dn934817.aspx
static const char *valid_colors[] = {
@@ -732,7 +742,8 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
const char **color = valid_colors;
while (*color) {
- if (p_color == *color) return true;
+ if (p_color == *color)
+ return true;
color++;
}
@@ -896,7 +907,8 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
ERR_PRINT("Unable to load logo");
}
- if (!image) return data;
+ if (!image)
+ return data;
String tmp_path = EditorSettings::get_singleton()->get_cache_dir().plus_file("uwp_tmp_logo.png");
@@ -1301,7 +1313,8 @@ public:
path = path.replace(".scale-100", "");
data = _get_image_data(p_preset, path);
- if (data.size() > 0) do_read = false;
+ if (data.size() > 0)
+ do_read = false;
}
//read
diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp
index 90df6fe5d7..93a9992706 100644
--- a/platform/uwp/joypad_uwp.cpp
+++ b/platform/uwp/joypad_uwp.cpp
@@ -48,7 +48,8 @@ void JoypadUWP::process_controllers() {
ControllerDevice &joy = controllers[i];
- if (!joy.connected) break;
+ if (!joy.connected)
+ break;
switch (joy.type) {
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index f5e989b370..1c83ebfdf7 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -123,7 +123,8 @@ bool OS_UWP::is_window_fullscreen() const {
void OS_UWP::set_keep_screen_on(bool p_enabled) {
- if (is_keep_screen_on() == p_enabled) return;
+ if (is_keep_screen_on() == p_enabled)
+ return;
if (p_enabled)
display_request->RequestActive();
@@ -826,7 +827,8 @@ void OS_UWP::run() {
while (!force_quit) {
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
- if (managed_object->alert_close_handle) continue;
+ if (managed_object->alert_close_handle)
+ continue;
process_events(); // get rid of pending events
if (Main::iteration())
break;
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 701cf69207..5063a0929a 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -677,7 +677,8 @@ void DisplayServerWindows::window_set_position(const Point2i &p_position, Window
ERR_FAIL_COND(!windows.has(p_window));
WindowData &wd = windows[p_window];
- if (wd.fullscreen) return;
+ if (wd.fullscreen)
+ return;
#if 0
//wrong needs to account properly for decorations
RECT r;
@@ -1474,19 +1475,22 @@ DisplayServer::LatinKeyboardVariant DisplayServerWindows::get_latin_keyboard_var
int i = 0;
while (azerty[i] != 0) {
- if (azerty[i] == hex) return LATIN_KEYBOARD_AZERTY;
+ if (azerty[i] == hex)
+ return LATIN_KEYBOARD_AZERTY;
i++;
}
i = 0;
while (qwertz[i] != 0) {
- if (qwertz[i] == hex) return LATIN_KEYBOARD_QWERTZ;
+ if (qwertz[i] == hex)
+ return LATIN_KEYBOARD_QWERTZ;
i++;
}
i = 0;
while (dvorak[i] != 0) {
- if (dvorak[i] == hex) return LATIN_KEYBOARD_DVORAK;
+ if (dvorak[i] == hex)
+ return LATIN_KEYBOARD_DVORAK;
i++;
}
diff --git a/platform/windows/joypad_windows.cpp b/platform/windows/joypad_windows.cpp
index 2adf2a8652..8fdc92a79c 100644
--- a/platform/windows/joypad_windows.cpp
+++ b/platform/windows/joypad_windows.cpp
@@ -112,7 +112,8 @@ bool JoypadWindows::is_xinput_device(const GUID *p_guid) {
return false;
}
dev_list = (PRAWINPUTDEVICELIST)malloc(sizeof(RAWINPUTDEVICELIST) * dev_list_count);
- if (!dev_list) return false;
+ if (!dev_list)
+ return false;
if (GetRawInputDeviceList(dev_list, &dev_list_count, sizeof(RAWINPUTDEVICELIST)) == (UINT)-1) {
free(dev_list);
@@ -267,7 +268,8 @@ void JoypadWindows::close_joypad(int id) {
return;
}
- if (!d_joypads[id].attached) return;
+ if (!d_joypads[id].attached)
+ return;
d_joypads[id].di_joy->Unacquire();
d_joypads[id].di_joy->Release();