From: Tim Moore Date: Mon, 11 Jan 2010 06:14:23 +0000 (+0100) Subject: Merge branch 'timoore/effects' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3cd4c5566f8c418bc9bbb6026072eb0192027993;p=simgear.git Merge branch 'timoore/effects' --- 3cd4c5566f8c418bc9bbb6026072eb0192027993 diff --cc simgear/scene/sky/newcloud.cxx index f4eb8de2,1e16629e..162f137a --- a/simgear/scene/sky/newcloud.cxx +++ b/simgear/scene/sky/newcloud.cxx @@@ -211,20 -218,14 +210,20 @@@ osg::ref_ptr SGNewCloud::g double elev = sg_random() * SGD_PI; x = width * cos(theta) * 0.5f * sin(elev); y = width * sin(theta) * 0.5f * sin(elev); - z = height * cos(elev) * 0.5f; + z = height * cos(elev) * 0.5f; } - // Determine the height and width as scaling factors on the minimum size (used to create the quad) + // Determine the height and width as scaling factors on the minimum size (used to create the quad). float sprite_width = 1.0f + sg_random() * (max_sprite_width - min_sprite_width) / min_sprite_width; float sprite_height = 1.0f + sg_random() * (max_sprite_height - min_sprite_height) / min_sprite_height; - - if (i == 2) { + + // Sprites are never taller than square. + if (sprite_height * min_sprite_height > sprite_width * min_sprite_width) + { + sprite_height = sprite_width * min_sprite_width / min_sprite_height; + } + + if (i == 0) { // The center sprite is always maximum size to fill up any holes. sprite_width = 1.0f + (max_sprite_width - min_sprite_width) / min_sprite_width; sprite_height = 1.0f + (max_sprite_height - min_sprite_height) / min_sprite_height;