summaryrefslogtreecommitdiffstats
path: root/src/Render.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Render.hs')
-rw-r--r--src/Render.hs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Render.hs b/src/Render.hs
index 82ad08e..356310f 100644
--- a/src/Render.hs
+++ b/src/Render.hs
@@ -92,13 +92,6 @@ setup = do
(lw, lh) <- gets (level . gameState) >>= \l -> return (fromIntegral . levelWidth $ l :: GLfloat, fromIntegral . levelHeight $ l :: GLfloat)
liftIO $ do
- matrixMode $= Projection
- scale 1 1 (0.1 :: GLfloat)
- translate $ Vector3 (lw/2) (lh/2) 0
- rotate (-30) $ Vector3 1 0 (0 :: GLfloat)
- translate $ Vector3 (-lw/2) (-lh/2) 0
- matrixMode $= Modelview 0
-
blend $= Enabled
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
depthFunc $= Just Lequal
@@ -144,6 +137,8 @@ render = do
liftIO $ do
clear [ColorBuffer, DepthBuffer]
+ depthFunc $= Just Lequal
+
texture Texture2D $= Enabled
textureBinding Texture2D $= Just textureWood
@@ -224,23 +219,26 @@ render = do
y = realToFrac . bulletY $ bullet
rotDir = realToFrac . bulletDir $ bullet
- translate $ Vector3 x y (0 :: GLfloat)
+ translate $ Vector3 x y (0.1 :: GLfloat)
+ rotate 30 $ Vector3 1 0 (0 :: GLfloat)
rotate rotDir $ Vector3 0 0 (1 :: GLfloat)
textureBinding Texture2D $= Just textureBullet
unsafeRenderPrimitive Quads $ do
texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex3 (-0.1 :: GLfloat) (-0.1 :: GLfloat) 0.01
+ vertex $ Vertex3 (-0.1 :: GLfloat) (-0.1 :: GLfloat) 0
texCoord $ TexCoord2 (0 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex3 (-0.1 :: GLfloat) (0.1 :: GLfloat) 0.01
+ vertex $ Vertex3 (-0.1 :: GLfloat) (0.1 :: GLfloat) 0
texCoord $ TexCoord2 (1 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex3 (0.1 :: GLfloat) (0.1 :: GLfloat) 0.01
+ vertex $ Vertex3 (0.1 :: GLfloat) (0.1 :: GLfloat) 0
texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex3 (0.1 :: GLfloat) (-0.1 :: GLfloat) 0.01
+ vertex $ Vertex3 (0.1 :: GLfloat) (-0.1 :: GLfloat) 0
+
+ depthFunc $= Just Always
textureBinding Texture2D $= Just textureCrosshair
forM_ playerlist renderPlayer