Simplify Prop drawing

This commit is contained in:
2025-10-25 13:54:40 +01:00
parent ff03efc41f
commit 7585531dd1
9 changed files with 73 additions and 201 deletions
-2
View File
@@ -1,7 +1,6 @@
module Dodge.Placement.Instance
( module Dodge.Placement.Instance.Door
, module Dodge.Placement.Instance.LightSource
, module Dodge.Placement.Instance.LightSource.Cover
, module Dodge.Placement.Instance.Wall
, module Dodge.Placement.Instance.Tank
, module Dodge.Placement.Instance.Button
@@ -14,7 +13,6 @@ module Dodge.Placement.Instance
where
import Dodge.Placement.Instance.Door
import Dodge.Placement.Instance.Tank
import Dodge.Placement.Instance.LightSource.Cover
import Dodge.Placement.Instance.LightSource
import Dodge.Placement.Instance.LightSource.Flicker
import Dodge.Placement.Instance.Wall
+1 -1
View File
@@ -57,7 +57,7 @@ moveLSThen posf off sh = propLSThen (PropUpdatePosition posf) (PrWdLsSetPosition
, _prRot = 0
, _prUpdate = PropUpdateId
, --, _prDraw = PropDrawSPic $ noPic $ uncurryV translateSHf (_prPos pr) $ rotateSH (_pjRot pr) sh
_prDraw = PropDrawFlatTranslate $ noPic sh
_prDraw = noPic sh
, _prToggle = True
}
@@ -1,43 +0,0 @@
module Dodge.Placement.Instance.LightSource.Cover where
import Dodge.Data.Prop
import Dodge.Data.WorldEffect
import Dodge.Default.Prop
import Geometry.Data
lampCover :: Float -> Prop
lampCover h =
ShapeProp
{ _prPos = V2 0 0
, _prID = 0
, _prRot = 0
, _prUpdate = PropRotate 0.15
, _prDraw = PropLampCover h
, _prToggle = True
}
lampCoverWhen :: WdBl -> Point2 -> Float -> Prop
lampCoverWhen cond pos h =
defaultProp
{ _prPos = pos
, _prUpdate = PropSetToggleAnd cond (PropRotate 0.15)
, _prDraw = PropLampCover h
, _prToggle = True
}
doubleLampCover :: Float -> Prop
doubleLampCover h =
defaultProp
{ _prPos = V2 0 0
, _prUpdate = PropRotate 0.15
, _prDraw = PropDoubleLampCover h
}
-- on the current (27/9/21) version of shadow stencilling, this glitches
-- slightly when the shadow rotates towards the screen
verticalLampCover :: Float -> Prop
verticalLampCover h =
defaultProp
{ _prUpdate = PropRotate 0.15
, _prDraw = PropVerticalLampCover h
}