Commit Graph

2653 Commits

Author SHA1 Message Date
Campbell Barton 2f01be2b2f UI: panel tabs, use simple color interpolation that ignores alpha 2014-02-10 17:06:56 +11:00
jens verwiebe a84bcea070 OSX/scons: allow for compiling with clang-openmp-3.4
See: http://clang-omp.github.io
+ fix a longstanding bad include in darwin-config
2014-02-09 18:03:13 +01:00
Campbell Barton f54e3589a4 some systems didnt define NULL 2014-02-08 08:09:49 +11:00
Campbell Barton b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Campbell Barton 6110a5bdef Scanfill: use poly_nr as an index rather then index + 1 2014-02-06 02:12:46 +11:00
Campbell Barton 6213d88c85 Scanfill: avoid converting int<>intptr_t for displist indices 2014-02-06 01:07:18 +11:00
Campbell Barton 41d23116aa Scanfill: malloc arrays and zero init members 2014-02-06 01:03:02 +11:00
Campbell Barton d598dcd461 Code cleanup: remove scdata from ScanFillContext 2014-02-05 05:39:28 +11:00
Campbell Barton 6c17d2141b Scanfill: optimize filling curves, text, masks - skip calculating holes
Support for tagging polygon numbers when adding scanfill data,
saves having to calculate connectivity afterwards (which can take approx half overall scanfill time for complex curves).
2014-02-05 05:27:01 +11:00
Campbell Barton db74968402 Scanfill: minor optimization, comment unused code, avoid vert loop 2014-02-05 05:27:01 +11:00
Andrea Weikert eaafa58c2b Code cleanup: removed unnecessary #defines causing re-definition warnings
Fixing warnings in own recent commit
2014-02-03 21:27:11 +01:00
Campbell Barton 76543574bc Code cleanup: declarations for removed functions 2014-02-04 07:20:19 +11:00
Campbell Barton 8b1731e13d Scanfill: skip checks for loose edges when they can't occur
Only editmesh needs this, text, curves, masks - can all skip this check
2014-02-04 02:57:27 +11:00
Campbell Barton 0d7586739a Code cleanup: replace while -> for loops 2014-02-04 02:23:34 +11:00
Campbell Barton 15f449c529 Add include for FreeBSD and clang 2014-02-03 22:04:56 +11:00
Campbell Barton d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
Campbell Barton fed1b8b16d Code cleanup: suffix vars to make obvious they are squared 2014-02-03 02:46:45 +11:00
Andrea Weikert dda63375b2 Fix: Compile error due to missing #define for MSVC9 (VisualC++ 2008)
Added some relevant #defines copied from extern\libmv\third_party\msinttypes to BLI_sys_types.h so they can be used in blenlib. Made smallhash.c use the BLI_sys_types.h include rather than including <stdint.h> directly
2014-02-02 14:40:52 +01:00
Campbell Barton 41cc86a666 Add include needed for clang, quiet warning 2014-02-02 21:33:52 +11:00
Campbell Barton c4345a808c Smallhash: add reserve option to avoid resizing when size is known 2014-02-02 17:08:26 +11:00
Campbell Barton dcd90d67c8 Smallhash: fixes/improvements
- use magic numbers based on uintptr max, not uint max, to avoid possible collisions with real pointer values on 64bit systems.
- comment BLI_smallhash_remove for now, its not used.
- added smallhash_val_is_used replacing ELEM() checks
- updated docs
2014-02-02 16:24:33 +11:00
Campbell Barton 7c9b106589 Smallhash: optimizations
- remove static array used only for copying (use alloca on resize)
- set SMSTACKSIZE to one of the values in 'hashsizes' since the full available size was never used.
- ensure ~1.5x as many buckets as entries, was 3x which caused malloc's quite early on.
2014-02-02 02:24:48 +11:00
Campbell Barton a1a0ebbf49 Code cleanup: use length squared where possible 2014-02-02 02:24:48 +11:00
Campbell Barton 798e684c7c Math lib: simplify size_to_mat4 and use in b_bone_spline_setup 2014-02-02 02:24:47 +11:00
Campbell Barton 5fce3457b7 Math lib: add axis_angle_normalized_to_quat, use when length is known 2014-02-02 02:24:47 +11:00
Campbell Barton 34a0532584 Code cleanup: comments and warnings 2014-02-01 02:01:00 +11:00
Campbell Barton 0e1c1b6196 Code cleanup: remove BLI_has_parent 2014-01-31 03:30:05 +11:00
Campbell Barton 3c86a1932f Code cleanup: add BLI_testextensie_n, replacing multuple calls to BLI_testextensie
also use attributes for BLI path functions
2014-01-31 03:30:05 +11:00
Campbell Barton 1f64371ec0 Smallhash: refactor and fixes
- BLI_smallhash_remove didnt decrement total entries.
- rename vars to match closer to ghash.
- smallhash_lookup returns NULL when no entry found.
- using a zero value key wasn't supported.
- no need to memset or calloc bucket arrays
- add asserts for unsupported conditions.
- added BLI_smallhash_lookup_p
2014-01-30 21:10:55 +11:00
Campbell Barton 39eb314cb9 UI: Refactor timecode functions into BLI_timecode
- deduplicate timecode_simple_string from image.c
- replace V2D_UNIT_SECONDSSEQ with V2D_UNIT_SECONDS
- avoid possible buffer overflow bugs (sprintf -> BLI_snprintf)
- remove option not to use timecode and split into 2 functions

Patch D227 by Andrew Buttery with own refactoring.
2014-01-29 20:44:01 +11:00
Campbell Barton c2da706a36 Code cleanup: remove references to svn and code style 2014-01-28 23:01:22 +11:00
Bastien Montagne d292d6ad74 Cleanup of BLI_smallhash
Factorized a bit the code here, think it's more readable now... No performance enhancement though.

Reviewed by: campbellbarton

Differential Revision: https://developer.blender.org/D259
2014-01-26 15:18:02 +01:00
Campbell Barton 4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
Bastien Montagne 8be4c6e8f3 Timing macros: remove the (void)0 at the end of TIMEIT_BLOCK_INIT,
it prevents declaring/using more than one of these timing blocks in a same code block
(C rule, no var declaration and code mixing)...
2014-01-21 15:50:44 +01:00
Bastien Montagne 7acb7cb897 Replace XOR swapping by default ("naive", with extra var) one.
Ref: http://en.wikipedia.org/wiki/XOR_swap_algorithm, modern compilers/CPUs are much more efficient with "naive" algo than XOR one.
Doubled check, for me in an optimized build, XOR is several times slower than naive algo.
2014-01-21 15:50:44 +01:00
Brecht Van Lommel dcba34b411 Fix T38303: same names with different case sorted unpredictable in the file browser.
The string comparison was in lower case, so the same strings with different case
were considered the same which can make qsort give different results on each
sort since it's not a stable sort. Now take case into account in comparison.
2014-01-21 14:59:12 +01:00
Campbell Barton 37242e6b0b Code Cleanup: style 2014-01-21 12:05:27 +11:00
Campbell Barton 621bf47e91 Docs: doxygen file descriptions for BLF, GPU and WM 2014-01-19 23:15:25 +11:00
Sergej Reich a025ff407e Math: Code cleanup
Remove stray #undef directives.
2014-01-17 20:44:34 +01:00
Campbell Barton af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
Campbell Barton b8b412230b Code Cleanup: use iroundf
also increase precision of rctf print functions
2014-01-15 13:40:40 +11:00
Campbell Barton da8619fe23 Math Lib: add iroundf function for: (int)floorf(a + 0.5f) 2014-01-15 13:40:40 +11:00
Antonis Ryakiotakis 53f93ef66d Fix build issues with mingw's 2014-01-15 00:33:55 +02:00
Gaia Clary 875ddfcee0 Added missing include 2014-01-14 22:54:18 +01:00
Campbell Barton a9f761708c Fix for icon generation with MSVC
Big thanks to Gaia for getting this working!
2014-01-15 08:40:56 +11:00
Sergey Sharybin 43c2b36431 Correction to assert in previous commit 2014-01-14 23:51:26 +06:00
Sergey Sharybin e7d18eb7bd Add check for KD tree size to BLI_kdtree_insert()
Makes sure we're not trying to insert more nodes than we've
been expecting to.
2014-01-14 17:16:06 +06:00
Campbell Barton aa986c3f3d Correct bad mistake in own recent to commit to angle calculation 2014-01-14 13:47:24 +11:00
Campbell Barton 8cb9b42c9c Math Lib: minor optimization for angle functions 2014-01-14 09:48:59 +11:00
Campbell Barton 61ff3dfdda Code Cleanup: spelling 2014-01-13 15:31:57 +11:00