Commit graph

124 commits

Author SHA1 Message Date
Rémi Verschelde d8b30d42f5 Fix warnings for operator precedence disambiguation [-Wparentheses]
Fixes the following GCC 5 warnings:
```
core/io/resource_format_binary.cpp:1721:29: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
core/typedefs.h:108:24: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses]
editor/plugins/spatial_editor_plugin.cpp:2202:58: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses]
editor/plugins/spatial_editor_plugin.cpp:5002:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
main/input_default.cpp:346:59: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
main/input_default.cpp:348:60: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
main/input_default.cpp:579:57: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
modules/gridmap/grid_map_editor_plugin.cpp:613:14: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
modules/theora/video_stream_theora.cpp:335:34: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
modules/theora/video_stream_theora.cpp:336:35: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
modules/visual_script/visual_script_property_selector.cpp:215:38: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/rich_text_label.cpp:424:84: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/rich_text_label.cpp:512:80: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/scroll_container.cpp:173:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/scroll_container.cpp:173:86: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/tree.cpp:1419:98: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
```
2018-09-27 10:29:48 +02:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Rainer Deyke 31c6d6649f Fixes scene corruption when updating dependencies.
This commit fixes issue #17585: renaming/moving resources can corrupt
scene files.  The corruption was caused by
'ResourceFormatLoaderBinary::rename_dependencies' updating the file
format version field of the affected scene file to the latest version
without actually updating the content of the file to that version,
resulting in a file whose content does not match its file format version
field.  The fix preserves the file format version field and the engine
version fields when renaming dependencies.
2018-03-24 15:08:55 +01:00
Artem Varaksa d35e486228 Clean up some bad words from code comments 2018-02-17 16:00:39 +03: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
Juan Linietsky 433cb6f490 fix compile issue 2017-12-15 09:04:57 -03:00
Juan Linietsky 251433847f -Added new scene conversion to binary on export (disabled by default, please test)
-This method works by directly converting text to binary, so the scene does not need to be loaded and saved
2017-12-15 08:39:26 -03:00
Juan Linietsky 0300522189
Merge pull request #13176 from bojidar-bg/allow-subproperty-set
Fix combatibility with older .scn files
2017-11-22 08:46:34 -03:00
Bojidar Marinov 3eb7858a3a
Fix combatibility with older .scn files 2017-11-22 13:34:43 +02:00
Rémi Verschelde 613d374bc5
Merge pull request #12284 from bojidar-bg/allow-subproperty-set
Allow for getting/setting "dotted" properties of objects
2017-11-21 22:44:14 +01: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
Ferenc Arn d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Rémi Verschelde 6361e24f29 Cleanup unnecessary debug prints 2017-10-21 20:41:07 +02:00
letheed 5ad9be4c24 Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:

* pos -> position
* rot -> rotation
* loc -> location

C++ variables are left as is.
2017-09-20 13:11:10 +02:00
Rémi Verschelde aabbd00284 Merge pull request #10908 from hpvb/fix-unused-variables
Fix unused variable warnings
2017-09-12 12:55:53 +02:00
Hein-Pieter van Braam b2a38854fd Fix unused variable warnings
The forth in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-08 15:03:53 +02:00
Hein-Pieter van Braam 67a706fc1b Fix various assorted warnings
Fix various warnings that don't have enough instances to merit
individual commits. Also fixes a potential bug in audio_server.cpp.
2017-09-08 14:57:48 +02:00
Juan Linietsky ce28452109 -Fixed EditorDirDialog, which was really old and needed to use EditorFileSystem
-Fixed refactoring tools to work with imported scenes (properly move .import files)
2017-09-03 00:24:36 -03:00
Poommetee Ketson 459f526119 Fix typos 'a' and 'an' 2017-09-02 21:19:06 +07:00
Hein-Pieter van Braam f9467ec1ea Fix signed and unsigned comparisons
The first in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-01 08:13:12 +02:00
Juan Linietsky d39e79e7ec Fix issues regarding reload of resources in imported scenes. Closes #10017 2017-08-31 18:57:44 -03:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Rémi Verschelde 565600e844 Cleanup tons of obsolete commented out code
Mostly in EditorNode, dropping some obsolete editor plugins and also a
cleanup of ProjectSettings/EditorSettings.
2017-08-26 17:47:57 +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
Indah Sylvia 51f56a4282 core/io: fix typo 'resoucre' to 'resource' 2017-08-08 12:02:49 +07:00
Rémi Verschelde 76005a8e75 Style: Apply clang-format on all files
Thus fixing some invalid changes that had still made it to the master branch.
2017-07-30 22:53:40 +02:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Juan Linietsky 2e73be99d8 Lots of work on Audio & Physics engine:
-Added new 3D stream player node
-Added ability for Area to capture sound from streams
-Added small features in physics to be able to properly guess distance to areas for sound
-Fixed 3D CollisionObject so shapes are added the same as in 2D, directly from children
-Fixed KinematicBody API to make it the same as 2D.
2017-07-15 08:32:34 -03:00
Juan Linietsky db3b05d289 Reworked translation system
-Label and Button reload translation on the fly
-Resources are loaded and reload depending on locale
2017-06-28 17:01:35 -03:00
alexholly 935f730170 renamed all Rect3.pos to Rect3.position 2017-06-09 15:54:02 +02:00
alexholly a3c90b0293 renamed all Rect2.pos to Rect2.position 2017-06-04 02:09:17 +02:00
Juan Linietsky 5b3709d309 Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
2017-05-20 17:05:38 -03:00
Rémi Verschelde c3baf5eb3c Fix two typos from previous commit
Also cleanup comments on variant types.
2017-05-17 18:45:56 +02:00
Juan Linietsky 98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02: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
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Juan Linietsky da11d6d9e8 Many fixes to make exported scenes work better, still buggy. 2017-02-15 08:34:02 -03:00
Juan Linietsky 96de0141cc Removed import/export system, will start new one from scratch. 2017-01-25 21:57:08 -03:00
Juan Linietsky 7e1afeafd4 Audio bus editing is COMPLETE! 2017-01-25 14:31:52 -03: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 e6583117df Both Array and Dictionary are always in shared mode (removed copy on write). 2017-01-11 08:54:17 -03:00
Juan Linietsky bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00
Juan Linietsky 13cdccf23b Variant INT and REAL are now 64 bits (other types remain at 32) 2017-01-08 20:58:39 -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 0f7af4ea51 -Changed most project settings in the engine, so they have major and minor categories.
-Changed SectionedPropertyEditor to support this
-Renamed Globals singleton to GlobalConfig, makes more sense.
-Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available
2017-01-05 09:16:00 -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 3f3f5a5359 Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
2017-01-02 21:52:26 +01: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 22d83bc9f6 Begining of GLES3 renderer:
-Most 2D drawing is implemented
-Missing shaders
-Missing all 3D
-Editor needs to be set on update always to be used, otherwise it does not refresh
-Large parts of editor not working
2016-10-03 21:35:16 +02:00
Juan Linietsky fc70824f7c More improvements to visual script..
fixed a bug of not saving when sub-nodes changed.
2016-08-31 17:58:51 -03:00
Juan Linietsky b77200728e -Added yield nodes to visual script
-Added input selection nodes to visual script
-Added script create icon for those who miss it, will only appear when it can be used.
2016-08-07 19:22:33 -03:00
Pedro J. Estébanez 92f10a3582 Tidy up population of extensions list 2016-06-28 18:58:40 +02:00
Hubert Jarosz 4a4f247914
remove trailing whitespace 2016-03-09 00:00:52 +01:00
Juan Linietsky 4248c84e20 -Make sure scenes properly update when switching tabs, even if sub-instances changed. Fixes #3201 2016-01-14 11:06:20 -03:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
Juan Linietsky 6bc6b8fcf2 -ability to change scripts in external editor and still have properties reloaded in godot UI, fixes #3003 2015-12-09 09:08:41 -03:00
Juan Linietsky 7ba484bc74 some fixes
-fix compilation on tres/tscn on MSVC
-fixed theora playback performance, closes #3004
2015-12-06 20:22:45 -03:00
Juan Linietsky d123c89c58 -fixed a quite serious scene corruption bug when saving that has been around for months.
good thing no one ran into it :P
2015-10-21 23:57:43 -03:00
Juan Linietsky 07e9741425 **WARNING BEFORE PULLING**
This push changes the binary and XML formats and bumps the major version to 2.0. As such, files saved in this version WILL NO LONGER WORK IN PREVIOUS VERSIONS. This compatibility breakage with older versions was required in order to properly provide project refactoring tools.
If I were you, unless you are brave, I would wait a week or two before pulling, in case of bugs :)

Summary of Changes

-New Filesystem dock, with filesystem & tree view modes.
-New refactoring tools, to change or fix dependencies.
-Quick search dialog, to quickly search any file
2015-08-23 20:15:56 -03:00
Juan Linietsky 95047562d7 Several performance improvements, mainly in loading and instancing scenes and resources.
A general speedup should be apparent, with even more peformance increase when compiling optimized.

WARNING: Tested and it seems to work, but if something breaks, please report.
2015-06-29 00:29:49 -03:00
Juan Linietsky e9bbb97acc Multiple scene editing *POTENTIALLY UNSTABLE*
-ability to edit multiple scenes at the same time
-resource internal IDs are now persistent, this makes multiple scene
editing possible but maaaaay result in file corruption bugs (tested and
could not find anything but possibility exists because core code
changed, report immediately if you find this).
-properly save settings, layout, etc when edited
-script editing is independent from scene editing now
-show a yellow box when a script belongs to the scene
2015-06-22 00:04:15 -03:00
Juan Linietsky 221443c5a2 more fixes
-only refuse to load an older file if version major is different, fixes
#1944
-fix drive letter default value, fixes #1939
2015-05-19 21:36:35 -03:00
Juan Linietsky a5cbfbbcbb -fixed relative path saving to file, fixes #1694 2015-04-18 16:33:31 -03:00
Juan Linietsky fdaa2920eb Updated copyright year in all headers 2015-04-18 14:38:54 -03:00
Juan Linietsky a1f715a4da support for 2D shadow casters
Added support for 2D shadow casters.

*DANGER* Shaders in CanvasItem CHANGED, if you are using shader in a
CanvasItem and pull this, you will lose them. Shaders now work through a
2D material system similar to 3D. If you don't want to lose the 2D
shader code, save the shader as a .shd, then create a material in
CanvasItem and re-assign the shader.
2015-03-02 00:54:43 -03:00
Juan Linietsky 2af2a84a03 Misc Fixes
==========

-NOTIFICATION_WM_QUIT fixed on android (seems tha way this is reported changed in newer sdk)
-WIP implementation of APK Expansion APIs for publishing games larger than 50mb in Play Store
-Feaures in the new tutorials are all present in the sourcecode
-This (hopefully) should get rid of the animation list order getting corrupted
-Improved 3D Scene Importer (Skeletons, Animations and other stuff were not being merged). Anything missing?
-In code editor, the automatic syntax checker will only use file_exists() to check preload() else it might freeze the editor too much while typing if the preload is a big resource
-Fixed bugs in PolygonPathFinder, stil pending to do a node and a demo
2014-06-27 23:21:45 -03:00
Juan Linietsky 9f33134c93 -Support for changing fonts
-Detect when free() might crash the project and throw error
-fixed 2D Bounce in physics (3d still broken)
-renamed “on_top” property to “behind_parent”, which makes more sense, old on_top remains there for compatibility but is invisible.
-large amount of fixes
2014-04-05 12:39:30 -03:00
Juan Linietsky 31ce3c5fd0 -fix bug in cache for atlas import/export
-fix some menus
-fixed bug in out transition curves
-detect and remove file:/// in collada
-remove multiscript for now
-remove dependencies on mouse in OS, moved to Input
-avoid fscache from screwing up (fix might make it slower, but it works)
-funcref was missing, it's there now
2014-03-13 22:57:24 -03:00
Juan Linietsky ed6d9463d2 -Added ATITC texture support
-Fixed bug of some tabs showing wrong names
-Exported properties for viewport
2014-02-26 10:08:17 -03:00
Juan Linietsky 0b806ee0fc GODOT IS OPEN SOURCE 2014-02-09 22:10:30 -03:00