Refactor vao preload
This commit is contained in:
+38
-36
@@ -482,10 +482,9 @@ crGlareWidth wdth col alphay p cr =
|
||||
)
|
||||
}
|
||||
where l x = uncurry translate x
|
||||
$ rotate (90 - (radToDeg $ argV (p -.- x)))
|
||||
$ rotate (pi*0.5 + argV (p -.- x))
|
||||
$ color (withAlpha alphay col)
|
||||
$ thickArc 0 180 (_crRad cr) wdth
|
||||
-- where l = rotate (radToDeg $ argV (cp -.- p)) $ uncurry translate cp $ color (withAlpha 0.5 white) $ thickArc 0 25 (_crRad cr) 5
|
||||
cp = _crPos cr
|
||||
cid = _crID cr
|
||||
upp cid' w' = case w' ^? creatures . ix cid . crPos of
|
||||
@@ -597,38 +596,37 @@ mvGenBullet' w bt
|
||||
t = _btTimer' bt
|
||||
|
||||
bulLine :: Color -> Float -> [Point2] -> Drawing
|
||||
bulLine col width (a:b:[])
|
||||
bulLine _ _ [] = blank
|
||||
bulLine _ _ (x:[]) = blank
|
||||
bulLine col width (a:b:[]) -- (a:b:[])
|
||||
= onLayer HPtLayer $ pictures
|
||||
[color (withAlpha 0.5 col) $ lineOfThickness (width+1.5) [a,b]
|
||||
,color white $ wedgeOfThickness width a b
|
||||
-- ,color white $ lineOfThickness width [a,b]
|
||||
-- ,color (withAlpha 0.3 white) $ lineOfThickness width [a3,b]
|
||||
-- ,color (withAlpha 0.7 white) $ lineOfThickness width [a2,a3]
|
||||
[polygonCol $ zip (wedgeGeom width b a) $ [white,withAlpha 0 white,withAlpha 0 white]
|
||||
,polygonCol $ zip (lineGeom (width+1.5) a b) $ [col,col,withAlpha 0 col,withAlpha 0 col]
|
||||
]
|
||||
-- where a2 = (0.7 *.* a) +.+ (0.3 *.* b)
|
||||
-- a3 = (0.3 *.* a) +.+ (0.7 *.* b)
|
||||
bulLine col width (a:b:c:_)
|
||||
bulLine col width (a:b:c:[]) -- (a:b:[])
|
||||
= onLayer HPtLayer $ pictures
|
||||
[color (withAlpha 0.5 col) $ lineOfThickness (width+1.5) [a,c]
|
||||
,color white $ wedgeOfThickness width a c
|
||||
-- ,color white $ lineOfThickness width [a,b]
|
||||
-- ,color (withAlpha 0.3 white) $ lineOfThickness (width-1) [a3,c]
|
||||
-- ,color (withAlpha 0.7 white) $ lineOfThickness width [a2,a3]
|
||||
-- ,color white $ lineOfThickness width [a,a2]
|
||||
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
|
||||
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
|
||||
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
|
||||
]
|
||||
-- where a2 = b
|
||||
-- a3 = (0.5 *.* b) +.+ (0.5 *.* c)
|
||||
-- where a2 = (0.7 *.* a) +.+ (0.3 *.* b)
|
||||
-- a3 = (0.3 *.* a) +.+ (0.7 *.* b)
|
||||
--bulLine col width (a:b:c:d:_)
|
||||
bulLine col width (a:b:_:c:[]) -- (a:b:[])
|
||||
= onLayer HPtLayer $ pictures
|
||||
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
|
||||
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
|
||||
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
|
||||
]
|
||||
bulLine col width (a:b:_:_:c:_) -- (a:b:[])
|
||||
= onLayer HPtLayer $ pictures
|
||||
[polygonCol $ zip (wedgeGeom width b a) $ repeat white
|
||||
,polygonCol $ zip (wedgeGeom width b c) $ [white,white,withAlpha 0 white]
|
||||
,polygonCol $ zip (lineGeom (width+1.5) a c) $ [col,col,withAlpha 0 col,withAlpha 0 col]
|
||||
]
|
||||
-- [color (withAlpha 0.5 col) $ lineOfThickness (width+1.5) [a,b]
|
||||
-- ,color white $ wedgeOfThickness width a b
|
||||
--bulLine col width (a:b:c:_)
|
||||
-- = onLayer HPtLayer $ pictures
|
||||
-- [color (withAlpha 0.5 col) $ lineOfThickness (width+1) [a,c]
|
||||
-- ,color (withAlpha 0.3 white) $ lineOfThickness width [a3,b]
|
||||
-- ,color (withAlpha 0.7 white) $ lineOfThickness width [a2,a3]
|
||||
-- ,color white $ lineOfThickness width [a,a2]
|
||||
-- ]
|
||||
-- where a2 = (0.7 *.* a) +.+ (0.3 *.* b)
|
||||
-- a3 = (0.3 *.* a) +.+ (0.7 *.* b)
|
||||
-- [color (withAlpha 0.5 col) $ lineOfThickness (width+1.5) [a,c]
|
||||
-- ,color white $ wedgeOfThickness width a c
|
||||
|
||||
thingsHitExceptCr :: Maybe Int -> Point2 -> Point2 -> World
|
||||
-> [(Point2, (Either3 Creature Wall ForceField))]
|
||||
@@ -735,11 +733,11 @@ moveFlamelet levelInt rot w pt =
|
||||
$ color (mixColors (fromIntegral (max 0 (time-2))) (10-fromIntegral time)
|
||||
white (dark red)
|
||||
)
|
||||
$ rotate (radToDeg ( 0.1 * fromIntegral time + rot))
|
||||
$ rotate (0 - ( 0.1 * fromIntegral time + rot))
|
||||
$ scale sc sc
|
||||
$ polygon [(-size,-size),(size,-size),(size,size),(-size,size)]
|
||||
piu = onLayerL [levelInt,1] $ uncurry translate ep
|
||||
$ color (dark red) $ rotate (radToDeg (rot - 0.1 * fromIntegral time))
|
||||
$ color (dark red) $ rotate (0 - (rot - 0.1 * fromIntegral time))
|
||||
$ scale s1 s1
|
||||
$ polygon $ rectNSWE (siz2) (-siz2) (-siz2) (siz2)
|
||||
glow = onLayerL [levelInt,0] $ uncurry translate ep
|
||||
@@ -753,7 +751,7 @@ moveFlamelet levelInt rot w pt =
|
||||
$ color (mixColors (fromIntegral (max 0 (time-2))) (10-fromIntegral time)
|
||||
orange (dark red)
|
||||
)
|
||||
$ rotate (radToDeg $ rot + 0.2 * fromIntegral time)
|
||||
$ rotate (0 - (rot + 0.2 * fromIntegral time))
|
||||
$ scale s2 s2
|
||||
$ polygon $ rectNSWE (siz2) (-siz2) (-siz2) (siz2)
|
||||
|
||||
@@ -822,7 +820,8 @@ moveSmoke' scal p time i
|
||||
makeSmokeAt'' :: Point2 -> Float -> Int -> Point2 -> World -> World
|
||||
makeSmokeAt'' vel scal time p w = over particles' ((:) smokeP) w
|
||||
where smokeP = Particle'
|
||||
{ _ptPict' = onLayerL [levLayer PtLayer - 1] $ uncurry translate p $ color black $ circleSolid 1
|
||||
--{ _ptPict' = onLayerL [levLayer PtLayer - 1] $ uncurry translate p $ color black $ circleSolid 1
|
||||
{ _ptPict' = onLayerL [levLayer PtLayer ] $ uncurry translate p $ color black $ circleSolid 1
|
||||
, _ptUpdate' = moveSmoke'' scal time p vel
|
||||
}
|
||||
|
||||
@@ -836,15 +835,18 @@ moveSmoke'' scal time p vel w pt
|
||||
})
|
||||
| otherwise = (w, Nothing)
|
||||
where pNew = p +.+ vel
|
||||
pic = onLayerL [levLayer PtLayer - 1]
|
||||
pic = onLayerL [levLayer PtLayer]
|
||||
--pic = onLayerL [levLayer PtLayer - 1]
|
||||
$ uncurry translate pNew
|
||||
$ color (greyN 0.5) $ circleSolid $ (21 - fromIntegral time) * scal
|
||||
pi1 = pictures
|
||||
pi1 = pictures $ reverse
|
||||
[(onLayerL [levLayer PtLayer]
|
||||
$ uncurry translate pNew
|
||||
$ color (withAlpha (0.3 * (1 + fromIntegral time /50)) (greyN 0.5))
|
||||
$ circleSolid $ 21 * scal)
|
||||
, (onLayerL [levLayer BgLayer+1]
|
||||
,
|
||||
--(onLayerL [levLayer BgLayer+1]
|
||||
(onLayerL [levLayer PtLayer]
|
||||
$ uncurry translate pNew
|
||||
$ color (withAlpha (1 + fromIntegral time /50) (greyN 0.5))
|
||||
$ circleSolid $ 21 * scal)
|
||||
|
||||
Reference in New Issue
Block a user