diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-01-03 15:31:53 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-01-03 15:31:53 +0100 |
commit | d7971385e844e24d9d851d3d142895b5cb89c91b (patch) | |
tree | d0a924eaec4cea24140a7b50b252a7adf28a63c5 /src | |
parent | ba7068c9400df7d471beecd3040a329b2344d308 (diff) | |
download | htanks-d7971385e844e24d9d851d3d142895b5cb89c91b.tar htanks-d7971385e844e24d9d851d3d142895b5cb89c91b.zip |
Added some fixes for current opengl library
Diffstat (limited to 'src')
-rw-r--r-- | src/DefaultPlayer.hs | 4 | ||||
-rw-r--r-- | src/HWiidPlayer.hs | 4 | ||||
-rw-r--r-- | src/Render.hs | 2 |
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 |