diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-04-19 22:53:32 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-04-19 22:53:32 +0400 |
commit | c7f8af329bb6c8cf7eeaa480269d75f86de9b896 (patch) | |
tree | f3a054bb2d4f245269c2ab54f3bbf0f48fd0a702 /source/blender/blenlib/intern/rand.c | |
parent | e730c1af6db8547dd9949240f13c8eb712918dc0 (diff) |
BMESH_TODO: randomize vertices working again.
That whole "element re-arrange" area could use some love, though (e.g. make a single vert operator with more options, as faces; and make faces work in edit mode, probably no more reasons to switch to object mode?). Post-release TODO, anyway.
Also spotted a glitch in BLI_rand code, imho, which makes first element of an array not guarantied to be shuffled by BLI_array_randomize()... No correction though, as this might/would affect other parts of the code!
Diffstat (limited to 'source/blender/blenlib/intern/rand.c')
-rw-r--r-- | source/blender/blenlib/intern/rand.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index 20f0a11f75f..2e722c2a135 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -119,6 +119,8 @@ void rng_shuffleArray(RNG *rng, void *data, int elemSize, int numElems) temp = malloc(elemSize); + /* XXX Shouldn’t it rather be "while (i--) {" ? + * Else we have no guaranty first (0) element has a chance to be shuffled... --mont29 */ while (--i) { int j = rng_getInt(rng)%numElems; if (i!=j) { |