changeset 220:b0407a4c0a11

Simplify frame finding in envelope update function.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 07 Oct 2012 23:24:08 +0300
parents b4eb9b59fef3
children 5c36aff80205
files jssplr.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/jssplr.c	Sun Oct 07 23:13:17 2012 +0300
+++ b/jssplr.c	Sun Oct 07 23:24:08 2012 +0300
@@ -133,17 +133,15 @@
 
 static BOOL jmpExecEnvelope(JSSEnvelope *env, JSSPlayerEnvelope *pe, BOOL keyOff)
 {
-    int point = 0;
+    int point;
 
     if (!pe->exec)
         return FALSE;
     
     // Find current point, if not last point
-    while (point < env->npoints - 1)
+    for (point = 0; point < env->npoints - 1; point++)
     {
-        if (pe->frame >= env->points[point + 1].frame)
-            point++;
-        else
+        if (pe->frame < env->points[point + 1].frame)
             break;
     }