Remove default light sources
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
@@ -23,8 +23,6 @@ data LSParam = LSParam -- LSPosRadCol
|
||||
data LightSource = LS
|
||||
{ _lsID :: Int
|
||||
, _lsParam :: LSParam
|
||||
-- , _lsDir :: Float
|
||||
-- , _lsPict :: LightSourceDraw --LightSource -> Picture
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ This module contains prototypical data structures.
|
||||
module Dodge.Default (
|
||||
module Dodge.Default,
|
||||
module Dodge.Default.Item,
|
||||
module Dodge.Default.LightSource,
|
||||
module Dodge.Default.Wall,
|
||||
module Dodge.Default.Creature,
|
||||
module Dodge.Default.Terminal,
|
||||
@@ -17,7 +16,6 @@ import Control.Lens
|
||||
import Dodge.Data.World
|
||||
import Dodge.Default.Creature
|
||||
import Dodge.Default.Item
|
||||
import Dodge.Default.LightSource
|
||||
import Dodge.Default.Terminal
|
||||
import Dodge.Default.Wall
|
||||
import Dodge.SoundLogic
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
module Dodge.Default.LightSource
|
||||
( defaultLS
|
||||
) where
|
||||
|
||||
import Dodge.Data.LightSource
|
||||
import Geometry
|
||||
|
||||
defaultLS :: LightSource
|
||||
defaultLS =
|
||||
LS
|
||||
{ _lsID = 0
|
||||
, _lsParam =
|
||||
LSParam
|
||||
{ _lsPos = V3 0 0 50
|
||||
, _lsRad = 200
|
||||
, _lsCol = 0.6
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,13 @@
|
||||
module Dodge.LightSource (
|
||||
-- tlsTimeRadFunPos,
|
||||
-- tlsTimeRadColPos,
|
||||
lsRadCol,
|
||||
lsColPosRad,
|
||||
lsColPos,
|
||||
lsPosCol,
|
||||
lsPosRad,
|
||||
lsColPosID,
|
||||
-- makeTlsTimeRadColPos,
|
||||
destroyLS,
|
||||
) where
|
||||
|
||||
import Dodge.Data.World
|
||||
import Dodge.Default.LightSource
|
||||
import Dodge.Material.Sound
|
||||
import Dodge.WorldEvent.Sound
|
||||
import Geometry.Data
|
||||
@@ -54,17 +49,12 @@ lsPosCol :: Point3 -> Point3 -> LightSource
|
||||
lsPosCol pos col = lsColPos col pos
|
||||
|
||||
lsColPosRad :: Point3 -> Point3 -> Float -> LightSource
|
||||
lsColPosRad col p r =
|
||||
defaultLS
|
||||
& lsParam . lsPos .~ p
|
||||
& lsParam . lsRad .~ r
|
||||
& lsParam . lsCol .~ col
|
||||
lsColPosRad col p r = LS 0 $ LSParam p r col
|
||||
|
||||
|
||||
lsRadCol :: Float -> Point3 -> LightSource
|
||||
lsRadCol r col =
|
||||
defaultLS & lsParam . lsRad .~ r
|
||||
& lsParam . lsCol .~ col
|
||||
--lsRadCol :: Float -> Point3 -> LightSource
|
||||
--lsRadCol r col =
|
||||
-- defaultLS & lsParam . lsRad .~ r
|
||||
-- & lsParam . lsCol .~ col
|
||||
|
||||
--tlsTimeRadColPos ::
|
||||
-- Int ->
|
||||
|
||||
@@ -78,7 +78,7 @@ putLitButOnPos col theps subpl =
|
||||
.~ _plSpot plmnt
|
||||
where
|
||||
changeLight lsid = SetLSCol (V3 0 0.5 0) lsid
|
||||
ls = lsRadCol 50 (V3 0.5 0 0)
|
||||
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
||||
|
||||
-- creates a lit external trigger, passes the trigger placement forward
|
||||
extTrigLitPos :: PlacementSpot -> (Placement -> Maybe Placement) -> Placement
|
||||
@@ -128,4 +128,4 @@ putLitButOnPosExtTrig' col thePS cnt =
|
||||
trigid tp = fromJust $ _plMID tp
|
||||
oneff tid = SetTrigger True tid
|
||||
changeLight = SetLSCol (V3 0 0.5 0)
|
||||
ls = lsRadCol 50 (V3 0.5 0 0)
|
||||
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
||||
|
||||
@@ -5,7 +5,6 @@ import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Creature.Inanimate
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.Default
|
||||
import Dodge.LevelGen.PlacementHelper
|
||||
import Dodge.LightSource
|
||||
import Dodge.Room.Foreground
|
||||
@@ -39,7 +38,7 @@ moveLSThen ::
|
||||
moveLSThen posf off sh = propLSThen (PropUpdatePosition posf) (PrWdLsSetPosition posf off) thels theprop
|
||||
where
|
||||
--lsupdate _ w = lsParam . lsPos .~ addZ 0 (fst (posf w)) +.+.+ rotate3z (snd (posf w)) off
|
||||
thels = defaultLS
|
||||
thels = LS 0 $ LSParam 0 200 0.6
|
||||
theprop =
|
||||
ShapeProp
|
||||
{ _prPos = 0
|
||||
@@ -123,9 +122,13 @@ vShape wallpos (V3 x y z) =
|
||||
|
||||
mntLS :: (Point2 -> Point3 -> Shape) -> Point2 -> Point3 -> Placement
|
||||
mntLS shp wallp lampp = mntLSOn shp Nothing defaultLS wallp lampp (const Nothing)
|
||||
where
|
||||
defaultLS = LS 0 $ LSParam 0 200 0.6
|
||||
|
||||
mntLSCol :: (Point2 -> Point3 -> Shape) -> Color -> Point2 -> Point3 -> Placement
|
||||
mntLSCol shp col wallp lampp = mntLSOn shp (Just col) defaultLS wallp lampp (const Nothing)
|
||||
where
|
||||
defaultLS = LS 0 $ LSParam 0 200 0.6
|
||||
|
||||
mntLSLampCol :: (Point2 -> Point3 -> Shape) -> Color -> Point2 -> Point3 -> Placement
|
||||
mntLSLampCol shp (V4 x y z _) wallp lampp =
|
||||
@@ -138,6 +141,7 @@ mntLSLampCol shp (V4 x y z _) wallp lampp =
|
||||
(const Nothing)
|
||||
where
|
||||
col = V3 x y z
|
||||
defaultLS = LS 0 $ LSParam 0 200 0.6
|
||||
|
||||
mntLSCond ::
|
||||
(Point2 -> Point3 -> Shape) ->
|
||||
|
||||
Reference in New Issue
Block a user