gloss-examples 1.8.0.2 → 1.8.2.1
raw patch · 9 files changed
+88/−81 lines, 9 filesdep ~basedep ~glossdep ~gloss-raster
Dependency ranges changed: base, gloss, gloss-raster
Files
- LICENSE +1/−1
- gloss-examples.cabal +66/−62
- picture/Styrene/Advance.hs +4/−4
- picture/Styrene/Collide.hs +3/−3
- picture/Styrene/Contact.hs +7/−4
- picture/Styrene/Main.hs +1/−1
- picture/Styrene/QuadTree.hs +2/−2
- picture/Styrene/World.hs +2/−2
- picture/Zen/Main.hs +2/−2
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2010-2012 Benjamin Lippmeier +Copyright (c) 2010-2014 Benjamin Lippmeier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
gloss-examples.cabal view
@@ -1,5 +1,5 @@ Name: gloss-examples-Version: 1.8.0.2+Version: 1.8.2.1 License: MIT License-file: LICENSE Author: Ben Lippmeier@@ -17,12 +17,16 @@ Synopsis: Examples using the gloss library +source-repository head+ type: git+ location: https://github.com/benl23x5/gloss+ Executable gloss-bitmap Build-depends:- base == 4.6.*,+ base == 4.7.*, bytestring == 0.10.*,- gloss == 1.8.*,- bmp == 1.2.*+ bmp == 1.2.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Bitmap ghc-options: -threaded -O2@@ -30,8 +34,8 @@ Executable gloss-boids Build-depends:- base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: KDTree2d Vec2 hs-source-dirs: picture/Boids@@ -40,8 +44,8 @@ Executable gloss-clock Build-depends: - base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Clock ghc-options: -threaded -O2@@ -49,9 +53,9 @@ Executable gloss-conway Build-depends: - base == 4.6.*,- gloss == 1.8.*,- vector == 0.10.*+ base == 4.7.*,+ vector == 0.10.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Cell World hs-source-dirs: picture/Conway@@ -60,8 +64,8 @@ Executable gloss-draw Build-depends:- base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Draw ghc-options: -threaded -O2@@ -69,8 +73,8 @@ Executable gloss-easy Build-depends:- base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Easy ghc-options: -threaded -O2@@ -78,9 +82,9 @@ Executable gloss-eden Build-depends: - base == 4.6.*,- gloss == 1.8.*,- random == 1.0.*+ base == 4.7.*,+ random == 1.0.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Cell Community World hs-source-dirs: picture/Eden@@ -89,8 +93,8 @@ Executable gloss-flake Build-depends:- base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Flake ghc-options: -threaded -O2@@ -98,8 +102,8 @@ Executable gloss-gameevent Build-depends: - base == 4.6.*,- gloss == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/GameEvent ghc-options: -threaded -O2@@ -107,8 +111,8 @@ Executable gloss-hello Build-depends: - base == 4.6.*, - gloss == 1.8.*+ base == 4.7.*, + gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Hello ghc-options: -threaded -O2@@ -116,8 +120,8 @@ Executable gloss-lifespan Build-depends: - base == 4.6.*, - gloss == 1.8.*, + base == 4.7.*, + gloss == 1.8.2.*, random == 1.0.* Main-is: Main.hs other-modules: Cell Community World@@ -127,8 +131,8 @@ Executable gloss-machina Build-depends: - base == 4.6.*, - gloss == 1.8.*+ base == 4.7.*, + gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Machina ghc-options: -threaded -O2@@ -136,8 +140,8 @@ Executable gloss-occlusion Build-depends: - base == 4.6.*, - gloss == 1.8.*+ base == 4.7.*, + gloss == 1.8.2.* Main-is: Main.hs other-modules: Cell World State Data hs-source-dirs: picture/Occlusion@@ -146,10 +150,10 @@ Executable gloss-styrene Build-depends: - base == 4.6.*,+ base == 4.7.*, ghc-prim == 0.3.*,- gloss == 1.8.*,- containers == 0.5.*+ containers == 0.5.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Actor Advance Collide Config Contact QuadTree World hs-source-dirs: picture/Styrene@@ -158,8 +162,8 @@ Executable gloss-tree Build-depends: - base == 4.6.*, - gloss == 1.8.*+ base == 4.7.*, + gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Tree ghc-options: -threaded -O2@@ -167,9 +171,9 @@ Executable gloss-visibility Build-depends: - base == 4.6.*, + base == 4.7.*, vector == 0.10.*,- gloss == 1.8.*+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Draw Interface State World Geometry.Randomish Geometry.Segment hs-source-dirs: picture/Visibility @@ -178,8 +182,8 @@ Executable gloss-zen Build-depends: - base == 4.6.*, - gloss == 1.8.*+ base == 4.7.*, + gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Zen ghc-options: -threaded -O2@@ -187,9 +191,9 @@ Executable gloss-crystal Build-depends:- base == 4.6.*,- gloss == 1.8.*,- gloss-raster == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.*,+ gloss-raster == 1.8.2.* Main-is: Main.hs hs-source-dirs: raster/Crystal ghc-options: @@ -205,9 +209,9 @@ Executable gloss-ray Build-depends:- base == 4.6.*,- gloss == 1.8.*,- gloss-raster == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.*,+ gloss-raster == 1.8.2.* Main-is: Main.hs other-modules: Light Object Trace Vec3 World hs-source-dirs: raster/Ray@@ -221,9 +225,9 @@ Executable gloss-pulse Build-depends:- base == 4.6.*,- gloss == 1.8.*,- gloss-raster == 1.8.*+ base == 4.7.*,+ gloss == 1.8.2.*,+ gloss-raster == 1.8.2.* Main-is: Main.hs hs-source-dirs: raster/Pulse ghc-options:@@ -236,11 +240,11 @@ Executable gloss-wave Build-depends:- base == 4.6.*,+ base == 4.7.*, ghc-prim == 0.3.*, vector == 0.10.*,- gloss == 1.8.*,- gloss-raster == 1.8.*+ gloss == 1.8.2.*,+ gloss-raster == 1.8.2.* Main-is: Main.hs hs-source-dirs: raster/Wave ghc-options:@@ -252,13 +256,13 @@ Executable gloss-fluid Build-depends:- base == 4.6.*,+ base == 4.7.*, ghc-prim == 0.3.*, vector == 0.10.*,- gloss == 1.8.*, repa == 3.2.*, repa-io == 3.2.*,- repa-algorithms == 3.2.*+ repa-algorithms == 3.2.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Args Config FieldElt Model UserEvent@@ -278,9 +282,9 @@ Executable gloss-snow Build-depends- base == 4.6.*,- gloss == 1.8.*,+ base == 4.7.*, repa == 3.2.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: raster/Snow ghc-options:@@ -293,9 +297,9 @@ Executable gloss-mandel Build-depends- base == 4.6.*,- gloss == 1.8.*,- repa == 3.2.*+ base == 4.7.*,+ repa == 3.2.*,+ gloss == 1.8.2.* Main-is: Main.hs other-modules: Solver hs-source-dirs: raster/Mandel@@ -311,9 +315,9 @@ Executable gloss-graph Build-depends- base == 4.6.*,- gloss == 1.8.*,- containers == 0.5.*+ base == 4.7.*,+ containers == 0.5.*,+ gloss == 1.8.2.* Main-is: Main.hs hs-source-dirs: picture/Graph ghc-options:
picture/Styrene/Advance.hs view
@@ -21,7 +21,7 @@ import Data.Map (Map) --- Advance -------------------------------------------------------------------------------------------+-- Advance ---------------------------------------------------------------------------------------- -- | Advance all the actors in this world by a certain time. advanceWorld @@ -78,9 +78,9 @@ = let (a1', a2') -- if one of the beads is stuck then do a safer, static collision.- -- with this method the beads don't transfer energy into each other- -- so there is less of a chance of lots of beads being crushed together- -- if there are many in the same place.+ -- with this method the beads don't transfer energy into each other+ -- so there is less of a chance of lots of beads being crushed+ -- together if there are many in the same place. | m1 >= beadStuckCount || m2 >= beadStuckCount = let a1' = collideBeadBead_static a1 a2 a2' = collideBeadBead_static a2 a1
picture/Styrene/Collide.hs view
@@ -113,9 +113,9 @@ -- | Move a bead which has collided with something. collideBeadPoint_static- :: Actor -- ^ the bead which collided with something- -> Point -- ^ the point of collision (should be near the bead's surface)- -> Float -- ^ velocity scaling factor (how much to slow the bead down after the collision)+ :: Actor -- ^ the bead which collided with something+ -> Point -- ^ the point of collision (should be near the bead's surface)+ -> Float -- ^ velocity scaling factor (how much to slow the bead down after the collision) -> Actor collideBeadPoint_static
picture/Styrene/Contact.hs view
@@ -20,8 +20,11 @@ -- Find all pairs of actors in the world that are in contact with each other. findContacts :: World - -> ( Set (Index, Index) -- ^ a set of all pairs of actors that are in contact.- , QuadTree Actor) -- ^ also return the quadtree so we can draw it in the window.+ -> ( -- a set of all pairs of actors that are in contact.+ Set (Index, Index) ++ -- also return the quadtree so we can draw it in the window.+ , QuadTree Actor) findContacts (World actors _) = let @@ -107,7 +110,7 @@ -- pClosest needs to lie on the line segment between pWal1 and pWall2 inSegment = uParam >= 0 && uParam <= 1 - in closeEnough && inSegment+ in tagToEnum# closeEnough && inSegment -- | Check whether a bead is in concat with another bead.@@ -117,7 +120,7 @@ bead2@(Bead ix2 _ radius2 pBead2 _) =let !dist# = distancePP_contact pBead1 pBead2 !(F# rad) = radius1 + radius2- in (dist# `ltFloat#` rad ) && (dist# `gtFloat#` 0.1#)+ in tagToEnum# (dist# `ltFloat#` rad ) && tagToEnum# (dist# `gtFloat#` 0.1#) -- | Return the distance between these two points.
picture/Styrene/Main.hs view
@@ -28,7 +28,7 @@ advanceWorld -- a function to advance the world to -- the next simulation step. --- Draw --------------------------------------------------------------------------------------------+-- Draw ------------------------------------------------------------------------------------------- -- | Draw this world as a picture. drawWorld :: World -> Picture
picture/Styrene/QuadTree.hs view
@@ -28,11 +28,11 @@ deriving (Eq, Show) --- Initial -----------------------------------------------------------------------------------------+-- Initial ---------------------------------------------------------------------------------------- treeZero size = QNil (0, 0) size --- Quadrant ----------------------------------------------------------------------------------------+-- Quadrant --------------------------------------------------------------------------------------- -- | Insert an element with a bounding box into the tree treeInsert
picture/Styrene/World.hs view
@@ -11,7 +11,7 @@ import qualified Data.Map as Map import Data.Map (Map) --- The world ---------------------------------------------------------------------------------------+-- The world ------------------------------------------------------------------ data World = World (Map Index Actor) -- actors (QuadTree Actor) -- tree@@ -65,7 +65,7 @@ , (iy * beadBoxSize) ) --- QuadTree ----------------------------------------------------------------------------------------+-- QuadTree ------------------------------------------------------------------- -- | insert an actor into the tree insertActor :: Actor -> QuadTree Actor -> QuadTree Actor
picture/Zen/Main.hs view
@@ -44,8 +44,8 @@ -- The tree fractal.--- The position of the branches changes depending on the animation time--- as well as the iteration number of the fractal.+-- The position of the branches changes depending on the animation time+-- as well as the iteration number of the fractal. treeFrac :: Int -> Float -> Picture treeFrac 0 timeS = Blank treeFrac n timeS