Compare commits
242 Commits
2.1.2-stab
...
2.0.3-stab
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ed2084b42 | |||
| c0df7da2ca | |||
| 49bf494eac | |||
| b8d8ec09ee | |||
| f120514402 | |||
| 77573a76d1 | |||
| c734a508c3 | |||
| d66b04921f | |||
| f61f515872 | |||
| c5e17d553e | |||
| 2bd6e2402b | |||
| c575f31d5d | |||
| 6d50ccfd32 | |||
| bd51dea8f6 | |||
| abc97d3bb4 | |||
| a5e54b83ec | |||
| 18782aec61 | |||
| f58cfaf585 | |||
| 5d98718c28 | |||
| 7ab1c1ea3b | |||
| f8debd8152 | |||
| ac06e3d4db | |||
| b6be2f503d | |||
| b224407770 | |||
| 7556391d20 | |||
| 23c659fc47 | |||
| 4832731477 | |||
| 19f08eaa5b | |||
| 975b4d2927 | |||
| 913818a246 | |||
| 4a4999451b | |||
| 4f57e532b8 | |||
| 3449c81bdb | |||
| 05857a5472 | |||
| ec3b50fd65 | |||
| f95918e05a | |||
| b3404c8c44 | |||
| 7e077258c5 | |||
| fb3d10c579 | |||
| 0b75c39c2b | |||
| e0a13981fc | |||
| bdbb831261 | |||
| 97e30f4cd7 | |||
| 78dc8e79c4 | |||
| 40681d90e5 | |||
| fbb8a2170c | |||
| e8a972197c | |||
| 047767b824 | |||
| ef2f1ae811 | |||
| 7c419032c7 | |||
| 9bdcc97e56 | |||
| 7f80fce464 | |||
| ea9b552e27 | |||
| 21ab3a030e | |||
| a14ff27337 | |||
| d6e30256ad | |||
| 4bc494ae2e | |||
| d49fff6246 | |||
| d29087cc53 | |||
| 27461a79dc | |||
| a86cfc258e | |||
| 26c2e0d09d | |||
| 0b49d78a3f | |||
| 40b546fb83 | |||
| 3c453b7bd2 | |||
| f033763700 | |||
| 944ac2500a | |||
| b4adb0d338 | |||
| 227604a566 | |||
| 70644301dd | |||
| 4228505cf0 | |||
| 9086a929b2 | |||
| 5365ae9212 | |||
| a3fd381a4f | |||
| d81ffaf2ab | |||
| c77a5f910e | |||
| 91461b588d | |||
| 3a3f56689e | |||
| 35e05b092c | |||
| 238bbb6539 | |||
| 946ef8d478 | |||
| d3ee8de754 | |||
| 517518ae9a | |||
| 084ce221d7 | |||
| e38666b76a | |||
| 6f76eca883 | |||
| d183a5361f | |||
| 11aa0d1405 | |||
| 6efe8818a7 | |||
| 9023a84a93 | |||
| 1bd2145e34 | |||
| 382a8250ba | |||
| 73296a9a6d | |||
| 93b1f60ca2 | |||
| 7f4387d21e | |||
| c0748bad06 | |||
| 94b321822d | |||
| c523749662 | |||
| 0f47311610 | |||
| 4c358b7043 | |||
| 98b30e3aff | |||
| 9f5c6cf950 | |||
| 07fc330241 | |||
| c712e54b63 | |||
| 6a2efc48c5 | |||
| ff1d370b9f | |||
| e654184888 | |||
| cabb80ecf4 | |||
| 3efa0f130d | |||
| 47c7b535d2 | |||
| 5fac497aa2 | |||
| 4bfcd14a6a | |||
| dbcf969fbf | |||
| 52bf4a76b2 | |||
| f32a4dc516 | |||
| a0b6645858 | |||
| b24c3be564 | |||
| b2b5c495e1 | |||
| e367c6cdd8 | |||
| b5a438413a | |||
| f4ebba513a | |||
| 40d21117f9 | |||
| e120e2265b | |||
| 8746966194 | |||
| 76eeb457d3 | |||
| 02afea1e4e | |||
| 692878b7f4 | |||
| b7f5418f8d | |||
| d4d810faac | |||
| 3a390e9b44 | |||
| 5d63f4e758 | |||
| cbac9a2ca3 | |||
| 837d50714a | |||
| bb6cfc130b | |||
| b3891246e5 | |||
| 00566a8592 | |||
| 63e33cfdd2 | |||
| dea6671d58 | |||
| 7c6d2e7062 | |||
| eb927383f2 | |||
| 5c98674a8b | |||
| 4bde902de1 | |||
| a5f07d18ec | |||
| 71da9a1a23 | |||
| 44daccc861 | |||
| 4220ffbd8e | |||
| 43c74056b1 | |||
| 48438e4f3b | |||
| 5f901e2b27 | |||
| 22ef9673dd | |||
| 5b1aa3a5cd | |||
| f06f574735 | |||
| aac3b9db5c | |||
| 9fdc1279cc | |||
| 01471e4c09 | |||
| bac8248316 | |||
| 69e67d51c7 | |||
| c6ccd05fed | |||
| 937a96b26b | |||
| a52b1e866d | |||
| fed11a662a | |||
| 26f2b7415c | |||
| 729dc5da83 | |||
| 54625bb771 | |||
| 523625a3d1 | |||
| 5caf6ad8b9 | |||
| 7ddc17b18e | |||
| cf0a586a3e | |||
| 41cc4ffe98 | |||
| 0ea354c12a | |||
| 2bc4049b9b | |||
| 64a8fe6ad7 | |||
| 05c620b7ad | |||
| ca1ca6c7df | |||
| 1369b38d85 | |||
| 68b7f9d87a | |||
| 8a78112e5b | |||
| 41326781d2 | |||
| cacf7d136f | |||
| a701c6ff68 | |||
| 812de22194 | |||
| 8de0405032 | |||
| e59c0610ca | |||
| 8fd4c78caf | |||
| 85820434de | |||
| d0151daa69 | |||
| 763b29ed18 | |||
| 1d096471dc | |||
| 7c44cbee67 | |||
| d950a13c10 | |||
| 6ce273b329 | |||
| 0635a639e9 | |||
| 424a104666 | |||
| 830947feaf | |||
| ee20365f7c | |||
| 0a24f562fb | |||
| 60e4cfbcb7 | |||
| 656aa0a501 | |||
| 7ad50eaea8 | |||
| 83887ae16d | |||
| 827f4a895a | |||
| da356eca0f | |||
| 53aa9cd51a | |||
| 706d576f7b | |||
| 226e0a7f4f | |||
| c44060bb82 | |||
| 4fee5f3915 | |||
| e69c9021b5 | |||
| edb3716da7 | |||
| 1bdd5d24cb | |||
| a1a1c0b9f6 | |||
| 450a7a9120 | |||
| c850fa7331 | |||
| afd75013f9 | |||
| 848c7378fd | |||
| 4b2fcabb74 | |||
| cb7693c533 | |||
| 7fea990b1b | |||
| 95e46e6eac | |||
| bea8e1654e | |||
| cafcdb015d | |||
| 459b914d9c | |||
| 9ed3d21d5a | |||
| 82d06b0027 | |||
| e0a66b6e56 | |||
| 186b82c350 | |||
| 1af2e1101d | |||
| a55f41e3d9 | |||
| 439e29ea95 | |||
| f5e8e89f50 | |||
| f619b05751 | |||
| aa94ff6dae | |||
| ee5c250b63 | |||
| e4d367e7a1 | |||
| 45a0bbe56e | |||
| d86b12a397 | |||
| f0ba9c7e78 | |||
| 61f17fb1bb | |||
| a43af20f31 | |||
| 7ba92ae9eb | |||
| b05c27a27f | |||
| e30cbc3b36 |
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -1,8 +1,3 @@
|
||||
# Properly detect languages on Github
|
||||
*.h linguist-language=cpp
|
||||
*.inc linguist-language=cpp
|
||||
drivers/* linguist-vendored
|
||||
|
||||
*.cpp eol=lf
|
||||
*.h eol=lf
|
||||
*.py eol=lf
|
||||
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
@ -17,10 +17,8 @@ core/global_defaults.cpp
|
||||
drivers/unix/os_unix_global_settings_path.cpp
|
||||
tools/editor/register_exporters.cpp
|
||||
tools/editor/doc_data_compressed.h
|
||||
tools/editor/certs_compressed.h
|
||||
tools/editor/editor_icons.cpp
|
||||
tools/editor/translations.h
|
||||
tools/editor/builtin_fonts.h
|
||||
-fpic
|
||||
.fscache
|
||||
make.bat
|
||||
log.txt
|
||||
@ -32,15 +30,21 @@ doc/_build/
|
||||
*.bc
|
||||
|
||||
# Android specific
|
||||
platform/android/java/build.gradle
|
||||
platform/android/java/.gradle
|
||||
platform/android/java/.gradletasknamecache
|
||||
platform/android/java/local.properties
|
||||
platform/android/java/project.properties
|
||||
platform/android/java/build.gradle
|
||||
platform/android/java/AndroidManifest.xml
|
||||
platform/android/java/bin/*
|
||||
platform/android/java/libs/*
|
||||
platform/android/java/gen/*
|
||||
platform/android/java/assets
|
||||
platform/android/libs/apk_expansion/bin/*
|
||||
platform/android/libs/apk_expansion/gen/*
|
||||
platform/android/libs/google_play_services/bin/*
|
||||
platform/android/libs/google_play_services/gen/*
|
||||
platform/android/libs/play_licensing/bin/*
|
||||
platform/android/libs/play_licensing/gen/*
|
||||
|
||||
# General c++ generated files
|
||||
*.lib
|
||||
@ -53,14 +57,12 @@ platform/android/java/assets
|
||||
*.os
|
||||
*.Plo
|
||||
*.lo
|
||||
*.Po
|
||||
|
||||
# Libs generated files
|
||||
.deps/*
|
||||
.dirstamp
|
||||
|
||||
# Vim temp files
|
||||
*.swo
|
||||
*.swp
|
||||
|
||||
# QT project files
|
||||
*.config
|
||||
@ -142,8 +144,6 @@ ipch/
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
@ -240,9 +240,6 @@ node_modules/
|
||||
# KDE
|
||||
.directory
|
||||
|
||||
#Kdevelop project files
|
||||
*.kdev4
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
@ -299,7 +296,3 @@ godot.creator.*
|
||||
|
||||
projects/
|
||||
platform/windows/godot_res.res
|
||||
|
||||
# Visual Studio Code folder (and files) that are created
|
||||
# when the C/C++ extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) is used
|
||||
/.vscode
|
||||
|
||||
@ -54,7 +54,7 @@ addons:
|
||||
- libglu1-mesa-dev
|
||||
- libssl-dev
|
||||
- libxinerama-dev
|
||||
- libxrandr-dev
|
||||
- libudev-dev
|
||||
|
||||
# For cross-compiling to Windows.
|
||||
- binutils-mingw-w64-i686
|
||||
@ -68,11 +68,7 @@ addons:
|
||||
|
||||
before_script:
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then
|
||||
brew update; travis_wait 20 brew install -v android-sdk;
|
||||
travis_wait 20 brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:";
|
||||
export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk;
|
||||
fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then brew update; brew install android-sdk android-ndk; export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; fi
|
||||
|
||||
script:
|
||||
- scons platform=$GODOT_TARGET CXX=$CXX openssl=builtin
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
**Operating system or device - Godot version:**
|
||||
**Operating system or device:**
|
||||
|
||||
|
||||
**Issue description** (what happened, and what was expected):
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
************************************************************************
|
||||
|
||||
Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.
|
||||
Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
67
README.md
67
README.md
@ -1,66 +1,29 @@
|
||||
[](https://godotengine.org)
|
||||

|
||||
|
||||
## Godot Engine
|
||||
http://www.godotengine.org
|
||||
|
||||
Homepage: https://godotengine.org
|
||||
### The Engine
|
||||
|
||||
#### 2D and 3D cross-platform game engine
|
||||
Godot is a fully featured, open source, MIT licensed, game engine. It focuses on having great tools, and a visual oriented workflow that can export to PC, Mobile and Web platforms with no hassle.
|
||||
The editor, language and APIs are feature rich, yet simple to learn, allowing you to become productive in a matter of hours.
|
||||
|
||||
Godot Engine is a feature-packed, cross-platform game engine to create 2D and
|
||||
3D games from a unified interface. It provides a comprehensive set of common
|
||||
tools, so that users can focus on making games without having to reinvent the
|
||||
wheel. Games can be exported in one click to a number of platforms, including
|
||||
the major desktop platforms (Linux, Mac OSX, Windows) as well as mobile
|
||||
(Android, iOS) and web-based (HTML5) platforms.
|
||||
### About
|
||||
|
||||
#### Free, open source and community-driven
|
||||
Godot has been developed by Juan Linietsky and Ariel Manzur for several years, and was born as an in-house engine, used to publish several work-for-hire titles. Godot is a member project of the [Software Freedom Conservancy](https://sfconservancy.org)
|
||||
|
||||
Godot is completely free and open source under the very permissive MIT license.
|
||||
No strings attached, no royalties, nothing. The users' games are theirs, down
|
||||
to the last line of engine code. Godot's development is fully independent and
|
||||
community-driven, empowering users to help shape their engine to match their
|
||||
expectations. It is supported by the Software Freedom Conservancy
|
||||
not-for-profit.
|
||||
### Documentation
|
||||
|
||||
Before being open sourced in February 2014, Godot had been developed by Juan
|
||||
Linietsky and Ariel Manzur (both still maintaining the project) for several
|
||||
years as an in-house engine, used to publish several work-for-hire titles.
|
||||
Documentation has been moved to [ReadTheDocs](http://docs.godotengine.org).
|
||||
|
||||
### Getting the engine
|
||||
### Binary Downloads, Community, etc.
|
||||
|
||||
#### Binary downloads
|
||||
Binary downloads, community, etc. can be found in Godot homepage:
|
||||
|
||||
Official binaries for the Godot editor and the export templates can be found
|
||||
[on the homepage](https://godotengine.org/download).
|
||||
http://www.godotengine.org
|
||||
|
||||
#### Compiling from source
|
||||
### Compiling from Source
|
||||
|
||||
[See the official docs](http://docs.godotengine.org/en/latest/reference/_compiling.html)
|
||||
for compilation instructions for every supported platform.
|
||||
|
||||
### Community
|
||||
|
||||
Godot is not only an engine but an ever-growing community of users and engine
|
||||
developers. The main community channels are listed [on the homepage](https://godotengine.org/community).
|
||||
|
||||
To get in touch with the developers, the best way is to join the
|
||||
[#godotengine IRC channel](https://webchat.freenode.net/?channels=godotengine)
|
||||
on Freenode.
|
||||
|
||||
### Documentation and demos
|
||||
|
||||
The official documentation is hosted on [ReadTheDocs](http://docs.godotengine.org).
|
||||
It is maintained by the Godot community in its own [GitHub repository](https://github.com/godotengine/godot-docs).
|
||||
|
||||
The [class reference](http://docs.godotengine.org/en/latest/classes/_classes.html)
|
||||
is also accessible from within the engine.
|
||||
|
||||
The official demos are maintained in their own [GitHub repository](https://github.com/godotengine/godot-demo-projects)
|
||||
as well.
|
||||
|
||||
There are also a number of other learning resources provided by the community,
|
||||
such as text and video tutorials, demos, etc. Consult the [community channels](https://godotengine.org/community)
|
||||
for more info.
|
||||
Compilation instructions for every platform can be found in the Wiki:
|
||||
http://docs.godotengine.org/en/latest/reference/_compiling.html
|
||||
|
||||
[](https://travis-ci.org/godotengine/godot)
|
||||
[](http://www.codetriage.com/godotengine/godot)
|
||||
|
||||
607
SConstruct
607
SConstruct
@ -1,7 +1,4 @@
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
EnsureSConsVersion(0, 14)
|
||||
EnsureSConsVersion(0,14);
|
||||
|
||||
|
||||
import string
|
||||
@ -15,85 +12,87 @@ methods.update_version()
|
||||
|
||||
# scan possible build platforms
|
||||
|
||||
platform_list = [] # list of platforms
|
||||
platform_opts = {} # options for each platform
|
||||
platform_flags = {} # flags for each platform
|
||||
platform_list = [] # list of platforms
|
||||
platform_opts = {} # options for each platform
|
||||
platform_flags = {} # flags for each platform
|
||||
|
||||
|
||||
active_platforms = []
|
||||
active_platform_ids = []
|
||||
platform_exporters = []
|
||||
global_defaults = []
|
||||
active_platforms=[]
|
||||
active_platform_ids=[]
|
||||
platform_exporters=[]
|
||||
global_defaults=[]
|
||||
|
||||
for x in glob.glob("platform/*"):
|
||||
if (not os.path.isdir(x) or not os.path.exists(x + "/detect.py")):
|
||||
continue
|
||||
tmppath = "./" + x
|
||||
if (not os.path.isdir(x) or not os.path.exists(x+"/detect.py")):
|
||||
continue
|
||||
tmppath="./"+x
|
||||
|
||||
sys.path.append(tmppath)
|
||||
import detect
|
||||
sys.path.append(tmppath)
|
||||
import detect
|
||||
|
||||
if (os.path.exists(x + "/export/export.cpp")):
|
||||
platform_exporters.append(x[9:])
|
||||
if (os.path.exists(x + "/globals/global_defaults.cpp")):
|
||||
global_defaults.append(x[9:])
|
||||
if (detect.is_active()):
|
||||
active_platforms.append(detect.get_name())
|
||||
active_platform_ids.append(x)
|
||||
if (detect.can_build()):
|
||||
x = x.replace("platform/", "") # rest of world
|
||||
x = x.replace("platform\\", "") # win32
|
||||
platform_list += [x]
|
||||
platform_opts[x] = detect.get_opts()
|
||||
platform_flags[x] = detect.get_flags()
|
||||
sys.path.remove(tmppath)
|
||||
sys.modules.pop('detect')
|
||||
if (os.path.exists(x+"/export/export.cpp")):
|
||||
platform_exporters.append(x[9:])
|
||||
if (os.path.exists(x+"/globals/global_defaults.cpp")):
|
||||
global_defaults.append(x[9:])
|
||||
if (detect.is_active()):
|
||||
active_platforms.append( detect.get_name() )
|
||||
active_platform_ids.append(x);
|
||||
if (detect.can_build()):
|
||||
x=x.replace("platform/","") # rest of world
|
||||
x=x.replace("platform\\","") # win32
|
||||
platform_list+=[x]
|
||||
platform_opts[x]=detect.get_opts()
|
||||
platform_flags[x]=detect.get_flags()
|
||||
sys.path.remove(tmppath)
|
||||
sys.modules.pop('detect')
|
||||
|
||||
module_list = methods.detect_modules()
|
||||
module_list=methods.detect_modules()
|
||||
|
||||
|
||||
# print "Detected Platforms: "+str(platform_list)
|
||||
#print "Detected Platforms: "+str(platform_list)
|
||||
|
||||
methods.save_active_platforms(active_platforms, active_platform_ids)
|
||||
methods.save_active_platforms(active_platforms,active_platform_ids)
|
||||
|
||||
custom_tools = ['default']
|
||||
custom_tools=['default']
|
||||
|
||||
platform_arg = ARGUMENTS.get("platform", ARGUMENTS.get("p", False))
|
||||
platform_arg = ARGUMENTS.get("platform", False)
|
||||
|
||||
if (os.name == "posix"):
|
||||
pass
|
||||
elif (os.name == "nt"):
|
||||
if (os.getenv("VSINSTALLDIR") == None or platform_arg == "android"):
|
||||
custom_tools = ['mingw']
|
||||
if (os.name=="posix"):
|
||||
pass
|
||||
elif (os.name=="nt"):
|
||||
if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"):
|
||||
custom_tools=['mingw']
|
||||
|
||||
env_base = Environment(tools=custom_tools)
|
||||
if 'TERM' in os.environ:
|
||||
env_base['ENV']['TERM'] = os.environ['TERM']
|
||||
env_base.AppendENVPath('PATH', os.getenv('PATH'))
|
||||
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
|
||||
env_base.global_defaults = global_defaults
|
||||
env_base.android_maven_repos = []
|
||||
env_base.android_dependencies = []
|
||||
env_base.android_java_dirs = []
|
||||
env_base.android_res_dirs = []
|
||||
env_base.android_aidl_dirs = []
|
||||
env_base.android_jni_dirs = []
|
||||
env_base.android_default_config = []
|
||||
env_base.android_manifest_chunk = ""
|
||||
env_base.android_permission_chunk = ""
|
||||
env_base.android_appattributes_chunk = ""
|
||||
env_base.disabled_modules = []
|
||||
env_base.use_ptrcall = False
|
||||
env_base.split_drivers = False
|
||||
env_base=Environment(
|
||||
tools=custom_tools,
|
||||
ENV={
|
||||
'PATH' : os.getenv('PATH'),
|
||||
'PKG_CONFIG_PATH' : os.getenv('PKG_CONFIG_PATH')
|
||||
});
|
||||
|
||||
#env_base=Environment(tools=custom_tools);
|
||||
env_base.global_defaults=global_defaults
|
||||
env_base.android_maven_repos=[]
|
||||
env_base.android_dependencies=[]
|
||||
env_base.android_java_dirs=[]
|
||||
env_base.android_res_dirs=[]
|
||||
env_base.android_aidl_dirs=[]
|
||||
env_base.android_jni_dirs=[]
|
||||
env_base.android_manifest_chunk=""
|
||||
env_base.android_permission_chunk=""
|
||||
env_base.android_appattributes_chunk=""
|
||||
env_base.disabled_modules=[]
|
||||
|
||||
env_base.split_drivers=False
|
||||
|
||||
|
||||
env_base.__class__.android_add_maven_repository = methods.android_add_maven_repository
|
||||
env_base.__class__.android_add_dependency = methods.android_add_dependency
|
||||
env_base.__class__.android_add_java_dir = methods.android_add_java_dir
|
||||
env_base.__class__.android_add_res_dir = methods.android_add_res_dir
|
||||
env_base.__class__.android_add_aidl_dir = methods.android_add_aidl_dir
|
||||
env_base.__class__.android_add_jni_dir = methods.android_add_jni_dir
|
||||
env_base.__class__.android_add_default_config = methods.android_add_default_config
|
||||
|
||||
env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository
|
||||
env_base.__class__.android_add_dependency=methods.android_add_dependency
|
||||
env_base.__class__.android_add_java_dir=methods.android_add_java_dir
|
||||
env_base.__class__.android_add_res_dir=methods.android_add_res_dir
|
||||
env_base.__class__.android_add_aidl_dir=methods.android_add_aidl_dir
|
||||
env_base.__class__.android_add_jni_dir=methods.android_add_jni_dir
|
||||
env_base.__class__.android_add_to_manifest = methods.android_add_to_manifest
|
||||
env_base.__class__.android_add_to_permissions = methods.android_add_to_permissions
|
||||
env_base.__class__.android_add_to_attributes = methods.android_add_to_attributes
|
||||
@ -101,92 +100,76 @@ env_base.__class__.disable_module = methods.disable_module
|
||||
|
||||
env_base.__class__.add_source_files = methods.add_source_files
|
||||
env_base.__class__.use_windows_spawn_fix = methods.use_windows_spawn_fix
|
||||
env_base.__class__.split_lib = methods.split_lib
|
||||
|
||||
env_base["x86_libtheora_opt_gcc"] = False
|
||||
env_base["x86_libtheora_opt_vc"] = False
|
||||
|
||||
# Build options
|
||||
env_base["x86_opt_gcc"]=False
|
||||
env_base["x86_opt_vc"]=False
|
||||
env_base["armv7_opt_gcc"]=False
|
||||
|
||||
customs = ['custom.py']
|
||||
|
||||
profile = ARGUMENTS.get("profile", False)
|
||||
if profile:
|
||||
import os.path
|
||||
if os.path.isfile(profile):
|
||||
customs.append(profile)
|
||||
elif os.path.isfile(profile + ".py"):
|
||||
customs.append(profile + ".py")
|
||||
|
||||
opts = Variables(customs, ARGUMENTS)
|
||||
|
||||
# Target build options
|
||||
opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/etc)", '')
|
||||
opts.Add('bits', "Target platform bits (default/32/64/fat)", 'default')
|
||||
opts.Add('p', "Platform (alias for 'platform')", '')
|
||||
opts.Add('platform', "Target platform: any in " + str(platform_list), '')
|
||||
opts.Add('target', "Compilation target (debug/release_debug/release)", 'debug')
|
||||
opts.Add('tools', "Build the tools a.k.a. the Godot editor (yes/no)", 'yes')
|
||||
|
||||
# Components
|
||||
opts.Add('deprecated', "Enable deprecated features (yes/no)", 'yes')
|
||||
opts.Add('gdscript', "Build GDSCript support (yes/no)", 'yes')
|
||||
opts.Add('minizip', "Build minizip archive support (yes/no)", 'yes')
|
||||
opts.Add('xml', "XML format support for resources (yes/no)", 'yes')
|
||||
|
||||
# Advanced options
|
||||
opts.Add('disable_3d', "Disable 3D nodes for smaller executable (yes/no)", 'no')
|
||||
opts.Add('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors (yes/no)", 'no')
|
||||
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
|
||||
opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '')
|
||||
opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'yes')
|
||||
opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no')
|
||||
|
||||
# Thirdparty libraries
|
||||
opts.Add('builtin_freetype', "Use the builtin freetype library (yes/no)", 'yes')
|
||||
opts.Add('builtin_glew', "Use the builtin glew library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libmpcdec', "Use the builtin libmpcdec library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libogg', "Use the builtin libogg library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libpng', "Use the builtin libpng library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libtheora', "Use the builtin libtheora library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libvorbis', "Use the builtin libvorbis library (yes/no)", 'yes')
|
||||
opts.Add('builtin_libwebp', "Use the builtin libwebp library (yes/no)", 'yes')
|
||||
opts.Add('builtin_openssl', "Use the builtin openssl library (yes/no)", 'yes')
|
||||
opts.Add('builtin_opus', "Use the builtin opus library (yes/no)", 'yes')
|
||||
# (akien) Unbundling would require work in audio_stream_speex.{cpp,h}, but since speex was
|
||||
# removed in 3.0+ and this is only to preserve compatibility in 2.1, I haven't worked on it.
|
||||
# Patches welcome if anyone cares :)
|
||||
opts.Add('builtin_speex', "Use the builtin speex library (yes/no)", 'yes')
|
||||
opts.Add('builtin_squish', "Use the builtin squish library (yes/no)", 'yes')
|
||||
opts.Add('builtin_zlib', "Use the builtin zlib library (yes/no)", 'yes')
|
||||
|
||||
# Environment setup
|
||||
opts.Add("CXX", "C++ compiler")
|
||||
opts.Add("CC", "C compiler")
|
||||
opts.Add("CCFLAGS", "Custom flags for the C and C++ compilers")
|
||||
opts.Add("CFLAGS", "Custom flags for the C compiler")
|
||||
opts.Add("LINKFLAGS", "Custom flags for the linker")
|
||||
import os.path
|
||||
if os.path.isfile(profile):
|
||||
customs.append(profile)
|
||||
elif os.path.isfile(profile+".py"):
|
||||
customs.append(profile+".py")
|
||||
|
||||
opts=Variables(customs, ARGUMENTS)
|
||||
opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug")
|
||||
opts.Add('bits', 'Compile Target Bits (default/32/64).', "default")
|
||||
opts.Add('platform','Platform: '+str(platform_list)+'.',"")
|
||||
opts.Add('p','Platform (same as platform=).',"")
|
||||
opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes')
|
||||
opts.Add('gdscript','Build GDSCript support: (yes/no)','yes')
|
||||
opts.Add('vorbis','Build Ogg Vorbis Support: (yes/no)','yes')
|
||||
opts.Add('opus','Build Opus Audio Format Support: (yes/no)','yes')
|
||||
opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
|
||||
opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
|
||||
opts.Add('theora','Theora Video (yes/no)','yes')
|
||||
opts.Add('theoralib','Theora Video (yes/no)','no')
|
||||
opts.Add('freetype','Freetype support in editor','yes')
|
||||
opts.Add('speex','Speex Audio (yes/no)','yes')
|
||||
opts.Add('xml','XML Save/Load support (yes/no)','yes')
|
||||
opts.Add('png','PNG Image loader support (yes/no)','yes')
|
||||
opts.Add('jpg','JPG Image loader support (yes/no)','yes')
|
||||
opts.Add('webp','WEBP Image loader support (yes/no)','yes')
|
||||
opts.Add('dds','DDS Texture loader support (yes/no)','yes')
|
||||
opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes')
|
||||
opts.Add('etc1','etc1 Texture compression support (yes/no)','yes')
|
||||
opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes')
|
||||
opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
|
||||
opts.Add('musepack','Musepack Audio (yes/no)','yes')
|
||||
opts.Add("CXX", "Compiler");
|
||||
opts.Add("CCFLAGS", "Custom flags for the C++ compiler");
|
||||
opts.Add("CFLAGS", "Custom flags for the C compiler");
|
||||
opts.Add("LINKFLAGS", "Custom flags for the linker");
|
||||
opts.Add('unix_global_settings_path', 'unix-specific path to system-wide settings. Currently only used by templates.','')
|
||||
opts.Add('disable_3d', 'Disable 3D nodes for smaller executable (yes/no)', "no")
|
||||
opts.Add('disable_advanced_gui', 'Disable advance 3D gui nodes and behaviors (yes/no)', "no")
|
||||
opts.Add('colored', 'Enable colored output for the compilation (yes/no)', 'no')
|
||||
opts.Add('extra_suffix', 'Custom extra suffix added to the base filename of all generated binary files.', '')
|
||||
opts.Add('vsproj', 'Generate Visual Studio Project. (yes/no)', 'no')
|
||||
|
||||
# add platform specific options
|
||||
|
||||
for k in platform_opts.keys():
|
||||
opt_list = platform_opts[k]
|
||||
for o in opt_list:
|
||||
opts.Add(o[0], o[1], o[2])
|
||||
opt_list = platform_opts[k]
|
||||
for o in opt_list:
|
||||
opts.Add(o[0],o[1],o[2])
|
||||
|
||||
for x in module_list:
|
||||
opts.Add('module_' + x + '_enabled', "Enable module '" + x + "' (yes/no)", "yes")
|
||||
opts.Add('module_'+x+'_enabled', "Enable module '"+x+"'.", "yes")
|
||||
|
||||
opts.Update(env_base) # update environment
|
||||
Help(opts.GenerateHelpText(env_base)) # generate help
|
||||
opts.Update(env_base) # update environment
|
||||
Help(opts.GenerateHelpText(env_base)) # generate help
|
||||
|
||||
# add default include paths
|
||||
|
||||
env_base.Append(CPPPATH=['#core', '#core/math', '#tools', '#drivers', '#'])
|
||||
env_base.Append(CPPPATH=['#core','#core/math','#tools','#drivers','#'])
|
||||
|
||||
# configure ENV for platform
|
||||
env_base.platform_exporters = platform_exporters
|
||||
env_base.platform_exporters=platform_exporters
|
||||
|
||||
"""
|
||||
sys.path.append("./platform/"+env_base["platform"])
|
||||
@ -196,222 +179,246 @@ sys.path.remove("./platform/"+env_base["platform"])
|
||||
sys.modules.pop('detect')
|
||||
"""
|
||||
|
||||
if (env_base['target'] == 'debug'):
|
||||
env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
|
||||
env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE'])
|
||||
|
||||
if (env_base['deprecated'] != 'no'):
|
||||
env_base.Append(CPPFLAGS=['-DENABLE_DEPRECATED'])
|
||||
if (env_base['target']=='debug'):
|
||||
env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']);
|
||||
env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE'])
|
||||
|
||||
env_base.platforms = {}
|
||||
|
||||
|
||||
selected_platform = ""
|
||||
selected_platform =""
|
||||
|
||||
if env_base['platform'] != "":
|
||||
selected_platform = env_base['platform']
|
||||
selected_platform=env_base['platform']
|
||||
elif env_base['p'] != "":
|
||||
selected_platform = env_base['p']
|
||||
env_base["platform"] = selected_platform
|
||||
selected_platform=env_base['p']
|
||||
env_base["platform"]=selected_platform
|
||||
|
||||
|
||||
if selected_platform in platform_list:
|
||||
|
||||
sys.path.append("./platform/" + selected_platform)
|
||||
import detect
|
||||
if "create" in dir(detect):
|
||||
env = detect.create(env_base)
|
||||
else:
|
||||
env = env_base.Clone()
|
||||
sys.path.append("./platform/"+selected_platform)
|
||||
import detect
|
||||
if "create" in dir(detect):
|
||||
env = detect.create(env_base)
|
||||
else:
|
||||
env = env_base.Clone()
|
||||
|
||||
if env['vsproj'] == "yes":
|
||||
env.vs_incs = []
|
||||
env.vs_srcs = []
|
||||
if env['vsproj']=="yes":
|
||||
env.vs_incs = []
|
||||
env.vs_srcs = []
|
||||
|
||||
def AddToVSProject(sources):
|
||||
for x in sources:
|
||||
if type(x) == type(""):
|
||||
fname = env.File(x).path
|
||||
else:
|
||||
fname = env.File(x)[0].path
|
||||
pieces = fname.split(".")
|
||||
if len(pieces) > 0:
|
||||
basename = pieces[0]
|
||||
basename = basename.replace('\\\\', '/')
|
||||
env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
|
||||
env.vs_incs = env.vs_incs + [basename + ".h"]
|
||||
# print basename
|
||||
env.AddToVSProject = AddToVSProject
|
||||
def AddToVSProject( sources ):
|
||||
for x in sources:
|
||||
if type(x) == type(""):
|
||||
fname = env.File(x).path
|
||||
else:
|
||||
fname = env.File(x)[0].path
|
||||
pieces = fname.split(".")
|
||||
if len(pieces)>0:
|
||||
basename = pieces[0]
|
||||
basename = basename.replace('\\\\','/')
|
||||
env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
|
||||
env.vs_incs = env.vs_incs + [basename + ".h"]
|
||||
#print basename
|
||||
env.AddToVSProject = AddToVSProject
|
||||
|
||||
env.extra_suffix = ""
|
||||
env.extra_suffix=""
|
||||
|
||||
if env["extra_suffix"] != '':
|
||||
env.extra_suffix += '.' + env["extra_suffix"]
|
||||
if env["extra_suffix"] != '' :
|
||||
env.extra_suffix += '.'+env["extra_suffix"]
|
||||
|
||||
CCFLAGS = env.get('CCFLAGS', '')
|
||||
env['CCFLAGS'] = ''
|
||||
CCFLAGS = env.get('CCFLAGS', '')
|
||||
env['CCFLAGS'] = ''
|
||||
|
||||
env.Append(CCFLAGS=string.split(str(CCFLAGS)))
|
||||
env.Append(CCFLAGS=string.split(str(CCFLAGS)))
|
||||
|
||||
CFLAGS = env.get('CFLAGS', '')
|
||||
env['CFLAGS'] = ''
|
||||
CFLAGS = env.get('CFLAGS', '')
|
||||
env['CFLAGS'] = ''
|
||||
|
||||
env.Append(CFLAGS=string.split(str(CFLAGS)))
|
||||
env.Append(CFLAGS=string.split(str(CFLAGS)))
|
||||
|
||||
LINKFLAGS = env.get('LINKFLAGS', '')
|
||||
env['LINKFLAGS'] = ''
|
||||
LINKFLAGS = env.get('LINKFLAGS', '')
|
||||
env['LINKFLAGS'] = ''
|
||||
|
||||
env.Append(LINKFLAGS=string.split(str(LINKFLAGS)))
|
||||
env.Append(LINKFLAGS=string.split(str(LINKFLAGS)))
|
||||
|
||||
flag_list = platform_flags[selected_platform]
|
||||
for f in flag_list:
|
||||
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
|
||||
env[f[0]] = f[1]
|
||||
flag_list = platform_flags[selected_platform]
|
||||
for f in flag_list:
|
||||
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
|
||||
env[f[0]] = f[1]
|
||||
|
||||
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
|
||||
detect.configure(env)
|
||||
#must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
|
||||
detect.configure(env)
|
||||
|
||||
#env['platform_libsuffix'] = env['LIBSUFFIX']
|
||||
#env['platform_libsuffix'] = env['LIBSUFFIX']
|
||||
|
||||
suffix = "." + selected_platform
|
||||
suffix="."+selected_platform
|
||||
|
||||
if (env["target"] == "release"):
|
||||
if (env["tools"] == "yes"):
|
||||
print("Tools can only be built with targets 'debug' and 'release_debug'.")
|
||||
sys.exit(255)
|
||||
suffix += ".opt"
|
||||
if (env["target"]=="release"):
|
||||
if (env["tools"]=="yes"):
|
||||
print("Tools can only be built with targets 'debug' and 'release_debug'.")
|
||||
sys.exit(255)
|
||||
suffix+=".opt"
|
||||
|
||||
env.Append(CCFLAGS=['-DNDEBUG'])
|
||||
elif (env["target"]=="release_debug"):
|
||||
if (env["tools"]=="yes"):
|
||||
suffix+=".opt.tools"
|
||||
else:
|
||||
suffix+=".opt.debug"
|
||||
else:
|
||||
if (env["tools"]=="yes"):
|
||||
suffix+=".tools"
|
||||
else:
|
||||
suffix+=".debug"
|
||||
|
||||
elif (env["target"] == "release_debug"):
|
||||
if (env["tools"] == "yes"):
|
||||
suffix += ".opt.tools"
|
||||
else:
|
||||
suffix += ".opt.debug"
|
||||
else:
|
||||
if (env["tools"] == "yes"):
|
||||
suffix += ".tools"
|
||||
else:
|
||||
suffix += ".debug"
|
||||
if (env["bits"]=="32"):
|
||||
suffix+=".32"
|
||||
elif (env["bits"]=="64"):
|
||||
suffix+=".64"
|
||||
|
||||
if env["arch"] != "":
|
||||
suffix += "." + env["arch"]
|
||||
elif (env["bits"] == "32"):
|
||||
suffix += ".32"
|
||||
elif (env["bits"] == "64"):
|
||||
suffix += ".64"
|
||||
elif (env["bits"] == "fat"):
|
||||
suffix += ".fat"
|
||||
suffix+=env.extra_suffix
|
||||
|
||||
suffix += env.extra_suffix
|
||||
env["PROGSUFFIX"]=suffix+env["PROGSUFFIX"]
|
||||
env["OBJSUFFIX"]=suffix+env["OBJSUFFIX"]
|
||||
env["LIBSUFFIX"]=suffix+env["LIBSUFFIX"]
|
||||
env["SHLIBSUFFIX"]=suffix+env["SHLIBSUFFIX"]
|
||||
|
||||
env["PROGSUFFIX"] = suffix + env["PROGSUFFIX"]
|
||||
env["OBJSUFFIX"] = suffix + env["OBJSUFFIX"]
|
||||
env["LIBSUFFIX"] = suffix + env["LIBSUFFIX"]
|
||||
env["SHLIBSUFFIX"] = suffix + env["SHLIBSUFFIX"]
|
||||
sys.path.remove("./platform/"+selected_platform)
|
||||
sys.modules.pop('detect')
|
||||
|
||||
sys.path.remove("./platform/" + selected_platform)
|
||||
sys.modules.pop('detect')
|
||||
|
||||
env.module_list = []
|
||||
env.module_list=[]
|
||||
|
||||
for x in module_list:
|
||||
if env['module_' + x + '_enabled'] != "yes":
|
||||
continue
|
||||
tmppath = "./modules/" + x
|
||||
sys.path.append(tmppath)
|
||||
env.current_module = x
|
||||
import config
|
||||
if (config.can_build(selected_platform)):
|
||||
config.configure(env)
|
||||
env.module_list.append(x)
|
||||
sys.path.remove(tmppath)
|
||||
sys.modules.pop('config')
|
||||
for x in module_list:
|
||||
if env['module_'+x+'_enabled'] != "yes":
|
||||
continue
|
||||
tmppath="./modules/"+x
|
||||
sys.path.append(tmppath)
|
||||
env.current_module=x
|
||||
import config
|
||||
if (config.can_build(selected_platform)):
|
||||
config.configure(env)
|
||||
env.module_list.append(x)
|
||||
sys.path.remove(tmppath)
|
||||
sys.modules.pop('config')
|
||||
|
||||
if (env.use_ptrcall):
|
||||
env.Append(CPPFLAGS=['-DPTRCALL_ENABLED'])
|
||||
|
||||
# to test 64 bits compiltion
|
||||
# env.Append(CPPFLAGS=['-m64'])
|
||||
if (env['musepack']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DMUSEPACK_ENABLED']);
|
||||
|
||||
if (env['tools'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DTOOLS_ENABLED'])
|
||||
if (env['disable_3d'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-D_3D_DISABLED'])
|
||||
if (env['gdscript'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DGDSCRIPT_ENABLED'])
|
||||
if (env['disable_advanced_gui'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DADVANCED_GUI_DISABLED'])
|
||||
#if (env['openssl']!='no'):
|
||||
# env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']);
|
||||
# if (env['openssl']=="builtin"):
|
||||
# env.Append(CPPPATH=['#drivers/builtin_openssl2'])
|
||||
|
||||
if (env['minizip'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DMINIZIP_ENABLED'])
|
||||
if (env["builtin_zlib"]=='yes'):
|
||||
env.Append(CPPPATH=['#drivers/builtin_zlib/zlib'])
|
||||
|
||||
if (env['xml'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DXML_ENABLED'])
|
||||
# to test 64 bits compiltion
|
||||
# env.Append(CPPFLAGS=['-m64'])
|
||||
|
||||
if (env['verbose'] == 'no'):
|
||||
methods.no_verbose(sys, env)
|
||||
if (env_base['squish']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DSQUISH_ENABLED']);
|
||||
|
||||
Export('env')
|
||||
if (env['vorbis']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DVORBIS_ENABLED']);
|
||||
if (env['opus']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DOPUS_ENABLED']);
|
||||
|
||||
# build subdirs, the build order is dependent on link order.
|
||||
|
||||
SConscript("core/SCsub")
|
||||
SConscript("servers/SCsub")
|
||||
SConscript("scene/SCsub")
|
||||
SConscript("tools/SCsub")
|
||||
SConscript("drivers/SCsub")
|
||||
if (env['theora']=='yes'):
|
||||
env['theoralib']='yes'
|
||||
env.Append(CPPFLAGS=['-DTHEORA_ENABLED']);
|
||||
if (env['theoralib']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DTHEORALIB_ENABLED']);
|
||||
|
||||
SConscript("modules/SCsub")
|
||||
SConscript("main/SCsub")
|
||||
if (env['png']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DPNG_ENABLED']);
|
||||
if (env['dds']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DDDS_ENABLED']);
|
||||
if (env['pvr']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DPVR_ENABLED']);
|
||||
if (env['jpg']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DJPG_ENABLED']);
|
||||
if (env['webp']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DWEBP_ENABLED']);
|
||||
|
||||
SConscript("platform/" + selected_platform + "/SCsub") # build selected platform
|
||||
if (env['speex']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DSPEEX_ENABLED']);
|
||||
|
||||
# Microsoft Visual Studio Project Generation
|
||||
if (env['vsproj']) == "yes":
|
||||
if (env['tools']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DTOOLS_ENABLED'])
|
||||
if (env['disable_3d']=='yes'):
|
||||
env.Append(CPPFLAGS=['-D_3D_DISABLED'])
|
||||
if (env['gdscript']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DGDSCRIPT_ENABLED'])
|
||||
if (env['disable_advanced_gui']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DADVANCED_GUI_DISABLED'])
|
||||
|
||||
AddToVSProject(env.core_sources)
|
||||
AddToVSProject(env.main_sources)
|
||||
AddToVSProject(env.modules_sources)
|
||||
AddToVSProject(env.scene_sources)
|
||||
AddToVSProject(env.servers_sources)
|
||||
AddToVSProject(env.tool_sources)
|
||||
if (env['minizip'] == 'yes'):
|
||||
env.Append(CPPFLAGS=['-DMINIZIP_ENABLED'])
|
||||
|
||||
# this env flag won't work, it needs to be set in env_base=Environment(MSVC_VERSION='9.0')
|
||||
# Even then, SCons still seems to ignore it and builds with the latest MSVC...
|
||||
# That said, it's not needed to be set so far but I'm leaving it here so that this comment
|
||||
# has a purpose.
|
||||
# env['MSVS_VERSION']='9.0'
|
||||
if (env['xml']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DXML_ENABLED'])
|
||||
|
||||
# Calls a CMD with /C(lose) and /V(delayed environment variable expansion) options.
|
||||
# And runs vcvarsall bat for the propper arhitecture and scons for propper configuration
|
||||
env['MSVSBUILDCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) ^& call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons platform=windows target=$(Configuration) tools=!tools! -j2'
|
||||
env['MSVSREBUILDCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) & call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons platform=windows target=$(Configuration) tools=!tools! vsproj=yes -j2'
|
||||
env['MSVSCLEANCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) ^& call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons --clean platform=windows target=$(Configuration) tools=!tools! -j2'
|
||||
if (env['colored']=='yes'):
|
||||
methods.colored(sys,env)
|
||||
|
||||
# This version information (Win32, x64, Debug, Release, Release_Debug seems to be
|
||||
# required for Visual Studio to understand that it needs to generate an NMAKE
|
||||
# project. Do not modify without knowing what you are doing.
|
||||
debug_variants = ['debug|Win32'] + ['debug|x64']
|
||||
release_variants = ['release|Win32'] + ['release|x64']
|
||||
release_debug_variants = ['release_debug|Win32'] + ['release_debug|x64']
|
||||
variants = debug_variants + release_variants + release_debug_variants
|
||||
debug_targets = ['bin\\godot.windows.tools.32.exe'] + ['bin\\godot.windows.tools.64.exe']
|
||||
release_targets = ['bin\\godot.windows.opt.32.exe'] + ['bin\\godot.windows.opt.64.exe']
|
||||
release_debug_targets = ['bin\\godot.windows.opt.tools.32.exe'] + ['bin\\godot.windows.opt.tools.64.exe']
|
||||
targets = debug_targets + release_targets + release_debug_targets
|
||||
msvproj = env.MSVSProject(target=['#godot' + env['MSVSPROJECTSUFFIX']],
|
||||
incs=env.vs_incs,
|
||||
srcs=env.vs_srcs,
|
||||
runfile=targets,
|
||||
buildtarget=targets,
|
||||
auto_build_solution=1,
|
||||
variant=variants)
|
||||
if (env['etc1']=='yes'):
|
||||
env.Append(CPPFLAGS=['-DETC1_ENABLED'])
|
||||
|
||||
Export('env')
|
||||
|
||||
#build subdirs, the build order is dependent on link order.
|
||||
|
||||
SConscript("core/SCsub")
|
||||
SConscript("servers/SCsub")
|
||||
SConscript("scene/SCsub")
|
||||
SConscript("tools/SCsub")
|
||||
SConscript("drivers/SCsub")
|
||||
SConscript("bin/SCsub")
|
||||
|
||||
SConscript("modules/SCsub")
|
||||
SConscript("main/SCsub")
|
||||
|
||||
SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform
|
||||
|
||||
# Microsoft Visual Studio Project Generation
|
||||
if (env['vsproj'])=="yes":
|
||||
|
||||
AddToVSProject(env.core_sources)
|
||||
AddToVSProject(env.main_sources)
|
||||
AddToVSProject(env.modules_sources)
|
||||
AddToVSProject(env.scene_sources)
|
||||
AddToVSProject(env.servers_sources)
|
||||
AddToVSProject(env.tool_sources)
|
||||
|
||||
#env['MSVS_VERSION']='9.0'
|
||||
env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
||||
env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes vsproj=true"
|
||||
env['MSVSCLEANCOM'] = "scons --clean platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
|
||||
|
||||
debug_variants = ['Debug|Win32']+['Debug|x64']
|
||||
release_variants = ['Release|Win32']+['Release|x64']
|
||||
release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64']
|
||||
variants = debug_variants + release_variants + release_debug_variants
|
||||
debug_targets = ['Debug']+['Debug']
|
||||
release_targets = ['Release']+['Release']
|
||||
release_debug_targets = ['ReleaseDebug']+['ReleaseDebug']
|
||||
targets = debug_targets + release_targets + release_debug_targets
|
||||
msvproj = env.MSVSProject(target = ['#godot' + env['MSVSPROJECTSUFFIX'] ],
|
||||
incs = env.vs_incs,
|
||||
srcs = env.vs_srcs,
|
||||
runfile = targets,
|
||||
buildtarget = targets,
|
||||
auto_build_solution=1,
|
||||
variant = variants)
|
||||
|
||||
else:
|
||||
|
||||
print("No valid target platform selected.")
|
||||
print("The following were detected:")
|
||||
for x in platform_list:
|
||||
print("\t" + x)
|
||||
print("\nPlease run scons again with argument: platform=<string>")
|
||||
print("No valid target platform selected.")
|
||||
print("The following were detected:")
|
||||
for x in platform_list:
|
||||
print("\t"+x)
|
||||
print("\nPlease run scons again with argument: platform=<string>")
|
||||
|
||||
4
bin/SCsub
Normal file
4
bin/SCsub
Normal file
@ -0,0 +1,4 @@
|
||||
Import('env')
|
||||
Export('env')
|
||||
|
||||
SConscript('tests/SCsub');
|
||||
12
bin/tests/SCsub
Normal file
12
bin/tests/SCsub
Normal file
@ -0,0 +1,12 @@
|
||||
Import('env')
|
||||
|
||||
env.tests_sources=[]
|
||||
env.add_source_files(env.tests_sources,"*.cpp")
|
||||
|
||||
Export('env')
|
||||
|
||||
#SConscript('math/SCsub');
|
||||
|
||||
lib = env.Library("tests",env.tests_sources)
|
||||
|
||||
env.Prepend(LIBS=[lib])
|
||||
@ -487,12 +487,12 @@ static String _disassemble_addr(const Ref<GDScript>& p_script,const GDFunction&
|
||||
static void _disassemble_class(const Ref<GDScript>& p_class,const Vector<String>& p_code) {
|
||||
|
||||
|
||||
const Map<StringName,GDFunction*>& mf = p_class->debug_get_member_functions();
|
||||
const Map<StringName,GDFunction>& mf = p_class->debug_get_member_functions();
|
||||
|
||||
for(const Map<StringName,GDFunction*>::Element *E=mf.front();E;E=E->next()) {
|
||||
for(const Map<StringName,GDFunction>::Element *E=mf.front();E;E=E->next()) {
|
||||
|
||||
|
||||
const GDFunction &func=*E->get();
|
||||
const GDFunction &func=E->get();
|
||||
const int *code = func.get_code();
|
||||
int codelen=func.get_code_size();
|
||||
String defargs;
|
||||
@ -40,9 +40,6 @@
|
||||
#include "scene/resources/texture.h"
|
||||
#include "vmap.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#include "method_ptrcall.h"
|
||||
|
||||
namespace TestMath {
|
||||
|
||||
|
||||
@ -108,13 +105,8 @@ uint32_t ihash3( uint32_t a)
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
MainLoop* test() {
|
||||
|
||||
print_line(itos(Math::step_decimals( 0.0001 )));
|
||||
return NULL;
|
||||
|
||||
{
|
||||
|
||||
@ -126,7 +118,10 @@ MainLoop* test() {
|
||||
for (List<StringName>::Element *E=tl.front();E;E=E->next()) {
|
||||
|
||||
Vector<uint8_t> m5b = E->get().operator String().md5_buffer();
|
||||
uint32_t *ub = (uint32_t*)m5b.ptr();
|
||||
//hashes.push_back(ihash(ihash2(ihash3(*ub))));
|
||||
hashes.push_back(hashes.size());
|
||||
//hashes.push_back(E->get().hash());
|
||||
|
||||
}
|
||||
|
||||
@ -53,4 +53,4 @@ void test() {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@ -32,7 +32,6 @@
|
||||
#include <stdio.h>
|
||||
#include "os/os.h"
|
||||
#include "drivers/nrex/regex.h"
|
||||
#include "core/io/ip_address.h"
|
||||
|
||||
#include "test_string.h"
|
||||
|
||||
@ -844,62 +843,6 @@ bool test_28() {
|
||||
return state;
|
||||
}
|
||||
|
||||
bool test_29() {
|
||||
|
||||
bool error = false;
|
||||
bool state = true;
|
||||
bool success = false;
|
||||
|
||||
IP_Address ip0("2001:0db8:85a3:0000:0000:8a2e:0370:7334");
|
||||
OS::get_singleton()->print("ip0 is %ls\n", String(ip0).c_str());
|
||||
|
||||
IP_Address ip(0x0123, 0x4567, 0x89ab, 0xcdef, true);
|
||||
OS::get_singleton()->print("ip6 is %ls\n", String(ip).c_str());
|
||||
|
||||
IP_Address ip2("fe80::52e5:49ff:fe93:1baf");
|
||||
OS::get_singleton()->print("ip6 is %ls\n", String(ip2).c_str());
|
||||
|
||||
IP_Address ip3("::ffff:192.168.0.1");
|
||||
OS::get_singleton()->print("ip6 is %ls\n", String(ip3).c_str());
|
||||
|
||||
String ip4 = "192.168.0.1";
|
||||
success = ip4.is_valid_ip_address();
|
||||
OS::get_singleton()->print("Is valid ipv4: %ls, %s\n", ip4.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
ip4 = "192.368.0.1";
|
||||
success = (!ip4.is_valid_ip_address());
|
||||
OS::get_singleton()->print("Is invalid ipv4: %ls, %s\n", ip4.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
String ip6 = "2001:0db8:85a3:0000:0000:8a2e:0370:7334";
|
||||
success = ip6.is_valid_ip_address();
|
||||
OS::get_singleton()->print("Is valid ipv6: %ls, %s\n", ip6.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
ip6 = "2001:0db8:85j3:0000:0000:8a2e:0370:7334";
|
||||
success = (!ip6.is_valid_ip_address());
|
||||
OS::get_singleton()->print("Is invalid ipv6: %ls, %s\n", ip6.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
ip6 = "2001:0db8:85f345:0000:0000:8a2e:0370:7334";
|
||||
success = (!ip6.is_valid_ip_address());
|
||||
OS::get_singleton()->print("Is invalid ipv6: %ls, %s\n", ip6.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
ip6 = "2001:0db8::0:8a2e:370:7334";
|
||||
success = (ip6.is_valid_ip_address());
|
||||
OS::get_singleton()->print("Is valid ipv6: %ls, %s\n", ip6.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
ip6 = "::ffff:192.168.0.1";
|
||||
success = (ip6.is_valid_ip_address());
|
||||
OS::get_singleton()->print("Is valid ipv6: %ls, %s\n", ip6.c_str(), success ? "OK" : "FAIL");
|
||||
if (!success) state = false;
|
||||
|
||||
return state;
|
||||
};
|
||||
|
||||
typedef bool (*TestFunc)(void);
|
||||
|
||||
TestFunc test_funcs[] = {
|
||||
@ -932,7 +875,6 @@ TestFunc test_funcs[] = {
|
||||
test_26,
|
||||
test_27,
|
||||
test_28,
|
||||
test_29,
|
||||
0
|
||||
|
||||
};
|
||||
72
core/SCsub
72
core/SCsub
@ -1,67 +1,65 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import('env')
|
||||
|
||||
env.core_sources = []
|
||||
env.core_sources=[]
|
||||
|
||||
|
||||
gd_call = ""
|
||||
gd_inc = ""
|
||||
gd_call=""
|
||||
gd_inc=""
|
||||
|
||||
for x in env.global_defaults:
|
||||
env.core_sources.append("#platform/" + x + "/globals/global_defaults.cpp")
|
||||
gd_inc += '#include "platform/' + x + '/globals/global_defaults.h"\n'
|
||||
gd_call += "\tregister_" + x + "_global_defaults();\n"
|
||||
env.core_sources.append("#platform/"+x+"/globals/global_defaults.cpp")
|
||||
gd_inc+='#include "platform/'+x+'/globals/global_defaults.h"\n'
|
||||
gd_call+="\tregister_"+x+"_global_defaults();\n"
|
||||
|
||||
gd_cpp = '#include "globals.h"\n'
|
||||
gd_cpp += gd_inc
|
||||
gd_cpp += "void Globals::register_global_defaults() {\n" + gd_call + "\n}\n"
|
||||
gd_cpp='#include "globals.h"\n'
|
||||
gd_cpp+=gd_inc
|
||||
gd_cpp+="void Globals::register_global_defaults() {\n"+gd_call+"\n}\n"
|
||||
|
||||
f = open("global_defaults.cpp", "wb")
|
||||
f = open("global_defaults.cpp","wb")
|
||||
f.write(gd_cpp)
|
||||
f.close()
|
||||
|
||||
import os
|
||||
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
|
||||
if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
|
||||
e = os.environ["SCRIPT_AES256_ENCRYPTION_KEY"]
|
||||
txt = ""
|
||||
ec_valid = True
|
||||
if (len(e) != 64):
|
||||
ec_valid = False
|
||||
else:
|
||||
e=os.environ["SCRIPT_AES256_ENCRYPTION_KEY"]
|
||||
txt = ""
|
||||
ec_valid=True
|
||||
if (len(e)!=64):
|
||||
ec_valid=False
|
||||
else:
|
||||
|
||||
for i in range(len(e) >> 1):
|
||||
if (i > 0):
|
||||
txt += ","
|
||||
txts = "0x" + e[i * 2:i * 2 + 2]
|
||||
try:
|
||||
int(txts, 16)
|
||||
except:
|
||||
ec_valid = False
|
||||
txt += txts
|
||||
if (not ec_valid):
|
||||
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
|
||||
print("Invalid AES256 encryption key, not 64 bits hex: " + e)
|
||||
for i in range(len(e)>>1):
|
||||
if (i>0):
|
||||
txt+=","
|
||||
txts="0x"+e[i*2:i*2+2]
|
||||
try:
|
||||
int(txts,16)
|
||||
except:
|
||||
ec_valid=False
|
||||
txt+=txts
|
||||
if (not ec_valid):
|
||||
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
|
||||
print("Invalid AES256 encryption key, not 64 bits hex: "+e)
|
||||
|
||||
f = open("script_encryption_key.cpp", "wb")
|
||||
f.write("#include \"globals.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
|
||||
f.close()
|
||||
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
env.add_source_files(env.core_sources,"*.cpp")
|
||||
|
||||
|
||||
Export('env')
|
||||
|
||||
import make_binders
|
||||
env.Command(['method_bind.inc', 'method_bind_ext.inc'], 'make_binders.py', make_binders.run)
|
||||
env.Command(['method_bind.inc','method_bind_ext.inc'], 'make_binders.py', make_binders.run)
|
||||
|
||||
SConscript('os/SCsub')
|
||||
SConscript('math/SCsub')
|
||||
SConscript('io/SCsub')
|
||||
SConscript('bind/SCsub')
|
||||
SConscript('os/SCsub');
|
||||
SConscript('math/SCsub');
|
||||
SConscript('io/SCsub');
|
||||
SConscript('bind/SCsub');
|
||||
|
||||
lib = env.Library("core", env.core_sources)
|
||||
lib = env.Library("core",env.core_sources)
|
||||
|
||||
env.Prepend(LIBS=[lib])
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -150,68 +150,9 @@ void Array::erase(const Variant& p_value) {
|
||||
_p->array.erase(p_value);
|
||||
}
|
||||
|
||||
Variant Array::front() const {
|
||||
ERR_FAIL_COND_V(_p->array.size() == 0, Variant());
|
||||
return operator[](0);
|
||||
}
|
||||
int Array::find(const Variant& p_value) const {
|
||||
|
||||
Variant Array::back() const {
|
||||
ERR_FAIL_COND_V(_p->array.size() == 0, Variant());
|
||||
return operator[](_p->array.size() - 1);
|
||||
}
|
||||
|
||||
int Array::find(const Variant& p_value, int p_from) const {
|
||||
|
||||
return _p->array.find(p_value, p_from);
|
||||
}
|
||||
|
||||
int Array::rfind(const Variant& p_value, int p_from) const {
|
||||
|
||||
if (_p->array.size() == 0)
|
||||
return -1;
|
||||
|
||||
if (p_from < 0) {
|
||||
// Relative offset from the end
|
||||
p_from = _p->array.size() + p_from;
|
||||
}
|
||||
if (p_from < 0 || p_from >= _p->array.size()) {
|
||||
// Limit to array boundaries
|
||||
p_from = _p->array.size() - 1;
|
||||
}
|
||||
|
||||
for (int i=p_from; i>=0; i--) {
|
||||
|
||||
if(_p->array[i] == p_value){
|
||||
return i;
|
||||
};
|
||||
};
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Array::find_last(const Variant& p_value) const {
|
||||
|
||||
return rfind(p_value);
|
||||
}
|
||||
|
||||
int Array::count(const Variant& p_value) const {
|
||||
|
||||
if(_p->array.size() == 0)
|
||||
return 0;
|
||||
|
||||
int amount=0;
|
||||
for (int i=0; i<_p->array.size(); i++) {
|
||||
|
||||
if(_p->array[i] == p_value){
|
||||
amount++;
|
||||
};
|
||||
};
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
bool Array::has(const Variant& p_value) const {
|
||||
return _p->array.find(p_value, 0) != -1;
|
||||
return _p->array.find(p_value);
|
||||
}
|
||||
|
||||
void Array::remove(int p_pos) {
|
||||
|
||||
11
core/array.h
11
core/array.h
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -67,18 +67,11 @@ public:
|
||||
void insert(int p_pos, const Variant& p_value);
|
||||
void remove(int p_pos);
|
||||
|
||||
Variant front() const;
|
||||
Variant back() const;
|
||||
|
||||
void sort();
|
||||
void sort_custom(Object *p_obj,const StringName& p_function);
|
||||
void invert();
|
||||
|
||||
int find(const Variant& p_value, int p_from=0) const;
|
||||
int rfind(const Variant& p_value, int p_from=-1) const;
|
||||
int find_last(const Variant& p_value) const;
|
||||
int count(const Variant& p_value) const;
|
||||
bool has(const Variant& p_value) const;
|
||||
int find(const Variant& p_value) const;
|
||||
|
||||
void erase(const Variant& p_value);
|
||||
|
||||
|
||||
35
core/balloon_allocator.h
Normal file
35
core/balloon_allocator.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*************************************************************************/
|
||||
/* balloon_allocator.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef BALLOON_ALLOCATOR_H
|
||||
#define BALLOON_ALLOCATOR_H
|
||||
|
||||
#include "os/memory.h"
|
||||
|
||||
#include "allocators.h"
|
||||
#endif // BALLOON_ALLOCATOR_H
|
||||
@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import('env')
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
env.add_source_files(env.core_sources,"*.cpp")
|
||||
|
||||
Export('env')
|
||||
|
||||
@ -1,31 +1,3 @@
|
||||
/*************************************************************************/
|
||||
/* core_bind.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#include "core_bind.h"
|
||||
#include "os/os.h"
|
||||
#include "geometry.h"
|
||||
@ -34,29 +6,6 @@
|
||||
#include "core/globals.h"
|
||||
#include "io/file_access_encrypted.h"
|
||||
#include "os/keyboard.h"
|
||||
|
||||
/**
|
||||
* Time constants borrowed from loc_time.h
|
||||
*/
|
||||
#define EPOCH_YR 1970 /* EPOCH = Jan 1 1970 00:00:00 */
|
||||
#define SECS_DAY (24L * 60L * 60L)
|
||||
#define LEAPYEAR(year) (!((year) % 4) && (((year) % 100) || !((year) % 400)))
|
||||
#define YEARSIZE(year) (LEAPYEAR(year) ? 366 : 365)
|
||||
#define SECOND_KEY "second"
|
||||
#define MINUTE_KEY "minute"
|
||||
#define HOUR_KEY "hour"
|
||||
#define DAY_KEY "day"
|
||||
#define MONTH_KEY "month"
|
||||
#define YEAR_KEY "year"
|
||||
#define WEEKDAY_KEY "weekday"
|
||||
#define DST_KEY "dst"
|
||||
|
||||
/// Table of number of days in each month (for regular year and leap year)
|
||||
static const unsigned int MONTH_DAYS_TABLE[2][12] = {
|
||||
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
|
||||
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
|
||||
};
|
||||
|
||||
_ResourceLoader *_ResourceLoader::singleton=NULL;
|
||||
|
||||
Ref<ResourceInteractiveLoader> _ResourceLoader::load_interactive(const String& p_path,const String& p_type_hint) {
|
||||
@ -106,17 +55,11 @@ bool _ResourceLoader::has(const String &p_path) {
|
||||
return ResourceCache::has(local_path);
|
||||
};
|
||||
|
||||
Ref<ResourceImportMetadata> _ResourceLoader::load_import_metadata(const String& p_path) {
|
||||
|
||||
return ResourceLoader::load_import_metadata(p_path);
|
||||
}
|
||||
|
||||
void _ResourceLoader::_bind_methods() {
|
||||
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL(""));
|
||||
ObjectTypeDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false));
|
||||
ObjectTypeDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata);
|
||||
ObjectTypeDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type);
|
||||
ObjectTypeDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources);
|
||||
ObjectTypeDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies);
|
||||
@ -254,11 +197,6 @@ Size2 _OS::get_screen_size(int p_screen) const {
|
||||
return OS::get_singleton()->get_screen_size(p_screen);
|
||||
}
|
||||
|
||||
int _OS::get_screen_dpi(int p_screen) const {
|
||||
|
||||
return OS::get_singleton()->get_screen_dpi(p_screen);
|
||||
}
|
||||
|
||||
Point2 _OS::get_window_position() const {
|
||||
return OS::get_singleton()->get_window_position();
|
||||
}
|
||||
@ -307,13 +245,6 @@ bool _OS::is_window_maximized() const {
|
||||
return OS::get_singleton()->is_window_maximized();
|
||||
}
|
||||
|
||||
void _OS::set_borderless_window(bool p_borderless) {
|
||||
OS::get_singleton()->set_borderless_window(p_borderless);
|
||||
}
|
||||
|
||||
bool _OS::get_borderless_window() const {
|
||||
return OS::get_singleton()->get_borderless_window();
|
||||
}
|
||||
|
||||
void _OS::set_use_file_access_save_and_swap(bool p_enable) {
|
||||
|
||||
@ -435,18 +366,6 @@ String _OS::get_locale() const {
|
||||
return OS::get_singleton()->get_locale();
|
||||
}
|
||||
|
||||
String _OS::get_latin_keyboard_variant() const {
|
||||
switch( OS::get_singleton()->get_latin_keyboard_variant() ) {
|
||||
case OS::LATIN_KEYBOARD_QWERTY: return "QWERTY";
|
||||
case OS::LATIN_KEYBOARD_QWERTZ: return "QWERTZ";
|
||||
case OS::LATIN_KEYBOARD_AZERTY: return "AZERTY";
|
||||
case OS::LATIN_KEYBOARD_QZERTY: return "QZERTY";
|
||||
case OS::LATIN_KEYBOARD_DVORAK: return "DVORAK";
|
||||
case OS::LATIN_KEYBOARD_NEO : return "NEO";
|
||||
default: return "ERROR";
|
||||
}
|
||||
}
|
||||
|
||||
String _OS::get_model_name() const {
|
||||
|
||||
return OS::get_singleton()->get_model_name();
|
||||
@ -476,15 +395,6 @@ Error _OS::set_thread_name(const String& p_name) {
|
||||
return Thread::set_name(p_name);
|
||||
};
|
||||
|
||||
void _OS::set_use_vsync(bool p_enable) {
|
||||
OS::get_singleton()->set_use_vsync(p_enable);
|
||||
}
|
||||
|
||||
bool _OS::is_vsync_enabled() const {
|
||||
|
||||
return OS::get_singleton()->is_vsync_enabled();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
enum Weekday {
|
||||
@ -553,208 +463,28 @@ void _OS::set_icon(const Image& p_icon) {
|
||||
OS::get_singleton()->set_icon(p_icon);
|
||||
}
|
||||
|
||||
int _OS::get_exit_code() const {
|
||||
|
||||
return OS::get_singleton()->get_exit_code();
|
||||
}
|
||||
|
||||
void _OS::set_exit_code(int p_code) {
|
||||
|
||||
OS::get_singleton()->set_exit_code(p_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current datetime with consideration for utc and
|
||||
* dst
|
||||
*/
|
||||
Dictionary _OS::get_datetime(bool utc) const {
|
||||
|
||||
Dictionary dated = get_date(utc);
|
||||
Dictionary timed = get_time(utc);
|
||||
|
||||
List<Variant> keys;
|
||||
timed.get_key_list(&keys);
|
||||
|
||||
for(int i = 0; i < keys.size(); i++) {
|
||||
dated[keys[i]] = timed[keys[i]];
|
||||
}
|
||||
|
||||
return dated;
|
||||
}
|
||||
|
||||
Dictionary _OS::get_date(bool utc) const {
|
||||
|
||||
OS::Date date = OS::get_singleton()->get_date(utc);
|
||||
Dictionary dated;
|
||||
dated[YEAR_KEY]=date.year;
|
||||
dated[MONTH_KEY]=date.month;
|
||||
dated[DAY_KEY]=date.day;
|
||||
dated[WEEKDAY_KEY]=date.weekday;
|
||||
dated[DST_KEY]=date.dst;
|
||||
dated["year"]=date.year;
|
||||
dated["month"]=date.month;
|
||||
dated["day"]=date.day;
|
||||
dated["weekday"]=date.weekday;
|
||||
dated["dst"]=date.dst;
|
||||
return dated;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Dictionary _OS::get_time(bool utc) const {
|
||||
|
||||
OS::Time time = OS::get_singleton()->get_time(utc);
|
||||
Dictionary timed;
|
||||
timed[HOUR_KEY]=time.hour;
|
||||
timed[MINUTE_KEY]=time.min;
|
||||
timed[SECOND_KEY]=time.sec;
|
||||
timed["hour"]=time.hour;
|
||||
timed["minute"]=time.min;
|
||||
timed["second"]=time.sec;
|
||||
return timed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a epoch time value from a dictionary of time values
|
||||
* @p datetime must be populated with the following keys:
|
||||
* day, hour, minute, month, second, year. (dst is ignored).
|
||||
*
|
||||
* You can pass the output from
|
||||
* get_datetime_from_unix_time directly into this function
|
||||
*
|
||||
* @param datetime dictionary of date and time values to convert
|
||||
*
|
||||
* @return epoch calculated
|
||||
*/
|
||||
uint64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const {
|
||||
|
||||
// Bunch of conversion constants
|
||||
static const unsigned int SECONDS_PER_MINUTE = 60;
|
||||
static const unsigned int MINUTES_PER_HOUR = 60;
|
||||
static const unsigned int HOURS_PER_DAY = 24;
|
||||
static const unsigned int SECONDS_PER_HOUR = MINUTES_PER_HOUR *
|
||||
SECONDS_PER_MINUTE;
|
||||
static const unsigned int SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
|
||||
|
||||
// Get all time values from the dictionary, set to zero if it doesn't exist.
|
||||
// Risk incorrect calculation over throwing errors
|
||||
unsigned int second = ((datetime.has(SECOND_KEY))?
|
||||
static_cast<unsigned int>(datetime[SECOND_KEY]): 0);
|
||||
unsigned int minute = ((datetime.has(MINUTE_KEY))?
|
||||
static_cast<unsigned int>(datetime[MINUTE_KEY]): 0);
|
||||
unsigned int hour = ((datetime.has(HOUR_KEY))?
|
||||
static_cast<unsigned int>(datetime[HOUR_KEY]): 0);
|
||||
unsigned int day = ((datetime.has(DAY_KEY))?
|
||||
static_cast<unsigned int>(datetime[DAY_KEY]): 0);
|
||||
unsigned int month = ((datetime.has(MONTH_KEY))?
|
||||
static_cast<unsigned int>(datetime[MONTH_KEY]) -1: 0);
|
||||
unsigned int year = ((datetime.has(YEAR_KEY))?
|
||||
static_cast<unsigned int>(datetime[YEAR_KEY]):0);
|
||||
|
||||
/// How many days come before each month (0-12)
|
||||
static const unsigned short int DAYS_PAST_THIS_YEAR_TABLE[2][13] =
|
||||
{
|
||||
/* Normal years. */
|
||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
/* Leap years. */
|
||||
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
|
||||
ERR_EXPLAIN("Invalid second value of: " + itos(second));
|
||||
ERR_FAIL_COND_V( second > 59, 0);
|
||||
|
||||
ERR_EXPLAIN("Invalid minute value of: " + itos(minute));
|
||||
ERR_FAIL_COND_V( minute > 59, 0);
|
||||
|
||||
ERR_EXPLAIN("Invalid hour value of: " + itos(hour));
|
||||
ERR_FAIL_COND_V( hour > 23, 0);
|
||||
|
||||
ERR_EXPLAIN("Invalid month value of: " + itos(month+1));
|
||||
ERR_FAIL_COND_V( month+1 > 12, 0);
|
||||
|
||||
// Do this check after month is tested as valid
|
||||
ERR_EXPLAIN("Invalid day value of: " + itos(day) + " which is larger "
|
||||
"than "+ itos(MONTH_DAYS_TABLE[LEAPYEAR(year)][month]));
|
||||
ERR_FAIL_COND_V( day > MONTH_DAYS_TABLE[LEAPYEAR(year)][month], 0);
|
||||
|
||||
// Calculate all the seconds from months past in this year
|
||||
uint64_t SECONDS_FROM_MONTHS_PAST_THIS_YEAR =
|
||||
DAYS_PAST_THIS_YEAR_TABLE[LEAPYEAR(year)][month] * SECONDS_PER_DAY;
|
||||
|
||||
uint64_t SECONDS_FROM_YEARS_PAST = 0;
|
||||
for(unsigned int iyear = EPOCH_YR; iyear < year; iyear++) {
|
||||
|
||||
SECONDS_FROM_YEARS_PAST += YEARSIZE(iyear) *
|
||||
SECONDS_PER_DAY;
|
||||
}
|
||||
|
||||
uint64_t epoch =
|
||||
second +
|
||||
minute * SECONDS_PER_MINUTE +
|
||||
hour * SECONDS_PER_HOUR +
|
||||
// Subtract 1 from day, since the current day isn't over yet
|
||||
// and we cannot count all 24 hours.
|
||||
(day-1) * SECONDS_PER_DAY +
|
||||
SECONDS_FROM_MONTHS_PAST_THIS_YEAR +
|
||||
SECONDS_FROM_YEARS_PAST;
|
||||
return epoch;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a dictionary of time values when given epoch time
|
||||
*
|
||||
* Dictionary Time values will be a union if values from #get_time
|
||||
* and #get_date dictionaries (with the exception of dst =
|
||||
* day light standard time, as it cannot be determined from epoch)
|
||||
*
|
||||
* @param unix_time_val epoch time to convert
|
||||
*
|
||||
* @return dictionary of date and time values
|
||||
*/
|
||||
Dictionary _OS::get_datetime_from_unix_time( uint64_t unix_time_val) const {
|
||||
|
||||
// Just fail if unix time is negative (when interpreted as an int).
|
||||
// This means the user passed in a negative value by accident
|
||||
ERR_EXPLAIN("unix_time_val was really huge!"+ itos(unix_time_val) +
|
||||
" You probably passed in a negative value!");
|
||||
ERR_FAIL_COND_V( (int64_t)unix_time_val < 0, Dictionary());
|
||||
|
||||
OS::Date date;
|
||||
OS::Time time;
|
||||
|
||||
unsigned long dayclock, dayno;
|
||||
int year = EPOCH_YR;
|
||||
|
||||
dayclock = (unsigned long)unix_time_val % SECS_DAY;
|
||||
dayno = (unsigned long)unix_time_val / SECS_DAY;
|
||||
|
||||
time.sec = dayclock % 60;
|
||||
time.min = (dayclock % 3600) / 60;
|
||||
time.hour = dayclock / 3600;
|
||||
|
||||
/* day 0 was a thursday */
|
||||
date.weekday = static_cast<OS::Weekday>((dayno + 4) % 7);
|
||||
|
||||
while (dayno >= YEARSIZE(year)) {
|
||||
dayno -= YEARSIZE(year);
|
||||
year++;
|
||||
}
|
||||
|
||||
date.year = year;
|
||||
|
||||
size_t imonth = 0;
|
||||
|
||||
while (dayno >= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth]) {
|
||||
dayno -= MONTH_DAYS_TABLE[LEAPYEAR(year)][imonth];
|
||||
imonth++;
|
||||
}
|
||||
|
||||
/// Add 1 to month to make sure months are indexed starting at 1
|
||||
date.month = static_cast<OS::Month>(imonth+1);
|
||||
|
||||
date.day = dayno + 1;
|
||||
|
||||
Dictionary timed;
|
||||
timed[HOUR_KEY]=time.hour;
|
||||
timed[MINUTE_KEY]=time.min;
|
||||
timed[SECOND_KEY]=time.sec;
|
||||
timed[YEAR_KEY]=date.year;
|
||||
timed[MONTH_KEY]=date.month;
|
||||
timed[DAY_KEY]=date.day;
|
||||
timed[WEEKDAY_KEY]=date.weekday;
|
||||
|
||||
return timed;
|
||||
}
|
||||
|
||||
Dictionary _OS::get_time_zone_info() const {
|
||||
@ -768,7 +498,7 @@ Dictionary _OS::get_time_zone_info() const {
|
||||
uint64_t _OS::get_unix_time() const {
|
||||
|
||||
return OS::get_singleton()->get_unix_time();
|
||||
}
|
||||
};
|
||||
|
||||
uint64_t _OS::get_system_time_secs() const {
|
||||
return OS::get_singleton()->get_system_time_secs();
|
||||
@ -867,6 +597,7 @@ void _OS::print_all_textures_by_size() {
|
||||
|
||||
for(List<_OSCoreBindImg>::Element *E=imgs.front();E;E=E->next()) {
|
||||
|
||||
print_line(E->get().path+" - "+String::humanize_size(E->get().vram)+" ("+E->get().size+") - total:"+String::humanize_size(total) );
|
||||
total-=E->get().vram;
|
||||
}
|
||||
}
|
||||
@ -900,21 +631,23 @@ void _OS::print_resources_by_type(const Vector<String>& p_types) {
|
||||
|
||||
|
||||
type_count[r->get_type()]++;
|
||||
|
||||
print_line(r->get_type()+": "+r->get_path());
|
||||
|
||||
List<String> metas;
|
||||
r->get_meta_list(&metas);
|
||||
for (List<String>::Element* me = metas.front(); me; me = me->next()) {
|
||||
print_line(" "+String(me->get()) + ": " + r->get_meta(me->get()));
|
||||
};
|
||||
}
|
||||
|
||||
for(Map<String,int>::Element *E=type_count.front();E;E=E->next()) {
|
||||
|
||||
print_line(E->key()+" count: "+itos(E->get()));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
bool _OS::has_virtual_keyboard() const {
|
||||
return OS::get_singleton()->has_virtual_keyboard();
|
||||
}
|
||||
|
||||
void _OS::show_virtual_keyboard(const String& p_existing_text) {
|
||||
OS::get_singleton()->show_virtual_keyboard(p_existing_text, Rect2());
|
||||
}
|
||||
|
||||
void _OS::hide_virtual_keyboard() {
|
||||
OS::get_singleton()->hide_virtual_keyboard();
|
||||
}
|
||||
|
||||
void _OS::print_all_resources(const String& p_to_file ) {
|
||||
|
||||
@ -965,11 +698,6 @@ void _OS::native_video_stop() {
|
||||
OS::get_singleton()->native_video_stop();
|
||||
};
|
||||
|
||||
void _OS::request_attention() {
|
||||
|
||||
OS::get_singleton()->request_attention();
|
||||
}
|
||||
|
||||
bool _OS::is_debug_build() const {
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
@ -1028,11 +756,6 @@ void _OS::alert(const String& p_alert,const String& p_title) {
|
||||
OS::get_singleton()->alert(p_alert,p_title);
|
||||
}
|
||||
|
||||
Dictionary _OS::get_engine_version() const {
|
||||
|
||||
return OS::get_singleton()->get_engine_version();
|
||||
}
|
||||
|
||||
_OS *_OS::singleton=NULL;
|
||||
|
||||
void _OS::_bind_methods() {
|
||||
@ -1055,7 +778,6 @@ void _OS::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen);
|
||||
ObjectTypeDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0));
|
||||
ObjectTypeDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0));
|
||||
ObjectTypeDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0));
|
||||
ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position);
|
||||
ObjectTypeDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position);
|
||||
ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size);
|
||||
@ -1068,10 +790,6 @@ void _OS::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized);
|
||||
ObjectTypeDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized);
|
||||
ObjectTypeDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized);
|
||||
ObjectTypeDB::bind_method(_MD("request_attention"), &_OS::request_attention);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
|
||||
ObjectTypeDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation);
|
||||
ObjectTypeDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation);
|
||||
@ -1109,28 +827,19 @@ void _OS::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args);
|
||||
ObjectTypeDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false));
|
||||
ObjectTypeDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false));
|
||||
ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false));
|
||||
ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info);
|
||||
ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time);
|
||||
ObjectTypeDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"),
|
||||
&_OS::get_datetime_from_unix_time);
|
||||
ObjectTypeDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"),
|
||||
&_OS::get_unix_time_from_datetime);
|
||||
ObjectTypeDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_exit_code"),&_OS::get_exit_code);
|
||||
ObjectTypeDB::bind_method(_MD("set_exit_code","code"),&_OS::set_exit_code);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec);
|
||||
ObjectTypeDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec);
|
||||
ObjectTypeDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec);
|
||||
ObjectTypeDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec);
|
||||
ObjectTypeDB::bind_method(_MD("get_locale"),&_OS::get_locale);
|
||||
ObjectTypeDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant);
|
||||
ObjectTypeDB::bind_method(_MD("get_model_name"),&_OS::get_model_name);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_custom_level"),&_OS::get_custom_level);
|
||||
@ -1147,9 +856,6 @@ void _OS::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file);
|
||||
ObjectTypeDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file);
|
||||
ObjectTypeDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard);
|
||||
ObjectTypeDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL(""));
|
||||
ObjectTypeDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard);
|
||||
ObjectTypeDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false));
|
||||
ObjectTypeDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL(""));
|
||||
|
||||
@ -1184,10 +890,6 @@ void _OS::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync);
|
||||
ObjectTypeDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled);
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version);
|
||||
|
||||
BIND_CONSTANT( DAY_SUNDAY );
|
||||
BIND_CONSTANT( DAY_MONDAY );
|
||||
@ -1605,12 +1307,7 @@ DVector<uint8_t> _File::get_buffer(int p_length) const{
|
||||
|
||||
String _File::get_as_text() const {
|
||||
|
||||
ERR_FAIL_COND_V(!f, String());
|
||||
|
||||
String text;
|
||||
size_t original_pos = f->get_pos();
|
||||
f->seek(0);
|
||||
|
||||
String l = get_line();
|
||||
while(!eof_reached()) {
|
||||
text+=l+"\n";
|
||||
@ -1618,27 +1315,10 @@ String _File::get_as_text() const {
|
||||
}
|
||||
text+=l;
|
||||
|
||||
f->seek(original_pos);
|
||||
|
||||
return text;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
String _File::get_md5(const String& p_path) const {
|
||||
|
||||
return FileAccess::get_md5(p_path);
|
||||
|
||||
}
|
||||
|
||||
String _File::get_sha256(const String& p_path) const {
|
||||
|
||||
return FileAccess::get_sha256(p_path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
String _File::get_line() const{
|
||||
|
||||
ERR_FAIL_COND_V(!f,String());
|
||||
@ -1827,8 +1507,6 @@ void _File::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer);
|
||||
ObjectTypeDB::bind_method(_MD("get_line"),&_File::get_line);
|
||||
ObjectTypeDB::bind_method(_MD("get_as_text"),&_File::get_as_text);
|
||||
ObjectTypeDB::bind_method(_MD("get_md5","path"),&_File::get_md5);
|
||||
ObjectTypeDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256);
|
||||
ObjectTypeDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap);
|
||||
ObjectTypeDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap);
|
||||
ObjectTypeDB::bind_method(_MD("get_error:Error"),&_File::get_error);
|
||||
@ -1937,57 +1615,29 @@ String _Directory::get_current_dir() {
|
||||
Error _Directory::make_dir(String p_dir){
|
||||
|
||||
ERR_FAIL_COND_V(!d,ERR_UNCONFIGURED);
|
||||
if (!p_dir.is_rel_path()) {
|
||||
DirAccess *d = DirAccess::create_for_path(p_dir);
|
||||
Error err = d->make_dir(p_dir);
|
||||
memdelete(d);
|
||||
return err;
|
||||
|
||||
}
|
||||
return d->make_dir(p_dir);
|
||||
}
|
||||
Error _Directory::make_dir_recursive(String p_dir){
|
||||
|
||||
ERR_FAIL_COND_V(!d,ERR_UNCONFIGURED);
|
||||
if (!p_dir.is_rel_path()) {
|
||||
DirAccess *d = DirAccess::create_for_path(p_dir);
|
||||
Error err = d->make_dir_recursive(p_dir);
|
||||
memdelete(d);
|
||||
return err;
|
||||
|
||||
}
|
||||
return d->make_dir_recursive(p_dir);
|
||||
}
|
||||
|
||||
bool _Directory::file_exists(String p_file){
|
||||
|
||||
ERR_FAIL_COND_V(!d,false);
|
||||
|
||||
if (!p_file.is_rel_path()) {
|
||||
return FileAccess::exists(p_file);
|
||||
}
|
||||
|
||||
return d->file_exists(p_file);
|
||||
}
|
||||
|
||||
bool _Directory::dir_exists(String p_dir) {
|
||||
ERR_FAIL_COND_V(!d,false);
|
||||
if (!p_dir.is_rel_path()) {
|
||||
|
||||
DirAccess *d = DirAccess::create_for_path(p_dir);
|
||||
bool exists = d->dir_exists(p_dir);
|
||||
memdelete(d);
|
||||
return exists;
|
||||
|
||||
} else {
|
||||
return d->dir_exists(p_dir);
|
||||
}
|
||||
return d->dir_exists(p_dir);
|
||||
}
|
||||
|
||||
int _Directory::get_space_left(){
|
||||
|
||||
ERR_FAIL_COND_V(!d,0);
|
||||
return d->get_space_left()/1024*1024; //return value in megabytes, given binding is int
|
||||
return d->get_space_left();
|
||||
}
|
||||
|
||||
Error _Directory::copy(String p_from,String p_to){
|
||||
@ -1998,26 +1648,12 @@ Error _Directory::copy(String p_from,String p_to){
|
||||
Error _Directory::rename(String p_from, String p_to){
|
||||
|
||||
ERR_FAIL_COND_V(!d,ERR_UNCONFIGURED);
|
||||
if (!p_from.is_rel_path()) {
|
||||
DirAccess *d = DirAccess::create_for_path(p_from);
|
||||
Error err = d->rename(p_from,p_to);
|
||||
memdelete(d);
|
||||
return err;
|
||||
}
|
||||
|
||||
return d->rename(p_from,p_to);
|
||||
|
||||
}
|
||||
Error _Directory::remove(String p_name){
|
||||
|
||||
ERR_FAIL_COND_V(!d,ERR_UNCONFIGURED);
|
||||
if (!p_name.is_rel_path()) {
|
||||
DirAccess *d = DirAccess::create_for_path(p_name);
|
||||
Error err = d->remove(p_name);
|
||||
memdelete(d);
|
||||
return err;
|
||||
}
|
||||
|
||||
return d->remove(p_name);
|
||||
}
|
||||
|
||||
@ -2343,6 +1979,7 @@ String _Thread::get_id() const {
|
||||
return itos(thread->get_ID());
|
||||
}
|
||||
|
||||
|
||||
bool _Thread::is_active() const {
|
||||
|
||||
return active;
|
||||
|
||||
@ -1,31 +1,3 @@
|
||||
/*************************************************************************/
|
||||
/* core_bind.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef CORE_BIND_H
|
||||
#define CORE_BIND_H
|
||||
|
||||
@ -54,7 +26,6 @@ public:
|
||||
void set_abort_on_missing_resources(bool p_abort);
|
||||
StringArray get_dependencies(const String& p_path);
|
||||
bool has(const String& p_path);
|
||||
Ref<ResourceImportMetadata> load_import_metadata(const String& p_path);
|
||||
|
||||
_ResourceLoader();
|
||||
};
|
||||
@ -109,9 +80,7 @@ public:
|
||||
};
|
||||
|
||||
enum Month {
|
||||
/// Start at 1 to follow Windows SYSTEMTIME structure
|
||||
/// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx
|
||||
MONTH_JANUARY = 1,
|
||||
MONTH_JANUARY,
|
||||
MONTH_FEBRUARY,
|
||||
MONTH_MARCH,
|
||||
MONTH_APRIL,
|
||||
@ -145,7 +114,6 @@ public:
|
||||
virtual void set_current_screen(int p_screen);
|
||||
virtual Point2 get_screen_position(int p_screen=0) const;
|
||||
virtual Size2 get_screen_size(int p_screen=0) const;
|
||||
virtual int get_screen_dpi(int p_screen=0) const;
|
||||
virtual Point2 get_window_position() const;
|
||||
virtual void set_window_position(const Point2& p_position);
|
||||
virtual Size2 get_window_size() const;
|
||||
@ -158,10 +126,7 @@ public:
|
||||
virtual bool is_window_minimized() const;
|
||||
virtual void set_window_maximized(bool p_enabled);
|
||||
virtual bool is_window_maximized() const;
|
||||
virtual void request_attention();
|
||||
|
||||
virtual void set_borderless_window(bool p_borderless);
|
||||
virtual bool get_borderless_window() const;
|
||||
|
||||
Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
|
||||
bool native_video_is_playing();
|
||||
@ -193,8 +158,6 @@ public:
|
||||
Vector<String> get_cmdline_args();
|
||||
|
||||
String get_locale() const;
|
||||
String get_latin_keyboard_variant() const;
|
||||
|
||||
String get_model_name() const;
|
||||
MainLoop *get_main_loop() const;
|
||||
|
||||
@ -205,10 +168,6 @@ public:
|
||||
void dump_memory_to_file(const String& p_file);
|
||||
void dump_resources_to_file(const String& p_file);
|
||||
|
||||
bool has_virtual_keyboard() const;
|
||||
void show_virtual_keyboard(const String& p_existing_text="");
|
||||
void hide_virtual_keyboard();
|
||||
|
||||
void print_resources_in_use(bool p_short=false);
|
||||
void print_all_resources(const String& p_to_file);
|
||||
void print_all_textures_by_size();
|
||||
@ -246,14 +205,8 @@ public:
|
||||
void set_use_file_access_save_and_swap(bool p_enable);
|
||||
|
||||
void set_icon(const Image& p_icon);
|
||||
|
||||
int get_exit_code() const;
|
||||
void set_exit_code(int p_code);
|
||||
Dictionary get_date(bool utc) const;
|
||||
Dictionary get_time(bool utc) const;
|
||||
Dictionary get_datetime(bool utc) const;
|
||||
Dictionary get_datetime_from_unix_time(uint64_t unix_time_val) const;
|
||||
uint64_t get_unix_time_from_datetime(Dictionary datetime) const;
|
||||
Dictionary get_time_zone_info() const;
|
||||
uint64_t get_unix_time() const;
|
||||
uint64_t get_system_time_secs() const;
|
||||
@ -320,11 +273,6 @@ public:
|
||||
|
||||
Error set_thread_name(const String& p_name);
|
||||
|
||||
void set_use_vsync(bool p_enable);
|
||||
bool is_vsync_enabled() const;
|
||||
|
||||
Dictionary get_engine_version() const;
|
||||
|
||||
static _OS *get_singleton() { return singleton; }
|
||||
|
||||
_OS();
|
||||
@ -419,8 +367,6 @@ public:
|
||||
DVector<uint8_t> get_buffer(int p_length) const; ///< get an array of bytes
|
||||
String get_line() const;
|
||||
String get_as_text() const;
|
||||
String get_md5(const String& p_path) const;
|
||||
String get_sha256(const String& p_path) const;
|
||||
|
||||
/**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac)
|
||||
* It's not about the current CPU type but file formats.
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -29,8 +29,6 @@
|
||||
#include "color.h"
|
||||
#include "math_funcs.h"
|
||||
#include "print_string.h"
|
||||
#include "map.h"
|
||||
#include "color_names.inc"
|
||||
|
||||
uint32_t Color::to_ARGB32() const {
|
||||
|
||||
@ -329,25 +327,7 @@ bool Color::html_is_valid(const String& p_color) {
|
||||
|
||||
}
|
||||
|
||||
Color Color::named(const String &p_name) {
|
||||
if (_named_colors.empty()) _populate_named_colors(); // from color_names.inc
|
||||
String name = p_name;
|
||||
// Normalize name
|
||||
name = name.replace(" ", "");
|
||||
name = name.replace("-", "");
|
||||
name = name.replace("_", "");
|
||||
name = name.replace("'", "");
|
||||
name = name.replace(".", "");
|
||||
name = name.to_lower();
|
||||
|
||||
const Map<String, Color>::Element* color = _named_colors.find(name);
|
||||
if(color) {
|
||||
return color->value();
|
||||
} else {
|
||||
ERR_EXPLAIN("Invalid Color Name: "+p_name);
|
||||
ERR_FAIL_V(Color());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String _to_hex(float p_val) {
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -111,7 +111,6 @@ struct Color {
|
||||
static Color hex(uint32_t p_hex);
|
||||
static Color html(const String& p_color);
|
||||
static bool html_is_valid(const String& p_color);
|
||||
static Color named(const String& p_name);
|
||||
String to_html(bool p_alpha=true) const;
|
||||
|
||||
_FORCE_INLINE_ bool operator<(const Color& p_color) const; //used in set keys
|
||||
|
||||
@ -1,150 +0,0 @@
|
||||
// Names from https://en.wikipedia.org/wiki/List_of_colors (through https://raw.githubusercontent.com/SuperUserNameMan/color_to_name/616a7cddafefda91478b7bc26167de97fb5badb1/godot_version.gd), slightly edited and normalized
|
||||
static Map<String, Color> _named_colors;
|
||||
static void _populate_named_colors() {
|
||||
if(!_named_colors.empty()) return;
|
||||
_named_colors.insert("aliceblue", Color(0.94, 0.97, 1.00));
|
||||
_named_colors.insert("antiquewhite", Color(0.98, 0.92, 0.84));
|
||||
_named_colors.insert("aqua", Color(0.00, 1.00, 1.00));
|
||||
_named_colors.insert("aquamarine", Color(0.50, 1.00, 0.83));
|
||||
_named_colors.insert("azure", Color(0.94, 1.00, 1.00));
|
||||
_named_colors.insert("beige", Color(0.96, 0.96, 0.86));
|
||||
_named_colors.insert("bisque", Color(1.00, 0.89, 0.77));
|
||||
_named_colors.insert("black", Color(0.00, 0.00, 0.00));
|
||||
_named_colors.insert("blanchedalmond", Color(1.00, 0.92, 0.80));
|
||||
_named_colors.insert("blue", Color(0.00, 0.00, 1.00));
|
||||
_named_colors.insert("blueviolet", Color(0.54, 0.17, 0.89));
|
||||
_named_colors.insert("brown", Color(0.65, 0.16, 0.16));
|
||||
_named_colors.insert("burlywood", Color(0.87, 0.72, 0.53));
|
||||
_named_colors.insert("cadetblue", Color(0.37, 0.62, 0.63));
|
||||
_named_colors.insert("chartreuse", Color(0.50, 1.00, 0.00));
|
||||
_named_colors.insert("chocolate", Color(0.82, 0.41, 0.12));
|
||||
_named_colors.insert("coral", Color(1.00, 0.50, 0.31));
|
||||
_named_colors.insert("cornflower", Color(0.39, 0.58, 0.93));
|
||||
_named_colors.insert("cornsilk", Color(1.00, 0.97, 0.86));
|
||||
_named_colors.insert("crimson", Color(0.86, 0.08, 0.24));
|
||||
_named_colors.insert("cyan", Color(0.00, 1.00, 1.00));
|
||||
_named_colors.insert("darkblue", Color(0.00, 0.00, 0.55));
|
||||
_named_colors.insert("darkcyan", Color(0.00, 0.55, 0.55));
|
||||
_named_colors.insert("darkgoldenrod", Color(0.72, 0.53, 0.04));
|
||||
_named_colors.insert("darkgray", Color(0.66, 0.66, 0.66));
|
||||
_named_colors.insert("darkgreen", Color(0.00, 0.39, 0.00));
|
||||
_named_colors.insert("darkkhaki", Color(0.74, 0.72, 0.42));
|
||||
_named_colors.insert("darkmagenta", Color(0.55, 0.00, 0.55));
|
||||
_named_colors.insert("darkolivegreen", Color(0.33, 0.42, 0.18));
|
||||
_named_colors.insert("darkorange", Color(1.00, 0.55, 0.00));
|
||||
_named_colors.insert("darkorchid", Color(0.60, 0.20, 0.80));
|
||||
_named_colors.insert("darkred", Color(0.55, 0.00, 0.00));
|
||||
_named_colors.insert("darksalmon", Color(0.91, 0.59, 0.48));
|
||||
_named_colors.insert("darkseagreen", Color(0.56, 0.74, 0.56));
|
||||
_named_colors.insert("darkslateblue", Color(0.28, 0.24, 0.55));
|
||||
_named_colors.insert("darkslategray", Color(0.18, 0.31, 0.31));
|
||||
_named_colors.insert("darkturquoise", Color(0.00, 0.81, 0.82));
|
||||
_named_colors.insert("darkviolet", Color(0.58, 0.00, 0.83));
|
||||
_named_colors.insert("deeppink", Color(1.00, 0.08, 0.58));
|
||||
_named_colors.insert("deepskyblue", Color(0.00, 0.75, 1.00));
|
||||
_named_colors.insert("dimgray", Color(0.41, 0.41, 0.41));
|
||||
_named_colors.insert("dodgerblue", Color(0.12, 0.56, 1.00));
|
||||
_named_colors.insert("firebrick", Color(0.70, 0.13, 0.13));
|
||||
_named_colors.insert("floralwhite", Color(1.00, 0.98, 0.94));
|
||||
_named_colors.insert("forestgreen", Color(0.13, 0.55, 0.13));
|
||||
_named_colors.insert("fuchsia", Color(1.00, 0.00, 1.00));
|
||||
_named_colors.insert("gainsboro", Color(0.86, 0.86, 0.86));
|
||||
_named_colors.insert("ghostwhite", Color(0.97, 0.97, 1.00));
|
||||
_named_colors.insert("gold", Color(1.00, 0.84, 0.00));
|
||||
_named_colors.insert("goldenrod", Color(0.85, 0.65, 0.13));
|
||||
_named_colors.insert("gray", Color(0.75, 0.75, 0.75));
|
||||
_named_colors.insert("webgray", Color(0.50, 0.50, 0.50));
|
||||
_named_colors.insert("green", Color(0.00, 1.00, 0.00));
|
||||
_named_colors.insert("webgreen", Color(0.00, 0.50, 0.00));
|
||||
_named_colors.insert("greenyellow", Color(0.68, 1.00, 0.18));
|
||||
_named_colors.insert("honeydew", Color(0.94, 1.00, 0.94));
|
||||
_named_colors.insert("hotpink", Color(1.00, 0.41, 0.71));
|
||||
_named_colors.insert("indianred", Color(0.80, 0.36, 0.36));
|
||||
_named_colors.insert("indigo", Color(0.29, 0.00, 0.51));
|
||||
_named_colors.insert("ivory", Color(1.00, 1.00, 0.94));
|
||||
_named_colors.insert("khaki", Color(0.94, 0.90, 0.55));
|
||||
_named_colors.insert("lavender", Color(0.90, 0.90, 0.98));
|
||||
_named_colors.insert("lavenderblush", Color(1.00, 0.94, 0.96));
|
||||
_named_colors.insert("lawngreen", Color(0.49, 0.99, 0.00));
|
||||
_named_colors.insert("lemonchiffon", Color(1.00, 0.98, 0.80));
|
||||
_named_colors.insert("lightblue", Color(0.68, 0.85, 0.90));
|
||||
_named_colors.insert("lightcoral", Color(0.94, 0.50, 0.50));
|
||||
_named_colors.insert("lightcyan", Color(0.88, 1.00, 1.00));
|
||||
_named_colors.insert("lightgoldenrod", Color(0.98, 0.98, 0.82));
|
||||
_named_colors.insert("lightgray", Color(0.83, 0.83, 0.83));
|
||||
_named_colors.insert("lightgreen", Color(0.56, 0.93, 0.56));
|
||||
_named_colors.insert("lightpink", Color(1.00, 0.71, 0.76));
|
||||
_named_colors.insert("lightsalmon", Color(1.00, 0.63, 0.48));
|
||||
_named_colors.insert("lightseagreen", Color(0.13, 0.70, 0.67));
|
||||
_named_colors.insert("lightskyblue", Color(0.53, 0.81, 0.98));
|
||||
_named_colors.insert("lightslategray", Color(0.47, 0.53, 0.60));
|
||||
_named_colors.insert("lightsteelblue", Color(0.69, 0.77, 0.87));
|
||||
_named_colors.insert("lightyellow", Color(1.00, 1.00, 0.88));
|
||||
_named_colors.insert("lime", Color(0.00, 1.00, 0.00));
|
||||
_named_colors.insert("limegreen", Color(0.20, 0.80, 0.20));
|
||||
_named_colors.insert("linen", Color(0.98, 0.94, 0.90));
|
||||
_named_colors.insert("magenta", Color(1.00, 0.00, 1.00));
|
||||
_named_colors.insert("maroon", Color(0.69, 0.19, 0.38));
|
||||
_named_colors.insert("webmaroon", Color(0.50, 0.00, 0.00));
|
||||
_named_colors.insert("mediumaquamarine", Color(0.40, 0.80, 0.67));
|
||||
_named_colors.insert("mediumblue", Color(0.00, 0.00, 0.80));
|
||||
_named_colors.insert("mediumorchid", Color(0.73, 0.33, 0.83));
|
||||
_named_colors.insert("mediumpurple", Color(0.58, 0.44, 0.86));
|
||||
_named_colors.insert("mediumseagreen", Color(0.24, 0.70, 0.44));
|
||||
_named_colors.insert("mediumslateblue", Color(0.48, 0.41, 0.93));
|
||||
_named_colors.insert("mediumspringgreen", Color(0.00, 0.98, 0.60));
|
||||
_named_colors.insert("mediumturquoise", Color(0.28, 0.82, 0.80));
|
||||
_named_colors.insert("mediumvioletred", Color(0.78, 0.08, 0.52));
|
||||
_named_colors.insert("midnightblue", Color(0.10, 0.10, 0.44));
|
||||
_named_colors.insert("mintcream", Color(0.96, 1.00, 0.98));
|
||||
_named_colors.insert("mistyrose", Color(1.00, 0.89, 0.88));
|
||||
_named_colors.insert("moccasin", Color(1.00, 0.89, 0.71));
|
||||
_named_colors.insert("navajowhite", Color(1.00, 0.87, 0.68));
|
||||
_named_colors.insert("navyblue", Color(0.00, 0.00, 0.50));
|
||||
_named_colors.insert("oldlace", Color(0.99, 0.96, 0.90));
|
||||
_named_colors.insert("olive", Color(0.50, 0.50, 0.00));
|
||||
_named_colors.insert("olivedrab", Color(0.42, 0.56, 0.14));
|
||||
_named_colors.insert("orange", Color(1.00, 0.65, 0.00));
|
||||
_named_colors.insert("orangered", Color(1.00, 0.27, 0.00));
|
||||
_named_colors.insert("orchid", Color(0.85, 0.44, 0.84));
|
||||
_named_colors.insert("palegoldenrod", Color(0.93, 0.91, 0.67));
|
||||
_named_colors.insert("palegreen", Color(0.60, 0.98, 0.60));
|
||||
_named_colors.insert("paleturquoise", Color(0.69, 0.93, 0.93));
|
||||
_named_colors.insert("palevioletred", Color(0.86, 0.44, 0.58));
|
||||
_named_colors.insert("papayawhip", Color(1.00, 0.94, 0.84));
|
||||
_named_colors.insert("peachpuff", Color(1.00, 0.85, 0.73));
|
||||
_named_colors.insert("peru", Color(0.80, 0.52, 0.25));
|
||||
_named_colors.insert("pink", Color(1.00, 0.75, 0.80));
|
||||
_named_colors.insert("plum", Color(0.87, 0.63, 0.87));
|
||||
_named_colors.insert("powderblue", Color(0.69, 0.88, 0.90));
|
||||
_named_colors.insert("purple", Color(0.63, 0.13, 0.94));
|
||||
_named_colors.insert("webpurple", Color(0.50, 0.00, 0.50));
|
||||
_named_colors.insert("rebeccapurple", Color(0.40, 0.20, 0.60));
|
||||
_named_colors.insert("red", Color(1.00, 0.00, 0.00));
|
||||
_named_colors.insert("rosybrown", Color(0.74, 0.56, 0.56));
|
||||
_named_colors.insert("royalblue", Color(0.25, 0.41, 0.88));
|
||||
_named_colors.insert("saddlebrown", Color(0.55, 0.27, 0.07));
|
||||
_named_colors.insert("salmon", Color(0.98, 0.50, 0.45));
|
||||
_named_colors.insert("sandybrown", Color(0.96, 0.64, 0.38));
|
||||
_named_colors.insert("seagreen", Color(0.18, 0.55, 0.34));
|
||||
_named_colors.insert("seashell", Color(1.00, 0.96, 0.93));
|
||||
_named_colors.insert("sienna", Color(0.63, 0.32, 0.18));
|
||||
_named_colors.insert("silver", Color(0.75, 0.75, 0.75));
|
||||
_named_colors.insert("skyblue", Color(0.53, 0.81, 0.92));
|
||||
_named_colors.insert("slateblue", Color(0.42, 0.35, 0.80));
|
||||
_named_colors.insert("slategray", Color(0.44, 0.50, 0.56));
|
||||
_named_colors.insert("snow", Color(1.00, 0.98, 0.98));
|
||||
_named_colors.insert("springgreen", Color(0.00, 1.00, 0.50));
|
||||
_named_colors.insert("steelblue", Color(0.27, 0.51, 0.71));
|
||||
_named_colors.insert("tan", Color(0.82, 0.71, 0.55));
|
||||
_named_colors.insert("teal", Color(0.00, 0.50, 0.50));
|
||||
_named_colors.insert("thistle", Color(0.85, 0.75, 0.85));
|
||||
_named_colors.insert("tomato", Color(1.00, 0.39, 0.28));
|
||||
_named_colors.insert("turquoise", Color(0.25, 0.88, 0.82));
|
||||
_named_colors.insert("violet", Color(0.93, 0.51, 0.93));
|
||||
_named_colors.insert("wheat", Color(0.96, 0.87, 0.70));
|
||||
_named_colors.insert("white", Color(1.00, 1.00, 1.00));
|
||||
_named_colors.insert("whitesmoke", Color(0.96, 0.96, 0.96));
|
||||
_named_colors.insert("yellow", Color(1.00, 1.00, 0.00));
|
||||
_named_colors.insert("yellowgreen", Color(0.60, 0.80, 0.20));
|
||||
}
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -152,23 +152,6 @@ class CommandQueueMT {
|
||||
virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7); }
|
||||
};
|
||||
|
||||
template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8>
|
||||
struct Command8 : public CommandBase {
|
||||
|
||||
T*instance;
|
||||
M method;
|
||||
typename GetSimpleTypeT<P1>::type_t p1;
|
||||
typename GetSimpleTypeT<P2>::type_t p2;
|
||||
typename GetSimpleTypeT<P3>::type_t p3;
|
||||
typename GetSimpleTypeT<P4>::type_t p4;
|
||||
typename GetSimpleTypeT<P5>::type_t p5;
|
||||
typename GetSimpleTypeT<P6>::type_t p6;
|
||||
typename GetSimpleTypeT<P7>::type_t p7;
|
||||
typename GetSimpleTypeT<P8>::type_t p8;
|
||||
|
||||
virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); }
|
||||
};
|
||||
|
||||
/* comands that return */
|
||||
|
||||
template<class T,class M,class R>
|
||||
@ -287,25 +270,6 @@ class CommandQueueMT {
|
||||
virtual void call() { *ret = (instance->*method)(p1,p2,p3,p4,p5,p6,p7); sync->sem->post(); sync->in_use=false; ; }
|
||||
};
|
||||
|
||||
template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8,class R>
|
||||
struct CommandRet8 : public CommandBase {
|
||||
|
||||
T*instance;
|
||||
M method;
|
||||
typename GetSimpleTypeT<P1>::type_t p1;
|
||||
typename GetSimpleTypeT<P2>::type_t p2;
|
||||
typename GetSimpleTypeT<P3>::type_t p3;
|
||||
typename GetSimpleTypeT<P4>::type_t p4;
|
||||
typename GetSimpleTypeT<P5>::type_t p5;
|
||||
typename GetSimpleTypeT<P6>::type_t p6;
|
||||
typename GetSimpleTypeT<P7>::type_t p7;
|
||||
typename GetSimpleTypeT<P8>::type_t p8;
|
||||
R* ret;
|
||||
SyncSemaphore *sync;
|
||||
|
||||
virtual void call() { *ret = (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); sync->sem->post(); sync->in_use=false; ; }
|
||||
};
|
||||
|
||||
/** commands that don't return but sync */
|
||||
|
||||
/* comands that return */
|
||||
@ -426,25 +390,6 @@ class CommandQueueMT {
|
||||
virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7); sync->sem->post(); sync->in_use=false; ; }
|
||||
};
|
||||
|
||||
template<class T,class M,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class P8>
|
||||
struct CommandSync8 : public CommandBase {
|
||||
|
||||
T*instance;
|
||||
M method;
|
||||
typename GetSimpleTypeT<P1>::type_t p1;
|
||||
typename GetSimpleTypeT<P2>::type_t p2;
|
||||
typename GetSimpleTypeT<P3>::type_t p3;
|
||||
typename GetSimpleTypeT<P4>::type_t p4;
|
||||
typename GetSimpleTypeT<P5>::type_t p5;
|
||||
typename GetSimpleTypeT<P6>::type_t p6;
|
||||
typename GetSimpleTypeT<P7>::type_t p7;
|
||||
typename GetSimpleTypeT<P8>::type_t p8;
|
||||
|
||||
SyncSemaphore *sync;
|
||||
|
||||
virtual void call() { (instance->*method)(p1,p2,p3,p4,p5,p6,p7,p8); sync->sem->post(); sync->in_use=false; ; }
|
||||
};
|
||||
|
||||
/***** BASE *******/
|
||||
|
||||
enum {
|
||||
@ -694,27 +639,6 @@ public:
|
||||
|
||||
if (sync) sync->post();
|
||||
}
|
||||
|
||||
template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7,class P8>
|
||||
void push( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8 ) {
|
||||
|
||||
Command8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> * cmd = allocate_and_lock< Command8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> >();
|
||||
|
||||
cmd->instance=p_instance;
|
||||
cmd->method=p_method;
|
||||
cmd->p1=p1;
|
||||
cmd->p2=p2;
|
||||
cmd->p3=p3;
|
||||
cmd->p4=p4;
|
||||
cmd->p5=p5;
|
||||
cmd->p6=p6;
|
||||
cmd->p7=p7;
|
||||
cmd->p8=p8;
|
||||
|
||||
unlock();
|
||||
|
||||
if (sync) sync->post();
|
||||
}
|
||||
/*** PUSH AND RET COMMANDS ***/
|
||||
|
||||
|
||||
@ -882,31 +806,6 @@ public:
|
||||
ss->sem->wait();
|
||||
}
|
||||
|
||||
template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6,class P7,class P8,class R>
|
||||
void push_and_ret( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6,P7 p7,P8 p8, R* r_ret ) {
|
||||
|
||||
CommandRet8<T,M,P1,P2,P3,P4,P5,P6,P7,P8,R> * cmd = allocate_and_lock< CommandRet8<T,M,P1,P2,P3,P4,P5,P6,P7,P8,R> >();
|
||||
|
||||
cmd->instance=p_instance;
|
||||
cmd->method=p_method;
|
||||
cmd->p1=p1;
|
||||
cmd->p2=p2;
|
||||
cmd->p3=p3;
|
||||
cmd->p4=p4;
|
||||
cmd->p5=p5;
|
||||
cmd->p6=p6;
|
||||
cmd->p7=p7;
|
||||
cmd->p8=p8;
|
||||
cmd->ret=r_ret;
|
||||
SyncSemaphore *ss=_alloc_sync_sem();
|
||||
cmd->sync=ss;
|
||||
|
||||
unlock();
|
||||
|
||||
if (sync) sync->post();
|
||||
ss->sem->wait();
|
||||
}
|
||||
|
||||
|
||||
template<class T, class M>
|
||||
void push_and_sync( T * p_instance, M p_method) {
|
||||
@ -1072,31 +971,6 @@ public:
|
||||
ss->sem->wait();
|
||||
}
|
||||
|
||||
template<class T, class M, class P1, class P2, class P3, class P4, class P5, class P6,class P7,class P8>
|
||||
void push_and_sync( T * p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6,P7 p7,P8 p8) {
|
||||
|
||||
CommandSync8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> * cmd = allocate_and_lock< CommandSync8<T,M,P1,P2,P3,P4,P5,P6,P7,P8> >();
|
||||
|
||||
cmd->instance=p_instance;
|
||||
cmd->method=p_method;
|
||||
cmd->p1=p1;
|
||||
cmd->p2=p2;
|
||||
cmd->p3=p3;
|
||||
cmd->p4=p4;
|
||||
cmd->p5=p5;
|
||||
cmd->p6=p6;
|
||||
cmd->p7=p7;
|
||||
cmd->p8=p8;
|
||||
|
||||
SyncSemaphore *ss=_alloc_sync_sem();
|
||||
cmd->sync=ss;
|
||||
|
||||
unlock();
|
||||
|
||||
if (sync) sync->post();
|
||||
ss->sem->wait();
|
||||
}
|
||||
|
||||
void wait_and_flush_one() {
|
||||
ERR_FAIL_COND(!sync);
|
||||
sync->wait();
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -199,18 +199,6 @@ Array Dictionary::keys() const {
|
||||
|
||||
}
|
||||
|
||||
Array Dictionary::values() const {
|
||||
|
||||
Array varr;
|
||||
varr.resize(size());
|
||||
const Variant *key=NULL;
|
||||
int i=0;
|
||||
while((key=next(key))){
|
||||
varr[i++] = _p->variant_map[*key];
|
||||
}
|
||||
return varr;
|
||||
}
|
||||
|
||||
const Variant* Dictionary::next(const Variant* p_key) const {
|
||||
|
||||
return _p->variant_map.next(p_key);
|
||||
@ -262,3 +250,5 @@ Dictionary::~Dictionary() {
|
||||
|
||||
_unref();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -81,7 +81,6 @@ public:
|
||||
const Variant* next(const Variant* p_key=NULL) const;
|
||||
|
||||
Array keys() const;
|
||||
Array values() const;
|
||||
|
||||
Dictionary(const Dictionary& p_from);
|
||||
Dictionary(bool p_shared=false);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -285,7 +285,6 @@ public:
|
||||
|
||||
Error resize(int p_size);
|
||||
|
||||
void invert();
|
||||
|
||||
void operator=(const DVector& p_dvector) { reference(p_dvector); }
|
||||
DVector() {}
|
||||
@ -425,18 +424,6 @@ Error DVector<T>::resize(int p_size) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void DVector<T>::invert() {
|
||||
T temp;
|
||||
Write w = write();
|
||||
int s = size();
|
||||
int half_s = s/2;
|
||||
|
||||
for(int i=0;i<half_s;i++) {
|
||||
temp = w[i];
|
||||
w[i] = w[s-i-1];
|
||||
w[s-i-1] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -57,33 +57,33 @@ enum Error {
|
||||
ERR_FILE_MISSING_DEPENDENCIES,
|
||||
ERR_FILE_EOF,
|
||||
ERR_CANT_OPEN, ///< Can't open a resource/socket/file
|
||||
ERR_CANT_CREATE, // (20)
|
||||
ERROR_QUERY_FAILED,
|
||||
ERR_CANT_CREATE,
|
||||
ERROR_QUERY_FAILED, // (20)
|
||||
ERR_ALREADY_IN_USE,
|
||||
ERR_LOCKED, ///< resource is locked
|
||||
ERR_TIMEOUT,
|
||||
ERR_CANT_CONNECT, // (25)
|
||||
ERR_CANT_RESOLVE,
|
||||
ERR_CANT_CONNECT,
|
||||
ERR_CANT_RESOLVE, // (25)
|
||||
ERR_CONNECTION_ERROR,
|
||||
ERR_CANT_AQUIRE_RESOURCE,
|
||||
ERR_CANT_FORK,
|
||||
ERR_INVALID_DATA, ///< Data passed is invalid (30)
|
||||
ERR_INVALID_PARAMETER, ///< Parameter passed is invalid
|
||||
ERR_INVALID_DATA, ///< Data passed is invalid
|
||||
ERR_INVALID_PARAMETER, ///< Parameter passed is invalid (30)
|
||||
ERR_ALREADY_EXISTS, ///< When adding, item already exists
|
||||
ERR_DOES_NOT_EXIST, ///< When retrieving/erasing, it item does not exist
|
||||
ERR_DATABASE_CANT_READ, ///< database is full
|
||||
ERR_DATABASE_CANT_WRITE, ///< database is full (35)
|
||||
ERR_COMPILATION_FAILED,
|
||||
ERR_DATABASE_CANT_WRITE, ///< database is full
|
||||
ERR_COMPILATION_FAILED, // (35)
|
||||
ERR_METHOD_NOT_FOUND,
|
||||
ERR_LINK_FAILED,
|
||||
ERR_SCRIPT_FAILED,
|
||||
ERR_CYCLIC_LINK, // (40)
|
||||
ERR_INVALID_DECLARATION,
|
||||
ERR_CYCLIC_LINK,
|
||||
ERR_INVALID_DECLARATION, // (40)
|
||||
ERR_DUPLICATE_SYMBOL,
|
||||
ERR_PARSE_ERROR,
|
||||
ERR_BUSY,
|
||||
ERR_SKIP, // (45)
|
||||
ERR_HELP, ///< user requested help!!
|
||||
ERR_SKIP,
|
||||
ERR_HELP, ///< user requested help!! (45)
|
||||
ERR_BUG, ///< a bug in the software certainly happened, due to a double check failing or unexpected behavior.
|
||||
ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
|
||||
ERR_OMFG_THIS_IS_VERY_VERY_BAD, ///< shit happens, has never been used, though
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -223,10 +223,5 @@ extern bool _err_error_exists;
|
||||
} \
|
||||
|
||||
|
||||
#define WARN_PRINTS(m_string) \
|
||||
{ \
|
||||
_err_print_error(FUNCTION_STR,__FILE__,__LINE__,String(m_string).utf8().get_data(),ERR_HANDLER_WARNING); \
|
||||
_err_error_exists=false;\
|
||||
} \
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -92,7 +92,7 @@ Error EventQueue::push_call(uint32_t p_instance_ID, const StringName& p_method,
|
||||
*v=p_arg5;
|
||||
}
|
||||
|
||||
if (buffer_end > buffer_max_used)
|
||||
if (buffer_max_used>buffer_end);
|
||||
buffer_max_used=buffer_end;
|
||||
|
||||
return OK;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
28
core/fpstr.cpp
Normal file
28
core/fpstr.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
/*************************************************************************/
|
||||
/* fpstr.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
28
core/fpstr.h
Normal file
28
core/fpstr.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*************************************************************************/
|
||||
/* fpstr.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
@ -1,31 +1,3 @@
|
||||
/*************************************************************************/
|
||||
/* func_ref.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#include "func_ref.h"
|
||||
|
||||
Variant FuncRef::call_func(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {
|
||||
|
||||
@ -1,31 +1,3 @@
|
||||
/*************************************************************************/
|
||||
/* func_ref.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef FUNC_REF_H
|
||||
#define FUNC_REF_H
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -432,7 +432,6 @@ static _GlobalConstant _global_constants[]={
|
||||
BIND_GLOBAL_CONSTANT( ERR_FILE_EOF ),
|
||||
BIND_GLOBAL_CONSTANT( ERR_CANT_OPEN ), ///< Can't open a resource/socket/file
|
||||
BIND_GLOBAL_CONSTANT( ERR_CANT_CREATE ),
|
||||
BIND_GLOBAL_CONSTANT( ERR_PARSE_ERROR ),
|
||||
BIND_GLOBAL_CONSTANT( ERROR_QUERY_FAILED ),
|
||||
BIND_GLOBAL_CONSTANT( ERR_ALREADY_IN_USE ),
|
||||
BIND_GLOBAL_CONSTANT( ERR_LOCKED ), ///< resource is locked
|
||||
@ -478,22 +477,7 @@ static _GlobalConstant _global_constants[]={
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORAGE ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NETWORK ),
|
||||
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR_HELPER ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKABLE ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKED ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_INTERNATIONALIZED ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_BUNDLE ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CATEGORY ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONZERO ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONONE ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NO_INSTANCE_STATE ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_RESTART_IF_CHANGED ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_SCRIPT_VARIABLE ),
|
||||
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT_INTL ),
|
||||
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NOEDITOR ),
|
||||
|
||||
BIND_GLOBAL_CONSTANT( METHOD_FLAG_NORMAL ),
|
||||
BIND_GLOBAL_CONSTANT( METHOD_FLAG_EDITOR ),
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -54,8 +54,7 @@ String Globals::localize_path(const String& p_path) const {
|
||||
if (resource_path=="")
|
||||
return p_path; //not initialied yet
|
||||
|
||||
if (p_path.begins_with("res://") || p_path.begins_with("user://") ||
|
||||
(p_path.is_abs_path() && !p_path.begins_with(resource_path)))
|
||||
if (p_path.find(":/") != -1)
|
||||
return p_path.simplify_path();
|
||||
|
||||
|
||||
@ -83,8 +82,6 @@ String Globals::localize_path(const String& p_path) const {
|
||||
if (sep == -1) {
|
||||
return "res://"+path;
|
||||
};
|
||||
|
||||
|
||||
String parent = path.substr(0, sep);
|
||||
|
||||
String plocal = localize_path(parent);
|
||||
@ -1376,25 +1373,6 @@ Vector<String> Globals::get_optimizer_presets() const {
|
||||
|
||||
}
|
||||
|
||||
void Globals::_add_property_info_bind(const Dictionary& p_info) {
|
||||
|
||||
ERR_FAIL_COND(!p_info.has("name"));
|
||||
ERR_FAIL_COND(!p_info.has("type"));
|
||||
|
||||
PropertyInfo pinfo;
|
||||
pinfo.name = p_info["name"];
|
||||
ERR_FAIL_COND(!props.has(pinfo.name));
|
||||
pinfo.type = Variant::Type(p_info["type"].operator int());
|
||||
ERR_FAIL_INDEX(pinfo.type, Variant::VARIANT_MAX);
|
||||
|
||||
if (p_info.has("hint"))
|
||||
pinfo.hint = PropertyHint(p_info["hint"].operator int());
|
||||
if (p_info.has("hint_string"))
|
||||
pinfo.hint_string = p_info["hint_string"];
|
||||
|
||||
set_custom_property_info(pinfo.name, pinfo);
|
||||
}
|
||||
|
||||
void Globals::set_custom_property_info(const String& p_prop,const PropertyInfo& p_info) {
|
||||
|
||||
ERR_FAIL_COND(!props.has(p_prop));
|
||||
@ -1419,7 +1397,6 @@ void Globals::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("get_order","name"),&Globals::get_order);
|
||||
ObjectTypeDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting);
|
||||
ObjectTypeDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting);
|
||||
ObjectTypeDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind);
|
||||
ObjectTypeDB::bind_method(_MD("clear","name"),&Globals::clear);
|
||||
ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path);
|
||||
ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path);
|
||||
@ -1450,7 +1427,7 @@ Globals::Globals() {
|
||||
|
||||
set("application/name","" );
|
||||
set("application/main_scene","");
|
||||
custom_prop_info["application/main_scene"]=PropertyInfo(Variant::STRING,"application/main_scene",PROPERTY_HINT_FILE,"tscn,scn,xscn,xml,res");
|
||||
custom_prop_info["application/main_scene"]=PropertyInfo(Variant::STRING,"application/main_scene",PROPERTY_HINT_FILE,"scn,res,xscn,xml,tscn");
|
||||
set("application/disable_stdout",false);
|
||||
set("application/use_shared_user_dir",true);
|
||||
|
||||
@ -1549,7 +1526,6 @@ Globals::Globals() {
|
||||
custom_prop_info["render/thread_model"]=PropertyInfo(Variant::INT,"render/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded");
|
||||
custom_prop_info["physics_2d/thread_model"]=PropertyInfo(Variant::INT,"physics_2d/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded");
|
||||
|
||||
set("debug/profiler_max_functions",16384);
|
||||
using_datapack=false;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -96,8 +96,6 @@ protected:
|
||||
|
||||
bool _load_resource_pack(const String& p_pack);
|
||||
|
||||
void _add_property_info_bind(const Dictionary& p_info);
|
||||
|
||||
protected:
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -74,10 +74,7 @@ static inline uint32_t hash_djb2_one_float(float p_in,uint32_t p_prev=5381) {
|
||||
float f;
|
||||
uint32_t i;
|
||||
} u;
|
||||
|
||||
// handle -0 case
|
||||
if (p_in==0.0f) u.f=0.0f;
|
||||
else u.f=p_in;
|
||||
u.f=p_in;
|
||||
|
||||
return ((p_prev<<5)+p_prev)+u.i;
|
||||
}
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
/*************************************************************************/
|
||||
/* value_evaluator.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef VALUE_EVALUATOR_H
|
||||
#define VALUE_EVALUATOR_H
|
||||
|
||||
#include "core/object.h"
|
||||
|
||||
class ValueEvaluator : public Object {
|
||||
|
||||
OBJ_TYPE(ValueEvaluator, Object);
|
||||
public:
|
||||
virtual double eval(const String& p_text) {
|
||||
return p_text.to_double();
|
||||
}
|
||||
};
|
||||
|
||||
#endif // VALUE_EVALUATOR_H
|
||||
2636
core/hq2x.cpp
2636
core/hq2x.cpp
File diff suppressed because it is too large
Load Diff
19
core/hq2x.h
19
core/hq2x.h
@ -1,19 +0,0 @@
|
||||
#ifndef HQ2X_H
|
||||
#define HQ2X_H
|
||||
|
||||
#include "typedefs.h"
|
||||
|
||||
|
||||
uint32_t *hq2x_resize(
|
||||
const uint32_t *image,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t *output,
|
||||
uint32_t trY = 0x30,
|
||||
uint32_t trU = 0x07,
|
||||
uint32_t trV = 0x06,
|
||||
uint32_t trA = 0x50,
|
||||
bool wrapX = false,
|
||||
bool wrapY = false );
|
||||
|
||||
#endif // HQ2X_H
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -30,7 +30,7 @@
|
||||
#include "hash_map.h"
|
||||
#include "core/io/image_loader.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "hq2x.h"
|
||||
|
||||
#include "print_string.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@ -901,44 +901,6 @@ static void _generate_po2_mipmap(const uint8_t* p_src, uint8_t* p_dst, uint32_t
|
||||
}
|
||||
|
||||
|
||||
void Image::expand_x2_hq2x() {
|
||||
|
||||
ERR_FAIL_COND(format>=FORMAT_INDEXED);
|
||||
|
||||
Format current = format;
|
||||
bool mipmaps=get_mipmaps();
|
||||
if (mipmaps) {
|
||||
clear_mipmaps();
|
||||
}
|
||||
|
||||
if (current!=FORMAT_RGBA)
|
||||
convert(FORMAT_RGBA);
|
||||
|
||||
DVector<uint8_t> dest;
|
||||
dest.resize(width*2*height*2*4);
|
||||
|
||||
{
|
||||
DVector<uint8_t>::Read r = data.read();
|
||||
DVector<uint8_t>::Write w = dest.write();
|
||||
|
||||
hq2x_resize((const uint32_t*)r.ptr(),width,height,(uint32_t*)w.ptr());
|
||||
|
||||
}
|
||||
|
||||
width*=2;
|
||||
height*=2;
|
||||
data=dest;
|
||||
|
||||
|
||||
if (current!=FORMAT_RGBA)
|
||||
convert(current);
|
||||
|
||||
if (mipmaps) {
|
||||
generate_mipmaps();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Image::shrink_x2() {
|
||||
|
||||
ERR_FAIL_COND(format==FORMAT_INDEXED || format==FORMAT_INDEXED_ALPHA);
|
||||
@ -1735,17 +1697,8 @@ Error Image::_decompress_bc() {
|
||||
|
||||
print_line("decompressing bc");
|
||||
|
||||
int wd=width,ht=height;
|
||||
if (wd%4!=0) {
|
||||
wd+=4-(wd%4);
|
||||
}
|
||||
if (ht%4!=0) {
|
||||
ht+=4-(ht%4);
|
||||
}
|
||||
|
||||
|
||||
int mm;
|
||||
int size = _get_dst_image_size(wd,ht,FORMAT_RGBA,mm,mipmaps);
|
||||
int size = _get_dst_image_size(width,height,FORMAT_RGBA,mm,mipmaps);
|
||||
|
||||
DVector<uint8_t> newdata;
|
||||
newdata.resize(size);
|
||||
@ -1755,8 +1708,7 @@ Error Image::_decompress_bc() {
|
||||
|
||||
int rofs=0;
|
||||
int wofs=0;
|
||||
|
||||
//print_line("width: "+itos(wd)+" height: "+itos(ht));
|
||||
int wd=width,ht=height;
|
||||
|
||||
for(int i=0;i<=mm;i++) {
|
||||
|
||||
@ -2061,11 +2013,6 @@ Error Image::_decompress_bc() {
|
||||
|
||||
data=newdata;
|
||||
format=FORMAT_RGBA;
|
||||
if (wd!=width || ht!=height) {
|
||||
//todo, crop
|
||||
width=wd;
|
||||
height=ht;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
@ -2327,8 +2274,6 @@ void Image::blit_rect(const Image& p_src, const Rect2& p_src_rect,const Point2&
|
||||
|
||||
|
||||
Image (*Image::_png_mem_loader_func)(const uint8_t*,int)=NULL;
|
||||
Image (*Image::_jpg_mem_loader_func)(const uint8_t*,int)=NULL;
|
||||
|
||||
void (*Image::_image_compress_bc_func)(Image *)=NULL;
|
||||
void (*Image::_image_compress_pvrtc2_func)(Image *)=NULL;
|
||||
void (*Image::_image_compress_pvrtc4_func)(Image *)=NULL;
|
||||
@ -2503,7 +2448,7 @@ String Image::get_format_name(Format p_format) {
|
||||
return format_names[p_format];
|
||||
}
|
||||
|
||||
Image::Image(const uint8_t* p_mem_png_jpg, int p_len) {
|
||||
Image::Image(const uint8_t* p_png,int p_len) {
|
||||
|
||||
width=0;
|
||||
height=0;
|
||||
@ -2511,13 +2456,8 @@ Image::Image(const uint8_t* p_mem_png_jpg, int p_len) {
|
||||
format=FORMAT_GRAYSCALE;
|
||||
|
||||
if (_png_mem_loader_func) {
|
||||
*this = _png_mem_loader_func(p_mem_png_jpg,p_len);
|
||||
*this = _png_mem_loader_func(p_png,p_len);
|
||||
}
|
||||
|
||||
if (empty() && _jpg_mem_loader_func) {
|
||||
*this = _jpg_mem_loader_func(p_mem_png_jpg,p_len);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Image::Image() {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -97,7 +97,6 @@ public:
|
||||
};
|
||||
|
||||
static Image (*_png_mem_loader_func)(const uint8_t* p_png,int p_size);
|
||||
static Image (*_jpg_mem_loader_func)(const uint8_t* p_png,int p_size);
|
||||
static void (*_image_compress_bc_func)(Image *);
|
||||
static void (*_image_compress_pvrtc2_func)(Image *);
|
||||
static void (*_image_compress_pvrtc4_func)(Image *);
|
||||
@ -250,7 +249,6 @@ public:
|
||||
void resize( int p_width, int p_height, Interpolation p_interpolation=INTERPOLATE_BILINEAR );
|
||||
Image resized( int p_width, int p_height, int p_interpolation=INTERPOLATE_BILINEAR );
|
||||
void shrink_x2();
|
||||
void expand_x2_hq2x();
|
||||
/**
|
||||
* Crop the image to a specific size, if larger, then the image is filled by black
|
||||
*/
|
||||
@ -358,7 +356,7 @@ public:
|
||||
static void set_compress_bc_func(void (*p_compress_func)(Image *));
|
||||
static String get_format_name(Format p_format);
|
||||
|
||||
Image(const uint8_t* p_mem_png_jpg, int p_len=-1);
|
||||
Image(const uint8_t* p_mem_png, int p_len=-1);
|
||||
Image(const char **p_xpm);
|
||||
~Image();
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -59,6 +59,7 @@ int Image::MCBlock::get_longest_axis_index() const {
|
||||
for(int i=0;i<4;i++) {
|
||||
|
||||
int d = max_color.color.col[i]-min_color.color.col[i];
|
||||
//printf(" ai:%i - %i\n",i,d);
|
||||
if (d>max_dist) {
|
||||
max_index=i;
|
||||
max_dist=d;
|
||||
@ -70,11 +71,13 @@ int Image::MCBlock::get_longest_axis_index() const {
|
||||
int Image::MCBlock::get_longest_axis_length() const {
|
||||
|
||||
int max_dist=-1;
|
||||
int max_index=0;
|
||||
|
||||
for(int i=0;i<4;i++) {
|
||||
|
||||
int d = max_color.color.col[i]-min_color.color.col[i];
|
||||
if (d>max_dist) {
|
||||
max_index=i;
|
||||
max_dist=d;
|
||||
}
|
||||
}
|
||||
@ -114,6 +117,8 @@ void Image::MCBlock::shrink() {
|
||||
|
||||
void Image::quantize() {
|
||||
|
||||
Image::Format orig_format=format;
|
||||
|
||||
bool has_alpha = detect_alpha()!=ALPHA_NONE;
|
||||
|
||||
bool quantize_fast=OS::get_singleton()->has_environment("QUANTIZE_FAST");
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -28,7 +28,6 @@
|
||||
/*************************************************************************/
|
||||
#include "input_map.h"
|
||||
#include "globals.h"
|
||||
#include "os/keyboard.h"
|
||||
|
||||
InputMap *InputMap::singleton=NULL;
|
||||
|
||||
@ -37,7 +36,6 @@ void InputMap::_bind_methods() {
|
||||
ObjectTypeDB::bind_method(_MD("has_action","action"),&InputMap::has_action);
|
||||
ObjectTypeDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id);
|
||||
ObjectTypeDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id);
|
||||
ObjectTypeDB::bind_method(_MD("get_actions"),&InputMap::_get_actions);
|
||||
ObjectTypeDB::bind_method(_MD("add_action","action"),&InputMap::add_action);
|
||||
ObjectTypeDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action);
|
||||
|
||||
@ -77,35 +75,6 @@ StringName InputMap::get_action_from_id(int p_id) const {
|
||||
return input_id_map[p_id];
|
||||
}
|
||||
|
||||
Array InputMap::_get_actions() {
|
||||
|
||||
Array ret;
|
||||
List<StringName> actions = get_actions();
|
||||
if(actions.empty())
|
||||
return ret;
|
||||
|
||||
for(const List<StringName>::Element *E=actions.front();E;E=E->next()) {
|
||||
|
||||
ret.push_back(E->get());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<StringName> InputMap::get_actions() const {
|
||||
|
||||
List<StringName> actions = List<StringName>();
|
||||
if(input_map.empty()){
|
||||
return actions;
|
||||
}
|
||||
|
||||
for (Map<StringName, Action>::Element *E=input_map.front();E;E=E->next()) {
|
||||
actions.push_back(E->key());
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const {
|
||||
|
||||
for (List<InputEvent>::Element *E=p_list.front();E;E=E->next()) {
|
||||
@ -232,6 +201,64 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac
|
||||
return _find_event(E->get().inputs,p_event)!=NULL;
|
||||
}
|
||||
|
||||
bool InputMap::event_is_joy_motion_action_pressed(const InputEvent& p_event) const {
|
||||
|
||||
ERR_FAIL_COND_V(p_event.type!=InputEvent::JOYSTICK_MOTION,false);
|
||||
bool pressed=false;
|
||||
|
||||
//this could be optimized by having a separate list of joymotions?
|
||||
|
||||
for (Map<StringName, Action>::Element *A=input_map.front();A;A=A->next()) {
|
||||
|
||||
for (List<InputEvent>::Element *E=A->get().inputs.front();E;E=E->next()) {
|
||||
|
||||
const InputEvent& e=E->get();
|
||||
if(e.type!=p_event.type)
|
||||
continue;
|
||||
if (e.type!=InputEvent::KEY && e.device!=p_event.device)
|
||||
continue;
|
||||
|
||||
switch(p_event.type) {
|
||||
|
||||
case InputEvent::KEY: {
|
||||
|
||||
if (e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod)
|
||||
return e.key.pressed;
|
||||
|
||||
} break;
|
||||
case InputEvent::JOYSTICK_BUTTON: {
|
||||
|
||||
if (e.joy_button.button_index==p_event.joy_button.button_index) {
|
||||
return e.joy_button.pressed;
|
||||
}
|
||||
|
||||
} break;
|
||||
case InputEvent::MOUSE_BUTTON: {
|
||||
|
||||
if (e.mouse_button.button_index==p_event.mouse_button.button_index) {
|
||||
return e.mouse_button.pressed;
|
||||
}
|
||||
|
||||
} break;
|
||||
case InputEvent::JOYSTICK_MOTION: {
|
||||
|
||||
if (e.joy_motion.axis==p_event.joy_motion.axis) {
|
||||
if (
|
||||
(e.joy_motion.axis_value * p_event.joy_motion.axis_value >0) && //same axis
|
||||
ABS(e.joy_motion.axis_value)>0.5 && ABS(p_event.joy_motion.axis_value)>0.5 )
|
||||
pressed=true;
|
||||
}
|
||||
|
||||
} break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return pressed;
|
||||
|
||||
}
|
||||
|
||||
void InputMap::load_from_globals() {
|
||||
|
||||
input_map.clear();;
|
||||
@ -262,67 +289,6 @@ void InputMap::load_from_globals() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void InputMap::load_default() {
|
||||
|
||||
InputEvent key;
|
||||
key.type=InputEvent::KEY;
|
||||
|
||||
add_action("ui_accept");
|
||||
key.key.scancode=KEY_RETURN;
|
||||
action_add_event("ui_accept",key);
|
||||
key.key.scancode=KEY_ENTER;
|
||||
action_add_event("ui_accept",key);
|
||||
key.key.scancode=KEY_SPACE;
|
||||
action_add_event("ui_accept",key);
|
||||
|
||||
add_action("ui_select");
|
||||
key.key.scancode=KEY_SPACE;
|
||||
action_add_event("ui_select",key);
|
||||
|
||||
add_action("ui_cancel");
|
||||
key.key.scancode=KEY_ESCAPE;
|
||||
action_add_event("ui_cancel",key);
|
||||
|
||||
add_action("ui_focus_next");
|
||||
key.key.scancode=KEY_TAB;
|
||||
action_add_event("ui_focus_next",key);
|
||||
|
||||
add_action("ui_focus_prev");
|
||||
key.key.scancode=KEY_TAB;
|
||||
key.key.mod.shift=true;
|
||||
action_add_event("ui_focus_prev",key);
|
||||
key.key.mod.shift=false;
|
||||
|
||||
add_action("ui_left");
|
||||
key.key.scancode=KEY_LEFT;
|
||||
action_add_event("ui_left",key);
|
||||
|
||||
add_action("ui_right");
|
||||
key.key.scancode=KEY_RIGHT;
|
||||
action_add_event("ui_right",key);
|
||||
|
||||
add_action("ui_up");
|
||||
key.key.scancode=KEY_UP;
|
||||
action_add_event("ui_up",key);
|
||||
|
||||
add_action("ui_down");
|
||||
key.key.scancode=KEY_DOWN;
|
||||
action_add_event("ui_down",key);
|
||||
|
||||
|
||||
add_action("ui_page_up");
|
||||
key.key.scancode=KEY_PAGEUP;
|
||||
action_add_event("ui_page_up",key);
|
||||
|
||||
add_action("ui_page_down");
|
||||
key.key.scancode=KEY_PAGEDOWN;
|
||||
action_add_event("ui_page_down",key);
|
||||
|
||||
// set("display/orientation", "landscape");
|
||||
|
||||
|
||||
}
|
||||
|
||||
InputMap::InputMap() {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
@ -47,7 +47,6 @@ class InputMap : public Object {
|
||||
List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const;
|
||||
|
||||
Array _get_action_list(const StringName& p_action);
|
||||
Array _get_actions();
|
||||
|
||||
protected:
|
||||
|
||||
@ -60,7 +59,6 @@ public:
|
||||
bool has_action(const StringName& p_action) const;
|
||||
int get_action_id(const StringName& p_action) const;
|
||||
StringName get_action_from_id(int p_id) const;
|
||||
List<StringName> get_actions() const;
|
||||
void add_action(const StringName& p_action);
|
||||
void erase_action(const StringName& p_action);
|
||||
|
||||
@ -70,10 +68,10 @@ public:
|
||||
|
||||
const List<InputEvent> *get_action_list(const StringName& p_action);
|
||||
bool event_is_action(const InputEvent& p_event, const StringName& p_action) const;
|
||||
bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const;
|
||||
|
||||
|
||||
void load_from_globals();
|
||||
void load_default();
|
||||
|
||||
InputMap();
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
This is version 2007-Mar-4 of the Info-ZIP license.
|
||||
The definitive version of this document should be available at
|
||||
ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and
|
||||
a copy at http://www.info-zip.org/pub/infozip/license.html.
|
||||
|
||||
|
||||
Copyright (c) 1990-2007 Info-ZIP. All rights reserved.
|
||||
|
||||
For the purposes of this copyright and license, "Info-ZIP" is defined as
|
||||
the following set of individuals:
|
||||
|
||||
Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
|
||||
Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
|
||||
Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
|
||||
David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
|
||||
Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
|
||||
Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
|
||||
Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
|
||||
Rich Wales, Mike White.
|
||||
|
||||
This software is provided "as is," without warranty of any kind, express
|
||||
or implied. In no event shall Info-ZIP or its contributors be held liable
|
||||
for any direct, indirect, incidental, special or consequential damages
|
||||
arising out of the use of or inability to use this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the above disclaimer and the following restrictions:
|
||||
|
||||
1. Redistributions of source code (in whole or in part) must retain
|
||||
the above copyright notice, definition, disclaimer, and this list
|
||||
of conditions.
|
||||
|
||||
2. Redistributions in binary form (compiled executables and libraries)
|
||||
must reproduce the above copyright notice, definition, disclaimer,
|
||||
and this list of conditions in documentation and/or other materials
|
||||
provided with the distribution. The sole exception to this condition
|
||||
is redistribution of a standard UnZipSFX binary (including SFXWiz) as
|
||||
part of a self-extracting archive; that is permitted without inclusion
|
||||
of this license, as long as the normal SFX banner has not been removed
|
||||
from the binary or disabled.
|
||||
|
||||
3. Altered versions--including, but not limited to, ports to new operating
|
||||
systems, existing ports with new graphical interfaces, versions with
|
||||
modified or added functionality, and dynamic, shared, or static library
|
||||
versions not from Info-ZIP--must be plainly marked as such and must not
|
||||
be misrepresented as being the original source or, if binaries,
|
||||
compiled from the original source. Such altered versions also must not
|
||||
be misrepresented as being Info-ZIP releases--including, but not
|
||||
limited to, labeling of the altered versions with the names "Info-ZIP"
|
||||
(or any variation thereof, including, but not limited to, different
|
||||
capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the
|
||||
explicit permission of Info-ZIP. Such altered versions are further
|
||||
prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP
|
||||
e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP
|
||||
will provide support for the altered versions.
|
||||
|
||||
4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
|
||||
"UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its
|
||||
own source and binary releases.
|
||||
@ -1,32 +0,0 @@
|
||||
Credits
|
||||
|
||||
Gilles Vollant - Original MiniZip author
|
||||
Even Rouault - ZIP64 unzip Support
|
||||
Daniel Borca - BZip Compression method support in unzip
|
||||
Mathias Svensson - ZIP64 zip support
|
||||
Mathias Svensson - BZip Compression method support in zip
|
||||
|
||||
This version has been modified for Godot Engine
|
||||
|
||||
|
||||
License
|
||||
----------------------------------------------------------------------------
|
||||
Condition of use and distribution are the same than zlib :
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@ -1,9 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import('env')
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
env.add_source_files(env.core_sources, "*.c")
|
||||
# env.core_sources.append("io/fastlz.c")
|
||||
env.add_source_files(env.core_sources,"*.cpp")
|
||||
env.add_source_files(env.core_sources,"*.c")
|
||||
#env.core_sources.append("io/fastlz.c")
|
||||
|
||||
Export('env')
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user