This commit is contained in:
2025-10-29 12:09:05 +00:00
parent a3b343dfab
commit c9ec962575
2 changed files with 0 additions and 34 deletions
-1
View File
@@ -93,7 +93,6 @@ doDrawing' win pdata u = do
(pokeCloud (pdata ^. cloudVBO . vboPtr) (pdata ^. cloudEBO . eboPtr))
(0, 0)
(V.fromList $ w ^. cWorld . lWorld . clouds)
--(sortOn (^. clPos . _3) $ w ^. cWorld . lWorld . clouds)
(nCloudVs, nCloudIs) <-
V.foldM'
(pokeDust (pdata ^. cloudVBO . vboPtr) (pdata ^. cloudEBO . eboPtr))
-33
View File
@@ -30,11 +30,6 @@ mkDustCloudLike x = (x ^. dsPos, V4 r g b a)
( V4 r g b a') = ( dustColor x)
a = a' * min 1 (fromIntegral (_dsTimer x) / 100)
--pokeCloud vptr iptr (nv, ni) cl = do
-- UV.imapM_ (pokeCloudVerx vptr cl nv) $ UV.fromList [(1, 1), (-1, 1), (-1, -1), (1, -1)]
-- UV.imapM_ (pokeCloudIndex iptr nv ni) $ UV.fromList [0, 1, 2, 2, 0, 3]
-- return (nv + 4, ni + 6)
pokeCloudLike :: Ptr Float -> Ptr GLushort -> (Int, Int) -> (Point3,Point4) -> IO (Int, Int)
pokeCloudLike vptr iptr (nv, ni) x = do
UV.imapM_ (pokeCloudLikeVerx vptr x nv)
@@ -42,17 +37,6 @@ pokeCloudLike vptr iptr (nv, ni) x = do
UV.imapM_ (pokeCloudIndex iptr nv ni) $ UV.fromList [0, 1, 2, 2, 0, 3]
return (nv + 4, ni + 6)
pokeCloudVerx :: Ptr Float -> Cloud -> Int -> Int -> (Float, Float) -> IO ()
{-# INLINE pokeCloudVerx #-}
pokeCloudVerx ptr cl nv i (dx, dy) =
UV.imapM_ (pokeCloudFloat ptr (nv + i)) $
UV.fromList [x, y, cz, 1, r, g, b, a, dx, dy, 0, 0]
where
V3 cx cy cz = _clPos cl
V2 x y = V2 cx cy - 20 *^ V2 dx dy
( V4 r g b a') = ( clColor $ cl ^. clType)
a = a' * min 1 (fromIntegral (_clTimer cl) / 100)
pokeCloudLikeVerx :: Ptr Float -> (Point3,Point4) -> Int -> Int -> (Float, Float) -> IO ()
{-# INLINE pokeCloudLikeVerx #-}
pokeCloudLikeVerx ptr (V3 cx cy cz,V4 r g b a) nv i (dx, dy) =
@@ -76,22 +60,5 @@ pokeCloudIndex :: Ptr GLushort -> Int -> Int -> Int -> Int -> IO ()
{-# INLINE pokeCloudIndex #-}
pokeCloudIndex ptr nv ni ioff voff = pokeElemOff ptr (ni + ioff) (fromIntegral $ nv + voff)
--pokeDust :: Ptr Float -> Ptr GLushort -> (Int, Int) -> Dust -> IO (Int, Int)
--pokeDust vptr iptr (nv, ni) cl = do
-- UV.imapM_ (pokeDustVerx vptr cl nv) $ UV.fromList [(1, 1), (-1, 1), (-1, -1), (1, -1)]
-- UV.imapM_ (pokeCloudIndex iptr nv ni) $ UV.fromList [0, 1, 2, 2, 0, 3]
-- return (nv + 4, ni + 6)
pokeDustVerx :: Ptr Float -> Dust -> Int -> Int -> (Float, Float) -> IO ()
{-# INLINE pokeDustVerx #-}
pokeDustVerx ptr cl nv i (dx, dy) =
UV.imapM_ (pokeCloudFloat ptr (nv + i)) $
UV.fromList [x, y, cz, 1, r, g, b, a, dx, dy, 0, 0]
where
V3 cx cy cz = _dsPos cl
V2 x y = V2 cx cy - 20 *^ V2 dx dy
( V4 r g b a') = ( dustColor cl)
a = a' * min 1 (fromIntegral (_dsTimer cl) / 100)
dustColor :: Dust -> Color
dustColor = materialColor . _dsType