diff --git a/assets/cabinet/cabCoffeeSE.kra b/assets/cabinet/cabCoffeeSE.kra new file mode 100644 index 0000000..fea057a Binary files /dev/null and b/assets/cabinet/cabCoffeeSE.kra differ diff --git a/assets/cabinet/cabCoffeeSE.png b/assets/cabinet/cabCoffeeSE.png new file mode 100644 index 0000000..1db76da Binary files /dev/null and b/assets/cabinet/cabCoffeeSE.png differ diff --git a/assets/cabinet/cabSinkSE.kra b/assets/cabinet/cabSinkSE.kra new file mode 100644 index 0000000..19c100c Binary files /dev/null and b/assets/cabinet/cabSinkSE.kra differ diff --git a/assets/cabinet/cabSinkSE.png b/assets/cabinet/cabSinkSE.png new file mode 100644 index 0000000..1f62776 Binary files /dev/null and b/assets/cabinet/cabSinkSE.png differ diff --git a/assets/cabinet/cabSinkSW.kra b/assets/cabinet/cabSinkSW.kra new file mode 100644 index 0000000..d6cb363 Binary files /dev/null and b/assets/cabinet/cabSinkSW.kra differ diff --git a/assets/cabinet/cabSinkSW.png b/assets/cabinet/cabSinkSW.png new file mode 100644 index 0000000..eda6bd9 Binary files /dev/null and b/assets/cabinet/cabSinkSW.png differ diff --git a/assets/cabinet/cabStoveSE.kra b/assets/cabinet/cabStoveSE.kra new file mode 100644 index 0000000..712c4e4 Binary files /dev/null and b/assets/cabinet/cabStoveSE.kra differ diff --git a/assets/cabinet/cabStoveSE.png b/assets/cabinet/cabStoveSE.png new file mode 100644 index 0000000..72fe66c Binary files /dev/null and b/assets/cabinet/cabStoveSE.png differ diff --git a/assets/cabinet/cabStoveSW.kra b/assets/cabinet/cabStoveSW.kra new file mode 100644 index 0000000..b5655bc Binary files /dev/null and b/assets/cabinet/cabStoveSW.kra differ diff --git a/assets/cabinet/cabStoveSW.png b/assets/cabinet/cabStoveSW.png new file mode 100644 index 0000000..58bf613 Binary files /dev/null and b/assets/cabinet/cabStoveSW.png differ diff --git a/src/Interior.hs b/src/Interior.hs index 21d674f..fe4ba82 100644 --- a/src/Interior.hs +++ b/src/Interior.hs @@ -81,6 +81,7 @@ placeCluster placeCluster imat rng bnds dim try mat rp appl = let (pr, g1) = randomR (fst (matmin bnds) - 1, fst (matmax bnds) - 1) rng (pc, g2) = randomR (snd (matmin bnds) - 1, snd (matmax bnds) - 1) g1 + (g2_1, g2_2) = split g2 freeRoom = foldl (\acc a -> if isNothing a then acc + 1 else acc) 0 @@ -89,7 +90,7 @@ placeCluster imat rng bnds dim try mat rp appl = (snd $ matmin bnds) (snd $ matmax bnds) mat ) :: Int - cmat = clusterMat appl dim + cmat = clusterMat appl dim g2_2 newmat = insertMat cmat mat (pr, pc) exits = filter (\p -> pointType p == RoomExit && inBounds (pointCoord p) bnds) @@ -129,7 +130,7 @@ placeCluster imat rng bnds dim try mat rp appl = mat )) then A.log A.Debug ("no cluster placed") $ - placeCluster imat g2 bnds dim (try + 1) mat rp appl + placeCluster imat g2_1 bnds dim (try + 1) mat rp appl else if any (`elem` (oldreaches)) (V2 @@ -140,9 +141,9 @@ placeCluster imat rng bnds dim try mat rp appl = else if isReachable newmat [(V2 10 10, Boundaries (0, 1) (0, 1))] (oldreaches ++ reaches) exits then A.log A.Debug ("placed cluster" ++ show appl) $ - placeCluster imat g2 bnds dim (try + 1) newmat newrp appl + placeCluster imat g2_1 bnds dim (try + 1) newmat newrp appl else A.log A.Debug ("no cluster placed") $ - placeCluster imat g2 bnds dim (try + 1) mat rp appl + placeCluster imat g2_1 bnds dim (try + 1) mat rp appl insertMat :: Matrix (Maybe a) diff --git a/src/Load.hs b/src/Load.hs index 14164da..da769da 100644 --- a/src/Load.hs +++ b/src/Load.hs @@ -63,7 +63,7 @@ loadFork -> MVar (Float, T.Text) -> IO () loadFork ws win glc nvg future progress = do - let stateSteps = 43 + let stateSteps = 49 increment = 1 / stateSteps SDL.glMakeCurrent win glc modifyMVar_ progress (return . (\(p, _) -> @@ -213,14 +213,49 @@ loadFork ws win glc nvg future progress = do mmiscVending <- createImage nvg (FileName "assets/misc/vending.png") 0 modifyMVar_ progress (return . (\(p, _) -> ( p + increment - , "Loading asset \"Cabinet with Coffee machine\"" + , "Loading asset \"Cabinet with Coffee machine SW\"" ))) - mmiscCabCoffee <- createImage nvg (FileName "assets/cabinet/cabCoffeeSW.png") 0 + mcabCoffeeSW <- createImage nvg (FileName "assets/cabinet/cabCoffeeSW.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"Cabinet with Coffee machine SE\"" + ))) + mcabCoffeeSE <- createImage nvg (FileName "assets/cabinet/cabCoffeeSE.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"Cabinet with sink SW\"" + ))) + mcabSinkSW <- createImage nvg (FileName "assets/cabinet/cabSinkSW.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"Cabinet with sink SE\"" + ))) + mcabSinkSE <- createImage nvg (FileName "assets/cabinet/cabSinkSE.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"Cabinet with stove SW\"" + ))) + mcabStoveSW <- createImage nvg (FileName "assets/cabinet/cabStoveSW.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"Cabinet with stove SE\"" + ))) + mcabStoveSE <- createImage nvg (FileName "assets/cabinet/cabStoveSE.png") 0 modifyMVar_ progress (return . (\(p, _) -> ( p + increment , "Loading asset \"cabinet SW\"" ))) - mmiscCabinetSW <- createImage nvg (FileName "assets/cabinet/cabinetSW.png") 0 + mcabinetSW <- createImage nvg (FileName "assets/cabinet/cabinetSW.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"cabinet SE\"" + ))) + mcabinetSE <- createImage nvg (FileName "assets/cabinet/cabinetSE.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"cabinet corner\"" + ))) + mcabinetCorner <- createImage nvg (FileName "assets/cabinet/cabinetCorner.png") 0 let micons = [ mcontrblue, mcontrgreen, marrow ] @@ -237,7 +272,10 @@ loadFork ws win glc nvg future progress = do , mmiscFlipchart , mmiscPlant1, mmiscPlant2 , mmiscWatercooler, mmiscVending - , mmiscCabCoffee, mmiscCabinetSW + , mcabCoffeeSW, mcabCoffeSE + , mcabSinkSW, mcabSinkSE + , mcabStoveSW, mcabStoveSE + , mcabinetSW, mcabinetSE, mcabinetCorner ] when (any isNothing mimgs) $ do liftIO $logIO Error "Failed to load image assets" @@ -250,7 +288,7 @@ loadFork ws win glc nvg future progress = do -- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE]) let imgs = zipWith (\a b -> (a, fromJust b)) [ ImgWallAsc - .. ImgCabinetSW + .. ImgCabinetCorner ] mimgs icons = zipWith (\a b -> (a, fromJust b)) diff --git a/src/Types/Collidible.hs b/src/Types/Collidible.hs index 9257b3a..3631ecc 100644 --- a/src/Types/Collidible.hs +++ b/src/Types/Collidible.hs @@ -99,8 +99,15 @@ instance Collidible ImgId where collisionObstacle ImgMiscVending = [ Boundaries (0, 2/36) (24/36, 34/36) ] - collisionObstacle ImgCabinetCoffee = collisionObstacle ImgTableSW + collisionObstacle ImgCabinetCoffeeSW = collisionObstacle ImgTableSW + collisionObstacle ImgCabinetCoffeeSE = collisionObstacle ImgTableSE + collisionObstacle ImgCabinetSinkSW = collisionObstacle ImgTableSW + collisionObstacle ImgCabinetSinkSE = collisionObstacle ImgTableSE + collisionObstacle ImgCabinetStoveSW = collisionObstacle ImgTableSW + collisionObstacle ImgCabinetStoveSE = collisionObstacle ImgTableSE collisionObstacle ImgCabinetSW = collisionObstacle ImgTableSW + collisionObstacle ImgCabinetSE = collisionObstacle ImgTableSE + collisionObstacle ImgCabinetCorner = collisionObstacle ImgTableCorner collisionObstacle ImgEmptyNoWalk = - [ Boundaries (0, 0) (0.99, 0.99) ] + [ Boundaries (0, 0) (1, 1) ] collisionObstacle _ = [] diff --git a/src/Types/ImgId.hs b/src/Types/ImgId.hs index 7e66362..e720d69 100644 --- a/src/Types/ImgId.hs +++ b/src/Types/ImgId.hs @@ -35,8 +35,15 @@ data ImgId | ImgMiscPlant2 | ImgMiscWatercooler | ImgMiscVending - | ImgCabinetCoffee + | ImgCabinetCoffeeSW + | ImgCabinetCoffeeSE + | ImgCabinetSinkSW + | ImgCabinetSinkSE + | ImgCabinetStoveSW + | ImgCabinetStoveSE | ImgCabinetSW + | ImgCabinetSE + | ImgCabinetCorner -- | ImgIntrNE -- | ImgIntrE -- | ImgIntrSE