From 5acc4373672123b28eca493959f6d957c0103623 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 24 Jul 2020 12:34:19 +0300 Subject: [PATCH] examples: fix compilation --- examples/sokol/particles/main.v | 2 +- examples/sokol/particles/particle/system.v | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/sokol/particles/main.v b/examples/sokol/particles/main.v index fed2e1a77f..0b6ba6f3d4 100644 --- a/examples/sokol/particles/main.v +++ b/examples/sokol/particles/main.v @@ -14,7 +14,7 @@ const ( ) fn main() { - app := &App{ + mut app := &App{ width: 800 height: 400 pass_action: gfx.create_clear_pass(0.1, 0.1, 0.1, 1.0) diff --git a/examples/sokol/particles/particle/system.v b/examples/sokol/particles/particle/system.v index 82d616b00d..ec2e7fed96 100644 --- a/examples/sokol/particles/particle/system.v +++ b/examples/sokol/particles/particle/system.v @@ -46,13 +46,15 @@ pub fn (s System) draw() { } pub fn (mut s System) reset() { - for p in s.pool { + for i in 0..s.pool.len { + mut p := s.pool[i] p.reset() p.life_time = 0 } - for p_ in s.bin { - p_.reset() - p_.life_time = 0 + for i in 0..s.bin.len { + mut p := s.pool[i] + p.reset() + p.life_time = 0 } }