-- |
-- TODO
getMapData :: B.ByteString -> MapType -> MapFileType -> ([Word8], [Word8])
getMapData md mt mft = do
  let
    tag = rlewTag mft
    (pl1ofs, pl2ofs, _) = planeStart  mt
    (pl1len, pl2len, _) = planeLength mt
    pl1comp = B.drop 2 . B.take pl1len . B.drop pl1ofs $ md -- carmacized data, drop length
    pl2comp = B.drop 2 . B.take pl2len . B.drop pl2ofs $ md
    pl1dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl1comp
    pl2dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl2comp

  (,) pl1dec pl2dec


-- |
--
getMapData :: B.ByteString -> MapType -> MapFileType -> ([Word8], [Word8])
getMapData md mt mft = do
  let
    tag = rlewTag mft
    (pl1ofs, pl2ofs, _) = planeStart  mt
    (pl1len, pl2len, _) = planeLength mt
    pl1comp = B.drop 2 . B.take pl1len . B.drop pl1ofs $ md -- carmacized data, drop length
    pl2comp = B.drop 2 . B.take pl2len . B.drop pl2ofs $ md
    pl1dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl1comp
    pl2dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl2comp

  (,) pl1dec pl2dec


-- |
--
getMapData md mt mft = do
  let
    tag = rlewTag mft
    (pl1ofs, pl2ofs, _) = planeStart  mt
    (pl1len, pl2len, _) = planeLength mt
    pl1comp = B.drop 2 . B.take pl1len . B.drop pl1ofs $ md -- carmacized data, drop length
    pl2comp = B.drop 2 . B.take pl2len . B.drop pl2ofs $ md
    pl1dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl1comp
    pl2dec  = rlewExpand tag . drop 2 $ carmackExpand $ bsToListOfWord8 pl2comp

  (,) pl1dec pl2dec


-- |
--