Commit graph

184 commits

Author SHA1 Message Date
MAriano Javier Suligoy ce87a30e45 New TileSet Editor 2018-08-09 20:38:02 -03:00
groud eb7f4ddcce Fixes bugs on the 2D editor scrollable area 2018-07-30 01:05:13 +02:00
Rémi Verschelde 391e46830f doc: Sync classref with current source
Fix various missing arguments in bindings.
2018-07-26 11:56:21 +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
Pieter-Jan Briers b2c797c584 Defer TileMap::update_dirty_quadrants once again.
This fixes #20323.

#11077 is now technically re-broken,
but you can now call update_dirty_quadrants as workaround.
2018-07-22 15:26:14 +02:00
Max Hilbrunner b21c1f64cd
Merge pull request #18634 from groud/fix_control_child_of_node2d
Fixes the bad calculation of margin & anchors when child of Node2D
2018-07-03 18:06:15 +02:00
Rémi Verschelde f036353b93
Merge pull request #19164 from marcelofg55/tilemap_undo2
Improve TileMap undo operations, second try
2018-06-26 20:57:39 +02:00
Marcelo Fernandez 67a78e020a Optimize _recreate_quadrants 2018-06-26 00:07:48 -03:00
Rémi Verschelde 3aed396a30
Merge pull request #19343 from bojidar-bg/x-fix-tilemap-shape-rotation
Fix bugs related to bad handling of rotated/translated shapes in tilemap
2018-06-08 18:15:51 +02:00
groud 4d78e16bc1 Fixes the bad calculation of margin & anchors when child of Node2D 2018-06-07 21:25:15 +02:00
Bojidar Marinov d73cdeb248
Fix bugs related to bad handling of rotated/translated shapes in tilemap
Fixup #18529 and #12870
2018-06-03 16:32:23 +03:00
James Beedie 6cbafdea16 Added autotile override 2018-06-02 21:25:09 -04:00
Marcelo Fernandez cadd72793b Improve TileMap undo operations, second try 2018-05-29 19:35:30 -03:00
isaacremnant e4f0ac558d Restore support for minimal 3x3 autotile sets 2018-05-17 09:49:14 -04:00
Mariano Javier Suligoy ba134d44b8
Merge pull request #15909 from authenticate/tilemap_fix
TileMap Navigation Fixes
2018-05-16 20:22:19 -03:00
James 69ee7945d7 Fixing a bug where tilemap navigation would not be accurate after a tilemap exits and then re-enters the tree. Fixing a bug where deleting a tile and then querying navigation would result in an incorrect path if both happened within the same frame. 2018-05-15 20:14:37 -04:00
mateusak ab0220affb
Allow uncommon bitmask for autotile - Fixes #16511
Removes some conditions that were there to create compatibility from 2X2 to 3X3.
Further dissociates 2X2 and 3X3 but adds more flexibility to 3X3.
2018-05-04 19:58:21 -03:00
Pieter-Jan Briers 20dd2204db Adds z-index properties to TileSets. 2018-05-01 17:24:57 +02:00
Gilles Roudiere 72ed1e4244 Remove the selection rect for nodes that do not require it 2018-04-03 22:04:19 +02:00
Benedikt Bär 84d60b0829 Implement missing navgiation polygon debugging in tilemap 2018-03-30 17:28:53 +02:00
Rémi Verschelde c81356153e
Merge pull request #16971 from Noshyaar/tilemap
TileMap: add fix_invalid_tiles
2018-03-13 13:57:58 +01:00
ShyRed 67f4944a21 Update TileMap when its TileSet changes
Make TileMap monitor its TileSet for changes and emit a signal when the TileSet changes. This makes the editor update and show the updated version of the TileSet.
2018-03-11 12:24:50 +01:00
Poommetee Ketson 7effe46461 TileMap: add fix_invalid_tiles 2018-02-24 19:34:41 +07:00
Damar Indra e69dd47501 Tileset Editor Improvement 2018-02-20 22:33:59 +07: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
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 f9f6f250e6
Merge pull request #15191 from Jerome67000/z_renaming
renames "z" Node2D property to "z_index"
2018-01-04 00:41:45 +01:00
Jerome67000 42ae3525a3 #15078 renamed "z" -> "z_index" property in Node2D 2018-01-03 13:02:26 +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
Poommetee Ketson 6c897707ca Add missing parameter names 2017-12-25 21:19:56 +07:00
Rémi Verschelde caf3a405ab
Merge pull request #13991 from CyanBlob/master
TileMap: Add update_bitmask_region(2), expose update_bitmask_area(1) …
2017-12-16 16:38:59 +01:00
Andrew Thomas d8c4324cfb TileMap: Add update_bitmask_region(2), expose update_bitmask_area(1) and update_bitmask_region(2) to GDscript 2017-12-16 08:18:54 -06:00
Nathan Warden 38caa4126f Renamed navmesh/poly_create to navmesh/poly_add since no navmesh is created. 2017-12-15 15:09:06 -05:00
Rémi Verschelde 48cefc9c96 TileMap: Drop unused center_x/center_y booleans
Two years later they are still unused and we do not know
their intend use case, so tschüss.
Closes #2513.
2017-12-10 16:40:31 +01:00
Rémi Verschelde 09fe926ab3
Merge pull request #14454 from CyanBlob/TileMap
Convert tilemap format in get_tile_data()
2017-12-09 19:05:07 +01:00
Andrew Thomas c3a005011b Convert tilemap format in get_tile_data() 2017-12-09 10:44:26 -06:00
PJB3005 cea5078ebe Fixes TileMap occluder offsets.
This is NOT related to #14388!

This fixes a graphical bug where the light occluders used by tilemaps weren't getting offset anymore, this they'd be positioned incorrectly.

I tried on all 3 tilemap positioning modes and it seemed to work on every one.
2017-12-08 20:14:06 +01:00
Mariano Suligoy af719a90a7 TileMap Fixes 2017-12-02 20:49:01 -03:00
Matthias Hoelzl 2beadf7ac0 Fix displacement for centered tilemaps
- Fixes tile and collision placement for tilemaps with
  `tile_origin` set to `TILE_ORIGIN_CENTER`.
- Also fixes a bug in the offset computation for collision shapes
  with `flip_v` flag set to true if `tile_origin` is
  `TILE_ORIGIN_BOTTOM_LEFT`.
2017-11-27 15:12:30 +01:00
Ruslan Mustakov e967dbca6f Fix TileMap and TileSet ClassDB bindings 2017-11-24 11:43:15 +07:00
Mariano Suligoy bcfb0a09f8 Implement auto-tiling 2017-11-20 06:27:47 -03:00
Gilles Roudiere 8d1f2b1857 Rework the canvas_item API for further improves to the canvas item editor 2017-11-19 13:36:31 +01:00
Vito 5515d28107 Fixing tilemap rotation for non top-left tiles. 2017-11-15 09:22:07 +00:00
Juan Linietsky 19b1ff0fc5 Disabled filter clip by default and made it optional, fixes #12368, likely others too 2017-11-10 09:22:25 -03:00
Juan Linietsky 192a4d7de5 Reworked how servers preallocate RIDs, should fix #10970 2017-11-09 23:35:34 -03: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 348eb4e4c5 Merge pull request #10361 from RandomShaper/tilemap-global-mtl
Let TileMap apply its material
2017-08-30 16:02:12 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Juan Linietsky 3061eca190 Removed old fp_adjust code that conflicts with clipped rects, fixes #9925 2017-08-25 10:40:29 -03: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
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Pedro J. Estébanez 3bb5abbc35 Let TileMap apply its material
So when a material is set, every tile will be rendered with that. Quadrants will not be recreated, so a `CanvasItem` will exist per material per quadrant regardless a global material is set.

This makes also __Use parent material__ work for `TileMap`s.

Closes #9996.
2017-08-15 23:41:23 +02:00
Ignacio Etcheverry 2f290038d6 Removes type information from method binds 2017-08-10 07:17:50 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Hassan A 74587a4927 Added get_used_cells_by_id method 3.0 2017-08-02 18:02:00 -04:00
Bojidar Marinov 4d2642b666 Readd tilemap's shape_transform and bugfixes
This reverts commit a808f53020.
2017-07-01 20:56:51 +03:00
Juan Linietsky a808f53020 Revert "Fix Tileset/tilemap issues related to my adding of one-way collisions to them" 2017-07-01 13:02:04 -03:00
Bojidar Marinov 80356f925c
Fix #9409, fixup #9370; tileset now has shape transform instead of offset
Fix bad return type in CollisionObject2D, Shape -> Shape2D. Was causing unintended null when casting. (9409)
Fix a misplaced ++ operator. (9370)
Fix merging with exiting tileset duplicating shapes. (9370)
2017-06-30 19:01:20 +03:00
Rémi Verschelde f2bc0cc966 Merge pull request #9370 from bojidar-bg/c-9318-oneway-tilemaps
Add one-way collisions and individual shape offsets for tilesets
2017-06-26 22:47:26 +02:00
Rémi Verschelde f7b77e5b76 Merge pull request #9318 from bojidar-bg/readd-normal-tilemap
Add normal map to tilemaps and tilesets
2017-06-26 22:47:11 +02:00
Bojidar Marinov 207feb2f87
Add one-way collisions and individual shape offsets for tilesets
As requested in #9318
Accidentially fixes #2231 as well
2017-06-25 21:47:30 +03:00
Poommetee Ketson e3998528e0 BuildSystem: generated files have .gen.extension 2017-06-25 07:55:01 +07:00
Bojidar Marinov 2edb082c7e
Add normal map to tilemaps and tilesets
Fixes #9310
2017-06-22 18:15:50 +03:00
Poommetee Ketson 6c44fff508 Refactor layer_mask to collision_layer 2017-06-14 10:58:34 +07:00
alexholly a3c90b0293 renamed all Rect2.pos to Rect2.position 2017-06-04 02:09:17 +02:00
Rémi Verschelde d596946a45 Merge pull request #8271 from MattUV/master
Add methods to get and set bits of collision layers and masks for TileMaps (3.0)
2017-04-09 23:37:56 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Juan Linietsky 74808ac4d9 New particle system, mostly working, some small features missing. 2017-04-06 23:49:27 -03:00
MattUV 6b5305b972 Add set/get_collision_layer/mask_bit() to TileMaps
Add four methods to the TileMap node to make collision layers and masks be modified bit by bit (like PhysicBody2Ds and RayCast2Ds:

 * set_collision_layer_bit()
 * set_collision_mask_bit()

 * get_collision_layer_bit()
 * get_collision_mask_bit()

To comply with collision layers' renaming from https://github.com/godotengine/godot/issues/5696 , the method names are NOT set/get_layer_mask_bit()
2017-04-06 23:27:55 +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
Andreas Haas 962243f931
TileMap: Respect self_modulate property
Now `TileMap`s make use of the `self_modulate` property.

There's still a bug: The Editor doesn't re-draw with the new color when you change the TileMaps `self_modulate`
in the inspector. You'll have to make it update manually (by placing a tile, changing the transform, etc..)
I'll open an issue for that after this is merged (If I don't fix it in the meantime ^^).
2017-03-05 11:42:01 +01:00
Bojidar Marinov 136e1e18ba
Add Rect2 TileMap::get_used_rect(), closes #4390 2017-02-20 23:02:03 +02: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
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 94609305a0 Merge pull request #6519 from RandomShaper/enhance-tileset
Add modulate (color) to TileSet tiles
2017-01-14 16:52:16 -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 a2903fc51d Must now register with set_transform_notify() to get NOTIFICATION_TRANSFORM_CHANGED 2017-01-12 20:35:46 -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 4338c90163 It is now possible to name layers of different kinds! 2017-01-10 22:20:57 -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 b085c40edf -Conversion of most properties to a simpler syntax, easier to use by script
-Modified help to display properties

GDScript can still not make use of them, though.
2017-01-04 01:16:14 -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 6428ebd91f Merge pull request #7406 from neikeq/pr-issue-5076
TileMap: _update_dirty_quadrants() cancel pending update pre return
2017-01-02 15:11:23 +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
Ignacio Etcheverry 5b3acd287d TileMap: _update_dirty_quadrants() cancel pending update pre return 2017-01-01 21:08:12 +01:00
Pedro J. Estébanez 86789c7071 Add modulate (color) to TileSet tiles 2016-11-30 14:33:39 +01:00
Ovnuniarchos e07dd9ab32 TileMap now honors blending mode. 2016-11-24 21:28:10 +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
Patrick Reh fff4d5867c Added Tile Origin = Bottom Left option to the TileMap 2016-06-20 12:18:53 +02:00
Bojidar Marinov 2a581835ca Fix issues with tilemap covering child nodes and old quadrants
Closes #4070
2016-03-18 18:57:26 +02:00
Hubert Jarosz 4a4f247914
remove trailing whitespace 2016-03-09 00:00:52 +01:00
Juan Linietsky 70cdfa681a -Change link to new documentation
-fixed bug in tilemap collision debug
2016-02-20 10:02:14 -03:00
Rémi Verschelde 5439937899 Bind method is_cell_transposed 2016-02-15 23:30:52 +01:00
Johan Manuel a634fc7a4a Added get_cellv() method to TileMap 2016-02-06 13:48:41 +01:00
Ignacio Etcheverry a9dbe83155 TileMap: Properly flip/rotate tiles with non-square region 2016-01-04 15:28:11 +01:00
Ignacio Etcheverry e22e0cecf7 TileMap: Consider texture offset for rotated tiles 2016-01-02 18:17:20 +01:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
reduz 5063cd7757 -Make tilemap able to change light mask, fixes #2557 2015-12-29 14:47:13 -03:00