Make laser fire above corpses

This commit is contained in:
2025-11-21 12:02:14 +00:00
parent 8bc2d6961f
commit dc1dca8aa0
3 changed files with 9 additions and 13 deletions
+4 -1
View File
@@ -5,6 +5,7 @@ module Dodge.Item.Weapon.LaserPath (
reflectPulseLaserAlong,
) where
import ListHelp
import Data.Bifunctor
import Data.Tuple
import Dodge.Base.Wall
@@ -19,7 +20,7 @@ import Linear
reflectLaserAlong ::
Float -> Point2 -> Point2 -> World -> (Maybe (Point2, Either Creature Wall), [Point2])
{-# INLINE reflectLaserAlong #-}
reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed sp ep w of
reflectLaserAlong phasev sp ep w = case safeHead $ filter g $ thingsHitZ 20 sp ep w of
Just (p, Right wl)
| Metal <- wl ^. wlMaterial ->
f
@@ -32,6 +33,8 @@ reflectLaserAlong phasev sp ep w = case thingHitFilt (const True) _wlUnshadowed
Nothing -> (Nothing, [ep])
where
f p a b = reflectLaserAlong phasev a b w & _2 .:~ p
g (_,Right wl) = wl ^. wlUnshadowed
g _ = True
refract :: Float -> Point2 -> Point2 -> Wall -> Point2 -> Point2
{-# INLINE refract #-}
-7
View File
@@ -359,7 +359,6 @@ doDrawing' win pdata u = do
glDrawArrays GL_TRIANGLES 0 6
rs' -> do
let rs = take 15 rs'
--glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fbo2 . _1 . unFBO)
glBindFramebuffer GL_FRAMEBUFFER 0
withArray (concatMap rdToVec2s rs) $
glNamedBufferSubData (pdata ^. barrelShader . _2 . vboName) 0
@@ -368,20 +367,14 @@ doDrawing' win pdata u = do
glUseProgram (pdata ^. barrelShader . _1)
glUniform1i 0 (fromIntegral (length rs))
glDrawArrays GL_TRIANGLES 0 6
-- glBindTextureUnit 0 $ pdata ^. fbo2 . _2 . unTO
-- glBindFramebuffer GL_FRAMEBUFFER 0
-- glUseProgram (pdata ^. fullscreenShader)
-- glDrawArrays GL_TRIANGLES 0 6
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
-- draw the overlay
--glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboOverlay ._1 . unFBO)
glDepthFunc GL_ALWAYS
glDepthMask GL_FALSE
glEnable GL_BLEND
--glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA -- assume premultiplied alpha
renderLayer DebugLayer shadV pokeCounts
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig)) $
glNamedBufferSubData (pdata ^. matUBO) 0 64
glDepthFunc GL_GEQUAL
+5 -5
View File
@@ -412,8 +412,8 @@ tutorialMessage1 i =
, makeTermLine " [D] TO MOVE"
, makeTermLine "--------------------------------------------"
]
<> tlSetStatus (TerminalPressTo "CONTINUE")
<> [ makeTermLine "AFTER EXITING THIS TERMINAL YOUR INVENTORY"
, makeTermLine " AND NEARBY OBJECTS WILL BE DISPLAYED"
, makeTermLine "--------------------------------------------"
]
-- <> tlSetStatus (TerminalPressTo "CONTINUE")
-- <> [ makeTermLine "AFTER EXITING THIS TERMINAL YOUR INVENTORY"
-- , makeTermLine " AND NEARBY OBJECTS WILL BE DISPLAYED"
-- , makeTermLine "--------------------------------------------"
-- ]