Cleanup door mounts, noticed space leak when no debug-display paths

This commit is contained in:
2025-10-25 22:49:37 +01:00
parent cbf0f47b9b
commit 61910785c4
16 changed files with 217550 additions and 864094 deletions
+39 -21
View File
@@ -2,6 +2,7 @@
-- | Rooms containing long doors, probably with a big reveal behind them.
module Dodge.Room.LongDoor where
import ShapePicture
import Linear
import Dodge.Door.PutSlideDoor
import Dodge.Default.Wall
@@ -97,7 +98,7 @@ addButtonSlowDoor x h rm = do
setOutLinksPD (f (> h + 40)) $
setInLinksPD (f (< h - 40)) $
rm
& rmPmnts .++~ [butDoor, theterminal]
& rmPmnts <>~ [butDoor, theterminal]
& rmBound .:~ openDoorBound
where
f g y = g $ y ^. _1 . _y
@@ -107,18 +108,18 @@ addButtonSlowDoor x h rm = do
(shiftByV2 (V2 0 (-10)) <&> (,S.singleton UsedPosLow))
themessage = [ "WARNING:" , "LARGE BIOMASS DETECTED" ]
openDoorBound = reverse $ rectNSWE (h + 5) (h - 5) (3 * x / 2) (- x / 2)
amountedlight dr xoff mpl = Just
. moveLSThen
(WdP2fDoorPosition (fromJust $ _plMID dr))
(V3 15 xoff 89)
(aShape (V2 15 0) (V3 15 xoff 90))
$ \plls plpr ->
Just $
ptCont (PutWorldUpdate (const $ const $ over gwWorld $ setmount dr plls plpr)) $
const mpl
setmount pldr plls plpr =
cWorld . lWorld . doors . ix (fromJust $ _plMID pldr) . drMounts
.++~ [MountedLS (fromJust $ _plMID plls), MountedProp (fromJust $ _plMID plpr)]
-- amountedlight dr xoff mpl = Just
-- . moveLSThen
-- (WdP2fDoorPosition (fromJust $ _plMID dr))
-- (V3 15 xoff 89)
-- (aShape (V2 15 0) (V3 15 xoff 90))
-- $ \plls plpr ->
-- Just $
-- ptCont (PutWorldUpdate (const $ const $ over gwWorld $ setmount dr plls plpr)) $
-- const mpl
-- setmount pldr plls plpr =
-- cWorld . lWorld . doors . ix (fromJust $ _plMID pldr) . drMounts
-- <>~ [MountedLS (fromJust $ _plMID plls), MountedProp (fromJust $ _plMID plpr)]
butDoor = putLitButOnPos
(dim $ light red)
(rprBool (isUnusedLnkType InLink))
@@ -130,14 +131,31 @@ addButtonSlowDoor x h rm = do
(V2 0 h)
(V2 x h)
0.5
$ \dr1 dr2 ->
amountedlight dr1 50 $
amountedlight dr1 (-50) $
amountedlight dr2 50 $
amountedlight
dr2
(-50)
Nothing
$ \dr1 dr2 ->
Just
$ sps0 $ PutWorldUpdate $ const $ const
$ (gwWorld . cWorld . lWorld . doors . ix (dr1 ^?! plMID . _Just)
. drMounts .~
[MountedSPic (noPic $ aShape (V2 25 0) (V3 25 50 50))
, MountedSPic (noPic $ aShape (V2 25 0) (V3 25 (-50) 50))
, MountedLight (V3 25 (-50) 50) 200 0.5
, MountedLight (V3 25 50 50) 200 0.5
])
. (gwWorld . cWorld . lWorld . doors . ix (dr2 ^?! plMID . _Just)
. drMounts .~
[MountedSPic (noPic $ aShape (V2 (-25) 0) (V3 (-25) 50 50))
, MountedSPic (noPic $ aShape (V2 (-25) 0) (V3 (-25) (-50) 50))
, MountedLight (V3 (-25) (-50) 50) 200 0.5
, MountedLight (V3 (-25) 50 50) 200 0.5
])
-- amountedlight dr1 50 $
-- amountedlight dr1 (-50) $
-- amountedlight dr2 50 $
-- amountedlight
-- dr2
-- (-50)
-- Nothing
slowDoorRoom :: RandomGen g => State g Room
slowDoorRoom = do