From 02afc949322950af19923df65b359215495abac7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 May 2008 06:30:19 +0000 Subject: [PATCH] fix for [#10458] Rc4 Blender crash when activate playback FPS than Alt+A to play animation. --- source/blender/src/drawview.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index b0d25636cf2..b01b7bc151c 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -3441,12 +3441,13 @@ static void draw_viewport_fps(ScrArea *sa) tot++; } } - - redrawtime_index++; - if (redrawtime_index >= REDRAW_FRAME_AVERAGE) - redrawtime_index = 0; - - fps = fps / tot; + if (tot) { + redrawtime_index++; + if (redrawtime_index >= REDRAW_FRAME_AVERAGE) + redrawtime_index = 0; + + fps = fps / tot; + } #endif /* is this more then half a frame behind? */ @@ -3577,7 +3578,7 @@ void inner_play_anim_loop(int init, int mode) while(redrawtime_index--) { redrawtimes_fps[redrawtime_index] = 0.0; } - + redrawtime_index = 0; lredrawtime = 0.0; return; }