packages feed

HGE2D 0.1.7.2 → 0.1.7.4

raw patch · 3 files changed

+19/−9 lines, 3 filesdep ~basePVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

+ HGE2D.Datas: instance GHC.Classes.Eq HGE2D.Datas.BoundingBox
+ HGE2D.Datas: instance GHC.Classes.Eq HGE2D.Datas.PhysicalObject
+ HGE2D.Datas: instance GHC.Classes.Eq HGE2D.Datas.RigidBody
+ HGE2D.Geometry: bbFromList :: (Positioned a) => [a] -> BoundingBox

Files

HGE2D.cabal view
@@ -2,7 +2,7 @@ --  see http://haskell.org/cabal/users-guide/  name:                HGE2D-version:             0.1.7.2+version:             0.1.7.4 synopsis:            2D game engine written in Haskell description:         See README and examples/ for further information license:             MIT@@ -40,7 +40,7 @@   -- other-modules:   -- other-extensions:   build-depends:-      base >= 4.9.0.0 && < 5.0,+      base >= 4.8.2.0 && < 5.0,       OpenGL >=3.0 && < 3.1,       GLUT >= 2.7 && < 2.8,       time >= 1.5.0.1 && < 1.7,@@ -52,27 +52,27 @@ executable example1   default-language:    Haskell2010   main-is:             Example1.hs-  build-depends:       base >= 4.9.0.0 && < 5.0, HGE2D+  build-depends:       base >= 4.8.2.0 && < 5.0, HGE2D   hs-source-dirs:      src/examples   ghc-options:         -O2 -W -fwarn-incomplete-patterns  executable example2   default-language:    Haskell2010   main-is:             Example2.hs-  build-depends:       base >= 4.9.0.0 && < 5.0, HGE2D+  build-depends:       base >= 4.8.2.0 && < 5.0, HGE2D   hs-source-dirs:      src/examples   ghc-options:         -O2 -W -fwarn-incomplete-patterns  executable example3   default-language:    Haskell2010   main-is:             Example3.hs-  build-depends:       base >= 4.9.0.0 && < 5.0, HGE2D+  build-depends:       base >= 4.8.2.0 && < 5.0, HGE2D   hs-source-dirs:      src/examples   ghc-options:         -O2 -W -fwarn-incomplete-patterns  executable example4   default-language:    Haskell2010   main-is:             Example4.hs-  build-depends:       base >= 4.9.0.0 && < 5.0, HGE2D+  build-depends:       base >= 4.8.2.0 && < 5.0, HGE2D   hs-source-dirs:      src/examples   ghc-options:         -O2 -W -fwarn-incomplete-patterns
src/HGE2D/Datas.hs view
@@ -23,20 +23,20 @@     , physicalMass              :: Mass     , physicalDrag              :: Drag     , physicalRotDrag           :: Drag ---TODO RotDrag?-    } deriving (Show, Read)+    } deriving (Show, Read, Eq)  -- | A rigidbody defined by position, size and velocity data RigidBody = RigidBody     { rigidPos  :: RealPosition -- current position     , rigidVel  :: Velocity     -- current velocity     , rigidBB   :: BoundingBox  -- bounding box-    } deriving (Show, Read)+    } deriving (Show, Read, Eq)  -- | A bounding box defined by two positions in space data BoundingBox = BoundingBox     { bbMin     :: RealPosition -- lower left corner of bb     , bbMax     :: RealPosition -- upper right corner of bb-    } deriving (Show, Read)+    } deriving (Show, Read, Eq)  -- | A position defined in number of tiles in x and y direction data TilePosition = TilePosition
src/HGE2D/Geometry.hs view
@@ -123,6 +123,16 @@     newY = (snd $ bbMin bb) + (height / 2)     (width, height) = sizeBB bb +-- | Calculates the bounding box of multiple positions+bbFromList :: (Positioned a) => [a] -> BoundingBox+bbFromList []  = nullBB+bbFromList [x] = nullBB+bbFromList xs  = BoundingBox (minX, minY) (maxX, maxY)+  where+    minX = minimum $ map getX xs+    minY = minimum $ map getY xs+    maxX = maximum $ map getX xs+    maxY = maximum $ map getY xs  -- | Testing whether a BoundingBox has the same min and max values isNullBB :: BoundingBox -> Bool