diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios/dummy.cpp | 4 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist | 4 | ||||
-rw-r--r-- | misc/dist/linux/godot.6 | 25 | ||||
-rw-r--r-- | misc/dist/linux/org.godotengine.Godot.appdata.xml | 2 | ||||
-rwxr-xr-x | misc/dist/osx_template.app/Contents/Info.plist | 4 | ||||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist | 12 | ||||
-rw-r--r-- | misc/dist/shell/_godot.zsh-completion | 77 | ||||
-rw-r--r-- | misc/dist/shell/godot.bash-completion | 124 | ||||
-rw-r--r-- | misc/hooks/README.md | 8 | ||||
-rwxr-xr-x | misc/hooks/pre-commit | 2 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-makerst | 5 | ||||
-rwxr-xr-x | misc/scripts/file-hex-array.py | 56 | ||||
-rwxr-xr-x | misc/scripts/fix_headers.py | 4 | ||||
-rwxr-xr-x | misc/scripts/fix_style.sh | 2 | ||||
-rw-r--r-- | misc/scripts/make_bmfhdr.py | 67 | ||||
-rw-r--r-- | misc/scripts/make_glwrapper.py | 181 | ||||
-rwxr-xr-x[-rw-r--r--] | misc/scripts/make_icons.sh | 2 | ||||
-rw-r--r-- | misc/scripts/makeargs.py | 82 | ||||
-rw-r--r-- | misc/scripts/memsort.py | 35 |
20 files changed, 260 insertions, 442 deletions
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj index b375293ca6..0b8a508d2f 100644 --- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj +++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 1FE926A11FBBF86D00F53A6F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FE9268F1FBBF77F00F53A6F /* CoreAudio.framework */; }; E360193721F32F38009258C1 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E360193621F32F37009258C1 /* CoreVideo.framework */; }; DEADBEEF2F582BE20003B888 /* $binary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEADBEEF1F582BE20003B888 /* $binary.a */; }; + $modules_buildfile 1FF8DBB11FBA9DE1009DE660 /* dummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */; }; 1FF4C1851F584E3F00A41E41 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1841F584E3F00A41E41 /* GameKit.framework */; }; 1FF4C1871F584E5600A41E41 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FF4C1861F584E5600A41E41 /* StoreKit.framework */; }; @@ -45,6 +46,7 @@ 1FE926951FBBF7C400F53A6F /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 1FE926961FBBF7D400F53A6F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; DEADBEEF1F582BE20003B888 /* $binary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = godot; path = "$binary.a"; sourceTree = "<group>"; }; + $modules_fileref 1FF4C1841F584E3F00A41E41 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; 1FF4C1861F584E5600A41E41 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; 1FF4C1881F584E7600A41E41 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -89,6 +91,7 @@ D0BCFE3E18AEBDA2004A7AAE /* GLKit.framework in Frameworks */, D0BCFE3818AEBDA2004A7AAE /* Foundation.framework in Frameworks */, DEADBEEF2F582BE20003B888 /* $binary.a */, + $modules_buildphase $additional_pbx_frameworks_build ); runOnlyForDeploymentPostprocessing = 0; @@ -138,6 +141,7 @@ D0BCFE3D18AEBDA2004A7AAE /* GLKit.framework */, D0BCFE3F18AEBDA2004A7AAE /* OpenGLES.framework */, DEADBEEF1F582BE20003B888 /* $binary.a */, + $modules_buildgrp $additional_pbx_frameworks_refs ); name = Frameworks; @@ -427,6 +431,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", + "$(PROJECT_DIR)", ); PRODUCT_BUNDLE_IDENTIFIER = $identifier; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -452,6 +457,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", + "$(PROJECT_DIR)", ); PRODUCT_BUNDLE_IDENTIFIER = $identifier; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/misc/dist/ios_xcode/godot_ios/dummy.cpp b/misc/dist/ios_xcode/godot_ios/dummy.cpp index 7b52e926b0..0fcbf227b5 100644 --- a/misc/dist/ios_xcode/godot_ios/dummy.cpp +++ b/misc/dist/ios_xcode/godot_ios/dummy.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 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/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist index e7c4f8f340..add2f6c084 100644 --- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist @@ -28,6 +28,10 @@ <string>$version</string> <key>LSRequiresIPhoneOS</key> <true/> + <key>LSSupportsOpeningDocumentsInPlace</key> + $docs_in_place + <key>UIFileSharingEnabled</key> + $docs_sharing <key>UIRequiredDeviceCapabilities</key> <array> $required_device_capabilities diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6 index 4860c7b5a8..00d19c5178 100644 --- a/misc/dist/linux/godot.6 +++ b/misc/dist/linux/godot.6 @@ -1,4 +1,4 @@ -.TH GODOT "6" "March 2019" "godot 3.2" "Games" +.TH GODOT "6" "January 2020" "godot 4.0" "Games" .SH NAME godot \- multi\-platform 2D and 3D game engine with a feature\-rich editor .SH SYNOPSIS @@ -85,6 +85,12 @@ Force low\-DPI mode (macOS and Windows only). .TP \fB\-\-no\-window\fR Disable window creation (Windows only). Useful together with \fB\-\-script\fR. +.TP +\fB\-\-enable\-vsync\-via\-compositor\fR +When vsync is enabled, vsync via the OS' window compositor (Windows only). +.TP +\fB\-\-disable\-vsync\-via\-compositor\fR +Disable vsync via the OS' window compositor (Windows only). .SS "Debug options:" .TP \fB\-d\fR, \fB\-\-debug\fR @@ -130,11 +136,16 @@ Run a script. \fB\-\-check\-only\fR Only parse for errors and quit (use with --script). .TP -\fB\-\-export\fR <target> -Export the project using the given export target. Export only main pack if path ends with .pck or .zip. +\fB\-\-export\fR <preset> <path> +Export the project using the given preset and matching release template. The preset name should match one defined in export_presets.cfg. +.br +<path> should be absolute or relative to the project directory, and include the filename for the binary (e.g. 'builds/game.exe'). The target directory should exist. +.TP +\fB\-\-export\-debug\fR <preset> <path> +Same as \-\-export, but using the debug template. .TP -\fB\-\-export\-debug\fR <target> -Like \-\-export, but use debug template. +\fB\-\-export\-pack\fR <preset> <path> +Same as \-\-export, but only export the game pack for the given preset. The <path> extension determines whether it will be in PCK or ZIP format. .TP \fB\-\-doctool\fR <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found. @@ -143,7 +154,7 @@ Dump the engine API reference to the given <path> in XML format, merging if exis Disallow dumping the base types (used with \fB\-\-doctool\fR). .TP \fB\-\-build\-solutions\fR -Build the scripting solutions (e.g. for C# projects). +Build the scripting solutions (e.g. for C# projects). Implies \-\-editor and requires a valid project to edit. .TP \fB\-\-gdnative\-generate\-json\-api\fR Generate JSON dump of the Godot API for GDNative bindings. @@ -179,5 +190,5 @@ Godot Engine is a free and open source project and welcomes any kind of contributions. In particular, you can report issues or make suggestions on Godot's issue tracker at \fIhttps://github.com/godotengine/godot/issues\fR. .SH AUTHOR -Man page written by Rémi Verschelde <akien@godotengine.org> on behalf of the +Man page written by Rémi Verschelde <remi@godotengine.org> on behalf of the Godot Engine development team. diff --git a/misc/dist/linux/org.godotengine.Godot.appdata.xml b/misc/dist/linux/org.godotengine.Godot.appdata.xml index 09d5468d70..2b30036006 100644 --- a/misc/dist/linux/org.godotengine.Godot.appdata.xml +++ b/misc/dist/linux/org.godotengine.Godot.appdata.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2017-2019 Rémi Verschelde <akien@godotengine.org> --> +<!-- Copyright 2017-2020 Rémi Verschelde <remi@godotengine.org> --> <component type="desktop"> <id>org.godotengine.Godot</id> <metadata_license>CC0-1.0</metadata_license> diff --git a/misc/dist/osx_template.app/Contents/Info.plist b/misc/dist/osx_template.app/Contents/Info.plist index eee787bdaf..696c825594 100755 --- a/misc/dist/osx_template.app/Contents/Info.plist +++ b/misc/dist/osx_template.app/Contents/Info.plist @@ -24,6 +24,10 @@ <string>$signature</string> <key>CFBundleVersion</key> <string>$version</string> + <key>NSMicrophoneUsageDescription</key> + <string>$microphone_usage_description</string> + <key>NSCameraUsageDescription</key> + <string>$camera_usage_description</string> <key>NSHumanReadableCopyright</key> <string>$copyright</string> <key>LSMinimumSystemVersion</key> diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index bb22f1807c..46550ba6c7 100755 --- a/misc/dist/osx_tools.app/Contents/Info.plist +++ b/misc/dist/osx_tools.app/Contents/Info.plist @@ -9,7 +9,7 @@ <key>CFBundleName</key> <string>Godot</string> <key>CFBundleGetInfoString</key> - <string>(c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>(c) 2007-2020 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> @@ -19,15 +19,19 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>3.2</string> + <string>4.0</string> <key>CFBundleSignature</key> <string>godot</string> <key>CFBundleVersion</key> - <string>3.2</string> + <string>4.0</string> + <key>NSMicrophoneUsageDescription</key> + <string>Microphone access is required to capture audio.</string> + <key>NSCameraUsageDescription</key> + <string>Camera access is required to capture video.</string> <key>NSRequiresAquaSystemAppearance</key> <false /> <key>NSHumanReadableCopyright</key> - <string>© 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>© 2007-2020 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>LSMinimumSystemVersion</key> <string>10.9.0</string> <key>LSMinimumSystemVersionByArchitecture</key> diff --git a/misc/dist/shell/_godot.zsh-completion b/misc/dist/shell/_godot.zsh-completion new file mode 100644 index 0000000000..4945ecbabc --- /dev/null +++ b/misc/dist/shell/_godot.zsh-completion @@ -0,0 +1,77 @@ +#compdef godot + +# zsh completion for the Godot editor +# To use it, install this file as `_godot` in a directory specified in your +# `fpath` environment variable then restart your shell. +# +# Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2014-2020 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 "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +_arguments \ + "1::path to scene or 'project.godot' file:_files" \ + '(-h --help)'{-h,--help}'[display the full help message]' \ + '--version[display the version string]' \ + '(-v --verbose)'{-v,--verbose}'[use verbose stdout mode]' \ + '--quiet[quiet mode, silences stdout messages (errors are still displayed)]' \ + '(-e --editor)'{-e,--editor}'[start the editor instead of running the scene]' \ + '(-p --project-manager)'{-p,--project-manager}'[start the project manager, even if a project is auto-detected]' \ + '(-q --quit)'{-q,--quit}'[quit after the first iteration]' \ + '(-l --language)'{-l,--language}'[use a specific locale (<locale> being a two-letter code)]:two-letter locale code' \ + "--path[path to a project (<directory> must contain a 'project.godot' file)]:path to directory with 'project.godot' file:_dirs" \ + '(-u --upwards)'{-u,--upwards}'[scan folders upwards for project.godot file]' \ + '--main-pack[path to a pack (.pck) file to load]:path to .pck file:_files' \ + '--render-thread[set the render thread mode]:render thread mode:(unsafe safe separate)' \ + '--remote-fs[use a remote filesystem]:remote filesystem address' \ + '--remote-fs-password[password for remote filesystem]:remote filesystem password' \ + '--audio-driver[set the audio driver]:audio driver name' \ + "--video-driver[set the video driver]:video driver name:((GLES3\:'OpenGL ES 3.0 renderer' GLES2\:'OpenGL ES 2.0 renderer'))" \ + '(-f --fullscreen)'{-f,--fullscreen}'[request fullscreen mode]' \ + '(-m --maximized)'{-m,--maximized}'[request a maximized window]' \ + '(-w --windowed)'{-w,--windowed}'[request windowed mode]' \ + '(-t --always-on-top)'{-t,--always-on-top}'[request an always-on-top window]' \ + '--resolution[request window resolution]:resolution in WxH format' \ + '--position[request window position]:position in X,Y format' \ + '--low-dpi[force low-DPI mode (macOS and Windows only)]' \ + '--no-window[disable window creation (Windows only), useful together with --script]' \ + "--enable-vsync-via-compositor[when Vsync is enabled, Vsync via the OS' window compositor (Windows only)]" \ + "--disable-vsync-via-compositor[disable Vsync via the OS' window compositor (Windows only)]" \ + '(-d --debug)'{-d,--debug}'[debug (local stdout debugger)]' \ + '(-b --breakpoints)'{-b,--breakpoints}'[specify the breakpoint list as source::line comma-separated pairs, no spaces (use %20 instead)]:breakpoint list' \ + '--profiling[enable profiling in the script debugger]' \ + '--remote-debug[enable remote debugging]:remote debugger address' \ + '--debug-collisions[show collision shapes when running the scene]' \ + '--debug-navigation[show navigation polygons when running the scene]' \ + '--frame-delay[simulate high CPU load (delay each frame by the given number of milliseconds)]:number of milliseconds' \ + '--time-scale[force time scale (higher values are faster, 1.0 is normal speed)]:time scale' \ + '--disable-render-loop[disable render loop so rendering only occurs when called explicitly from script]' \ + '--disable-crash-handler[disable crash handler when supported by the platform code]' \ + '--fixed-fps[force a fixed number of frames per second (this setting disables real-time synchronization)]:frames per second' \ + '--print-fps[print the frames per second to the stdout]' \ + '(-s, --script)'{-s,--script}'[run a script]:path to script:_files' \ + '--check-only[only parse for errors and quit (use with --script)]' \ + '--export[export the project using the given preset and matching release template]:export preset name' \ + '--export-debug[same as --export, but using the debug template]:export preset name' \ + '--export-pack[same as --export, but only export the game pack for the given preset]:export preset name' \ + '--doctool[dump the engine API reference to the given path in XML format, merging if existing files are found]:path to base Godot build directory:_dirs' \ + '--no-docbase[disallow dumping the base types (used with --doctool)]' \ + '--build-solutions[build the scripting solutions (e.g. for C# projects)]' \ + '--gdnative-generate-json-api[generate JSON dump of the Godot API for GDNative bindings]' \ + '--test[run a unit test]:unit test name' diff --git a/misc/dist/shell/godot.bash-completion b/misc/dist/shell/godot.bash-completion new file mode 100644 index 0000000000..714b6758e3 --- /dev/null +++ b/misc/dist/shell/godot.bash-completion @@ -0,0 +1,124 @@ +#!/usr/bin/env bash + +# Bash completion for the Godot editor +# To use it, install this file in `/etc/bash_completion.d` then restart your shell. +# You can also `source` this file directly in your shell startup file. +# +# Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2014-2020 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 "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +_complete_godot_options() { + # Since Bash doesn't support option descriptions in autocompletion, + # only display long options to be more descriptive. + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W " \ +--help +--version +--verbose +--quiet +--editor +--project-manager +--quit +--language +--path +--upwards +--main-pack +--render-thread +--remote-fs +--remote-fs-password +--audio-driver +--video-driver +--fullscreen +--maximized +--windowed +--always-on-top +--resolution +--position +--low-dpi +--no-window +--enable-vsync-via-compositor +--disable-vsync-via-compositor +--debug +--breakpoints +--profiling +--remote-debug +--debug-collisions +--debug-navigation +--frame-delay +--time-scale +--disable-render-loop +--disable-crash-handler +--fixed-fps +--print-fps +--script +--check-only +--export +--export-debug +--export-pack +--doctool +--no-docbase +--build-solutions +--gdnative-generate-json-api +--test +" -- "$1")) +} + +_complete_godot_bash() { + local cur="${COMP_WORDS[$COMP_CWORD]}" prev + + # Complete options or the positional argument. + if [[ $cur == -* ]]; then + _complete_godot_options "$cur" + else + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.@(scn|tscn|escn|godot)" -- "$cur")) + fi + + # If the array is accessed out of bounds (which will happen for the first argument), + # `$prev` will be an empty string and won't match any of the conditions below. + prev="${COMP_WORDS[$((COMP_CWORD-1))]}" + + # Complete option values. + if [[ $prev == "--render-thread" ]]; then + local IFS=$' \n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "unsafe safe separate" -- "$cur")) + elif [[ $prev == "--video-driver" ]]; then + local IFS=$' \n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "GLES3 GLES2" -- "$cur")) + elif [[ $prev == "--path" || $prev == "--doctool" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -d -- "$cur")) + elif [[ $prev == "--main-pack" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.@(pck|zip)" -- "$cur")) + elif [[ $prev == "-s" || $prev == "--script" ]]; then + local IFS=$'\n\t' + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -f -X "!*.gd" -- "$cur")) + fi +} + +complete -o filenames -F _complete_godot_bash godot diff --git a/misc/hooks/README.md b/misc/hooks/README.md index 6ec90fcc54..b18ba7df38 100644 --- a/misc/hooks/README.md +++ b/misc/hooks/README.md @@ -1,6 +1,6 @@ # Git hooks for Godot Engine -This folder contains git hooks meant to be installed locally by Godot Engine +This folder contains Git hooks meant to be installed locally by Godot Engine contributors to make sure they comply with our requirements. ## List of hooks @@ -9,10 +9,12 @@ contributors to make sure they comply with our requirements. before accepting a commit; blocks the commit and generates a patch if the style is not respected. Should work on Linux and macOS. You may need to edit the file if your - clang-format binary is not in the $PATH, or if you want to enable colored + clang-format binary is not in the `$PATH`, or if you want to enable colored output with pygmentize. +- Pre-commit hook for makerst: Checks the class reference syntax using `makerst.py`. + Should work on Linux and macOS. ## Installation -Copy all the files from this folder into your .git/hooks folder, and make sure +Copy all the files from this folder into your `.git/hooks` folder, and make sure the hooks and helper scripts are executable. diff --git a/misc/hooks/pre-commit b/misc/hooks/pre-commit index fc50ed70e7..36e9935785 100755 --- a/misc/hooks/pre-commit +++ b/misc/hooks/pre-commit @@ -14,7 +14,7 @@ # as this script. Hooks should return 0 if successful and nonzero to cancel the # commit. They are executed in the order in which they are listed. #HOOKS="pre-commit-compile pre-commit-uncrustify" -HOOKS="pre-commit-clang-format" +HOOKS="pre-commit-clang-format pre-commit-makerst" ########################################################### # There should be no need to change anything below this line. diff --git a/misc/hooks/pre-commit-makerst b/misc/hooks/pre-commit-makerst new file mode 100755 index 0000000000..d9b684e73b --- /dev/null +++ b/misc/hooks/pre-commit-makerst @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Git pre-commit hook that checks the class reference syntax using makerst.py. + +doc/tools/makerst.py doc/classes modules --dry-run diff --git a/misc/scripts/file-hex-array.py b/misc/scripts/file-hex-array.py deleted file mode 100755 index a6cdfe541f..0000000000 --- a/misc/scripts/file-hex-array.py +++ /dev/null @@ -1,56 +0,0 @@ -import binascii -import os.path -import sys - - -def tof(filepath): - with open(filepath, 'r') as f: - content = f.read() - content = content.replace("0x", "") - content = content.split(',') - for i in range(len(content)): - if len(content[i]) == 1: - content[i] = "0" + content[i] - content = "".join(content) - with open(filepath + ".file", 'wb') as f: - content = f.write(content.decode("hex")) - print(os.path.basename(filepath) + ".file created.") - exit(0) - - -def toa(filepath): - with open(filepath, 'rb') as f: - content = f.read() - content = binascii.hexlify(content) - content = [content[i:i + 2] for i in range(0, len(content), 2)] - content = ",0x".join(content) - content = "0x" + content - content = content.replace("0x00", "0x0") - with open(filepath + ".array", 'w') as f: - content = f.write(content) - print(os.path.basename(filepath) + ".array created.") - exit(0) - - -def usage(): - print("========================================================\n\ -#\n\ -# Usage: python file-hex-array.py [action] [option]\n\ -#\n\ -# Arguments:\n\ -# action ==> toa # convert file to array [option is file path]\n\ -# tof # convert array to file [option is array file path]\n\ -#\n\ -# Example : python file-hex-array.py toa 1.png\n\ -#\n\ -========================================================") - exit(1) - -if len(sys.argv) != 3: - usage() -if sys.argv[1] == "toa" and os.path.isfile(sys.argv[2]): - toa(sys.argv[2]) -elif sys.argv[1] == "tof" and os.path.isfile(sys.argv[2]): - tof(sys.argv[2]) -else: - usage() diff --git a/misc/scripts/fix_headers.py b/misc/scripts/fix_headers.py index d94db22b42..f0038a8351 100755 --- a/misc/scripts/fix_headers.py +++ b/misc/scripts/fix_headers.py @@ -9,8 +9,8 @@ header = """\ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 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/misc/scripts/fix_style.sh b/misc/scripts/fix_style.sh index 19ca781535..b33cb0a7b4 100755 --- a/misc/scripts/fix_style.sh +++ b/misc/scripts/fix_style.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Command line arguments run_clang_format=false diff --git a/misc/scripts/make_bmfhdr.py b/misc/scripts/make_bmfhdr.py deleted file mode 100644 index 1d3c40f9c6..0000000000 --- a/misc/scripts/make_bmfhdr.py +++ /dev/null @@ -1,67 +0,0 @@ - - -import sys - -if (len(sys.argv) != 2): - print("Pass me a .fnt argument!") - -f = open(sys.argv[1], "rb") - -name = sys.argv[1].lower().replace(".fnt", "") - -l = f.readline() - -font_height = 0 -font_ascent = 0 -font_charcount = 0 -font_chars = [] -font_cc = 0 - -while(l != ""): - - fs = l.strip().find(" ") - if (fs == -1): - l = f.readline() - continue - t = l[0:fs] - - dv = l[fs + 1:].split(" ") - d = {} - for x in dv: - if (x.find("=") == -1): - continue - s = x.split("=") - d[s[0]] = s[1] - - if (t == "common"): - font_height = d["lineHeight"] - font_ascent = d["base"] - - if (t == "char"): - font_chars.append(d["id"]) - font_chars.append(d["x"]) - font_chars.append(d["y"]) - font_chars.append(d["width"]) - font_chars.append(d["height"]) - font_chars.append(d["xoffset"]) - font_chars.append(d["yoffset"]) - font_chars.append(d["xadvance"]) - font_cc += 1 - - l = f.readline() - - -print("static const int _bi_font_" + name + "_height=" + str(font_height) + ";") -print("static const int _bi_font_" + name + "_ascent=" + str(font_ascent) + ";") -print("static const int _bi_font_" + name + "_charcount=" + str(font_cc) + ";") -cstr = "static const int _bi_font_" + name + "_characters={" -for i in range(len(font_chars)): - - c = font_chars[i] - if (i > 0): - cstr += ", " - cstr += c - -cstr += ("};") - -print(cstr) diff --git a/misc/scripts/make_glwrapper.py b/misc/scripts/make_glwrapper.py deleted file mode 100644 index 15b66a950b..0000000000 --- a/misc/scripts/make_glwrapper.py +++ /dev/null @@ -1,181 +0,0 @@ -#! /usr/bin/env python -import sys - -if (len(sys.argv) < 2): - print("usage: make_glwrapper.py <headers>") - sys.exit(255) - - -functions = [] -types = [] -constants = [] - -READ_FUNCTIONS = 0 -READ_TYPES = 1 -READ_CONSTANTS = 2 - -read_what = READ_TYPES - -def read_file(f): - while(True): - - line = f.readline() - if (line == ""): - break - - line = line.replace("\n", "").strip() - """ - if (line.find("[types]")!=-1): - read_what=READ_TYPES - continue - elif (line.find("[constants]")!=-1): - read=READ_TYPES - continue - elif (line.find("[functions]")!=-1): - read_what=READ_FUNCTIONS - continue - """ - - if (line.find("#define") != -1): - if (line.find("0x") == -1 and line.find("GL_VERSION") == -1): - continue - constants.append(line) - elif (line.find("typedef") != -1): - if (line.find("(") != -1 or line.find(")") != -1 or line.find("ARB") != -1 or line.find("EXT") != -1 or line.find("GL") == -1): - continue - types.append(line) - elif (line.find("APIENTRY") != -1 and line.find("GLAPI") != -1): - - if (line.find("ARB") != -1 or line.find("EXT") != -1 or line.find("NV") != -1): - continue - - line = line.replace("APIENTRY", "") - line = line.replace("GLAPI", "") - - glpos = line.find(" gl") - if (glpos == -1): - - glpos = line.find("\tgl") - if (glpos == -1): - continue - - ret = line[:glpos].strip() - - line = line[glpos:].strip() - namepos = line.find("(") - - if (namepos == -1): - continue - - name = line[:namepos].strip() - line = line[namepos:] - - argpos = line.rfind(")") - if (argpos == -1): - continue - - args = line[1:argpos] - - funcdata = {} - funcdata["ret"] = ret - funcdata["name"] = name - funcdata["args"] = args - - functions.append(funcdata) - print(funcdata) - -for path in sys.argv[1:]: - with open(path, "r") as f: - read_file(f) - -# print(types) -# print(constants) -# print(functions) - - -f = open("glwrapper.h", "w") - -f.write("#ifndef GL_WRAPPER\n") -f.write("#define GL_WRAPPER\n\n\n") - -header_code = """\ -#if defined(__gl_h_) || defined(__GL_H__) -#error gl.h included before glwrapper.h -#endif -#if defined(__glext_h_) || defined(__GLEXT_H_) -#error glext.h included before glwrapper.h -#endif -#if defined(__gl_ATI_h_) -#error glATI.h included before glwrapper.h -#endif - -#define __gl_h_ -#define __GL_H__ -#define __glext_h_ -#define __GLEXT_H_ -#define __gl_ATI_h_ - -#define GL_TRUE 1 -#define GL_FALSE 0 - -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_NONE 0 -#define GL_NO_ERROR 0 - -\n\n -""" - -f.write("#include <stddef.h>\n\n\n") - -f.write(header_code) - -f.write("#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n") -f.write("#if defined(_WIN32) && !defined(__CYGWIN__)\n") -f.write("#define GLWRP_APIENTRY __stdcall\n") -f.write("#else\n") -f.write("#define GLWRP_APIENTRY \n") -f.write("#endif\n\n") -for x in types: - f.write(x + "\n") - -f.write("\n\n") - -for x in constants: - f.write(x + "\n") - -f.write("\n\n") - -for x in functions: - f.write("extern " + x["ret"] + " GLWRP_APIENTRY (*__wrapper_" + x["name"] + ")(" + x["args"] + ");\n") - f.write("#define " + x["name"] + " __wrapper_" + x["name"] + "\n") - -f.write("\n\n") -f.write("typedef void (*GLWrapperFuncPtr)(void);\n\n") -f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) );\n") - -f.write("#ifdef __cplusplus\n}\n#endif\n") - -f.write("#endif\n\n") -f.close() - -f = open("glwrapper.c", "w") - -f.write("\n\n") -f.write("#include \"glwrapper.h\"\n") -f.write("\n\n") - -for x in functions: - f.write(x["ret"] + " GLWRP_APIENTRY (*__wrapper_" + x["name"] + ")(" + x["args"] + ")=NULL;\n") - -f.write("\n\n") -f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) ) {\n") -f.write("\n") - -for x in functions: - f.write("\t__wrapper_" + x["name"] + "=(" + x["ret"] + " GLWRP_APIENTRY (*)(" + x["args"] + "))wrapperFunc(\"" + x["name"] + "\");\n") - -f.write("\n\n") -f.write("}\n") -f.write("\n\n") -f.close() diff --git a/misc/scripts/make_icons.sh b/misc/scripts/make_icons.sh index 5f3ea40d6a..b590f03d38 100644..100755 --- a/misc/scripts/make_icons.sh +++ b/misc/scripts/make_icons.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # Generate .ico, .icns and .zip set of icons for Steam # Make icons with transparent backgrounds and all sizes diff --git a/misc/scripts/makeargs.py b/misc/scripts/makeargs.py deleted file mode 100644 index 26d9cc5a00..0000000000 --- a/misc/scripts/makeargs.py +++ /dev/null @@ -1,82 +0,0 @@ - -text = """ -#define FUNC$numR(m_r,m_func,$argt)\\ - virtual m_r m_func($argtp) { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - m_r ret;\\ - command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\ - return ret;\\ - } else {\\ - return visual_server->m_func($argp);\\ - }\\ - } - -#define FUNC$numRC(m_r,m_func,$argt)\\ - virtual m_r m_func($argtp) const { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - m_r ret;\\ - command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\ - return ret;\\ - } else {\\ - return visual_server->m_func($argp);\\ - }\\ - } - - -#define FUNC$numS(m_func,$argt)\\ - virtual void m_func($argtp) { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - command_queue.push_and_sync( visual_server, &VisualServer::m_func,$argp);\\ - } else {\\ - visual_server->m_func($argp);\\ - }\\ - } - -#define FUNC$numSC(m_func,$argt)\\ - virtual void m_func($argtp) const { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - command_queue.push_and_sync( visual_server, &VisualServer::m_func,$argp);\\ - } else {\\ - visual_server->m_func($argp);\\ - }\\ - } - - -#define FUNC$num(m_func,$argt)\\ - virtual void m_func($argtp) { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - command_queue.push( visual_server, &VisualServer::m_func,$argp);\\ - } else {\\ - visual_server->m_func($argp);\\ - }\\ - } - -#define FUNC$numC(m_func,$argt)\\ - virtual void m_func($argtp) const { \\ - if (Thread::get_caller_id()!=server_thread) {\\ - command_queue.push( visual_server, &VisualServer::m_func,$argp);\\ - } else {\\ - visual_server->m_func($argp);\\ - }\\ - } - - -""" - - -for i in range(1, 8): - - tp = "" - p = "" - t = "" - for j in range(i): - if (j > 0): - tp += ", " - p += ", " - t += ", " - tp += ("m_arg" + str(j + 1) + " p" + str(j + 1)) - p += ("p" + str(j + 1)) - t += ("m_arg" + str(j + 1)) - - t = text.replace("$argtp", tp).replace("$argp", p).replace("$argt", t).replace("$num", str(i)) - print(t) diff --git a/misc/scripts/memsort.py b/misc/scripts/memsort.py deleted file mode 100644 index fb636b0f78..0000000000 --- a/misc/scripts/memsort.py +++ /dev/null @@ -1,35 +0,0 @@ - -import sys - -arg = "memdump.txt" - -if (len(sys.argv) > 1): - arg = sys.argv[1] - -f = open(arg, "rb") - - -l = f.readline() - - -sum = {} -cnt = {} - - -while(l != ""): - - s = l.split("-") - amount = int(s[1]) - what = s[2] - if (what in sum): - sum[what] += amount - cnt[what] += 1 - else: - sum[what] = amount - cnt[what] = 1 - - l = f.readline() - - -for x in sum: - print(x.strip() + "(" + str(cnt[x]) + "):\n: " + str(sum[x])) |