packages feed

htiled 0.1.1 → 0.1.1.1

raw patch · 3 files changed

+10/−2 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Data.Tiled.Types: tsMargin :: Tileset -> Int
+ Data.Tiled.Types: tsSpacing :: Tileset -> Int
- Data.Tiled.Types: Tileset :: String -> Word32 -> Int -> Int -> [Image] -> [(Word32, Properties)] -> Tileset
+ Data.Tiled.Types: Tileset :: String -> Word32 -> Int -> Int -> Int -> Int -> [Image] -> [(Word32, Properties)] -> Tileset

Files

htiled.cabal view
@@ -1,5 +1,5 @@ Name:                htiled-Version:             0.1.1+Version:             0.1.1.1 Synopsis:            Import from the Tiled map editor. Description:         Import maps from the .tmx map format generated by Tiled,                      <http://www.mapeditor.org>.
src/Data/Tiled/Load.hs view
@@ -42,6 +42,12 @@ getAttrR ∷ (Read α, Num α) ⇒ String → IOSArrow XmlTree α getAttrR a = arr read . getAttrValue0 a +getAttrMaybe ∷ (Read α, Num α) ⇒ String → IOSArrow XmlTree (Maybe α)+getAttrMaybe a = arr tm . getAttrValue a+    where+        tm "" = Nothing+        tm s = Just $ read s+ doMap ∷ FilePath → IOSArrow XmlTree TiledMap doMap mapPath = proc m → do     mapOrientation ← arr (\x → case x of "orthogonal" → Orthogonal@@ -139,7 +145,6 @@         returnA ⤙ case x of Left  layerData    → Layer {..}                             Right layerObjects → ObjectLayer {..} - tilesets ∷ IOSArrow XmlTree [Tileset] tilesets = listA $ getChildren >>> isElem >>> hasName "tileset"          >>> proc ts → do@@ -147,6 +152,8 @@               tsInitialGid  ← getAttrR "firstgid"     ⤙ ts               tsTileWidth   ← getAttrR "tilewidth"    ⤙ ts               tsTileHeight  ← getAttrR "tileheight"   ⤙ ts+              tsMargin      ← (arr $ fromMaybe 0) . getAttrMaybe "margin" ⤙ ts+              tsSpacing     ← (arr $ fromMaybe 0) . getAttrMaybe "spacing" ⤙ ts               tsImages      ← images                  ⤙ ts               tsTileProperties ← listA tileProperties ⤙ ts               returnA ⤙ Tileset {..}
src/Data/Tiled/Types.hs view
@@ -27,6 +27,7 @@              { tsName                    ∷ String              , tsInitialGid              ∷ Word32              , tsTileWidth, tsTileHeight ∷ Int+             , tsSpacing, tsMargin       ∷ Int              , tsImages                  ∷ [Image] -- ^ Multiple images not                                                    -- yet supported in tiled.              , tsTileProperties          ∷ [(Word32, Properties)]