Commit graph

40 commits

Author SHA1 Message Date
Pedro J. Estébanez 57b2b275b4 Skip export of non-project libraries
That is, any library referred to in GDNative library resources, won't be copied to the export target path unless its path begins with `res://`.

The case use for this is a bit advanced: having a GDN library that will be deployed separately from the project; for instance, to a path in the system (like `/opt/...`).

Currently the GDN library editor doesn't allow to pick dynamic libraries outside the project, but that can be done by editing the `.gdnlib` file manually.
2019-07-03 21:54:46 +02:00
Fabio Alessandrelli a95563208f Update GDNativeLibrarySingletonEditor.
Moved GDNative singletons discoverer from register_types to
GDNativeSingletonEditor.
Fix enable/disable switch in GDNativeLibrarySingletonEditor.
Separate `gdnative/singletons` and `gdnative/singletons_disabled`
project settings, keeping "on by default" behavior.
2019-05-15 18:08:17 +02:00
marxin 8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
Rémi Verschelde e5f1d19352 Consistency in resource format saver/loader de-registration
Some used 'is_valid()' checks, others not. Validity is already checked in 'unref()',
and 'remove_resource_format_*()' has an ERR_FAIL condition on 'is_null()' already
(which shouldn't happen since we're only unregistering things that we previously
registered.

Also add missing GDCLASS statement in ResourceFormatLoaderVideoStreamGDNative,
missed in #20552 which was last amended before #19501 was merged.
2019-01-10 12:45:57 +01:00
Rémi Verschelde fe8cdafbf4
Merge pull request #20552 from KidRigger/gsoc-peer
Added interface for GDNative Videodecoder.
2019-01-09 17:30:09 +01:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Marc Gilleron 065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Anish 7199b7b5dd Added interface for GDNative Videodecoder.
Interface and callback api added for Videodecoder support.
Should be able to construct any format videodecoder using
only the given interface.

GSoC 2018 project.
2018-12-13 15:19:09 +01:00
Rémi Verschelde cdc411fd54 Fix various warnings: [-Waddress], [-Wpointer-arith], [-Wwrite-strings], [-Wreturn-local-addr] and more
Fixes the following GCC 5 warnings:
```
core/os/file_access.cpp:49:19: warning: the address of 'FileAccess::create_func' will always evaluate as 'true' [-Waddress]
servers/audio_server.cpp:192:70: warning: comparison with string literal results in unspecified behaviour [-Waddress]

drivers/gles2/rasterizer_storage_gles2.cpp:4095:90: warning: NULL used in arithmetic [-Wpointer-arith]

modules/gdnative/register_types.cpp:237:3: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
platform/android/export/export.cpp:207:1: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

modules/gdscript/gdscript.h:150:67: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:119:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:123:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:127:50: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:131:52: warning: returning reference to temporary [-Wreturn-local-addr]

editor/plugins/skeleton_editor_plugin.cpp:34:36: warning: extra tokens at end of #include directive
modules/bullet/bullet_types_converter.cpp:31:9: warning: #pragma once in main file

editor/import/editor_scene_importer_gltf.cpp:1996:51: warning: name lookup of 'i' changed
modules/visual_script/visual_script_property_selector.cpp:402:45: warning: name lookup of 'E' changed
scene/gui/tree.cpp:1268:25: warning: name lookup of 'i' changed
scene/resources/visual_shader.cpp:808:32: warning: name lookup of 'i' changed
```
2018-09-27 16:33:52 +02:00
Rémi Verschelde e5bbcb8bcf Fix warnings for comparison between signed and unsigned integers [-Wsign-compare]
Also turn off -Wsign-compare warnings in the future, we do not consider them important.

Fixes the following GCC 5 warnings:
```
core/node_path.cpp:279:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:169:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:314:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/shader_gles2.cpp:985:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles3/rasterizer_storage_gles3.cpp:1075:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/pulseaudio/audio_driver_pulseaudio.cpp:343:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_plugin.cpp:525:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_properties_array_dict.cpp:747:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:2078:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:4096:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/sprite_editor_plugin.cpp💯20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:134:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:339:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/etc/image_etc.cpp:222:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:242:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:258:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:200:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:222:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1085:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1489:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1623:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:206:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:356:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:406:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:493:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/audio_stream_player_3d.cpp:420:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:565:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:571:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_rb_resampler.cpp:156:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```

The following warnings were not fixed, as they implied casting for no gain:
```
core/io/packet_peer.cpp:228:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/io/resource_format_binary.cpp:109:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/rasterizer_scene_gles2.cpp:144:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/unix/file_access_unix.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:889:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1020:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:2255:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/bit_mask.cpp:336:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:141:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:150:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:154:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:86:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:89:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```
2018-09-27 16:25:23 +02:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +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
Fabio Alessandrelli 15451479e5 Add [Packet/Stream/Multiplayer]PeerGDNative
They provide an interface to implement PacketPeer, StreamPeer, and
NetworkedMultiplayerPeer via GDNative.
2018-06-27 19:07:30 +02: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
geequlim 13bd5c22c6 Add plugin to edit GDNativeLibrary
Rename GDNativeLibraryEditor to GDNativeLibrarySingletonEditor
2017-12-18 23:23:29 +08:00
Rémi Verschelde aeae05a2f4 Fix missing parenthesis 2017-12-09 23:36:41 +01:00
Rémi Verschelde 2b91a2059b GDNative: Fix warning when gdnative/singletons is missing 2017-12-09 23:32:40 +01:00
George Marques 6af42c536a
GDNative: Save singletons only if there's a change
Ensures that the Project Settings are saved only if the list of
singletons actually changed.
2017-12-05 00:25:29 -02:00
Ruslan Mustakov 8f0f327f02 Allow configuring iOS export
- EditorExportPlugin's _export_begin accepts all the arguments related
   to the current export (is_debug, path, flags).

 - EditorExportPlugin API is extended with methods allowing to configure
   iOS export: add_ios_framework, add_ios_plist_content,
   add_ios_linker_flags, add_ios_bundle_file.

 - iOS export template now contains Godot as a static library so that
   it can be linked with third-party Frameworks and GDNative static
   libraries.

 - Adds method to DirAccess for recursive copying of a directory.

 - Fixes iOS export to work with Xcode 9 (released recently).
2017-11-21 01:16:49 +07:00
Ferenc Arn d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Karroffel f1099c7221 [GDNative] export plugin 2017-11-15 17:24:32 +01:00
Thomas Herzog bd2b1a62d9
Merge pull request #12586 from karroffel/gdnative-gdnlibrary-changes
[GDNative] use feature tags, added load once option
2017-11-14 15:34:07 +01:00
Karroffel 79285b084d [GDNative] rename nativearvr extension to arvr 2017-11-10 12:36:50 +01:00
Karroffel ffc2669298 [GDNative] use feature tags, added load once option 2017-11-03 15:17:44 +01:00
Rémi Verschelde 6361e24f29 Cleanup unnecessary debug prints 2017-10-21 20:41:07 +02:00
Emmanuel Leblond e715be0f0a
[GDnative] add pluginscript \o/ 2017-10-17 10:50:13 +02:00
Karroffel e568f80e6e [GDNative] removed native_raw_call 2017-10-14 15:50:55 +02:00
BastiaanOlij cc37d43f86 Redoing the ARVR GDNative interface as module and tighter implementation 2017-10-14 09:10:18 +11:00
Emmanuel Leblond 6363bcf209
[GDnative] fix crash at cleanup time when singleton_gdnatives is not empty 2017-10-09 00:31:25 +02:00
Rémi Verschelde 2d4f6ef0bf Apply clang-format again to recent changes
Also add missing copyright headers.

[ci skip]
2017-09-16 19:48:45 +02:00
Juan Linietsky 35ed1eef2a Added a menu to enable/disabled GDNative singletons in project settings 2017-09-14 15:02:51 -03:00
bncastle fc83821316 Fixed attempt to delete NULL pointer error
Fixed: Error cause by attemptng to delete a NULL pointer.
unregister_gdnative_types() now checks discoverer to see if it is NULL
before deleting. After selecting a godot project to edit (in Win10), the
discoverer_callback() wasn't called thus discoverer was NULL.
2017-09-10 17:39:42 -04:00
Karroffel 54a9c1ee43 [GDNative] added singleton GDNativeLibraries
A GDNativeLibrary now has a field "gdnative_singleton" which can be
used to let the `godot_gdnative_singleton` procedure be executed on
Godot's startup. In future this can be used to register new
scripting languages or resource importer types.
2017-09-03 16:56:00 +02:00
Karroffel 7878329e6f merged gdnative and nativescript module 2017-09-03 15:28:43 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Karroffel 880048377d [GDNative] better header include paths
The old include paths caused some problems on some compilers, for
example including "string.h" was ambiguous.
2017-08-02 03:50:33 +02:00
Karroffel 135c2112ad added an optional parameter to OS symbol lookup
When looking up a symbol from a library, previously an error was
shown when the symbol did not exist. That caused confusion when the
lookup was completely optional.
This adds a new parameter to that method so that those errors can
be handled manually if needed.
2017-07-27 11:13:21 +02:00
Karroffel 534d62d2f4 [GDNative] new GDNative API
This adds GDNative as a separate class type.
It can be used to interface with native libraries by
using "native calls", which can be registered by modules
(and in future other GDNative libraries?).

It also reworks the currently called "GDNativeScript" into a
"NativeScript" that just makes use of the new GDNative instead
of it being the component that implements that functionality.
2017-07-24 04:23:37 +02:00
Karroffel c7f8b22ba0 renamed dlscript module to gdnative 2017-04-09 21:07:53 +02:00
Renamed from modules/dlscript/register_types.cpp (Browse further)