diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-05-27 10:40:48 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-05-27 10:40:48 -0700 |
commit | 68fd6f2d4e18582a9966f9e6eb96dc23565116da (patch) | |
tree | f0382b27b4e568bdeed5126c218bd5075336502e /src | |
parent | d532a50e568728abc08f71c3c2a7c3d8c8c0e9f2 (diff) |
pig: reset t1 immediately on timer expiry
When using T in the shader, the previous code would let T
briefly overflow while everything else has reset.
Diffstat (limited to 'src')
-rw-r--r-- | src/pig.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -76,11 +76,11 @@ static void pig_uniforms_func(shader_t *shader, void *uniforms_ctxt, void *rende /* this one resets every second and gets constrained to 0.f-1.f */ t1 = play_ticks(play, PLAY_TICKS_TIMER1); - if (t1 >= 1000) { + if (t1 > 1000) { randomize_color(&pig->color); pig->seed = randf(); - play_ticks_reset(play, PLAY_TICKS_TIMER1); + t1 = play_ticks_reset(play, PLAY_TICKS_TIMER1); } glUniform1f(uniforms[0], alpha); |