Fix inherited tile positioning
This commit is contained in:
+3
-2
@@ -17,11 +17,12 @@ data Tile = Tile
|
||||
{ _tilePoly :: [Point2]
|
||||
, -- | point in the world where tile texture is 0,0
|
||||
_tileZero :: Point2
|
||||
, -- | world position one along in the X direction, note this also set the scale of the
|
||||
-- texture
|
||||
, -- | world position one along in the X direction
|
||||
-- note this also sets the scale of the texture
|
||||
-- this has to be a position because it is shifted
|
||||
_tileTangentPos :: Point2
|
||||
, _tileArrayZ :: Float
|
||||
, _tileZeroShift :: Maybe Point2A
|
||||
}
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
|
||||
+9
-3
@@ -73,9 +73,15 @@ setTile r gw = case _rmFloor r of
|
||||
InheritFloor ->
|
||||
gw & genRooms . ix (fromJust (_rmMID r)) . rmFloor .~ Tiled [t & tilePoly .~ poly]
|
||||
where
|
||||
t = case _rmMParent r of
|
||||
Nothing -> Tile poly (V2 0 0) (V2 1 0) 16
|
||||
Just pid -> head $ _tiles $ _rmFloor $ _genRooms gw IM.! pid
|
||||
t = fromMaybe (Tile poly (V2 0 0) (V2 1 0) 16 Nothing) $ do
|
||||
pid <- r ^. rmMParent
|
||||
rm <- gw ^? genRooms . ix pid
|
||||
(gw ^? genRooms . ix pid . rmFloor . tiles . ix 0)
|
||||
<&> tileZeroShift ?~ _rmShift rm
|
||||
|
||||
-- t = case _rmMParent r of
|
||||
-- Nothing -> Tile poly (V2 0 0) (V2 1 0) 16
|
||||
-- Just pid -> head $ _tiles $ _rmFloor $ _genRooms gw IM.! pid
|
||||
poly =
|
||||
orderPolygon
|
||||
. convexHullSafe
|
||||
|
||||
+16
-6
@@ -42,14 +42,24 @@ shiftRoomBy shift r =
|
||||
& rmPath %~ S.map (shiftPathBy shift)
|
||||
& rmBound %~ fmap (map (shiftPointBy shift))
|
||||
& rmShift %~ shiftPosDirBy shift
|
||||
& rmFloor . tiles
|
||||
%~ map
|
||||
( (tilePoly %~ map (shiftPointBy shift))
|
||||
. (tileZero %~ shiftPointBy shift)
|
||||
. (tileTangentPos %~ shiftPointBy shift)
|
||||
)
|
||||
& rmFloor . tiles . each %~ shiftTile shift
|
||||
-- %~ map
|
||||
-- ( (tilePoly %~ map (shiftPointBy shift))
|
||||
-- . (tileZero %~ shiftPointBy shift)
|
||||
-- . (tileTangentPos %~ shiftPointBy shift)
|
||||
-- )
|
||||
& rmViewpoints %~ map (shiftPointBy shift)
|
||||
|
||||
shiftTile :: Point2A -> Tile -> Tile
|
||||
shiftTile shift tl = case tl ^. tileZeroShift of
|
||||
Nothing -> tl & tilePoly . each %~ shiftPointBy shift
|
||||
& tileZero %~ shiftPointBy shift
|
||||
& tileTangentPos %~ shiftPointBy shift
|
||||
Just s -> tl & tilePoly . each %~ shiftPointBy shift
|
||||
& tileZero %~ shiftPointBy s
|
||||
& tileTangentPos %~ shiftPointBy s
|
||||
|
||||
|
||||
moveRoomBy :: (Point2, Float) -> Room -> Room
|
||||
moveRoomBy shift r =
|
||||
r
|
||||
|
||||
@@ -56,6 +56,7 @@ roomRect x y xn yn =
|
||||
, _tileZero = 0
|
||||
, _tileTangentPos = V2 baseFloorTileSize 0
|
||||
, _tileArrayZ = 16
|
||||
, _tileZeroShift = Nothing
|
||||
}
|
||||
]
|
||||
, _rmRandPSs = [psRandRanges (10, x -10) (10, y -10) (0, 2 * pi)]
|
||||
|
||||
@@ -38,6 +38,7 @@ makeTileFromPoly poly z =
|
||||
, _tileZero = c
|
||||
, _tileTangentPos = c + (baseFloorTileSize *.* normalizeV (d -.- c))
|
||||
, _tileArrayZ = z
|
||||
, _tileZeroShift = Nothing
|
||||
}
|
||||
where
|
||||
(c : d : _) = poly
|
||||
|
||||
@@ -2379,6 +2379,7 @@ _tileArrayZ src/Data/Tile.hs 24;" f
|
||||
_tilePoly src/Data/Tile.hs 17;" f
|
||||
_tileTangentPos src/Data/Tile.hs 23;" f
|
||||
_tileZero src/Data/Tile.hs 19;" f
|
||||
_tileZeroShift src/Data/Tile.hs 25;" f
|
||||
_tiles src/Data/Tile.hs 14;" f
|
||||
_timeFlow src/Dodge/Data/World.hs 38;" f
|
||||
_timeFlowCharge src/Dodge/Data/World.hs 83;" f
|
||||
@@ -2691,7 +2692,7 @@ barrelShape src/Dodge/Render/ShapePicture.hs 121;" f
|
||||
baseAMRShape src/Dodge/Item/Draw/SPic.hs 410;" f
|
||||
baseBlockPane src/Dodge/Placement/Instance/Wall.hs 76;" f
|
||||
baseCI src/Dodge/Item/Grammar.hs 165;" f
|
||||
baseFloorTileSize src/Tile.hs 45;" f
|
||||
baseFloorTileSize src/Tile.hs 46;" f
|
||||
baseItemTriggerType src/Dodge/BaseTriggerType.hs 21;" f
|
||||
baseRifleShape src/Dodge/Item/Draw/SPic.hs 324;" f
|
||||
baseRodShape src/Dodge/Item/Draw/SPic.hs 407;" f
|
||||
@@ -2805,7 +2806,7 @@ ceilingTo src/Geometry/Zone.hs 15;" f
|
||||
cenLasTur src/Dodge/Room/LasTurret.hs 52;" f
|
||||
centerText src/Picture/Base.hs 176;" f
|
||||
centerVaultExplosiveExit src/Dodge/Room/NoNeedWeapon.hs 20;" f
|
||||
centerVaultRoom src/Dodge/Room/Procedural.hs 270;" f
|
||||
centerVaultRoom src/Dodge/Room/Procedural.hs 271;" f
|
||||
centroid src/Geometry/Polygon.hs 192;" f
|
||||
centroidNum src/Geometry/Polygon.hs 195;" f
|
||||
chainPairs src/Geometry.hs 360;" f
|
||||
@@ -2864,7 +2865,7 @@ circleSolidCol src/Picture/Base.hs 160;" f
|
||||
clAlt src/Dodge/Cloud.hs 5;" f
|
||||
clColor src/Shader/Poke/Cloud.hs 39;" f
|
||||
clZoneSize src/Dodge/Zoning/Cloud.hs 24;" f
|
||||
clampPath src/Dodge/Room/Procedural.hs 147;" f
|
||||
clampPath src/Dodge/Room/Procedural.hs 148;" f
|
||||
clang1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 817;" f
|
||||
clang2S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 733;" f
|
||||
clangS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 577;" f
|
||||
@@ -2915,11 +2916,11 @@ colorSH src/Shape.hs 234;" f
|
||||
combinationsOf src/Multiset.hs 46;" f
|
||||
combinationsTrie src/Dodge/Combine.hs 44;" f
|
||||
combineAwareness src/Dodge/Creature/Perception.hs 109;" f
|
||||
combineFloors src/Dodge/Room/Procedural.hs 153;" f
|
||||
combineFloors src/Dodge/Room/Procedural.hs 154;" f
|
||||
combineInventoryExtra src/Dodge/Render/HUD.hs 340;" f
|
||||
combineItemListYouX src/Dodge/Combine.hs 36;" f
|
||||
combineList src/Dodge/Combine.hs 21;" f
|
||||
combineRooms src/Dodge/Room/Procedural.hs 133;" f
|
||||
combineRooms src/Dodge/Room/Procedural.hs 134;" f
|
||||
combineS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 743;" f
|
||||
combineTree src/Dodge/Tree/Compose.hs 68;" f
|
||||
commandColor src/Dodge/Terminal.hs 127;" f
|
||||
@@ -3271,8 +3272,8 @@ doFloatFloat src/Dodge/FloatFunction.hs 5;" f
|
||||
doGenFloat src/Dodge/HeldUse.hs 1177;" f
|
||||
doGravityPU src/Dodge/Projectile/Update.hs 35;" f
|
||||
doHeldUseEffect src/Dodge/HeldUse.hs 379;" f
|
||||
doInPlacements src/Dodge/Layout.hs 89;" f
|
||||
doIndividualPlacements src/Dodge/Layout.hs 101;" f
|
||||
doInPlacements src/Dodge/Layout.hs 95;" f
|
||||
doIndividualPlacements src/Dodge/Layout.hs 107;" f
|
||||
doInputScreenInput src/Dodge/Update/Input/ScreenLayer.hs 38;" f
|
||||
doItemTimeScroll src/Dodge/Update.hs 228;" f
|
||||
doLoop src/Loop.hs 60;" f
|
||||
@@ -3284,7 +3285,7 @@ doQuickload src/Dodge/Save.hs 83;" f
|
||||
doQuicksave src/Dodge/Save.hs 77;" f
|
||||
doRandImpulse src/Dodge/RandImpulse.hs 8;" f
|
||||
doRegexInput src/Dodge/Update/Input/InGame.hs 423;" f
|
||||
doRoomPlacements src/Dodge/Layout.hs 104;" f
|
||||
doRoomPlacements src/Dodge/Layout.hs 110;" f
|
||||
doRoomShift src/Dodge/Room/Link.hs 33;" f
|
||||
doScopeZoom src/Dodge/Update/Scroll.hs 89;" f
|
||||
doSectionSize src/Dodge/DisplayInventory.hs 215;" f
|
||||
@@ -3618,9 +3619,9 @@ gLauncher src/Dodge/Item/Held/Launcher.hs 24;" f
|
||||
gRandify src/Dodge/Randify.hs 12;" f
|
||||
gadgetEffect src/Dodge/HeldUse.hs 50;" f
|
||||
gameOverMenu src/Dodge/Menu.hs 200;" f
|
||||
gameRoomFromRoom src/Dodge/Layout.hs 156;" f
|
||||
gameRoomFromRoom src/Dodge/Layout.hs 162;" f
|
||||
gameRoomViewpoints src/Dodge/Viewpoints.hs 35;" f
|
||||
gameRoomsFromRooms src/Dodge/Layout.hs 153;" f
|
||||
gameRoomsFromRooms src/Dodge/Layout.hs 159;" f
|
||||
gameplayMenu src/Dodge/Menu.hs 152;" f
|
||||
gameplayMenuOptions src/Dodge/Menu.hs 155;" f
|
||||
gasEffect src/Dodge/Update.hs 881;" f
|
||||
@@ -3647,8 +3648,8 @@ getCloseObj src/Dodge/Update/Input/InGame.hs 509;" f
|
||||
getCommand src/Dodge/Terminal.hs 61;" f
|
||||
getCommands src/Dodge/Terminal.hs 58;" f
|
||||
getCrMoveSpeed src/Dodge/Creature/Statistics.hs 47;" f
|
||||
getCrsFromRooms src/Dodge/Room/Tutorial.hs 570;" f
|
||||
getCrsFromRooms' src/Dodge/Room/Tutorial.hs 557;" f
|
||||
getCrsFromRooms src/Dodge/Room/Tutorial.hs 571;" f
|
||||
getCrsFromRooms' src/Dodge/Room/Tutorial.hs 558;" f
|
||||
getDebugMouseOver src/Dodge/Update.hs 449;" f
|
||||
getDistortions src/Dodge/Render.hs 443;" f
|
||||
getEdgesCrossing src/Dodge/Path.hs 37;" f
|
||||
@@ -3665,13 +3666,13 @@ getPJStabiliser src/Dodge/HeldUse.hs 1271;" f
|
||||
getPretty src/AesonHelp.hs 8;" f
|
||||
getPromptTM src/Dodge/Terminal/Type.hs 3;" f
|
||||
getRoomFromID src/Dodge/Room/Modify.hs 31;" f
|
||||
getRoomsFromInts src/Dodge/Room/Tutorial.hs 553;" f
|
||||
getRoomsFromInts src/Dodge/Room/Tutorial.hs 554;" f
|
||||
getRootItemBounds src/Dodge/Render/HUD.hs 106;" f
|
||||
getRootItemInvID src/Dodge/Inventory/Location.hs 36;" f
|
||||
getSelectedCloseObj src/Dodge/SelectedClose.hs 14;" f
|
||||
getSmoothScrollValue src/Dodge/SmoothScroll.hs 21;" f
|
||||
getSplitString src/Dodge/Debug/Terminal.hs 129;" f
|
||||
getTiles src/Dodge/Layout.hs 207;" f
|
||||
getTiles src/Dodge/Layout.hs 213;" f
|
||||
getViewpoints src/Dodge/Viewpoints.hs 29;" f
|
||||
getVolleyBurst src/Dodge/HeldUse.hs 130;" f
|
||||
getWallPathing src/Dodge/Wall/Pathing.hs 7;" f
|
||||
@@ -3707,7 +3708,7 @@ greyN src/Color.hs 151;" f
|
||||
gridInPolygon src/Grid.hs 10;" f
|
||||
gridPoints' src/Grid.hs 37;" f
|
||||
gridPointsOff src/Grid.hs 32;" f
|
||||
gridRoomPos src/Dodge/Room/Procedural.hs 90;" f
|
||||
gridRoomPos src/Dodge/Room/Procedural.hs 91;" f
|
||||
groupSplitItemAmounts src/Dodge/Combine.hs 52;" f
|
||||
gruntS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 521;" f
|
||||
gut1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 849;" f
|
||||
@@ -4402,7 +4403,7 @@ pairsToSCC src/Dodge/Graph.hs 32;" f
|
||||
paletteToColor src/Color.hs 85;" f
|
||||
parseItem src/Dodge/Debug/Terminal.hs 62;" f
|
||||
parseNum src/Dodge/Debug/Terminal.hs 77;" f
|
||||
passthroughLockKeyLists src/Dodge/Room/Tutorial.hs 635;" f
|
||||
passthroughLockKeyLists src/Dodge/Room/Tutorial.hs 636;" f
|
||||
pathConnected src/Dodge/Room/CheckConsistency.hs 13;" f
|
||||
pathEdgeObstructed src/Dodge/Path.hs 66;" f
|
||||
pauseAndFloatCam src/Dodge/Camera.hs 10;" f
|
||||
@@ -4443,7 +4444,7 @@ plNew src/Dodge/Base/NewID.hs 19;" f
|
||||
plNewID src/Dodge/Base/NewID.hs 7;" f
|
||||
plNewUpID src/Dodge/Base/NewID.hs 13;" f
|
||||
plNewUsing src/Dodge/Base/NewID.hs 27;" f
|
||||
plPriority src/Dodge/Layout.hs 112;" f
|
||||
plPriority src/Dodge/Layout.hs 118;" f
|
||||
plRRpt src/Dodge/LevelGen/PlacementHelper.hs 33;" f
|
||||
placeChasm src/Dodge/Placement/PlaceSpot.hs 147;" f
|
||||
placePlainPSSpot src/Dodge/Placement/PlaceSpot.hs 40;" f
|
||||
@@ -4598,7 +4599,7 @@ putLitButOnPosExtTrig src/Dodge/Placement/Instance/Button.hs 97;" f
|
||||
putLitButOnPosExtTrig' src/Dodge/Placement/Instance/Button.hs 100;" f
|
||||
putMessageTerminal src/Dodge/Placement/Instance/Terminal.hs 58;" f
|
||||
putShape src/Dodge/Room/Foreground.hs 134;" f
|
||||
putSingleLight src/Dodge/Room/Tutorial.hs 453;" f
|
||||
putSingleLight src/Dodge/Room/Tutorial.hs 454;" f
|
||||
putSlideDr src/Dodge/Door/PutSlideDoor.hs 12;" f
|
||||
putStrLnAppend src/Dodge/LevelGen.hs 84;" f
|
||||
putTerminal src/Dodge/Placement/Instance/Terminal.hs 52;" f
|
||||
@@ -4613,8 +4614,8 @@ qToAng src/Quaternion.hs 69;" f
|
||||
qToV2 src/Quaternion.hs 66;" f
|
||||
qToV3 src/Quaternion.hs 63;" f
|
||||
qid src/Quaternion.hs 72;" f
|
||||
quarterRoomSquare src/Dodge/Room/Procedural.hs 194;" f
|
||||
quarterRoomTri src/Dodge/Room/Procedural.hs 158;" f
|
||||
quarterRoomSquare src/Dodge/Room/Procedural.hs 195;" f
|
||||
quarterRoomTri src/Dodge/Room/Procedural.hs 159;" f
|
||||
quitCommand src/Dodge/Terminal.hs 106;" f
|
||||
qz src/Quaternion.hs 81;" f
|
||||
rLauncher src/Dodge/Item/Held/Launcher.hs 14;" f
|
||||
@@ -4646,8 +4647,8 @@ randSparkExtraVel src/Dodge/Spark.hs 93;" f
|
||||
randWallReflect src/Dodge/Update.hs 728;" f
|
||||
randomChallenges src/Dodge/Room/Start.hs 64;" f
|
||||
randomCompass src/Dodge/Layout.hs 60;" f
|
||||
randomFourCornerRoom src/Dodge/Room/Procedural.hs 247;" f
|
||||
randomFourCornerRoomCrsIts src/Dodge/Room/Procedural.hs 259;" f
|
||||
randomFourCornerRoom src/Dodge/Room/Procedural.hs 248;" f
|
||||
randomFourCornerRoomCrsIts src/Dodge/Room/Procedural.hs 260;" f
|
||||
randomLightPositions src/Dodge/Room/Modify/Girder.hs 152;" f
|
||||
randomMediumRoom src/Dodge/Room/Boss.hs 70;" f
|
||||
randomPath src/TreeHelp.hs 147;" f
|
||||
@@ -4771,7 +4772,7 @@ roomPillarsContaining src/Dodge/Room/Containing.hs 39;" f
|
||||
roomPillarsPassage src/Dodge/Room/Pillar.hs 94;" f
|
||||
roomPillarsSquare src/Dodge/Room/Pillar.hs 50;" f
|
||||
roomRect src/Dodge/Room/Procedural.hs 42;" f
|
||||
roomRectAutoLights src/Dodge/Room/Procedural.hs 119;" f
|
||||
roomRectAutoLights src/Dodge/Room/Procedural.hs 120;" f
|
||||
roomShuriken src/Dodge/Room/Boss.hs 116;" f
|
||||
roomTwistCross src/Dodge/Room/Boss.hs 147;" f
|
||||
roomsContaining src/Dodge/Room/Containing.hs 20;" f
|
||||
@@ -4883,7 +4884,7 @@ sensorReqToString src/Dodge/Machine/Update.hs 240;" f
|
||||
sensorRoom src/Dodge/Room/SensorDoor.hs 27;" f
|
||||
sensorRoomRunPast src/Dodge/Room/SensorDoor.hs 59;" f
|
||||
sensorSPic src/Dodge/Machine/Draw.hs 97;" f
|
||||
sensorTut src/Dodge/Room/Tutorial.hs 579;" f
|
||||
sensorTut src/Dodge/Room/Tutorial.hs 580;" f
|
||||
sensorTypeDamages src/Dodge/Machine/Update.hs 286;" f
|
||||
sensorTypeDamages src/Dodge/Wall/Damage.hs 92;" f
|
||||
sentinelAI src/Dodge/Creature/SentinelAI.hs 20;" f
|
||||
@@ -4933,7 +4934,7 @@ setupFramebufferGivenStencil src/Framebuffer/Setup.hs 31;" f
|
||||
setupLoop src/Loop.hs 30;" f
|
||||
setupShadowFramebuffer src/Framebuffer/Setup.hs 24;" f
|
||||
setupVBO src/Shader/Compile.hs 37;" f
|
||||
setupWorldBounds src/Dodge/Layout.hs 119;" f
|
||||
setupWorldBounds src/Dodge/Layout.hs 125;" f
|
||||
sfInvColor src/Dodge/Item/InventoryColor.hs 12;" f
|
||||
shaderTypeExt src/Shader/Compile.hs 59;" f
|
||||
shapeBounds src/Dodge/Room/Foreground.hs 147;" f
|
||||
@@ -5004,7 +5005,7 @@ shrinkVert src/Geometry/Polygon.hs 202;" f
|
||||
shuffle src/RandomHelp.hs 68;" f
|
||||
shuffleLinks src/Dodge/Room/Link.hs 30;" f
|
||||
shufflePair src/RandomHelp.hs 166;" f
|
||||
shuffleRoomPos src/Dodge/Layout.hs 86;" f
|
||||
shuffleRoomPos src/Dodge/Layout.hs 92;" f
|
||||
shuffleTail src/RandomHelp.hs 78;" f
|
||||
sigmoid src/Dodge/Base.hs 151;" f
|
||||
simpleCrSprings src/Dodge/Update.hs 959;" f
|
||||
@@ -5256,7 +5257,7 @@ throb1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 801;" f
|
||||
throbC4S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 761;" f
|
||||
throwItem src/Dodge/Creature/Action.hs 191;" f
|
||||
tileTexCoords src/Tile.hs 11;" f
|
||||
tilesFromRooms src/Dodge/Layout.hs 204;" f
|
||||
tilesFromRooms src/Dodge/Layout.hs 210;" f
|
||||
tilesToLine src/Shader/AuxAddition.hs 66;" f
|
||||
timeFlowUpdate src/Dodge/Update.hs 203;" f
|
||||
timeScroller src/Dodge/Item/Held/Utility.hs 42;" f
|
||||
@@ -5375,11 +5376,11 @@ turnTo src/Dodge/Movement/Turn.hs 8;" f
|
||||
turretItemOffset src/Dodge/Item/HeldOffset.hs 23;" f
|
||||
tutAnoTree src/Dodge/Room/Tutorial.hs 53;" f
|
||||
tutDrop src/Dodge/Room/Tutorial.hs 101;" f
|
||||
tutHub src/Dodge/Room/Tutorial.hs 477;" f
|
||||
tutHub src/Dodge/Room/Tutorial.hs 478;" f
|
||||
tutLight src/Dodge/Room/Tutorial.hs 393;" f
|
||||
tutRezBox src/Dodge/Room/Tutorial.hs 590;" f
|
||||
tutRezBox src/Dodge/Room/Tutorial.hs 591;" f
|
||||
tutRoomTree src/Dodge/Floor.hs 20;" f
|
||||
tutorialMessage1 src/Dodge/Room/Tutorial.hs 615;" f
|
||||
tutorialMessage1 src/Dodge/Room/Tutorial.hs 616;" f
|
||||
tweenAngles src/Geometry/Vector.hs 192;" f
|
||||
twinSlowDoorChasers src/Dodge/Room/LongDoor.hs 83;" f
|
||||
twinSlowDoorRoom src/Dodge/Room/LongDoor.hs 39;" f
|
||||
@@ -5610,7 +5611,7 @@ wallBuffer src/Dodge/WallCreatureCollisions.hs 99;" f
|
||||
wallIsZeroLength src/Dodge/LevelGen/StaticWalls.hs 179;" f
|
||||
wallMovement src/Dodge/WallCreatureCollisions.hs 68;" f
|
||||
wallToSurface src/Dodge/Base/Collide.hs 182;" f
|
||||
wallsFromRooms src/Dodge/Layout.hs 141;" f
|
||||
wallsFromRooms src/Dodge/Layout.hs 147;" f
|
||||
wallsToDraw src/Dodge/Render/Walls.hs 18;" f
|
||||
warmupSound src/Dodge/HeldUse.hs 1396;" f
|
||||
warningRooms src/Dodge/Room/Warning.hs 34;" f
|
||||
|
||||
Reference in New Issue
Block a user