diff --git a/src/Dodge/Block/Debris.hs b/src/Dodge/Block/Debris.hs index 474722191..a72594084 100644 --- a/src/Dodge/Block/Debris.hs +++ b/src/Dodge/Block/Debris.hs @@ -11,7 +11,6 @@ import Color import Data.Foldable import qualified Data.IntSet as IS import Data.Maybe -import Dodge.Base import Dodge.Data.World import Dodge.Material.Sound import Dodge.WorldEvent.Sound @@ -49,25 +48,31 @@ makeDebris = makeDebrisDirected (2 * pi) 0 makeDebrisDirected :: Float -> Float -> Material -> Color -> Point2 -> World -> World makeDebrisDirected arcrad dir bm col p w = w - & flip (foldl' (flip $ plNew (cWorld . lWorld . props) prID)) thedebris +-- & flip (foldl' (flip $ plNew (cWorld . lWorld . props) prID)) thedebris + & cWorld . lWorld . debris <>~ thedebris & randGen .~ newg & soundOriginsIDsAt [MaterialSound bm i | i <- [0, 1, 2]] (destroyMatS bm) p where - (thedebris, newg) = mapM f [35, 55 .. 95] & runState $ _randGen w + (thedebris, newg) = mapM f [35, 55, 75, 95] & runState $ _randGen w f h = do v <- rotateV (dir - arcrad / 2) <$> randInArcStrip 1 2 arcrad - q <- Q.vToQuat (V3 0 0 1) <$> randOnUnitSphere spinspeed <- randomR (-0.2, -0.1) & state - basedebris <- baseDebris bm - return $ - basedebris - & prColor .~ col - & prPos .~ p - & prVel .~ v - & prQuatSpin .~ Q.axisAngle (vNormal v `v2z` 0) spinspeed - & prQuat .~ q - & prVelZ .~ 0 - & prPosZ .~ h +-- basedebris <- baseDebris bm + return $ DebrisChunk + { _dbPos = p `v2z` h + , _dbType = BlockDebris col + , _dbVel = v `v2z` 0 + , _dbRot = Q.qID + , _dbSpin = Q.axisAngle (vNormal v `v2z` 0) spinspeed + } +-- basedebris +-- & prColor .~ col +-- & prPos .~ p +-- & prVel .~ v +-- & prQuatSpin .~ Q.axisAngle (vNormal v `v2z` 0) spinspeed +-- & prQuat .~ Q.qID +-- & prVelZ .~ 0 +-- & prPosZ .~ h debrisSize :: Material -> Float debrisSize mt = case mt of diff --git a/src/Dodge/Data/Prop.hs b/src/Dodge/Data/Prop.hs index abe6b2888..82602635e 100644 --- a/src/Dodge/Data/Prop.hs +++ b/src/Dodge/Data/Prop.hs @@ -44,7 +44,7 @@ data DebrisType = Gib {_gibSize :: Float ,_gibColor :: Color } - | BlockDebris {_bdMaterial :: Material} + | BlockDebris {_bdColor :: Color} data Debris = DebrisChunk { _dbPos :: Point3 @@ -54,7 +54,7 @@ data Debris = DebrisChunk , _dbSpin :: Q.Quaternion Float } -data PropType = FallingBlock Material +--data PropType = FallingBlock Material data PropDraw = PropDrawSPic SPic diff --git a/src/Dodge/Prop/Draw.hs b/src/Dodge/Prop/Draw.hs index 77219d013..9a9c32d76 100644 --- a/src/Dodge/Prop/Draw.hs +++ b/src/Dodge/Prop/Draw.hs @@ -4,7 +4,6 @@ module Dodge.Prop.Draw ( debrisSPic, ) where -import Dodge.Material.Color import Dodge.Block.Debris import Control.Lens import Dodge.Data.Prop @@ -22,7 +21,7 @@ debrisSPic :: Debris -> SPic debrisSPic db = translateSP (_dbPos db) . overPosSP (Q.rotate (_dbRot db)) $ case db ^. dbType of Gib x col -> noPic $ drawGib x col - BlockDebris m -> noPic . colorSH (materialColor m) $ cubeShape 4 + BlockDebris m -> noPic . colorSH m $ cubeShape 4 drawProp :: PropDraw -> Prop -> SPic drawProp = \case diff --git a/tags b/tags index 191a3ec9a..11da30471 100644 --- a/tags +++ b/tags @@ -443,7 +443,6 @@ FacilityType src/Dodge/Data/Scenario.hs 55;" t Faction src/Dodge/Data/Creature/State.hs 14;" t Factory src/Dodge/Data/Scenario.hs 56;" C FailedResource src/Dodge/Data/Scenario.hs 37;" t -FallingBlock src/Dodge/Data/Prop.hs 57;" C FetchItem src/Dodge/Data/Scenario.hs 11;" C FireSpark src/Dodge/Data/Spark.hs 22;" C Fixated src/Dodge/Data/Creature/Perception.hs 62;" C @@ -1059,7 +1058,6 @@ PropFallSmallBounceDamage src/Dodge/Data/Prop.hs 73;" C PropLampCover src/Dodge/Data/Prop.hs 66;" C PropRotate src/Dodge/Data/Prop.hs 76;" C PropSetToggleAnd src/Dodge/Data/Prop.hs 77;" C -PropType src/Dodge/Data/Prop.hs 57;" t PropUpdate src/Dodge/Data/Prop.hs 71;" t PropUpdateAnd src/Dodge/Data/Prop.hs 72;" C PropUpdateId src/Dodge/Data/Prop.hs 75;" C @@ -1588,7 +1586,7 @@ _avatarMaterial src/Dodge/Data/Creature/Misc.hs 63;" f _avatarPulse src/Dodge/Data/Creature/Misc.hs 62;" f _barrelShader src/Data/Preload/Render.hs 23;" f _barrelType src/Dodge/Data/Creature/Misc.hs 73;" f -_bdMaterial src/Dodge/Data/Prop.hs 47;" f +_bdColor src/Dodge/Data/Prop.hs 47;" f _bdMaxX src/Dodge/Data/Bounds.hs 14;" f _bdMaxY src/Dodge/Data/Bounds.hs 16;" f _bdMinX src/Dodge/Data/Bounds.hs 13;" f @@ -2773,7 +2771,7 @@ baseAMRShape src/Dodge/Item/Draw/SPic.hs 418;" f baseBlockPane src/Dodge/Placement/Instance/Wall.hs 86;" f baseCI src/Dodge/Item/Grammar.hs 157;" f baseCaneShape src/Dodge/Item/Draw/SPic.hs 335;" f -baseDebris src/Dodge/Block/Debris.hs 122;" f +baseDebris src/Dodge/Block/Debris.hs 88;" f baseFloorTileSize src/Tile.hs 45;" f baseItemTriggerType src/Dodge/BaseTriggerType.hs 21;" f baseRifleShape src/Dodge/Item/Draw/SPic.hs 338;" f @@ -2936,7 +2934,7 @@ circleSolid src/Picture/Base.hs 164;" f circleSolidCol src/Picture/Base.hs 168;" f clAlt src/Dodge/Cloud.hs 5;" f clClSpringVel src/Dodge/Update.hs 871;" f -clColor src/Shader/Poke/Cloud.hs 36;" f +clColor src/Shader/Poke/Cloud.hs 35;" f clZoneSize src/Dodge/Zoning/Cloud.hs 21;" f clampPath src/Dodge/Room/Procedural.hs 166;" f clang1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 560;" f @@ -3116,9 +3114,9 @@ crsNearCirc src/Dodge/Zoning/Creature.hs 35;" f crsNearPoint src/Dodge/Zoning/Creature.hs 17;" f crsNearRect src/Dodge/Zoning/Creature.hs 38;" f crsNearSeg src/Dodge/Zoning/Creature.hs 23;" f -crystalDebris src/Dodge/Block/Debris.hs 175;" f +crystalDebris src/Dodge/Block/Debris.hs 141;" f crystalLine src/Dodge/Placement/Instance/Wall.hs 55;" f -cubeShape src/Dodge/Block/Debris.hs 195;" f +cubeShape src/Dodge/Block/Debris.hs 161;" f cullPoint src/Dodge/Render/ShapePicture.hs 88;" f cullPretty src/AesonHelp.hs 14;" f cutPoly src/Dodge/LevelGen/StaticWalls.hs 77;" f @@ -3172,8 +3170,8 @@ deadRot src/Dodge/Creature/Picture.hs 81;" f deadScalp src/Dodge/Creature/Picture.hs 78;" f deadUpperBody src/Dodge/Creature/Picture.hs 122;" f debrisS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 684;" f -debrisSPic src/Dodge/Prop/Draw.hs 21;" f -debrisSize src/Dodge/Block/Debris.hs 111;" f +debrisSPic src/Dodge/Prop/Draw.hs 20;" f +debrisSize src/Dodge/Block/Debris.hs 77;" f debugDraw src/Dodge/Debug/Picture.hs 154;" f debugDraw' src/Dodge/Debug/Picture.hs 165;" f debugEvent src/Dodge/Debug.hs 26;" f @@ -3281,8 +3279,8 @@ difference src/Geometry.hs 128;" f digitalLine src/Geometry.hs 288;" f digitalRect src/Geometry.hs 305;" f dim src/Color.hs 112;" f -dirtColor src/Dodge/Block/Debris.hs 159;" f -dirtDebris src/Dodge/Block/Debris.hs 153;" f +dirtColor src/Dodge/Block/Debris.hs 125;" f +dirtDebris src/Dodge/Block/Debris.hs 119;" f dirtPoly src/Dodge/Room/RoadBlock.hs 74;" f disconnectItemS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 650;" f disconnectTerminal src/Dodge/Terminal.hs 217;" f @@ -3425,7 +3423,7 @@ drawCrossCol src/Dodge/Render/Label.hs 21;" f drawCursorAt src/Dodge/Render/List.hs 71;" f drawDDATest src/Dodge/Debug/Picture.hs 291;" f drawDoorPaths src/Dodge/Debug/Picture.hs 252;" f -drawDoubleLampCover src/Dodge/Prop/Draw.hs 96;" f +drawDoubleLampCover src/Dodge/Prop/Draw.hs 95;" f drawDrag src/Dodge/Render/Picture.hs 183;" f drawDragDrop src/Dodge/Render/Picture.hs 204;" f drawDragPickup src/Dodge/Render/Picture.hs 213;" f @@ -3443,7 +3441,7 @@ drawFlamelet src/Dodge/EnergyBall/Draw.hs 35;" f drawFooterText src/Dodge/Render/MenuScreen.hs 72;" f drawForceField src/Dodge/Wall/Draw.hs 11;" f drawGapPlus src/Dodge/Render/Picture.hs 255;" f -drawGib src/Dodge/Prop/Draw.hs 40;" f +drawGib src/Dodge/Prop/Draw.hs 39;" f drawHUD src/Dodge/Render/HUD.hs 49;" f drawInputMenu src/Dodge/Render/MenuScreen.hs 22;" f drawInspectWall src/Dodge/Debug/Picture.hs 244;" f @@ -3453,7 +3451,7 @@ drawItemChildrenConnect src/Dodge/Render/HUD.hs 326;" f drawItemConnections src/Dodge/Render/HUD.hs 316;" f drawJumpDown src/Dodge/Render/Picture.hs 175;" f drawLabCrossCol src/Dodge/Render/Label.hs 8;" f -drawLampCover src/Dodge/Prop/Draw.hs 56;" f +drawLampCover src/Dodge/Prop/Draw.hs 55;" f drawLaser src/Dodge/Laser/Update.hs 29;" f drawLightSource src/Dodge/LightSource/Draw.hs 7;" f drawLinearShockwave src/Dodge/LinearShockwave/Draw.hs 10;" f @@ -3471,8 +3469,8 @@ drawMenuScreen src/Dodge/Render/MenuScreen.hs 16;" f drawMouseCursor src/Dodge/Render/Picture.hs 79;" f drawMouseOver src/Dodge/Render/HUD.hs 104;" f drawMousePosition src/Dodge/Debug/Picture.hs 354;" f -drawMovingShape src/Dodge/Prop/Draw.hs 82;" f -drawMovingShapeCol src/Dodge/Prop/Draw.hs 88;" f +drawMovingShape src/Dodge/Prop/Draw.hs 81;" f +drawMovingShapeCol src/Dodge/Prop/Draw.hs 87;" f drawOptions src/Dodge/Render/MenuScreen.hs 36;" f drawPathBetween src/Dodge/Debug/Picture.hs 200;" f drawPathEdge src/Dodge/Debug/Picture.hs 257;" f @@ -3480,7 +3478,7 @@ drawPathing src/Dodge/Debug/Picture.hs 427;" f drawPlus src/Dodge/Render/Picture.hs 144;" f drawPointLabel src/Dodge/Render/Label.hs 13;" f drawProjectile src/Dodge/Projectile/Draw.hs 13;" f -drawProp src/Dodge/Prop/Draw.hs 27;" f +drawProp src/Dodge/Prop/Draw.hs 26;" f drawPulseBall src/Dodge/Render/ShapePicture.hs 51;" f drawRBOptions src/Dodge/Render/HUD.hs 249;" f drawRadarSweep src/Dodge/RadarSweep/Draw.hs 14;" f @@ -3513,7 +3511,7 @@ drawTitleBackground src/Dodge/Render/List.hs 44;" f drawTractorBeam src/Dodge/TractorBeam/Draw.hs 7;" f drawTurret src/Dodge/Machine/Draw.hs 65;" f drawVerticalDoubleArrow src/Dodge/Render/Picture.hs 195;" f -drawVerticalLampCover src/Dodge/Prop/Draw.hs 72;" f +drawVerticalLampCover src/Dodge/Prop/Draw.hs 71;" f drawWall src/Dodge/Wall/Draw.hs 7;" f drawWallFace src/Dodge/Debug/Picture.hs 73;" f drawWallSearchRays src/Dodge/Debug/Picture.hs 300;" f @@ -3547,7 +3545,7 @@ dtToLRAdjEither src/Dodge/DoubleTree.hs 180;" f dtToRootIntMap' src/Dodge/DoubleTree.hs 153;" f dtToUpDownAdj src/Dodge/DoubleTree.hs 158;" f dummyMenuOption src/Dodge/Menu/Option.hs 74;" f -dustColor src/Shader/Poke/Cloud.hs 72;" f +dustColor src/Shader/Poke/Cloud.hs 71;" f dustSpringVel src/Dodge/Update.hs 882;" f ebColor src/Dodge/EnergyBall.hs 94;" f ebDamage src/Dodge/EnergyBall.hs 102;" f @@ -3773,7 +3771,7 @@ girderV src/Dodge/Room/Foreground.hs 182;" f girderV' src/Dodge/Room/Foreground.hs 157;" f girderZ src/Dodge/Room/Foreground.hs 108;" f glNamedBufferSubDataH src/Shader/Bind.hs 53;" f -glassDebris src/Dodge/Block/Debris.hs 168;" f +glassDebris src/Dodge/Block/Debris.hs 134;" f glassLesson src/Dodge/Room/GlassLesson.hs 23;" f glassLessonRunPast src/Dodge/Room/GlassLesson.hs 68;" f glassShat1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 648;" f @@ -4051,7 +4049,7 @@ itmEquipSiteInfo src/Dodge/Item/Info.hs 251;" f itmSpaceInfo src/Dodge/Item/Info.hs 25;" f itmUsageInfo src/Dodge/Item/Info.hs 231;" f jShape src/Dodge/Placement/Instance/LightSource.hs 85;" f -jaggedShape src/Dodge/Block/Debris.hs 190;" f +jaggedShape src/Dodge/Block/Debris.hs 156;" f joinItemsInList src/Dodge/Item/Grammar.hs 205;" f joystick src/Dodge/Item/Scope.hs 149;" f jps0' src/Dodge/LevelGen/PlacementHelper.hs 60;" f @@ -4202,7 +4200,7 @@ main test/Spec.hs 12;" f makeArc src/Picture/Base.hs 157;" f makeAttach src/Dodge/Item/Attach.hs 10;" f makeBlip src/Dodge/RadarSweep.hs 69;" f -makeBlockDebris src/Dodge/Block/Debris.hs 28;" f +makeBlockDebris src/Dodge/Block/Debris.hs 34;" f makeBoolOption src/Dodge/Menu/OptionType.hs 8;" f makeBullet src/Dodge/HeldUse.hs 1035;" f makeButton src/Dodge/LevelGen/Switch.hs 16;" f @@ -4211,12 +4209,10 @@ makeCloudAt src/Dodge/WorldEvent/Cloud.hs 7;" f makeColorTermLine src/Dodge/Terminal.hs 129;" f makeColorTermPara src/Dodge/Terminal.hs 126;" f makeCorpse src/Dodge/Corpse/Make.hs 13;" f -makeDebris src/Dodge/Block/Debris.hs 42;" f -makeDebrisDirected src/Dodge/Block/Debris.hs 79;" f -makeDebrisDirectedHeight src/Dodge/Block/Debris.hs 45;" f -makeDebrisToHeight src/Dodge/Block/Debris.hs 39;" f +makeDebris src/Dodge/Block/Debris.hs 45;" f +makeDebrisDirected src/Dodge/Block/Debris.hs 48;" f makeDefaultCorpse src/Dodge/Corpse/Make.hs 16;" f -makeDoorDebris src/Dodge/Block/Debris.hs 18;" f +makeDoorDebris src/Dodge/Block/Debris.hs 24;" f makeDustAt src/Dodge/WorldEvent/Cloud.hs 17;" f makeEnumOption src/Dodge/Menu/OptionType.hs 13;" f makeExplosionAt src/Dodge/WorldEvent/Explosion.hs 71;" f @@ -4256,7 +4252,7 @@ makeTileFromPoly src/Tile.hs 34;" f makeTypeCraft src/Dodge/Item/Craftable.hs 18;" f makeTypeCraftNum src/Dodge/Item/Craftable.hs 12;" f mapper src/Dodge/Item/Scope.hs 70;" f -materialColor src/Dodge/Material/Color.hs 7;" f +materialColor src/Dodge/Material/Color.hs 8;" f maxAmmo src/Dodge/Item/MaxAmmo.hs 6;" f maxDamageType src/Dodge/Damage.hs 58;" f maxInvSlots src/Dodge/Inventory/CheckSlots.hs 27;" f @@ -4312,7 +4308,7 @@ metal4S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 636;" f metal5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 652;" f metal6S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 692;" f metal7S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 536;" f -metalDebris src/Dodge/Block/Debris.hs 162;" f +metalDebris src/Dodge/Block/Debris.hs 128;" f metalPlate src/Dodge/Item/Craftable.hs 35;" f mglCreate src/GLHelp.hs 8;" f mglDelete src/GLHelp.hs 14;" f @@ -4592,16 +4588,16 @@ pokeBox src/Shader/Poke.hs 227;" f pokeBoxSurface src/Shader/Poke.hs 262;" f pokeChasm src/Shader/Poke/Floor.hs 24;" f pokeChasmVerx src/Shader/Poke/Floor.hs 28;" f -pokeCloud src/Shader/Poke/Cloud.hs 15;" f -pokeCloudFloat src/Shader/Poke/Cloud.hs 43;" f -pokeCloudIndex src/Shader/Poke/Cloud.hs 47;" f -pokeCloudVerx src/Shader/Poke/Cloud.hs 21;" f +pokeCloud src/Shader/Poke/Cloud.hs 14;" f +pokeCloudFloat src/Shader/Poke/Cloud.hs 42;" f +pokeCloudIndex src/Shader/Poke/Cloud.hs 46;" f +pokeCloudVerx src/Shader/Poke/Cloud.hs 20;" f pokeCylinder src/Shader/Poke.hs 172;" f pokeCylinderCaps src/Shader/Poke.hs 215;" f -pokeDust src/Shader/Poke/Cloud.hs 51;" f -pokeDustFloat src/Shader/Poke/Cloud.hs 75;" f -pokeDustIndex src/Shader/Poke/Cloud.hs 79;" f -pokeDustVerx src/Shader/Poke/Cloud.hs 57;" f +pokeDust src/Shader/Poke/Cloud.hs 50;" f +pokeDustFloat src/Shader/Poke/Cloud.hs 74;" f +pokeDustIndex src/Shader/Poke/Cloud.hs 78;" f +pokeDustVerx src/Shader/Poke/Cloud.hs 56;" f pokeF src/Shader/Poke.hs 67;" f pokeFlatV src/Shader/Poke.hs 455;" f pokeFloors src/Shader/Poke.hs 61;" f @@ -4674,9 +4670,9 @@ prismBox src/Shape.hs 73;" f prismPoly src/Shape.hs 59;" f projV src/Geometry/Vector.hs 182;" f projV3 src/Geometry/Vector3D.hs 127;" f -propDrawToggle src/Dodge/Prop/Draw.hs 51;" f +propDrawToggle src/Dodge/Prop/Draw.hs 50;" f propLSThen src/Dodge/Placement/Instance/LightSource.hs 16;" f -propSPic src/Dodge/Prop/Draw.hs 18;" f +propSPic src/Dodge/Prop/Draw.hs 17;" f propSetToggleAnd src/Dodge/Prop/Update.hs 41;" f propUpdateIf src/Dodge/Prop/Update.hs 25;" f propUpdatePosition src/Dodge/Prop/Update.hs 30;" f @@ -5053,7 +5049,7 @@ shapeBounds src/Dodge/Room/Foreground.hs 148;" f shapePoints src/Dodge/Room/Foreground.hs 145;" f shapeVerxAttributes src/Shape/Parameters.hs 13;" f shapeVerxSize src/Shape/Parameters.hs 10;" f -shardShape src/Dodge/Block/Debris.hs 180;" f +shardShape src/Dodge/Block/Debris.hs 146;" f shatterGun src/Dodge/Item/Held/Weapons.hs 8;" f shatterGunSPic src/Dodge/Item/Draw/SPic.hs 324;" f shatterWall src/Dodge/Item/Weapon/Shatter.hs 26;" f @@ -5239,7 +5235,7 @@ stone2S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 662;" f stone3S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 572;" f stone4S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 484;" f stone5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 626;" f -stoneDebris src/Dodge/Block/Debris.hs 137;" f +stoneDebris src/Dodge/Block/Debris.hs 103;" f stopAllSounds src/Sound.hs 125;" f stopBulletAt src/Dodge/Bullet.hs 198;" f stopPushing src/Dodge/Block.hs 105;" f