diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-04-03 02:18:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-04-03 02:18:32 +0400 |
commit | 5dbe42af07ac8a1889bdded10a07d0914a78e8e2 (patch) | |
tree | bfa59b75f0a656b44beaf76e9d628bbc93f72520 /source/blender/blenkernel | |
parent | 49c65433cc87ceb8a40b52ccf9ed22151c425f4b (diff) |
Fix to make grass render the same on solaris as linux, by doing
pointer comparisons in qsort. This works for glibc according to
the documentation, and appears to work on solaris too.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 7f1d554d172..8bde0afb752 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -845,8 +845,16 @@ static int compare_orig_index(const void *p1, const void *p2) if(index1 < index2) return -1; - else if(index1 == index2) - return 0; + else if(index1 == index2) { + /* this pointer comparison appears to make qsort stable for glibc, + * and apparently on solaris too, makes the renders reproducable */ + if(p1 < p2) + return -1; + else if(p1 == p2) + return 0; + else + return 1; + } else return 1; } |