Commit Graph

2845 Commits

Author SHA1 Message Date
Campbell Barton
94d4b31323 Math Lib: mat3_to_eulo2 & mat3_to_eul2 mixed float/double differently
replace sqrt with hypotf to avoid precision loss instead
2014-06-14 17:10:46 +10:00
Campbell Barton
746f0ad257 Polyfill2d: use kd-tree
Simple search for intersections became slow for larger concave ngons (100+)
Tested to work with ngons up to 75k sides, performance is approx ~6x faster then scanfill.

This is a 2D version of BLI_kdtree with modifications:
- nodes can be removed
- an index -> node map is stored (especially for tessellation)
2014-06-14 08:27:19 +10:00
Campbell Barton
19b1da2b7b Polyfill2d: avoid calculating polygon winding (its known in all cases) 2014-06-14 08:21:52 +10:00
Campbell Barton
7529e36f49 Polyfill2d: Switch directions on concave triangles
Better topology and minor speedup
2014-06-14 08:21:51 +10:00
Campbell Barton
f0f45eea2e Polyfill2d: replace array with linklist, faster resizing
approx 4.0x speedup
2014-06-14 08:21:51 +10:00
Campbell Barton
ecb7905127 Resolve MSVC error 2014-06-14 04:46:37 +10:00
Campbell Barton
bf462149a6 BLI_bitmap: rename macros
- BLI_BITMAP_SET -> BLI_BITMAP_ENABLE
- BLI_BITMAP_CLEAR -> BLI_BITMAP_DISABLE
- BLI_BITMAP_GET -> BLI_BITMAP_TEST
- BLI_BITMAP_MODIFY -> BLI_BITMAP_SET
2014-06-14 00:47:12 +10:00
Campbell Barton
a427fa5261 BLI_bitmap: typecheck maco 2014-06-14 00:47:12 +10:00
Campbell Barton
341fd67fbf Add string escaping support for BLI_str_quoted_substrN 2014-06-14 00:47:12 +10:00
Campbell Barton
365ff66987 GSet, GHash: Add BLI_gset_add, since its common to add members to a set
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
2014-06-14 00:47:12 +10:00
Campbell Barton
0e085c637e BLI_kdtree: use UNLIKELY 2014-06-14 00:47:11 +10:00
Campbell Barton
1962e21703 Code cleanup: remove redundant arg from ARRAY_LAST_ITEM 2014-06-14 00:47:11 +10:00
Campbell Barton
b707b07c5b Fix mempool bottleneck alloc & freeing a single item
Would continuously reinitialize the first chunk of the mempool,
now check for at least 2 blocks.
2014-06-08 23:09:30 +10:00
Antony Riakiotakis
f8f25c38d3 Fix T40510, revert openmp thread count to how it was in
2.70 for non Apple systems.

Also refactored the code that restores the previous openmp thread count.
The logic here was weird, mostly due to all the commit madness with
Apple openmp support. The restored thread count though should not depend
on the on/off state of threaded sculpting (since it has to do with
systems other than sculpting only). For OSX threads are restored to the
system thread count but Jens should recheck here.
2014-06-08 01:39:02 +03:00
Campbell Barton
a1f8cb6dbb Fix T40423: UV Editing 'Draw Other Objects' fails with Cycles 2014-06-05 13:58:31 +10:00
Matteo F. Vescovi
9b23d9acec Fix compilation error non non-linux architectures 2014-06-02 16:26:38 +06:00
Campbell Barton
09b0eadadd Add debug define for timing polyfill 2014-05-31 21:37:51 +10:00
Campbell Barton
b2cad79500 Math lib: add negate_m3, negate_m4 2014-05-30 00:26:32 +10:00
Campbell Barton
73452ae588 BLI_dynstr: add assert to check curlen is correct 2014-05-29 20:39:51 +10:00
Sergey Sharybin
973f95fa9d Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because
of file size didn't fit into stat structure which was using
long datatype.

The idea of this patch is to use _wstat64 and _stat64 structure
which is capable storing 64bit file sizes.

Made it a typedef for stat structure used by BLI_stat function
in order to make code easier to follow and avoid ifdefs all
over the place.

Additionally solved issue with BLI_exists which was wrongly
returning False in cases destination file is larger then 4GB.
2014-05-28 23:21:39 +06:00
Lukas Tönne
4893780d9f PIL_time is no longer used in BLI_random.
The last remnant of using the system time for random seed was removed
in rBafb4b65, now seeds are always explicit for BLI_random.
2014-05-27 08:29:55 +02:00
Campbell Barton
c6a34e047c Correct ortho_v2_v2 arg size 2014-05-27 14:42:22 +10:00
Campbell Barton
6b7bee6cd7 Fix for BLI_delete failing on files containing quotes 2014-05-26 10:23:05 +10:00
Dalai Felinto
7f089afc8b Bake-API: relaxing in the check for scale uniformity
It still warns the user that there may be an error, but the baking goes
on. Also using the new is_uniform_scaled_m4() instead of float comparison.

Reported and fix suggested by Campbell Barton as a concern over 2bfc3deb
2014-05-22 21:35:58 -03:00
Campbell Barton
c28f2ed489 Fix T40224: Crash moving objects to another layer
Incorrect nonnull attribute was optimizing out NULL check.
2014-05-20 21:41:57 +10:00
Campbell Barton
2191590711 Polyfill: simply re-ordering checks gives ~%15 speedup 2014-05-20 17:21:57 +10:00
Campbell Barton
f8278e5479 Correct ARRAY_SIZE macro and make doxy comments consistent 2014-05-19 18:00:20 +10:00
Campbell Barton
193e77cc67 Fix T40201: Keyframe edits fail to update the viewport 2014-05-19 00:24:45 +10:00
Campbell Barton
e8630bdccf Comment unused BLI_rebase_path 2014-05-19 00:00:59 +10:00
Campbell Barton
2a49bf35f0 Add ARRAY_SIZE macro to check fixed size arrays 2014-05-18 23:51:59 +10:00
Campbell Barton
a089a86edd Fix BLI_cleanup_path: '.' at the start of a path
On windows "." was replaced with the root directory.
On other systems any path starting with a '.' would be replaced with "/"

This was added for the file selector only,
so better handle this in the file selector (though it looks not to be needed).
2014-05-18 19:03:15 +10:00
Campbell Barton
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
Antony Riakiotakis
33df6aa12e Fix T39196, Dynamic Topology Undo Applied to Wrong Mesh
Undoing nodes that do not belong to the current object will cause the
saved bmesh log entry to be reverted instead. This entry can belong to
another object though.
This is easy to fix by enforcing name matching (this was borrowed by
edit mode but can definitely be improved) between current object name
and undo node name and deleting older entries.

However there are complications. Deleting dyntopo entries in this way
can leave a brush stroke as first dyntopo log entry. This can present
issues if we attempt to delete that entry since it's deleted mesh
elements may now have had their ids (which would still be valid at the
time) cleaned up. This can result in crashing if we attempt to resculpt
on the mesh. To fix this I have disabled releasing the deleted entries.

This entanglement between bm_log and undo is quite volatile but I hope
the system works better now.

Also minor cleanup, fix unneeded check warning
2014-05-13 22:05:23 +03:00
Sergey Sharybin
9531091eb8 Fix compilation error with debug SCons
For some reason SCons defines _DEBUG, not DEBUG as mathutils was
expecting it to be.

Made it so mathutils checks for NDEBUG which mimics BLI_assert
define.
2014-05-13 19:52:50 +02:00
Antony Riakiotakis
c60d5c6895 style cleanup, keep preprocessor identation 2014-05-13 20:11:27 +03:00
Antony Riakiotakis
ba350d3020 Add alloca include in compiler compatibility. Helps with MinGW32
compilation.
2014-05-13 18:41:53 +03:00
Campbell Barton
5db81a0695 Fix T40144: Font rendering problems 2014-05-12 09:08:02 +10:00
Campbell Barton
b78bb98cc9 VFont: de-duplicate checks for next/prev handles 2014-05-12 09:02:14 +10:00
Campbell Barton
4dcdb4b15e VFont: avoid allocating an array for storing total contours. 2014-05-12 08:47:49 +10:00
Campbell Barton
c88e65da61 Code cleanup: comment typos 2014-05-11 16:22:05 +10:00
Campbell Barton
c3a3664e8c Utility macros for linklist stack & asserts for bmesh 2014-05-10 09:29:34 +10:00
Campbell Barton
65d54f34b1 Code cleanup: spelling/indentation 2014-05-08 04:53:05 +10:00
Campbell Barton
35380cdcad Fix for uninitialized unit_use_radians variable with inset and bevel 2014-05-06 19:20:03 +10:00
Dalai Felinto
56d8affe42 BLI_path_suffix() - new path util functon to add a suffix to a filepath (before the extension)
Revision: D465
Reviewd by Campbell Barton
2014-05-02 20:56:16 -03:00
Campbell Barton
95b93b5d46 Add BLI_compiler_compat.h to help with portability 2014-05-02 01:14:15 +10:00
Campbell Barton
af86b008b2 Include removal gave problems with windows, ifdef some back in for windows only 2014-05-01 07:21:08 +10:00
Campbell Barton
cb48c0ceea Revert "Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc7a."
This reverts commit a47a4ef82f.
2014-05-01 07:20:46 +10:00
Thomas Dinges
a47a4ef82f Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc. 2014-04-30 23:16:12 +02:00
Campbell Barton
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
Campbell Barton
409fb4da0c Code cleanup: remove redundant matrix initialization 2014-04-29 18:13:20 +10:00