From 133872591181e7683f1cf31342c89451b5395bb6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 17 Jul 2017 14:06:56 -0400 Subject: [PATCH] gamnit: fix div by zero when there is no animation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/flat/flat_core.nit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gamnit/flat/flat_core.nit b/lib/gamnit/flat/flat_core.nit index 800b3de..932a584 100644 --- a/lib/gamnit/flat/flat_core.nit +++ b/lib/gamnit/flat/flat_core.nit @@ -687,7 +687,7 @@ private class Simple2dProgram vec3 c; // coords float end = a_start + a_loops/a_fps*a_n_frames; - if (a_loops == -1.0 || time < end) { + if (a_fps != 0.0 && (a_loops == -1.0 || time < end)) { // in animation float frame = mod(floor((time-a_start)*a_fps), a_n_frames); v_coord = a_tex_coord + a_tex_diff*frame; -- 1.7.9.5