Cleanup, trying to diagnose space leak in crit update

This commit is contained in:
2021-12-09 22:12:44 +00:00
parent bd94044445
commit 3c35a04531
23 changed files with 203 additions and 178 deletions
+19 -21
View File
@@ -52,8 +52,7 @@ import qualified Data.IntSet as IS
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
import SDL (Scancode, MouseButton)
import Data.Monoid
type CRUpdate = Creature -> World -> (Endo World, Maybe Creature)
type CRUpdate = Creature -> World -> (World -> World, Maybe Creature)
data Universe = Universe
{ _uvWorld :: World
, _preloadData :: PreloadData
@@ -63,13 +62,13 @@ data Universe = Universe
, _config :: Configuration
}
data World = World
{ _keys :: !(S.Set Scancode)
, _mouseButtons :: !(S.Set MouseButton)
, _mousePos :: !Point2
, _cameraCenter :: !Point2
, _cameraRot :: !Float
, _cameraZoom :: !Float
, _cameraViewFrom :: !Point2
{ _keys :: S.Set Scancode
, _mouseButtons :: S.Set MouseButton
, _mousePos :: Point2
, _cameraCenter :: Point2
, _cameraRot :: Float
, _cameraZoom :: Float
, _cameraViewFrom :: Point2
, _creatures :: IM.IntMap Creature
, _creaturesZone :: Zone (IM.IntMap Creature)
, _creatureGroups :: IM.IntMap CrGroupParams
@@ -78,8 +77,8 @@ data World = World
, _cloudsZone :: Zone [Cloud]
, _props :: IM.IntMap Prop
, _instantParticles :: [Particle]
, _particles :: ![Particle]
, _walls :: !(IM.IntMap Wall)
, _particles :: [Particle]
, _walls :: (IM.IntMap Wall)
, _doors :: IM.IntMap Door
, _machines :: IM.IntMap Machine
, _magnets :: IM.IntMap Magnet
@@ -92,7 +91,7 @@ data World = World
, _randGen :: StdGen
, _testString :: World -> [String]
, _modifications :: IM.IntMap Modification
, _yourID :: !Int
, _yourID :: Int
, _worldEvents :: World -> World
, _delayedEvents :: [(Int,World -> World)]
, _pressPlates :: IM.IntMap PressPlate
@@ -102,16 +101,16 @@ data World = World
, _decorations :: IM.IntMap Picture
, _foregroundShape :: Shape
, _corpses :: Zone [Corpse]
, _clickMousePos :: !Point2
, _clickMousePos :: Point2
, _pathGraph :: ~(Gr Point2 Float)
, _pathGraphP :: ~[(Point2,Point2)]
, _pathPoints :: ~(IM.IntMap (IM.IntMap [(Int,Point2)]))
, _carteDisplay :: !Bool
, _carteCenter :: !Point2
, _carteZoom :: !Float
, _carteRot :: !Float
, _lightSources :: !(IM.IntMap LightSource)
, _tempLightSources :: ![TempLightSource]
, _carteDisplay :: Bool
, _carteCenter :: Point2
, _carteZoom :: Float
, _carteRot :: Float
, _lightSources :: (IM.IntMap LightSource)
, _tempLightSources :: [TempLightSource]
, _closeObjects :: [Either FloorItem Button]
, _seenLocations :: IM.IntMap (World -> Point2,String)
, _selLocation :: Int
@@ -229,7 +228,6 @@ data Creature = Creature
, _crTwist :: Float
, _crID :: Int
, _crPict :: Creature -> Configuration -> World -> SPic
--, _crUpdate :: Creature -> World -> (Endo World, Maybe Creature)
, _crUpdate :: Creature -> World -> World
, _crRad :: Float
, _crMass :: Float
@@ -246,7 +244,7 @@ data Creature = Creature
, _crApplyDamage :: [DamageType] -> Creature -> (World -> World,Creature)
, _crStance :: Stance
, _crActionPlan :: ActionPlan
, _crMeleeCooldown :: !Int
, _crMeleeCooldown :: Int
, _crPerception :: PerceptionState
, _crMemory :: MemoryState
, _crVocalization :: Vocalization