Allow tweaking z buffer when rendering polygon, improve explosion render
This commit is contained in:
+7
-5
@@ -14,11 +14,12 @@ import Geometry.Data
|
||||
--import Control.Monad
|
||||
|
||||
data RenderType
|
||||
= RenderPoly [(Point3,Point4)]
|
||||
| RenderBezQ [(Point3,Point4,Point4)]
|
||||
| RenderText [(Point3,Point4,Point2)]
|
||||
| RenderArc [(Point3,Point4,Point3)]
|
||||
| RenderLine [(Point3,Point4)]
|
||||
= RenderPoly [(Point3,Point4)]
|
||||
| RenderPolyZ [(Point3,Point4,Float)]
|
||||
| RenderBezQ [(Point3,Point4,Point4)]
|
||||
| RenderText [(Point3,Point4,Point2)]
|
||||
| RenderArc [(Point3,Point4,Point3)]
|
||||
| RenderLine [(Point3,Point4)]
|
||||
| RenderEllipse [(Point3,Point4)]
|
||||
| Render3 [Point3]
|
||||
| RenderConst
|
||||
@@ -79,6 +80,7 @@ data Picture
|
||||
= Blank
|
||||
| Text Int String
|
||||
| Polygon Int [Point2]
|
||||
| PolygonZ Int [Point2] Float
|
||||
| BezierQuad Int [(Point2,RGBA,Point2,Point2)]
|
||||
| PolygonCol Int [(Point2,RGBA)]
|
||||
| Poly3D Int [(Point3,RGBA)]
|
||||
|
||||
@@ -21,6 +21,8 @@ picToLTree
|
||||
{-# INLINE picToLTree #-}
|
||||
picToLTree mx (Polygon i ps)
|
||||
= filtB mx i $ LLeaf $ RenderPoly $ zip (map zeroZ $ polyToTris ps) $ repeat black
|
||||
picToLTree mx (PolygonZ i ps z)
|
||||
= filtB mx i $ LLeaf $ RenderPolyZ $ zip3 (map zeroZ $ polyToTris ps) (repeat black) (repeat z)
|
||||
picToLTree mx (PolygonCol i vs)
|
||||
= filtB mx i $ LLeaf $ RenderPoly $ zip (map zeroZ $ polyToTris ps) $ polyToTris cs
|
||||
where
|
||||
@@ -85,6 +87,7 @@ 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
|
||||
overPos f (RenderArc vs) = RenderArc $ map (\(a,b,c) -> (f a,b,c)) vs
|
||||
overPos f (RenderPolyZ vs) = RenderPolyZ $ map (\(a,b,c) -> (f a,b,c)) vs
|
||||
overPos _ _ = undefined
|
||||
|
||||
overCol :: (Point4 -> Point4) -> RenderType -> RenderType
|
||||
@@ -95,6 +98,7 @@ 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
|
||||
overCol f (RenderArc vs) = RenderArc $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||
overCol f (RenderPolyZ vs) = RenderPolyZ $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||
overCol _ _ = undefined
|
||||
|
||||
stringToList :: String -> [(Point3,Point4,Point2)]
|
||||
|
||||
Reference in New Issue
Block a user