diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/html/editor.html | 39 | ||||
-rw-r--r-- | misc/dist/html/full-size.html | 6 | ||||
-rw-r--r-- | misc/dist/html/manifest.json | 2 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | misc/dist/shell/_godot.zsh-completion | 1 | ||||
-rw-r--r-- | misc/dist/shell/godot.bash-completion | 6 | ||||
-rw-r--r-- | misc/dist/shell/godot.fish | 8 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-clang-format | 4 | ||||
-rwxr-xr-x | misc/scripts/codespell.sh | 2 | ||||
-rwxr-xr-x | misc/scripts/header_guards.sh | 17 | ||||
-rw-r--r-- | misc/scripts/mypy.ini | 11 | ||||
-rwxr-xr-x | misc/scripts/mypy_check.sh | 6 |
12 files changed, 73 insertions, 30 deletions
diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 7c44dd45a1..c9f3c2cc0d 100644 --- a/misc/dist/html/editor.html +++ b/misc/dist/html/editor.html @@ -259,31 +259,20 @@ >Web editor documentation</a> for usage instructions and limitations. </p> </div> - <div id="welcome-modal-description-no-cross-origin-isolation" style="display: none"> + <div id="welcome-modal-missing-description" style="display: none"> <p> - The web server does not support cross-origin isolation, - which is required for the Godot Web Editor to function. - </p> - <p> - <strong>Reasons for cross-origin isolation being disabled:</strong> - <ul> - <li id="welcome-modal-reason-not-secure"> - This page is not served from a secure context (HTTPS <i>or</i> localhost). - </li> - <li> - This page may not be served with cross-origin isolation headers - (check with the developer tools' Network tab). - </li> + <strong>The following features required by the Godot Web Editor are missing:</strong> + <ul id="welcome-modal-missing-list"> </ul> </p> <p> If you are self-hosting the web editor, refer to <a - href="https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_web.html#threads" + href="https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_web.html" target="_blank" rel="noopener" - >Exporting for the Web - Threads</a> for more information. + >Exporting for the Web</a> for more information. </p> </div> <div style="text-align: center"> @@ -394,16 +383,22 @@ }); } - if (!crossOriginIsolated) { + const missing = Engine.getMissingFeatures(); + if (missing.length) { // Display error dialog as threading support is required for the editor. setButtonEnabled('startButton', false); document.getElementById("welcome-modal-description").style.display = "none"; - document.getElementById("welcome-modal-description-no-cross-origin-isolation").style.display = "block"; + document.getElementById("welcome-modal-missing-description").style.display = "block"; document.getElementById("welcome-modal-dismiss").style.display = "none"; - document.getElementById("welcome-modal-reason-not-secure").style.display = window.isSecureContext ? "none" : "list-item"; + const list = document.getElementById("welcome-modal-missing-list"); + for (let i = 0; i < missing.length; i++) { + const node = document.createElement("li"); + node.innerText = missing[i]; + list.appendChild(node); + } } - if (!crossOriginIsolated || localStorage.getItem("welcomeModalDismissed") !== 'true') { + if (missing.length || localStorage.getItem("welcomeModalDismissed") !== 'true') { document.getElementById("welcome-modal").style.display = "block"; document.getElementById("welcome-modal-dismiss").focus(); } @@ -416,7 +411,7 @@ } } //]]></script> - <script src="godot.tools.js"></script> + <script src="godot.editor.js"></script> <script>//<![CDATA[ var editor = null; @@ -711,7 +706,7 @@ displayFailureNotice('WebGL not available'); } else { setStatusMode('indeterminate'); - editor.init('godot.tools').then(function() { + editor.init('godot.editor').then(function() { if (zip) { editor.copyToFS("/tmp/preload.zip", zip); } diff --git a/misc/dist/html/full-size.html b/misc/dist/html/full-size.html index f385b82f1d..d5b0050cfd 100644 --- a/misc/dist/html/full-size.html +++ b/misc/dist/html/full-size.html @@ -215,8 +215,10 @@ $GODOT_HEAD_INCLUDE initializing = false; }; - if (!Engine.isWebGLAvailable()) { - displayFailureNotice('WebGL not available'); + const missing = Engine.getMissingFeatures(); + if (missing.length !== 0) { + const missingMsg = 'Warning!\nThe following features required to run Godot projects on the Web are missing:\n'; + displayFailureNotice(missingMsg + missing.join("\n")); } else { setStatusMode('indeterminate'); engine.startGame({ diff --git a/misc/dist/html/manifest.json b/misc/dist/html/manifest.json index ccfb793b20..75af81cda1 100644 --- a/misc/dist/html/manifest.json +++ b/misc/dist/html/manifest.json @@ -3,7 +3,7 @@ "short_name": "Godot", "description": "Multi-platform 2D and 3D game engine with a feature-rich editor (Web edition)", "lang": "en", - "start_url": "./godot.tools.html", + "start_url": "./godot.editor.html", "display": "standalone", "theme_color": "#202531", "icons": [ diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj index 467aa3ce83..b58f002f3c 100644 --- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj @@ -249,7 +249,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; diff --git a/misc/dist/shell/_godot.zsh-completion b/misc/dist/shell/_godot.zsh-completion index b17bb6e66b..2bc6fe9317 100644 --- a/misc/dist/shell/_godot.zsh-completion +++ b/misc/dist/shell/_godot.zsh-completion @@ -44,6 +44,7 @@ _arguments \ '--remote-fs-password[password for remote filesystem]:remote filesystem password' \ '--audio-driver[set the audio driver]:audio driver name' \ '--display-driver[set the display driver]:display driver name' \ + "--rendering-method[set the renderer]:renderer name:((forward_plus\:'Desktop renderer' mobile\:'Desktop and mobile renderer' gl_compatibility\:'Desktop, mobile and web renderer'))" \ "--rendering-driver[set the rendering driver]:rendering driver name:((vulkan\:'Vulkan renderer' opengl3\:'OpenGL ES 3.0 renderer' dummy\:'Dummy renderer'))" \ "--gpu-index[use a specific GPU (run with --verbose to get available device list)]:device index" \ '--text-driver[set the text driver]:text driver name' \ diff --git a/misc/dist/shell/godot.bash-completion b/misc/dist/shell/godot.bash-completion index 1ab687e1fc..bc5fa600f5 100644 --- a/misc/dist/shell/godot.bash-completion +++ b/misc/dist/shell/godot.bash-completion @@ -47,6 +47,7 @@ _complete_godot_options() { --remote-fs-password --audio-driver --display-driver +--rendering-method --rendering-driver --gpu-index --text-driver @@ -58,7 +59,6 @@ _complete_godot_options() { --always-on-top --resolution --position ---headless --single-window --debug --breakpoints @@ -112,6 +112,10 @@ _complete_godot_bash() { local IFS=$' \n\t' # shellcheck disable=SC2207 COMPREPLY=($(compgen -W "unsafe safe separate" -- "$cur")) + elif [[ $prev == "--rendering-method" ]]; then + local IFS=$' \n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "forward_plus mobile gl_compatibility" -- "$cur")) elif [[ $prev == "--rendering-driver" ]]; then local IFS=$' \n\t' # shellcheck disable=SC2207 diff --git a/misc/dist/shell/godot.fish b/misc/dist/shell/godot.fish index d58066c135..9ac692eace 100644 --- a/misc/dist/shell/godot.fish +++ b/misc/dist/shell/godot.fish @@ -23,6 +23,13 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +function godot_rendering_method_args + # Use a function instead of a fixed string to customize the argument descriptions. + echo -e "forward_plus\tHigh-end desktop renderer" + echo -e "mobile\tHigh-end mobile/desktop renderer" + echo -e "gl_compatibility\tLow-end desktop, mobile and web renderer" +end + function godot_rendering_driver_args # Use a function instead of a fixed string to customize the argument descriptions. echo -e "vulkan\tVulkan renderer" @@ -53,6 +60,7 @@ complete -c godot -l remote-fs -d "Use a remote filesystem (<host/IP>[:<port>] a complete -c godot -l remote-fs-password -d "Password for remote filesystem" -x complete -c godot -l audio-driver -d "Set the audio driver" -x complete -c godot -l display-driver -d "Set the display driver" -x +complete -c godot -l rendering-method -d "Set the renderer" -x -a "(godot_rendering_method_args)" complete -c godot -l rendering-driver -d "Set the rendering driver" -x -a "(godot_rendering_driver_args)" complete -c godot -l gpu-index -d "Use a specific GPU (run with --verbose to get available device list)" -x complete -c godot -l text-driver -d "Set the text driver" -x diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index 44b6f59132..9570d5120b 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -76,8 +76,8 @@ fi # To get consistent formatting, we recommend contributors to use the same # clang-format version as CI. -RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="12" -RECOMMENDED_CLANG_FORMAT_MAJOR_MAX="14" +RECOMMENDED_CLANG_FORMAT_MAJOR_MIN="13" +RECOMMENDED_CLANG_FORMAT_MAJOR_MAX="15" if [ ! -x "$CLANG_FORMAT" ] ; then message="Error: clang-format executable not found. Please install clang-format $RECOMMENDED_CLANG_FORMAT_MAJOR_MAX." diff --git a/misc/scripts/codespell.sh b/misc/scripts/codespell.sh index f99c5d22b2..4cc01ec637 100755 --- a/misc/scripts/codespell.sh +++ b/misc/scripts/codespell.sh @@ -1,5 +1,5 @@ #!/bin/sh SKIP_LIST="./thirdparty,*.gen.*,*.po,*.pot,package-lock.json,./core/string/locales.h,./DONORS.md,./misc/dist/linux/org.godotengine.Godot.desktop,./misc/scripts/codespell.sh" -IGNORE_LIST="ba,childs,complies,curvelinear,expct,fave,findn,gird,inout,lod,nd,numer,ois,ro,statics,te,varius,varn" +IGNORE_LIST="alo,ba,childs,complies,curvelinear,doubleclick,expct,fave,findn,gird,gud,inout,lod,nd,numer,ois,readded,ro,sav,statics,te,varius,varn,wan" codespell -w -q 3 -S "${SKIP_LIST}" -L "${IGNORE_LIST}" diff --git a/misc/scripts/header_guards.sh b/misc/scripts/header_guards.sh index 9a830f3ad2..9fdc864f8c 100755 --- a/misc/scripts/header_guards.sh +++ b/misc/scripts/header_guards.sh @@ -5,11 +5,15 @@ if [ ! -f "version.py" ]; then echo "Some of the paths checks may not work as intended from a different folder." fi +files_invalid_guard="" + for file in $(find -name "thirdparty" -prune -o -name "*.h" -print); do # Skip *.gen.h and *-so_wrap.h, they're generated. if [[ "$file" == *".gen.h" || "$file" == *"-so_wrap.h" ]]; then continue; fi # Has important define before normal header guards. if [[ "$file" == *"thread.h" || "$file" == *"platform_config.h" ]]; then continue; fi + # Obj-C files don't use header guards. + if grep -q "#import " "$file"; then continue; fi bname=$(basename $file .h) @@ -43,8 +47,21 @@ for file in $(find -name "thirdparty" -prune -o -name "*.h" -print); do sed -i $file -e "$ s/#endif.*/\n#endif \/\/ $guard/" # Removes redundant \n added before, if they weren't needed. sed -i $file -e "/^$/N;/^\n$/D" + + # Check that first ifndef (should be header guard) is at the expected position. + # If not it can mean we have some code before the guard that should be after. + # "31" is the expected line with the copyright header. + first_ifndef=$(grep -n -m 1 "ifndef" $file | sed 's/\([0-9]*\).*/\1/') + if [[ "$first_ifndef" != "31" ]]; then + files_invalid_guard+="$file\n" + fi done +if [[ ! -z "$files_invalid_guard" ]]; then + echo -e "The following files were found to have potentially invalid header guard:\n" + echo -e "$files_invalid_guard" +fi + diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. diff --git a/misc/scripts/mypy.ini b/misc/scripts/mypy.ini new file mode 100644 index 0000000000..c1ea695ca5 --- /dev/null +++ b/misc/scripts/mypy.ini @@ -0,0 +1,11 @@ +[mypy] +ignore_missing_imports = true +disallow_any_generics = True +pretty = True +show_column_numbers = True +warn_redundant_casts = True +warn_return_any = True +warn_unreachable = True + +namespace_packages = True +explicit_package_bases = True diff --git a/misc/scripts/mypy_check.sh b/misc/scripts/mypy_check.sh new file mode 100755 index 0000000000..2a06486d67 --- /dev/null +++ b/misc/scripts/mypy_check.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -uo pipefail + +echo -e "Python: mypy static analysis..." +mypy --config-file=./misc/scripts/mypy.ini . |