summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DefaultPlayer.hs4
-rw-r--r--src/HWiidPlayer.hs4
-rw-r--r--src/Render.hs2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/DefaultPlayer.hs b/src/DefaultPlayer.hs
index 7f97f39..e16502a 100644
--- a/src/DefaultPlayer.hs
+++ b/src/DefaultPlayer.hs
@@ -8,7 +8,7 @@ import qualified Data.Set as S
import Data.Fixed
import Data.Ratio ((%))
import Data.Typeable
-import Graphics.Rendering.OpenGL.GL (GLfloat, Vector3(..))
+import Graphics.Rendering.OpenGL.GL (GLfloat, Vector3(..), Vertex2(..))
import Graphics.Rendering.OpenGL.GL.BeginEnd (unsafeRenderPrimitive, PrimitiveMode(..))
import Graphics.Rendering.OpenGL.GL.CoordTrans (unsafePreservingMatrix, translate, rotate)
import Graphics.Rendering.OpenGL.GL.VertexSpec
@@ -41,7 +41,7 @@ instance Player DefaultPlayer where
| otherwise = DefaultPlayer keys aimx aimy shoot
renderPlayer (DefaultPlayer _ aimx aimy _) = unsafePreservingMatrix $ do
- translate $ Vector3 aimx aimy (0.2 :: GLfloat)
+ translate $ Vector3 (realToFrac aimx) (realToFrac aimy) (0.2 :: GLfloat)
rotate 30 $ Vector3 1 0 (0 :: GLfloat)
unsafeRenderPrimitive Quads $ do
diff --git a/src/HWiidPlayer.hs b/src/HWiidPlayer.hs
index db35871..04ea38e 100644
--- a/src/HWiidPlayer.hs
+++ b/src/HWiidPlayer.hs
@@ -12,7 +12,7 @@ import Data.Maybe
import Data.Ratio ((%))
import Data.Typeable
import HWiid
-import Graphics.Rendering.OpenGL.GL (GLfloat, Vector3(..))
+import Graphics.Rendering.OpenGL.GL (GLfloat, Vector3(..), Vertex2(..))
import Graphics.Rendering.OpenGL.GL.BeginEnd (unsafeRenderPrimitive, PrimitiveMode(..))
import Graphics.Rendering.OpenGL.GL.CoordTrans (unsafePreservingMatrix, translate, rotate)
import Graphics.Rendering.OpenGL.GL.VertexSpec
@@ -65,7 +65,7 @@ instance Player HWiidPlayer where
renderPlayer (HWiidPlayer _ _ aims) = unsafePreservingMatrix $ do
let (x, y) = mulV (1/(fromIntegral $ length aims)) $ foldr addV (0, 0) aims
- translate $ Vector3 x y (0.2 :: GLfloat)
+ translate $ Vector3 (realToFrac x) (realToFrac y) (0.2 :: GLfloat)
rotate 30 $ Vector3 1 0 (0 :: GLfloat)
unsafeRenderPrimitive Quads $ do
diff --git a/src/Render.hs b/src/Render.hs
index 5c961db..de61593 100644
--- a/src/Render.hs
+++ b/src/Render.hs
@@ -22,7 +22,7 @@ import qualified Data.Map as M
import Bindings.GLPng
-import Graphics.Rendering.OpenGL.GL (($=), GLfloat, GLdouble, Capability(..), Vector3(..))
+import Graphics.Rendering.OpenGL.GL (($=), GLfloat, GLdouble, Capability(..), Vector3(..), Vertex2(..), Vertex4(..))
import Graphics.Rendering.OpenGL.GL.BeginEnd (unsafeRenderPrimitive, PrimitiveMode(..))
import Graphics.Rendering.OpenGL.GL.CoordTrans
import Graphics.Rendering.OpenGL.GL.Colors