From cc0d68b066a9a161ac4452f320676e1169ed0f6f Mon Sep 17 00:00:00 2001 From: Morimasa Aketa Date: Wed, 16 Dec 2015 01:16:23 +0900 Subject: [PATCH] Fix crush on windows which orrurs when bvh data reached to the end. --- ofxBvh/src/ofxBvh.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ofxBvh/src/ofxBvh.cpp b/ofxBvh/src/ofxBvh.cpp index f999869..c6db7c8 100644 --- a/ofxBvh/src/ofxBvh.cpp +++ b/ofxBvh/src/ofxBvh.cpp @@ -143,9 +143,7 @@ void ofxBvh::update() { need_update = true; - currentFrame = frames[index]; - - if (index >= frames.size()) + if (index >= frames.size()) { if (loop) play_head = 0; @@ -155,6 +153,10 @@ void ofxBvh::update() if (play_head < 0) play_head = 0; + + index = getFrame(); + currentFrame = frames[index]; + } }