Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.cabal-sandbox
*.trace
cabal.sandbox.config
deps/hsSDL2*
deps/*.deb
dist/*
*.swp
Expand Down
26 changes: 23 additions & 3 deletions Pioneers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ executable Pioneers
UI.Callbacks,
Types
main-is: Main.hs
build-depends:
build-depends:
base >=4.6,
OpenGL >=2.9,
bytestring >=0.10,
Expand All @@ -42,11 +42,21 @@ executable Pioneers
distributive >=0.3.2,
linear >=1.3.1,
lens >=4.0,
SDL2 >= 0.1.0,
sdl2,
sdl2-ttf,
sdl2-image,
sdl2-mixer,
time >=1.4.0,
GLUtil >= 0.7,
attoparsec >= 0.11.2,
attoparsec-binary >= 0.1
extra-libraries:
GL,
GLU,
SDL2,
SDL2_ttf,
SDL2_image,
SDL2_mixer
Default-Language: Haskell2010

test-suite MapTests
Expand All @@ -69,7 +79,10 @@ test-suite MapTests
distributive >=0.3.2,
linear >=1.3.1,
lens >=4.0,
SDL2 >= 0.1.0,
sdl2,
sdl2-ttf,
sdl2-image,
sdl2-mixer,
time >=1.4.0,
GLUtil >= 0.7,
attoparsec >= 0.11.2,
Expand All @@ -78,4 +91,11 @@ test-suite MapTests
test-framework,
test-framework-th,
test-framework-quickcheck2
extra-libraries:
GL,
GLU,
SDL2,
SDL2_ttf,
SDL2_image,
SDL2_mixer
Default-Language: Haskell2010
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
set -e

cabal v2-update
cabal v2-build
NIX_LD_LIBRARY_PATH="$NIX_LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu" \
cabal v2-build
23 changes: 8 additions & 15 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
packages: .

source-repository-package
type: git
location: https://github.com/Lemmih/hsSDL2

source-repository-package
type: git
location: https://github.com/osa1/hsSDL2-ttf

source-repository-package
type: git
location: https://github.com/jdeseno/hs-sdl2-mixer

source-repository-package
type: git
location: https://github.com/jdeseno/hs-sdl2-image
-- Allow building even when dependencies require versions newer than what is
-- declared, so that cabal gives clearer error messages when resolving
-- dependencies.
allow-newer: all

package *
extra-lib-dirs: /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu
extra-include-dirs: /usr/include
2 changes: 1 addition & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Foreign.Marshal.Array (pokeArray)
import Foreign.Marshal.Alloc (allocaBytes)

-- GUI
import qualified Graphics.UI.SDL as SDL
import qualified SDL

-- Render
import qualified Graphics.Rendering.OpenGL.GL as GL
Expand Down
2 changes: 1 addition & 1 deletion src/Render/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Graphics.Rendering.OpenGL.GL.VertexArrayObjects
import Graphics.Rendering.OpenGL.GL.VertexArrays
import Graphics.Rendering.OpenGL.GL.VertexSpec
import Graphics.Rendering.OpenGL.GL.BufferObjects
import Graphics.UI.SDL.Types (Texture)
import SDL (Texture)
import System.IO (hPutStrLn, stderr)
import Linear
import Foreign.C (CFloat, CUChar)
Expand Down
2 changes: 1 addition & 1 deletion src/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Types where

import Control.Concurrent.STM (TQueue, TVar, readTVar, writeTVar, atomically)
import qualified Graphics.Rendering.OpenGL.GL as GL
import Graphics.UI.SDL as SDL (Event, Window)
import SDL (Event, Window)
import Foreign.C (CFloat)
import qualified Data.HashMap.Strict as Map
import Data.Time (UTCTime)
Expand Down
2 changes: 1 addition & 1 deletion src/UI/Callbacks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import qualified Data.HashMap.Strict as Map
import Data.Maybe
import Foreign.Marshal.Array (pokeArray)
import Foreign.Marshal.Alloc (allocaBytes)
import qualified Graphics.UI.SDL as SDL
import qualified SDL
import Control.Concurrent.STM.TVar (readTVar, writeTVar)
import Control.Concurrent.STM (atomically)

Expand Down
5 changes: 1 addition & 4 deletions src/UI/GUIOverlay.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module UI.GUIOverlay where

import Data.Int
import Graphics.UI.SDL.Surface
import Graphics.UI.SDL.Color
import Graphics.UI.SDL.Rect
import Graphics.UI.SDL.Types
import SDL
import UI.UITypes

--createRGBSurface :: Int32 -> Int32 -> Int32 -> Word32 -> Word32 -> Word32 -> Word32 -> IO Surface
Expand Down