Commit graph

198 commits

Author SHA1 Message Date
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Bojidar Marinov 7b7c7c8dc0
Rename KEY_RETURN to KEY_ENTER and KEY_ENTER to KEY_KP_ENTER
Closes #7695
2017-08-06 16:26:07 +03:00
Pedro J. Estébanez 02607b3103 Use atomics for memory use tracking
Plus:
- An allocation is counted only after checking its success.
- Max usage is updated after growing reallocs as well.
- Drop unused header.
- Changed the 0xFFF.. at get_mem_available() to -1 with a comment telling it's the same, but more universal.
2017-08-01 01:50:56 +02: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
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
Rémi Verschelde 6645c7cc18 Merge pull request #9872 from bruvzg/3.0-num-enter-fix
Remove duplicate keycode constant for Numpad Enter key (3.0)
2017-07-27 08:52:52 +02:00
Thomas Herzog 9caf9fa76f Merge pull request #9720 from endragor/stack-bottom
Add a way to retrieve stack bottom of the main thread
2017-07-26 15:30:04 +02:00
bruvzg 7de7ca8ae4 Remove duplicate keycode constant for Numpad Enter key. 2017-07-26 14:43:02 +03:00
Marcelo Fernandez 2144093fe6 Fix cvs files freezing the editor when a double quote is not closed 2017-07-25 22:38:28 -03:00
Ruslan Mustakov 3b88476130 Add a way to retrieve stack bottom of the main thread
I'm working on Nim bindings and Nim GC needs to know the stack
boundaries to check whether certain pointers are located on the stack
or in the heap. This commit adds godot_get_stack_bottom procedure
to gdnative module which returns pointer to the stack bottom of the
main thread. Later on this may be improved to return stack bottom of
the current thread.
2017-07-25 10:53:31 +07: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
Poommetee Ketson 49c7620326 Add object type hint for docs 2017-07-19 02:03:34 +07:00
Juan Linietsky bbada82f80 -Reorganized all properties of project settings (Sorry, Again).
(Lot's of bloat accumulated, so it was time for clean up.)
-Made EditorSettings and ProjectSettings search more useful (search in sections too)
2017-07-17 22:18:58 -03:00
geequlim 7358766ff6 IME window follow the input cursor.
Abstruct set_ime_position to OS class.
Update ime position for LineEdit and TextEdit.
2017-07-11 18:36:20 +08:00
Bojidar Marinov 7542896046
Make the InputEvent device property get saved
Fixes #9299
2017-06-24 16:28:19 +03:00
Juan Linietsky 3f2cd75c6f Fix shortcuts, make them visible again and work. 2017-06-22 19:57:59 -03:00
Rémi Verschelde b52466f793 Merge pull request #9002 from Hinsbart/key_action_match
InputEvent: Restore old behaviour for matching key events to actions.
2017-06-08 07:43:18 +02:00
Andreas Haas 9bc5348961
InputEvent: Renamed "pos" property to "position"
Make the naming consistent with other classes.
2017-06-03 11:26:39 +02:00
Karroffel 6bda2876f1 fixed PowerState enum cast
Quite a while ago I made a commit (131631b) where I did a weird
thing to fix compilation with PTRCALL_ENABLED. And I couldn't
sleep because of this after all these months. So here is the
proper version.
2017-06-01 00:16:33 +02:00
Andreas Haas c218390864
InputEvent: Restore old behaviour for matching key events to actions.
Original code in 9100db7
2017-05-30 22:27:55 +02:00
Juan Linietsky bb20f230ad -Added .hdr format support
-Added default environment editor setting
-Added environment created by default in new projects
-Removed default light and ambient from spatial editor, to make the editor more PBR compliant
2017-05-28 21:48:05 -03:00
Andreas Haas 3204befd1e
Fix InputEvent actions.
The `InputEvent::is_action(pressed|released)` methods weren't implemented yet.
Also fixed a typo in `InputDefault` that prevented `Input.is_action(pressed|released)` from working.
2017-05-27 10:52:57 +02:00
Andreas Haas 3744d9fd55
Fix virtual methods in InputEventKey.
This fixes a lot of problems with key input in the engine.
2017-05-25 21:56:54 +02:00
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
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
Juan Linietsky 98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03: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 2398eb6ed4 Move core thirdparty files to thirdparty/{minizip,misc} 2017-04-28 21:19:23 +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
Sergey Pusnei 8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Karroffel fd55308786 added dlscript module
This module was written by bojidar-bg and me, with the help of ClikCode and touilleMan.

This adds a module to Godot that enables the use of dynamic libraries as a source for scripts.
That also allows third party libraries to be linked to Godot more easily and without creating modules.

For a readme see https://github.com/GodotNativeTools/godot_headers/blob/master/README.md
2017-04-03 17:20:11 +02:00
Karroffel 2281942fb3 Added methods for opening dynamic libraries to OS 2017-03-29 23:05:15 +02:00
Rémi Verschelde 5cad9147f9 Merge pull request #8133 from Hinsbart/joy_constants
Input: Refactor JOY_* constants.
2017-03-24 22:53:16 +01:00
Andreas Haas 0d8f5660f6
Input: Refactor JOY_* constants.
**Breaking change**

Removed the `JOY_SNES_*` and `JOY_SEGA_*` constants. Imho there's no reason for a modern game engine to provide button aliases for decades-old hardware.
Also renamed `JOY_ANALOG_{0,1}_{X,Y}` to `JOY_ANALOG_{L,R}{X,Y}` and removed `JOY_ANALOG_2_*`.
2017-03-24 18:04:36 +01:00
Pedro J. Estébanez f5004b78d0 Implement warped mouse panning for 2D & 3D editors
Enabled by default as in Blender, but can be disabled separately for 2D & 3D;
the core functionality is in Input so this could be reused or even exposed to scripts in the future
2017-03-22 21:36:52 +01:00
Andreas Haas a69e449782
Input: bind parse_input_event()
When using get_tree().input_event(ev), the engine will JUST send the event down the SceneTree.
However, you won't get any of the benefits of the Input singleton:
- No InputMap actions will be emitted
- The internal input state won't be modified, so methods like `Input.get_mouse_pos()` or `Input.is_joy_button_pressed` won't return the expected output after sending the event.

This is fixed by using `Input.parse_input_event(ev)` instead.
I guess we'll also have to update the docs to reflect that this is the preferred method of sending custom InputEvents.
2017-03-19 09:20:44 +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
Rémi Verschelde e1c1d7d1d7 Add a bunch of missing Godot headers in own files 2017-03-05 15:47:28 +01:00
Julian Murgia 94103c0c02 Add API to access battery power state
Done:
- X11, server (tested)
- Windows (developed, would be nice to retest)
- OSX (not tested)
Prepared (not developed):
- Android (code is here, but may not compile)
- iphone
- winrt
- bb10
- haiku
- javascript
2017-03-04 18:04:29 +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
Hein-Pieter van Braam 411ee71b4d Rename the _MD macro to D_METHOD
This new name also makes its purpose a little clearer

This is a step towards fixing #56
2017-02-13 12:50:02 +01:00
Juan Linietsky 6f2e16306a Several bugfixes, improving the import workflow 2017-02-06 00:38:39 -03:00
Ilija Boshkov 1005a56e5a Added focus tracking in X11 and Windows classes, added new confined mouse mode (#7162) 2017-01-25 19:21:41 +01:00
Rémi Verschelde 2a0ddc1e89 Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
Rémi Verschelde f44ee891be Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00