summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rwxr-xr-xmisc/scripts/fix_style.sh60
-rw-r--r--platform/iphone/camera_ios.h6
-rw-r--r--platform/iphone/camera_ios.mm6
-rw-r--r--platform/javascript/http_client.h.inc2
-rw-r--r--platform/osx/camera_osx.h6
-rw-r--r--platform/osx/camera_osx.mm6
-rw-r--r--platform/windows/camera_win.cpp6
-rw-r--r--platform/windows/camera_win.h6
-rw-r--r--platform/x11/godot_x11.cpp7
-rw-r--r--scene/gui/option_button.cpp21
-rw-r--r--scene/resources/default_theme/font_hidpi.inc2
-rw-r--r--scene/resources/default_theme/font_lodpi.inc2
-rw-r--r--servers/camera/camera_feed.cpp6
-rw-r--r--servers/camera/camera_feed.h6
-rw-r--r--servers/camera_server.cpp6
-rw-r--r--servers/camera_server.h8
17 files changed, 105 insertions, 53 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 7456c5d016..1610e5d3d7 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2056,6 +2056,8 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra
se->goto_line(p_line - 1);
}
}
+ _update_script_names();
+ script_list->ensure_current_is_visible();
return true;
}
}
diff --git a/misc/scripts/fix_style.sh b/misc/scripts/fix_style.sh
new file mode 100755
index 0000000000..7a335c21ea
--- /dev/null
+++ b/misc/scripts/fix_style.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Command line arguments
+run_clang_format=false
+run_fix_headers=false
+usage="Invalid argument. Usage:\n$0 <option>\n\t--clang-format|-c\n\t--headers|-h\n\t--all|-a"
+
+if [ -z "$1" ]; then
+ echo -e $usage
+ exit 0
+fi
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --clang-format|-c)
+ run_clang_format=true
+ ;;
+ --headers|-h)
+ run_fix_headers=true
+ ;;
+ --all|-a)
+ run_clang_format=true
+ run_fix_headers=true
+ ;;
+ *)
+ echo -e $usage
+ exit 0
+ esac
+ shift
+done
+
+echo "Removing generated files, some have binary data and make clang-format freeze."
+find -name "*.gen.*" -delete
+
+# Apply clang-format
+if $run_clang_format; then
+ # Sync list with pre-commit hook
+ FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m .mm .inc .java .glsl"
+
+ for extension in ${FILE_EXTS}; do
+ echo -e "Formatting ${extension} files..."
+ find \( -path "./.git" \
+ -o -path "./thirdparty" \
+ -o -path "./platform/android/java/src/com" \
+ \) -prune \
+ -o -name "*${extension}" \
+ -exec clang-format -i {} \;
+ done
+fi
+
+# Add missing copyright headers
+if $run_fix_headers; then
+ echo "Fixing copyright headers in Godot code files..."
+ find \( -path "./.git" -o -path "./thirdparty" \) -prune \
+ -o -regex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|m\|mm\|java\)' \
+ > tmp-files
+ cat tmp-files | grep -v ".git\|thirdparty\|theme_data.h\|platform/android/java/src/com\|platform/android/java/src/org/godotengine/godot/input/InputManager" > files
+ python misc/scripts/fix_headers.py
+ rm -f tmp-files files
+fi
diff --git a/platform/iphone/camera_ios.h b/platform/iphone/camera_ios.h
index e5d62af65d..cf747283e1 100644
--- a/platform/iphone/camera_ios.h
+++ b/platform/iphone/camera_ios.h
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/iphone/camera_ios.mm b/platform/iphone/camera_ios.mm
index 3994e9366a..4c11701fdd 100644
--- a/platform/iphone/camera_ios.mm
+++ b/platform/iphone/camera_ios.mm
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/javascript/http_client.h.inc b/platform/javascript/http_client.h.inc
index d707d623ab..c034069ab2 100644
--- a/platform/javascript/http_client.h.inc
+++ b/platform/javascript/http_client.h.inc
@@ -3,7 +3,7 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
diff --git a/platform/osx/camera_osx.h b/platform/osx/camera_osx.h
index ed7a1f0a73..80ca3759ba 100644
--- a/platform/osx/camera_osx.h
+++ b/platform/osx/camera_osx.h
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/osx/camera_osx.mm b/platform/osx/camera_osx.mm
index 34486c58b1..f13cf76beb 100644
--- a/platform/osx/camera_osx.mm
+++ b/platform/osx/camera_osx.mm
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/camera_win.cpp b/platform/windows/camera_win.cpp
index 6eff2749f2..b97796fe89 100644
--- a/platform/windows/camera_win.cpp
+++ b/platform/windows/camera_win.cpp
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/windows/camera_win.h b/platform/windows/camera_win.h
index 61d22ac6b1..22ce9aa43f 100644
--- a/platform/windows/camera_win.h
+++ b/platform/windows/camera_win.h
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 79407cd9dc..9baa4d6dca 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -55,8 +55,11 @@ int main(int argc, char *argv[]) {
os.run(); // it is actually the OS that decides how to run
Main::cleanup();
- if (ret)
- chdir(cwd);
+ if (ret) { // Previous getcwd was successful
+ if (chdir(cwd) != 0) {
+ ERR_PRINT("Couldn't return to previous working directory.");
+ }
+ }
free(cwd);
return os.get_exit_code();
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index 7027fceb84..872402e9e1 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -86,24 +86,7 @@ void OptionButton::_focused(int p_which) {
void OptionButton::_selected(int p_which) {
- int selid = -1;
- for (int i = 0; i < popup->get_item_count(); i++) {
-
- bool is_clicked = popup->get_item_id(i) == p_which;
- if (is_clicked) {
- selid = i;
- break;
- }
- }
-
- if (selid == -1 && p_which >= 0 && p_which < popup->get_item_count()) {
- _select(p_which, true);
- } else {
-
- ERR_FAIL_COND(selid == -1);
-
- _select(selid, true);
- }
+ _select(p_which, true);
}
void OptionButton::pressed() {
@@ -355,7 +338,7 @@ OptionButton::OptionButton() {
popup->set_pass_on_modal_close_click(false);
popup->set_notify_transform(true);
popup->set_allow_search(true);
- popup->connect("id_pressed", this, "_selected");
+ popup->connect("index_pressed", this, "_selected");
popup->connect("id_focused", this, "_focused");
popup->connect("popup_hide", this, "set_pressed", varray(false));
}
diff --git a/scene/resources/default_theme/font_hidpi.inc b/scene/resources/default_theme/font_hidpi.inc
index 2fc0f56c3f..4860149e6b 100644
--- a/scene/resources/default_theme/font_hidpi.inc
+++ b/scene/resources/default_theme/font_hidpi.inc
@@ -1,3 +1,4 @@
+/* clang-format off */
static const int _hidpi_font_height=25;
static const int _hidpi_font_ascent=19;
static const int _hidpi_font_charcount=191;
@@ -25459,3 +25460,4 @@ static const unsigned char _hidpi_font_img_data[25255]={
96,
130,
};
+/* clang-format on */
diff --git a/scene/resources/default_theme/font_lodpi.inc b/scene/resources/default_theme/font_lodpi.inc
index 8eae45a8a7..959e2c1d7b 100644
--- a/scene/resources/default_theme/font_lodpi.inc
+++ b/scene/resources/default_theme/font_lodpi.inc
@@ -1,3 +1,4 @@
+/* clang-format off */
static const int _lodpi_font_height=14;
static const int _lodpi_font_ascent=11;
static const int _lodpi_font_charcount=191;
@@ -13113,3 +13114,4 @@ static const unsigned char _lodpi_font_img_data[12909]={
96,
130,
};
+/* clang-format on */
diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp
index b96e9b749f..31b8b2874f 100644
--- a/servers/camera/camera_feed.cpp
+++ b/servers/camera/camera_feed.cpp
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h
index aa8a78b2f6..90c076071c 100644
--- a/servers/camera/camera_feed.h
+++ b/servers/camera/camera_feed.h
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp
index f52d3decae..8d2ae37001 100644
--- a/servers/camera_server.cpp
+++ b/servers/camera_server.cpp
@@ -3,10 +3,10 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/camera_server.h b/servers/camera_server.h
index c7716a3cff..d204142c7d 100644
--- a/servers/camera_server.h
+++ b/servers/camera_server.h
@@ -1,12 +1,12 @@
/*************************************************************************/
-/* camera_server.h */
+/* camera_server.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */