From c7f8af329bb6c8cf7eeaa480269d75f86de9b896 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 19 Apr 2012 18:53:32 +0000 Subject: 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! --- source/blender/blenlib/intern/rand.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenlib/intern') 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) { -- cgit v1.2.3