[Fix frag for Linux/amd64 Peter De Wachter **20071231174537 The code assumed that sizeof Int == sizeof GLint. Other similarly broken assumptions still remain. ] { hunk ./BSP.hs 134 - vindices :: !(Ptr Int), + vindices :: !(Ptr GLint), hunk ./BSP.hs 240 -type VertexPointers = (Ptr Float,Ptr Float, Ptr Float, Ptr CInt) +type VertexPointers = (Ptr GLfloat, Ptr GLfloat, Ptr GLfloat, Ptr GLint) hunk ./BSP.hs 378 -renderPolygonFace :: BSPFace -> VertexArrays -> Ptr Int-> IO () +renderPolygonFace :: BSPFace -> VertexArrays -> Ptr GLint -> IO () hunk ./BSP.hs 403 -renderMeshFace :: BSPFace -> VertexArrays -> Ptr Int-> IO () +renderMeshFace :: BSPFace -> VertexArrays -> Ptr GLint -> IO () hunk ./BSP.hs 630 -readLeaves :: Handle -> [BSPLump] -> VertexArrays -> Ptr Int -> IO [BSPLeaf] +readLeaves :: Handle -> [BSPLump] -> VertexArrays -> Ptr GLint -> IO [BSPLeaf] hunk ./BSP.hs 684 -readFaces :: Handle -> [BSPLump] -> VertexArrays -> Ptr Int-> IO [BSPFace] +readFaces :: Handle -> [BSPLump] -> VertexArrays -> Ptr GLint -> IO [BSPFace] hunk ./BSP.hs 701 - VertexArrays -> Ptr Int -> Int -> IO (BSPFace) + VertexArrays -> Ptr GLint -> Int -> IO (BSPFace) hunk ./BSP.hs 1024 -readIndices :: Handle -> [BSPLump] -> IO [Int] +readIndices :: Handle -> [BSPLump] -> IO [GLint] hunk ./Curves.hs 29 - patchLOD :: Int, -- the level of tesselation - patchPtr :: Ptr Float, -- points to patch vertices - indexPtrPtr :: Ptr (Ptr Int), -- points to indices - numIndexPtr :: Ptr GLsizei -- the number of indices + patchLOD :: Int, -- the level of tesselation + patchPtr :: Ptr Float, -- points to patch vertices + indexPtrPtr :: Ptr (Ptr GLint), -- points to indices + numIndexPtr :: Ptr GLsizei -- the number of indices hunk ./Curves.hs 182 -generateIndices :: Int -> IO (Ptr GLsizei, Ptr (Ptr Int)) +generateIndices :: Int -> IO (Ptr GLsizei, Ptr (Ptr GLint)) hunk ./Curves.hs 185 - let pt1 = [ ((((row*(tess+1))+point)*2)+1, (row*(tess+1))+point) | + let pt1 = [ ((((row*(tess+1))+point)*2)+1, fromIntegral ((row*(tess+1))+point)) | hunk ./Curves.hs 188 - let pt2 = [ ((((row*(tess+1))+point)*2), ((row+1)*(tess+1))+point) | + let pt2 = [ ((((row*(tess+1))+point)*2), fromIntegral (((row+1)*(tess+1))+point)) | hunk ./Curves.hs 193 - indexList <- getElems indexArray - indexPtr <- mallocBytes ((tess*(tess+1)*2)*4) + indexList <- (getElems indexArray) + indexPtr <- mallocBytes ((tess * (tess+1)*2) * (sizeOf (undefined :: GLint))) hunk ./Curves.hs 196 - numArrayIndicesPtr <- mallocBytes (tess*4) + numArrayIndicesPtr <- mallocBytes (tess * (sizeOf (undefined :: GLsizei))) hunk ./Curves.hs 198 - indexPtrPtr <- mallocBytes (tess*(sizeOf(undefined :: Ptr Int))) - let ptrPtr = map (plusPtr indexPtr) [(4*(row*2*(tess+1)))| row <-[0..(tess-1)]] + indexPtrPtr <- mallocBytes (tess * (sizeOf (undefined :: Ptr GLint))) + let ptrPtr = map (plusPtr indexPtr) [((sizeOf (undefined :: GLint)) * (row*2*(tess+1))) | row <-[0..(tess-1)]] hunk ./Curves.hs 201 - return (numArrayIndicesPtr,indexPtrPtr) + return (numArrayIndicesPtr, indexPtrPtr) hunk ./Curves.hs 205 -writeIndices :: IOUArray Int Int -> (Int,Int) -> IO() +writeIndices :: IOUArray Int GLint -> (Int,GLint) -> IO () }