From c0d2d54ea1687a80ff76fa032ad4dc89670d2988 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 7 Apr 2010 13:28:38 +0200 Subject: Added Wiimote support --- src/Render.hs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/Render.hs') diff --git a/src/Render.hs b/src/Render.hs index a5f5ae9..839859e 100644 --- a/src/Render.hs +++ b/src/Render.hs @@ -100,10 +100,10 @@ render = do vertex $ Vertex2 (0 :: GLfloat) (0 :: GLfloat) forM_ tanklist $ \tank -> unsafePreservingMatrix $ do - let x = fromReal . tankX $ tank - y = fromReal . tankY $ tank - rotDir = fromReal . tankDir $ tank - rotAim = fromReal . tankAim $ tank + let x = realToFrac . tankX $ tank + y = realToFrac . tankY $ tank + rotDir = realToFrac . tankDir $ tank + rotAim = realToFrac . tankAim $ tank translate $ Vector3 x y (0 :: GLfloat) rotate rotDir $ Vector3 0 0 (1 :: GLfloat) @@ -141,9 +141,9 @@ render = do vertex $ Vertex2 (0.5 :: GLfloat) (-0.5 :: GLfloat) forM_ bulletlist $ \bullet -> unsafePreservingMatrix $ do - let x = fromReal . bulletX $ bullet - y = fromReal . bulletY $ bullet - rotDir = fromReal . bulletDir $ bullet + let x = realToFrac . bulletX $ bullet + y = realToFrac . bulletY $ bullet + rotDir = realToFrac . bulletDir $ bullet translate $ Vector3 x y (0 :: GLfloat) rotate rotDir $ Vector3 0 0 (1 :: GLfloat) @@ -162,7 +162,3 @@ render = do texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat) vertex $ Vertex2 (0.1 :: GLfloat) (-0.1 :: GLfloat) - - -fromReal :: (Real a, Fractional b) => a -> b -fromReal = fromRational . toRational \ No newline at end of file -- cgit v1.2.3