Commit graph

79 commits

Author SHA1 Message Date
K. S. Ernest (iFire) Lee
ef1c26a9a5 Make sure PropertyHint matches in the VisualScript editor. 2018-01-15 22:19:54 +01:00
Bojidar Marinov
9b8e8b2220
Bind many more properties to scripts
Notable potentially breaking changes:
- PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL
- Some properties were renamed, and sometimes even shadowed by new ones
- New getter methods (some virtual) were added
2018-01-12 00:58:14 +02:00
AndreaCatania
5ac441131e Fixed crash on duplicate GIProbe baking 2018-01-11 19:50:33 +01:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Rémi Verschelde
13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
Juan Linietsky
a496dd4d38 Created internal usage flag to remove non editor properties from doc, closes #13334 2017-12-06 17:16:25 -03:00
Bojidar Marinov
0cf9597758
Allow for getting/setting indexed properties of objects using get/set_indexed
Performance is around the same as using pure set() through GDScript.
2017-11-21 20:58:21 +02:00
Ross Hadden
1a97d6455d Fixed a bunch of typos, including an error code. 2017-09-21 23:58:29 -04:00
Wilson E. Alvarez
0f4643a4f6 Moved class_name and return_val to initializer list 2017-09-14 12:54:37 -04:00
Hein-Pieter van Braam
f8cb9f5516 Remove NULL check from Object::cast_to()
After discussing this with @reduz on IRC we agreed to remove these
checks. We now consider cast_to() to be NULL safe
2017-09-04 22:29:43 +02:00
Ignacio Etcheverry
c16d00591b DocData and type hints fixes
- Makes vararg methods automatically use PROPERTY_USAGE_NIL_IS_VARIANT on return types
- Completely removes the ":type" suffix for method names. Virtual methods must use the MethodInfo constructors that takes Variant::Type or PropertyHint as the first parameter for the return type (with CLASS_INFO as a helper to get the PropertyInfo). Parameters must use PROPERTY_HINT_RESOURCE_TYPE and hint string.
- PROPERTY_USAGE_NIL_IS_VARIANT is no longer needed for parameters, because parameters cannot be void.
- Adds missing PROPERTY_USAGE_NIL_IS_VARIANT to virtual and built-in methods that return Variant.
2017-08-29 19:40:21 +02:00
Rémi Verschelde
bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Ignacio Etcheverry
b50a937fe6 MethodBind: Adds operator== to compare by id 2017-08-26 21:41:25 +02:00
Henrik Andersson
3cd3c1da5f Fix refactored Object::cast_to in NO_SAFE_CAST branch 2017-08-26 18:59:37 +02:00
Hein-Pieter van Braam
cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Hein-Pieter van Braam
4aa2c18cb4 Add a static version of Object::cast_to()
This is to prepare to replace all instances of the member version of
cast_to().
2017-08-24 23:08:24 +02:00
Juan Linietsky
3d1c031871 Changed MethodBind API to request information from methods. It's much claner now.
Also changed PropertyInfo to include informatino about class names.
2017-08-23 19:11:11 -03:00
Rémi Verschelde
18a7315381 Rename localization method to tr again
Partial revert of #10380 based on contributor ~~bullying~~ feedback.
2017-08-18 22:38:38 +02:00
Juan Linietsky
dc62389739 -Properly check limits to objects sent (regarding to size), fixes #9034
-Changed the way objects are marshalled and sent to the debugger
-Editing debugged objects happens in the remote inspector now
2017-08-18 10:59:31 -03:00
Rémi Verschelde
c72529baf0 Rename XL_MESSAGE aka tr to localize
Also renames `set_message_translation` to `set_message_localization`
for consistency.
2017-08-17 18:10:22 +02:00
TwistedTwigleg
00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Wilson E. Alvarez
6d112a68b6 Moved member variables from constructor to initialization list 2017-08-08 21:43:19 -04:00
Indah Sylvia
5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Juan Linietsky
475e8b28b2 keep default exported script values unless overriden, closes #8127 2017-08-06 09:33:59 -03:00
Juan Linietsky
a3a7fb83e6 Made bool constructor explicit in Variant to avoid bugs, fixes #7843 2017-08-05 19:50:53 -03:00
Juan Linietsky
3b2dfae5af function to add script and instance at once, as needed by neikeq 2017-07-22 16:57:56 -03:00
Juan Linietsky
4366b7c8b0 Added a simpler/faster way to bind script languages instance wrappers to Godot 2017-07-16 12:40:23 -03:00
Rémi Verschelde
6f63a01302 Merge pull request #8943 from RandomShaper/fix-error-handling
Implement well-defined handling of unrecoverable errors
2017-07-05 10:55:11 +02:00
Pedro J. Estébanez
211c451890 Implement well-defined handling of unrecoverable errors
Plus the addition of some convenience CRASH_* error macros.
Plus transient avoidance of the flood of warnings emitted by Clang when checking 'this' for NULL.
Plus explanation about the do-while(0) loop in some error macros.
2017-07-05 09:31:44 +02:00
Rémi Verschelde
6f0762ba5d Merge pull request #9195 from kubecz3k/obj-incoming-connections
Ability to get a list of signals that are targeting given object
2017-06-27 00:06:42 +02:00
Juan Linietsky
760cdbe1a3 -Added folding to property editor, persistent on objects it edits
-Some changes to tree to support this properly
2017-06-25 17:31:22 -03:00
Jakub Grzesik
8ff5e50513 Ability to get a list of signals that are targeting object 2017-06-15 15:32:30 +02:00
Juan Linietsky
612ab8fcdb -Restored multithread capability to VisualServer
-Restored resource previews!
2017-06-09 00:24:18 -03:00
Rémi Verschelde
df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Rémi Verschelde
debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01:00
Rémi Verschelde
5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Hein-Pieter van Braam
b696beea65 Correct hash behavior for floating point numbers
This fixes HashMap where a key or part of a key is a floating point
number. To fix this the following has been done:

* HashMap now takes an extra template argument Comparator. This class
gets used to compare keys. The default Comperator now works correctly
for common types and floating point numbets.

* Variant implements ::hash_compare() now. This function implements
nan-safe comparison for all types with components that contain floating
point numbers.

* Variant now has a VariantComparator which uses Variant::hash_compare()
safely compare floating point components of variant's types.

* The hash functions for floating point numbers will now normalize NaN
values so that all floating point numbers that are NaN hash to the same
value.

C++ module writers that want to use HashMap internally in their modules
can now also safeguard against this crash by defining their on
Comperator class that safely compares their types.

GDScript users, or writers of modules that don't use HashMap internally
in their modules don't need to do anything.

This fixes #7354 and fixes #6947.
2017-02-16 18:44:29 +01:00
Hein-Pieter van Braam
0f687f0ccb Remove use of _SCS from ADD_METHOD
This saves typing and is a step towards fixing #56
2017-02-13 10:37:47 +01:00
Juan Linietsky
2cd2ca7bbc Lot of work in new importer, importing textures now works. 2017-02-01 09:46:36 -03:00
Rémi Verschelde
3890256fc5 Style: Cleanups, added headers, renamed files
Made sure files in core/ and tools/ have a proper Godot license header
when written by us. Also renamed aabb.{cpp,h} and object_type_db.{cpp,h}
to rect3.{cpp,h} and class_db.{cpp,h} respectively.

Also added a proper header to core/io/base64.{c,h} after clarifying
the licensing with the original author (public domain).
2017-01-16 08:04:23 +01:00
Rémi Verschelde
93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Juan Linietsky
4338c90163 It is now possible to name layers of different kinds! 2017-01-10 22:20:57 -03:00
Juan Linietsky
e9bb65db81 -All types have editable script now in properties
-Changed clip to a property in Control which can be set by the user
2017-01-09 15:50:59 -03:00
Juan Linietsky
2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
Juan Linietsky
3fae505128 Begin modifying properties to make them more friendly to script and doc. 2017-01-03 00:38:16 -03:00
Juan Linietsky
118eed485e ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant.
All usages of "type" to refer to classes were renamed to "class"
ClassDB has been exposed to GDScript.
OBJ_TYPE() macro is now GDCLASS()
2017-01-02 23:03:46 -03:00
Rémi Verschelde
c7bc44d5ad Welcome in 2017, dear changelog reader!
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer
with state-of-the-art rendering techniques tuned to work as low as middle
end handheld devices - without compromising with the possibilities given
for higher end desktop games of course. Great times ahead for the Godot
community and the gamers that will play our games!
2017-01-01 22:03:33 +01:00
Juan Linietsky
9c6175db11 More visual script work
-Block switches to 2d/3d editor if editing visual script
-Added cast node in flow control
-Added ability to do RPC in visual script
-Comment nodes
-Fix bug with inverted cable in connecting backwards
-Copy and paste nodes, including from different scripts
2016-08-25 17:45:20 -03:00
Juan Linietsky
ad8f208bdb Proper function/property selection in visual script editing for property.
This one has an ordered list, built-in description, search, etc.
2016-08-23 19:29:07 -03:00