This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module KDT | |
( KDT | |
, empty | |
, makeFrom | |
, make | |
, inRange | |
, inRangeMatching | |
) where | |
import Data.Monoid ((<>)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Applicative | |
import Control.Monad.ST.Safe | |
import qualified Data.Vector.Unboxed as IU | |
import qualified Data.Vector.Unboxed.Mutable as U | |
-- Mutable world | |
data World s = World | |
{ _souls :: !(U.STVector s Int) | |
, _positions :: !(U.STVector s (Float,Float)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
{- | |
Row/Column storage grid where each node is an 8x8 chunk of bytes. | |
-} | |
module ByteGrid | |
( ByteGrid | |
, make | |
, readUnsafe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
module Main where | |
import qualified ByteGrid as BG | |
main = do | |
let bg0 = BG.make (512,512) 0 | |
doThings bg0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
{- | |
Row/Column storage grid where each node is an 8x8 chunk of bytes. | |
-} | |
module ByteGrid | |
( ByteGrid | |
, make | |
, readUnsafe |