Commit graph

1067 commits

Author SHA1 Message Date
Rémi Verschelde 7592c2380d Merge pull request #8898 from vnen/screentouch-struct-class
Change InputEventScreenTouch from struct to class
2017-05-25 08:40:27 +02:00
George Marques 452caf3f80
Change InputEventScreenTouch from struct to class 2017-05-24 16:06:07 -03:00
Martin Capitanio 29c5b4c7e6 Fix 2D-editor mouse wheel zoom (x11).
Fixes #8888
2017-05-24 10:02:43 +02:00
Juan Linietsky afcce9eb12 -Fix the "set_val" call deferred, it was the only one.. closes #8742
-Removed redundant bind in input_event
2017-05-23 09:06:22 -03:00
Juan Linietsky 6161e731d0 fixed crash on code that checks InputEvent 2017-05-23 08:13:11 -03:00
Rémi Verschelde ce51138b38 Merge pull request #8786 from bojidar-bg/fix-astar-weight-scale
Fix weigth scale of A* being applied to the whole estimation
2017-05-22 15:16:20 +02:00
Bojidar Marinov bd91730347
Fix weigth scale of A* being applied to the whole path and estimation
Attempt to fix #8584
2017-05-22 15:55:49 +03:00
Ferenc Arn e4eb093c62 Avoid overestimating the cost in AStar heuristics.
This is a necessary condition for finding optimal solutions.
This is achieved by simply requiring/ensuring that no weights are smaller than 1.

Fixes #8584.
2017-05-21 15:13:09 -05: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 c7650c363b Merge pull request #8829 from supagu/astar-bidirectional
Added bool to allow astar points to be connected in one direction only
2017-05-20 09:49:28 +02:00
Emmanuel Leblond abcb044bf3
Finish implementation of GDnative builtins bindings 2017-05-19 23:28:15 +02:00
Fabian Mathews 2262a59ab3 Added bool to allow astar points to be connected in one direction only 2017-05-19 20:46:45 +09:30
Rémi Verschelde 1f62c33141 Merge pull request #8807 from RandomShaper/mq-flush-reentrant
Make MessageQueue::flush() reentrant
2017-05-18 18:52:55 +02:00
Rémi Verschelde c2854381b3 Merge pull request #8649 from neikeq/pr-ringbuffer-find
RingBuffer: Adds find() method
2017-05-18 13:42:56 +02:00
Pedro J. Estébanez 983fd3a7bb Make MessageQueue::flush() reentrant 2017-05-18 13:02:49 +02: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
Damian Day f2564ca97f Fix natural sorting order in EditorFileDialog, FileDialog and EditorFileSystemDirectory
Make EditorFileDialog, FileDialog and EditorFileSystemDirectory alphanumerical sorting more natural

Added a new method 'naturalnocasecmp_to' and comparator 'NaturalNoCaseComparator' to String.

Fixes #8712.
2017-05-12 13:02:25 +01:00
Marcelo Fernandez bba8f1db30 Fixed the IP resolver code blocking the main thread, it uses a Mutex now to lock its own thread. 2017-05-08 21:30:48 +02:00
toger5 304a1f5b5a Implemented scrolling factor for smooth trackpad scrolling
Working platforms platform: OSX, Windows.
Support for almost all ui elements, including project list.
2017-05-07 14:23:56 +02:00
Rémi Verschelde 18df047f0b Merge pull request #8658 from Faless/explain_out_of_mem_msg_queue_master
Better explain out of memory error in message queue
2017-05-05 23:09:30 +02:00
Rémi Verschelde e58519eb31 Merge pull request #8642 from RandomShaper/fix-pack-get-curr-dir
Fix infinite loop in DirAccessPack::get_current_dir()
2017-05-05 23:02:07 +02:00
Fabio Alessandrelli 1a7aafa90d Better explain out of memory error in message queue
Also effectively saves one unnecessary call when everything is fine.
2017-05-05 19:56:54 +02:00
Ignacio Etcheverry 803a54d93c RingBuffer: Adds find() method 2017-05-05 02:09:43 +02:00
Pedro J. Estébanez 5c0188b5c3 Fix infinite loop in DirAccessPack::get_current_dir() 2017-05-04 02:20:53 +02:00
Rémi Verschelde 7ce8342ac5 Rename project file to "project.godot"
Slimmed down variant from the reverted #8375.
The rationale behind the name change is to give Godot's project file a unique
extension (".godot") that can be registered on the OS to be associated with
the Godot binary (OS registration not implemented here).

This PR also adds the possibility to start the game or editor if launched
with the project.godot passed as argument, which paves the way for allowing
a similar behaviour on a double-click in the OS file manager (code originally
by @Hinsbart).

Closes #6915.
2017-05-01 17:50:19 +02:00
Rémi Verschelde de7eba887e Merge pull request #8572 from akien-mga/thirdparty
Moving more thirdparty stuff (minizip, some single-file external libs) to the thirdparty directory
2017-04-29 22:57:49 +02:00
Juan Linietsky 6d2f985db4 Revert "Use .godot as file extension for project files." 2017-04-29 17:56:51 +02:00
Rémi Verschelde d4029aa51a Move other lone thirdparty files to thirdparty/misc
Also move Box2D ConvexDecomposition contrib code to
thirdparty/b2d_convexdecomp.
2017-04-28 21:19:25 +02:00
Rémi Verschelde c5f830d6b9 Split thirdparty smaz.c out of compressed_translation.cpp
Code comes from 150e125cba/smaz.c

With a small modification to match Godot expectations:
```
diff --git a/thirdparty/core/smaz.c b/thirdparty/core/smaz.c
index 9b1ebc2..555dfea 100644
--- a/thirdparty/core/smaz.c
+++ b/thirdparty/core/smaz.c
@@ -14,7 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 #include <string.h>

 /* Our compression codebook, used for compression */
-static char *Smaz_cb[241] = {
+static const char *Smaz_cb[241] = {
 "\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS",
 "\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277",
 "\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336",
@@ -89,7 +89,7 @@ static char *Smaz_rcb[254] = {
 "e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com"
 };

-int smaz_compress(char *in, int inlen, char *out, int outlen) {
+int smaz_compress(const char *in, int inlen, char *out, int outlen) {
     unsigned int h1,h2,h3=0;
     int verblen = 0, _outlen = outlen;
     char verb[256], *_out = out;
@@ -167,7 +167,7 @@ out:
     return out-_out;
 }

-int smaz_decompress(char *in, int inlen, char *out, int outlen) {
+int smaz_decompress(const char *in, int inlen, char *out, int outlen) {
     unsigned char *c = (unsigned char*) in;
     char *_out = out;
     int _outlen = outlen;
@@ -192,7 +192,7 @@ int smaz_decompress(char *in, int inlen, char *out, int outlen) {
             inlen -= 2+len;
         } else {
             /* Codebook entry */
-            char *s = Smaz_rcb[*c];
+            const char *s = Smaz_rcb[*c];
             int len = strlen(s);

             if (outlen < len) return _outlen+1;
diff --git a/thirdparty/core/smaz.h b/thirdparty/core/smaz.h
index a547d89..a9d8a33 100644
--- a/thirdparty/core/smaz.h
+++ b/thirdparty/core/smaz.h
@@ -14,7 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 #ifndef _SMAZ_H
 #define _SMAZ_H

-int smaz_compress(char *in, int inlen, char *out, int outlen);
-int smaz_decompress(char *in, int inlen, char *out, int outlen);
+int smaz_compress(const char *in, int inlen, char *out, int outlen);
+int smaz_decompress(const char *in, int inlen, char *out, int outlen);

 #endif
```
2017-04-28 21:19:24 +02:00
Rémi Verschelde 2398eb6ed4 Move core thirdparty files to thirdparty/{minizip,misc} 2017-04-28 21:19:23 +02:00
Andreas Haas c530d8f43c
Fix recognition of resource extensions.
Also removes a related debug print.
2017-04-26 23:07:23 +02:00
volzhs ec1c7ce6c3 Fix wrong fallback for locale 2017-04-26 04:48:03 +09:00
Rémi Verschelde 1dc689b513 Merge pull request #8506 from iam13islucky/patch-1
[3.0] Fix bug in Image::_get_pixelb
2017-04-24 12:02:10 +02:00
Rémi Verschelde bd885ed704 Merge pull request #8469 from Melix19/patch-2
Update snake_case splitting
2017-04-24 11:38:36 +02:00
Rémi Verschelde 68870af214 Merge pull request #8420 from magyar123/pr-script-files-as-base
Added the ability to select files as base when creating scripts
2017-04-24 11:28:36 +02:00
Rémi Verschelde 5ae1e172da Merge pull request #8277 from tagcup/math_checks
Added various functions basic math classes. Also enabled math checks …
2017-04-24 11:16:20 +02:00
iam13islucky 73a9a85bc9 [3.0] Fix bug in Image::_get_pixelb
Fixes issue:
 https://github.com/godotengine/godot/issues/8158
2017-04-23 22:51:35 -06:00
Marco Melorio 4677c0fbb8 Update snake_case splitting 2017-04-23 23:03:16 +02:00
Rémi Verschelde 515f92d03b Fix property warnings and hide some debug prints
"ALL IS GOOD" was a lie.

In particular, removes verbose "path not recognized" false positive.

The actual logic is to (somewhat naively) check all ResourceFormatLoaders
and to pick the first good match, so no need to warn about the formats
that do not match the type hint.
2017-04-23 11:17:32 +02:00
Rémi Verschelde 99529fb80d Move VERSION_MKSTRING logic to version.h
Fixes a bug where the VERSION_PATCH define is not yet in scope if
typedefs.h is included before version.h at compilation time.

(cherry picked from commit 3b687c5474)
2017-04-20 12:14:34 +02:00
Rémi Verschelde 22b9c0207b Merge pull request #8417 from neikeq/hello-there
External editor improvements and fixes
2017-04-20 02:20:04 +02:00
Marco Melorio 1ac38846e8 Fixed that playing the project opens the project manager
Fixes #8445
2017-04-18 15:46:37 +02:00
Rémi Verschelde 7088d9e30f Merge pull request #8441 from tagcup/seed_fix
Fix PRNG randomization.
2017-04-18 00:06:41 +02:00
Rémi Verschelde 474f18512a Merge pull request #8375 from Hinsbart/project_extension
Use .godot as file extension for project files.
2017-04-17 23:28:15 +02:00
Ferenc Arn ceb699f5ec Fix PRNG randomization.
PCG32 doesn't like small seeds, which leads to zero random values (prior to #7532, zero values were handled as special cases).

Use a large default seed, and also add a shift in Math::randomize.

Fixes #8423.
2017-04-17 14:05:02 -05:00
Ignacio Etcheverry 4b8568006d External editor improvements and fixes
Notable changes:

- Now ScriptLanguages have the option to override the global external editor setting.
If `ScriptLanguage::open_in_external_editor()` returns `ERR_UNAVAILABLE` (which it does by default), then the global external editor option will be used.
- Added formatting to the external editor execution arguments. Now it's possible to write something like this: `{project} -g {file}:{line}:{col}`.
- `VisualScript::get_member_line()` now can return the line of functions (well, it returns the id of the _Function_ node of the function). I guess there is nothing else we can get a "line" from.

Fixes:

- Fixes a bug where `ScriptEditor::script_goto_method()` would not work if the script is not already open in the built-in editor.
- Fixes wrong DEFVAL for `cursor_set_column` and `cursor_set_line` in TextEdit.
- `Script::get_member_line()` now returns -1 ("found nothing") by default.
2017-04-17 01:51:30 +02:00
Andreas Haas c06a2db63a
Use .godot as file extension for project files.
Now project files don't have to be named "godot.cfg" anymore, they can have any name so as long as it ends with *.godot.
Also godot will automatically start the editor now if launched with a project file as an argument.
This allows for double-clicking of projects to open them :)

Code-wise this should be complete, but there's still work to do:

- Make a nice icon for godot projects.
- Work on installers/packaging -> register the extension and icon with godot.
- Update the 2.1 to 3.0 exporter.

Tested on linux and windows so far.
2017-04-16 10:19:07 +02:00
mbalint12 a3afec588c Added the ability to select files as base when creating scripts 2017-04-15 23:29:09 +02:00
Hein-Pieter van Braam 8ff6e53833 Correct Variant::hash_compare()
There was a logic error in #7815 which made
Variant.hash_compare() == Variant.hash_compare() always true.
In an attempt to short-circuit the NaN check I made an (in hindsight) obvious
error: 10 == 12 || is_nan(10) == is_nan(12)

This will be true for all inputs, except for the NaN, not-NaN case. The macro
has been updated to now generate:

(10 == 12) || (is_nan(10) && is_nan(10))

so:

(10 == 12)   || (is_nan(10)  && is_nan(12))  = false
   False  or (False and False) is False
(10 == 10)   || (is_nan(10)  && is_nan(10))  = true
   True or (False and False) is True
(Nan == 10)  || (is_nan(NaN) && is_nan(10))  = false
   False or (True and False) is False
(Nan == Nan) || (is_nan(NaN) && is_nan(NaN)) = true
   False or (True and True) is True

Which is correct for all cases.

This bug was triggered because the hash function for floating point numbers
can very easily generate collisions for the tested Vector3(). I've also added
an extra hashing step to the float hash function to make this less likely to
occur.

This fixes #8081 and probably many more random weirdness.
2017-04-14 11:31:18 +02:00