Skip to content

Commit c60ed10

Browse files
committed
fix screen flicker
1 parent 69c4b38 commit c60ed10

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

icarus.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- icarus v1.3.0
1+
-- icarus v1.3.1
22
--
33
-- I warn you, fly a middle
44
-- course: go too low & water
@@ -151,8 +151,8 @@ function redraw_clock() -- our grid redraw clock
151151
vol_current=vol_current+sign(vol_target-vol_current)/200
152152
end
153153
-- print(vol_current,vol_target)
154-
clock.sleep(1/14) -- refresh
155-
current_time=current_time+1/14
154+
clock.sleep(1/20) -- refresh
155+
current_time=current_time+1/20
156156
redraw()
157157
end
158158
end
@@ -179,7 +179,7 @@ function redraw()
179179
screen.level(15)
180180
screen.circle(rpos[1],rpos[2]+10,rfeedback)
181181
screen.fill()
182-
screen.update()
182+
--screen.update()
183183
-- the ocean
184184
local rfilter=util.linlin(0,18000,20,62,params:get("lpf"))
185185
-- screen.level(0)
@@ -200,7 +200,6 @@ function redraw()
200200
local horizon=math.floor(rfilter)
201201
--cls()
202202
-- circfill(30,22,15,7)
203-
screen.update()
204203
math.randomseed(4)
205204
screen.level(0)
206205
screen.rect(0,rfilter,129,65)
@@ -211,8 +210,8 @@ function redraw()
211210
x=(rnd(160)+current_time*160/z)%150-16
212211
w=cos(rnd()+current_time)*12/z
213212
if (w>0) then
214-
local s = screen.peek(math.floor(x),math.floor(horizon-1-y/2), math.floor(x+1),math.floor(horizon-y/2))
215-
if s ~= nil then
213+
local s = screen.peek(math.floor(x)%128+1,math.floor(horizon-1-y/2)%64+1, math.floor(x+1)%128+1,math.floor(horizon-y/2)%64+1)
214+
if s ~= nil and s~='' then
216215
local pgot = util.clamp(string.byte(s,1),1,15)
217216
screen.level(pgot+1)
218217
screen.move(x-w,y+horizon)

0 commit comments

Comments
 (0)