From 7d96616b914ecf5c355e5261b61620f3574bb76c Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 25 Mar 2023 17:56:20 +0000 Subject: [PATCH] Fix some shapes --- shader/lighting/cap.geom | 2 +- src/Dodge/Block/Draw.hs | 10 ++++------ src/Dodge/Machine/Draw.hs | 19 +++++++++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/shader/lighting/cap.geom b/shader/lighting/cap.geom index eb0e6432d..2e7007085 100644 --- a/shader/lighting/cap.geom +++ b/shader/lighting/cap.geom @@ -4,7 +4,7 @@ layout (triangle_strip, max_vertices = 3) out; layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ; layout(location=0)uniform vec3 lightPos; in float drawbit[]; -// this code is duplicated in lineShadow.geom, should not be changed on its own +// the following code is duplicated in lineShadow.geom, should not be changed on its own vec4 projNear (vec4 pos) { // note we project to a specific height diff --git a/src/Dodge/Block/Draw.hs b/src/Dodge/Block/Draw.hs index d04f4f91f..55d488e71 100644 --- a/src/Dodge/Block/Draw.hs +++ b/src/Dodge/Block/Draw.hs @@ -1,13 +1,13 @@ -module Dodge.Block.Draw - where -import Shape +module Dodge.Block.Draw (drawBlock) where + import Dodge.Data.Block +import Shape import ShapePicture drawBlock :: BlockDraw -> Block -> SPic drawBlock bd = case bd of BlockDrawMempty -> const mempty - BlockDraws bds -> \bl -> foldMap (`drawBlock` bl) bds + BlockDraws bds -> \bl -> foldMap (`drawBlock` bl) bds BlockDrawColHeightPoss col h ps -> const $ noPic $ colorSH col (upperBox Medium Typical h ps) BlockDrawBlSh x -> noPic . doBlSh x @@ -15,5 +15,3 @@ doBlSh :: BlSh -> Block -> Shape doBlSh bs = case bs of BlShMempty -> const mempty BlShConst sh -> const sh - - diff --git a/src/Dodge/Machine/Draw.hs b/src/Dodge/Machine/Draw.hs index 9ff557101..5448b55ac 100644 --- a/src/Dodge/Machine/Draw.hs +++ b/src/Dodge/Machine/Draw.hs @@ -28,13 +28,17 @@ terminalShape :: Machine -> Shape terminalShape mc = colorSH col - ( prismBox Medium Typical + ( prismBox + Medium + Typical [V3 10 10 20, V3 (-10) 10 20, V3 (-10) (-10) 10, V3 10 (-10) 10] - [V3 10 10 0, V3 (-10) 10 0, V3 (-10) (-10) 0, V3 10 (-10) 0] + (addZ 0 `map` rectWH 10 10) ) <> colorSH black - ( prismBox Small Superfluous + ( prismBox + Small + Superfluous [V3 8 8 20, V3 (-8) 8 20, V3 0 (-8) 10] [V3 8 8 19, V3 (-8) 8 19, V3 0 (-8) 9] --[V3 8 8 20, V3 (-8) 8 20, V3 (-8) (-8) 10, V3 8 (-8) 10] @@ -45,9 +49,12 @@ terminalShape mc = drawBaseMachine :: Float -> Machine -> SPic drawBaseMachine h mc = - ( colorSH (_mcColor mc) $ upperBox Medium Typical h (reverse $ square (_mcWidth mc)) - , mempty - ) + noPic + . colorSH (_mcColor mc) + . upperBox Medium Typical h + . square + $ _mcWidth mc + drawTurret :: Turret -> Machine -> SPic drawTurret tu mc = overPosSP (turretItemOffset it tu mc) (itemSPic it) where