billboards were using un-initialized memory and avoid divide by zero in some cases.

This commit is contained in:
2010-05-04 21:10:26 +00:00
parent 22a34cc83b
commit f721447f22
2 changed files with 5 additions and 0 deletions

View File

@@ -1137,6 +1137,9 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData
int point_vel = (point && point->keys->vel);
float real_t, dfra, keytime;
/* billboards wont fill in all of these, so start cleared */
memset(keys, 0, sizeof(keys));
/* interpret timing and find keys */
if(point) {
if(result->time < 0.0f)

View File

@@ -1389,6 +1389,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
/* scroller 'button' extents */
totsize= v2d->tot.xmax - v2d->tot.xmin;
scrollsize= (float)(hor.xmax - hor.xmin);
if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
fac1= (v2d->cur.xmin - v2d->tot.xmin) / totsize;
if(fac1<=0.0f)
@@ -1429,6 +1430,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
/* scroller 'button' extents */
totsize= v2d->tot.ymax - v2d->tot.ymin;
scrollsize= (float)(vert.ymax - vert.ymin);
if(totsize==0.0f) totsize = 1.0f; /* avoid divide by zero */
fac1= (v2d->cur.ymin- v2d->tot.ymin) / totsize;
if(fac1<=0.0f)