Remove dedicated line shader
This commit is contained in:
@@ -21,10 +21,8 @@ data RenderType
|
||||
| RenderBezQ [(Point3,Point4,Point4)]
|
||||
| RenderText [(Point3,Point4,Point2)]
|
||||
| RenderArc [(Point3,Point4,Point3)]
|
||||
| RenderLine [(Point3,Point4)]
|
||||
| RenderEllipse [(Point3,Point4)]
|
||||
| Render3 [Point3]
|
||||
| RenderConst
|
||||
| Render1111 {_unRender1111 :: (Float,Float,Float,Float)}
|
||||
| Render22 {_unRender22 :: (Point2,Point2)}
|
||||
| Render2221 {_unRender2221 :: (Point2,Point2,Point2,Float)}
|
||||
@@ -99,8 +97,6 @@ data Picture
|
||||
| Poly3D [(Point3,RGBA)]
|
||||
| Circle RGBA RGBA Float
|
||||
| ThickArc Float Float Float Float
|
||||
| Line [Point2]
|
||||
| LineCol [(Point2,RGBA)]
|
||||
| Pictures [Picture]
|
||||
| OverPic (Point3 -> Point3) (Point4 -> Point4) Picture
|
||||
| OnLayer Int Picture
|
||||
|
||||
@@ -52,11 +52,6 @@ picToLTree _ (ThickArc startA endA rad wdth) = LLeaf $ RenderArc
|
||||
(xa,ya) = rotateV startA (rad,0)
|
||||
(xb,yb) = rotateV (0.5 * (startA + endA)) (rad * sqrt 2,0)
|
||||
(xc,yc) = rotateV endA (rad,0)
|
||||
picToLTree _ (Line ps)
|
||||
= LLeaf $ RenderLine $ zip (map zeroZ $ doubleLine ps) $ repeat white
|
||||
picToLTree _ (LineCol vs)
|
||||
= LLeaf $ RenderLine $ zip (map zeroZ $ doubleLine ps) $ doubleLine cs
|
||||
where (ps,cs) = unzip vs
|
||||
picToLTree _ (Text s) = LLeaf $ RenderText $ stringToList s
|
||||
picToLTree _ Blank = LBranches []
|
||||
picToLTree j (Pictures pics) = LBranches $ map (picToLTree j) pics
|
||||
@@ -135,11 +130,6 @@ picToRenderType (ThickArc startA endA rad wdth) = RenderArc
|
||||
(xa,ya) = rotateV startA (rad,0)
|
||||
(xb,yb) = rotateV (0.5 * (startA + endA)) (rad * sqrt 2,0)
|
||||
(xc,yc) = rotateV endA (rad,0)
|
||||
picToRenderType (Line ps)
|
||||
= RenderLine $ zip (map zeroZ $ doubleLine ps) $ repeat white
|
||||
picToRenderType (LineCol vs)
|
||||
= RenderLine $ zip (map zeroZ $ doubleLine ps) $ doubleLine cs
|
||||
where (ps,cs) = unzip vs
|
||||
picToRenderType (Text s) = RenderText $ stringToList s
|
||||
picToRenderType _ = error "Tried to make a render type from a tree picture"
|
||||
--
|
||||
@@ -151,12 +141,6 @@ picToRenderType _ = error "Tried to make a render type from a tree picture"
|
||||
--picToAlternative _ Blank = empty
|
||||
--picToAlternative j (Pictures pics) = undefined
|
||||
|
||||
|
||||
doubleLine :: [a] -> [a]
|
||||
{-# INLINE doubleLine #-}
|
||||
doubleLine (x:y:xs) = concat $ zipWith (:) (init (x:y:xs)) $ map (: []) (y:xs)
|
||||
doubleLine _ = []
|
||||
|
||||
white, black :: Color
|
||||
white = (1,1,1,1)
|
||||
black = (0,0,0,1)
|
||||
@@ -164,7 +148,6 @@ black = (0,0,0,1)
|
||||
overPos :: (Point3 -> Point3) -> RenderType -> RenderType
|
||||
--{-# INLINE overPos #-}
|
||||
overPos f (RenderPoly vs) = RenderPoly $ map (first f) vs
|
||||
overPos f (RenderLine vs) = RenderLine $ map (first f) vs
|
||||
overPos f (RenderText vs) = RenderText $ map (\(a,b,c) -> (f a,b,c)) vs
|
||||
overPos f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (f a,b,c)) vs
|
||||
overPos f (RenderEllipse vs) = RenderEllipse $ map (first f) vs
|
||||
@@ -175,7 +158,6 @@ overPos _ _ = undefined
|
||||
overCol :: (Point4 -> Point4) -> RenderType -> RenderType
|
||||
--{-# INLINE overCol #-}
|
||||
overCol f (RenderPoly vs) = RenderPoly $ map (second f) vs
|
||||
overCol f (RenderLine vs) = RenderLine $ map (second f) vs
|
||||
overCol f (RenderEllipse vs) = RenderEllipse $ map (second f) vs
|
||||
overCol f (RenderText vs) = RenderText $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||
overCol f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||
|
||||
Reference in New Issue
Block a user