Commit Graph

147 Commits

Author SHA1 Message Date
4b1fc0593e add versions of BLI_ghash_int_new, BLI_ghash_str_new, etc. that take a reserve argument. 2013-08-24 15:14:50 +00:00
aefe93d909 revert bucket size change (edgehash was this way for years, since r26206, ghash since r57657)
having 2 free buckets for each entry is faster but uses more memory.

use the original size, best case 3 entries per bucket.
2013-08-24 15:09:57 +00:00
9c090cecfe ghash and edgehash api, allow newly defined hashes to take in the size of the hash as an arg (avoids resizing in simple cases when the hash is created and filled immediately). 2013-08-24 13:04:03 +00:00
4dd9353e56 ghash/edgehash flag wasn't being initialized for new hashes. also init vars in same order for ghash/edgehash. 2013-08-21 20:21:42 +00:00
a31db0c7e9 rename recently added BLI_ghash_assign() -> BLI_ghash_reinsert() 2013-08-21 16:06:03 +00:00
a2541508ac Fix a few compiler warnings reported by clang. 2013-08-18 14:15:51 +00:00
754b4ab3bc add hash function BLI_ghash_assign, BLI_edgehash_assign
avoids remove,insert and only hashes the key once.
2013-08-18 03:41:39 +00:00
ee2d95f850 minor api cleanup for ghash/edgehash
- use single inlined lookup function.
- move comments into source.
- pack iterator vars more efficiently.
2013-08-18 01:00:52 +00:00
fbb446dff6 add assert for hashes if an existing element is ever inserted into a ghash/edgehash.
the outliner does this intentionally, so add a flag to allow this situation optionally.
2013-08-18 00:36:04 +00:00
22dae3e600 fix for BLI_ghash_clear from Sv. Lockal (lockal) 2013-07-31 20:50:55 +00:00
8bf5ec4f8a code cleanup: de-duplicate BLI_ghashIterator_new/init and disable unused text undo print function. 2013-07-21 17:05:41 +00:00
4b0f50597f revert r58419. caller should do NULL check here. 2013-07-20 00:15:01 +00:00
869d654ccc BGE fix [#36223] Strange page fault of "Game" actuator
Adding a NULL check to BLI_ghash_lookup
2013-07-19 22:04:06 +00:00
1a50be2d94 Make edgehash and ghash use the same limit for expanding buckets, r26206 changed ghash.
double checked and r26206 does indeed give a speedup, so change for edgehash too.
2013-06-22 22:30:56 +00:00
1fb980e7df reduce sign conversion comparisons for smallhash and tweak warnings elsewhere. 2013-06-22 20:20:06 +00:00
Dalai Felinto
d23bf09712 build fix for old gccs (after rev.57620)
enabling the new pragmas only when gcc >= 4.6
gcc 4.2.1 here (OSX)
2013-06-22 20:00:17 +00:00
2efea8cf03 reduce sign comparisons for ghash and add more strict warnings for gcc. 2013-06-20 19:39:29 +00:00
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
13bde6645b code cleanup: remove callbacks only added to wrap MEM_freeN 2013-05-21 08:45:10 +00:00
a9fb183901 rename BLI_ghashIterator_notDone() -> BLI_ghashIterator_done()
was renamed fairly recently but other similar iterators not negated
	like this, would prefer to keep it as it was
2013-05-08 12:58:11 +00:00
3b341068ba warn of sign conversions for low level apis - ghash, heap, mempool 2013-05-08 12:55:51 +00:00
62db610220 use unsigned int's for smallhash, avoids using ABS when converting an
int from a key.
2013-05-08 12:54:07 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00
221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
53b7bc8f1f Change !BLI_ghashIterator_isDone to BLI_ghashIterator_notDone. It is
always used in that context so we can at least avoid reverting it twice
:p.
2013-03-06 20:55:04 +00:00
0d5b028d43 patch [#34103] use boolean in path functions and add comments.
path_util_1.patch from Lawrence D'Oliveiro (ldo)
2013-03-04 19:27:51 +00:00
bc3cb6ff76 remove paranoid null check from BLI_ghash_lookup(), was the only ghash function with a null check, callers better check the ghash exists first. 2013-02-03 15:03:55 +00:00
a6bee579e9 move pbvh into BKE, it used many BKE bad level includes.
now blenlib/BLI doesn't depend on any blenkern/BKE functions,
there are still some bad level includes but these are only to access G.background and the blender version define.
2012-12-15 15:59:25 +00:00
361eb23a42 switch BLI_ghashutil_strhash() to "djb" hash (as used by glib),
Gives approx 10% speedup in my own micro-benchmark looking up operators.
2012-12-11 13:57:58 +00:00
ebaf1306b8 bmesh operator api:
avoid per vert/edge/face string lookups in BMO_slot_map_* functions --- used in array modifier, subdivide, remove doubles and other tools.
2012-11-20 13:29:27 +00:00
1767b65846 style cleanup: also rename bmesh_decimate.c --> bmesh_decimate_collapse.c 2012-10-23 03:38:26 +00:00
cfb7aee017 style cleanup 2012-07-07 22:51:57 +00:00
4f90d757c7 add BLI_ghash_pop() which returns the value for a key and removes it at the same time, saves a lookup if you need to check if the item exists before removing. 2012-05-28 19:33:14 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
2f2b15bbb2 style cleanup: whitespace, bli & makesdna 2012-05-12 15:02:10 +00:00
d20c129a9c style cleanup: whitespace/operators 2012-05-09 09:24:15 +00:00
68d9e73ecd Fix: forgot to commit these files as part of strand bugfix. 2012-05-04 12:46:51 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
cae11a98f9 style cleanup 2012-03-11 23:47:41 +00:00
bc767059cb Code Cleanup: update to mempool, use flag rather then bool args. 2012-03-01 22:59:18 +00:00
588b26f18b more syncing smaller changes with trunk 2012-02-17 21:32:30 +00:00
5c6ee6b523 svn merge ^/trunk/blender -r42670:42680 2011-12-17 02:41:53 +00:00
ad96dacbc5 style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
2011-12-17 00:52:36 +00:00
4d6c34462c Fix #29640: make duplicates release keep hierarchy and parent properties not
working for multiple objects.

ID.newid only worked for one object, now it uses a hash instead.
2011-12-16 23:56:18 +00:00
3ed866d2fc svn merge -r41926:41932 ^/trunk/blender 2011-11-16 19:57:20 +00:00
3dcc9aef96 merge mempool changes from bmesh (adds mempool iterator). 2011-11-16 19:31:42 +00:00
15e6d6cd75 svn merge ^/trunk/blender -r41226:41227 . 2011-10-24 12:43:08 +00:00
dbe2fe5043 fix for errors with merge 2011-10-24 08:18:20 +00:00
0503a4f7a6 svn merge ^/trunk/blender -r41100:41150 2011-10-24 04:18:28 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00