Compare commits

..

No commits in common. "4987e71debba80f63c8928a21c2c0f670341175b" and "3f7f96a520741028f69002fb3389bef7337960c3" have entirely different histories.

View File

@ -937,11 +937,6 @@ function rope:draw(artificial_px,artificial_py)
local len_cumulative=0 local len_cumulative=0
local ia,iz,istep=#points-1,1,-1 local ia,iz,istep=#points-1,1,-1
if (from_end) ia,iz,istep=1,#points-1,1 if (from_end) ia,iz,istep=1,#points-1,1
local function colorh(ix)
color(8)
if (highlight==ix) color(12)
end
for i=ia,iz,istep do for i=ia,iz,istep do
local src=points[i] local src=points[i]
local dst=points[i+1] local dst=points[i+1]
@ -958,35 +953,36 @@ function rope:draw(artificial_px,artificial_py)
if from_end then if from_end then
x,y=x+dx-dx*coef,y+dy-dy*coef x,y=x+dx-dx*coef,y+dy-dy*coef
end dx,dy=dx*coef,dy*coef
dx,dy=dx*coef,dy*coef else
dx,dy=dx*coef,dy*coef
colorh(i)
local function lf(d0,d1,w)
linefill(x+d0*dx,y+d0*dy,x+d1*dx,y+d1*dy,w)
end end
lf(0,0.25,1.0) local color=8
lf(0.25,1,0.5) if (highlight==i) color=12
lf(0.9,1,1.0)
circfill(x+dx+0.5,y+dy+0.5,1.0) linefill(x,y,x+0.25*dx,y+0.25*dy,1.0,color)
linefill(x+0.25*dx,y+0.25*dy,x+1*dx,y+1*dy,0.5,color)
linefill(x+0.9*dx,y+0.9*dy,x+dx,y+dy,1.0,color)
circfill(x+dx+0.5,y+dy+0.5,1.0,color)
end end
end end
-- draw latch -- draw latch
local l=self.latch if self.latch!=nil and self.latch.rec and (perc_to_show>=1.0 or from_end) then
if l and l.rec and (perc_to_show>=1.0 or from_end) then local x,y=self.latch.rec.px,self.latch.rec.py
local function rfsplit(x) rectfill(unpack(split(x))) end local ldx,ldy=self.latch.dx,self.latch.dy
local ldx,ldy=l.dx,l.dy local color=8
colorh(0) if (highlight==0) color=12
camera(-l.rec.px,-l.rec.py) if self.latch.dx==-1 and self.latch.dy==0 then
if (ldx==-1) rfsplit"0,3,2,4" rectfill(x,y+3,x+2,y+4,color)
if (ldx==1) rfsplit"5,3,7,4" elseif self.latch.dx==1 and self.latch.dy==0 then
if (ldy==-1) rfsplit"3,0,4,2" rectfill(x+5,y+3,x+7,y+4,color)
if (ldy==1) rfsplit"3,5,4,7" elseif self.latch.dx==0 and self.latch.dy==-1 then
camera() rectfill(x+3,y,x+4,y+2,color)
color() elseif self.latch.dx==0 and self.latch.dy==1 then
rectfill(x+3,y+5,x+4,y+7,color)
end
end end
-- debug -- debug